// 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_CC_Types.hh"

namespace MobileL3__CC__Types {

/* Member functions of C++ classes */

SetupContatinerCCBS__LV::SetupContatinerCCBS__LV()
{
}

SetupContatinerCCBS__LV::SetupContatinerCCBS__LV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_setupMessage)
  :   field_lengthIndicator(par_lengthIndicator),
  field_setupMessage(par_setupMessage)
{
}

SetupContatinerCCBS__LV::SetupContatinerCCBS__LV(const SetupContatinerCCBS__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.SetupContatinerCCBS_LV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.setupMessage().is_bound()) field_setupMessage = other_value.setupMessage();
else field_setupMessage.clean_up();
}

void SetupContatinerCCBS__LV::clean_up()
{
field_lengthIndicator.clean_up();
field_setupMessage.clean_up();
}

const TTCN_Typedescriptor_t* SetupContatinerCCBS__LV::get_descriptor() const { return &SetupContatinerCCBS__LV_descr_; }
SetupContatinerCCBS__LV& SetupContatinerCCBS__LV::operator=(const SetupContatinerCCBS__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.SetupContatinerCCBS_LV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.setupMessage().is_bound()) field_setupMessage = other_value.setupMessage();
  else field_setupMessage.clean_up();
}
return *this;
}

boolean SetupContatinerCCBS__LV::operator==(const SetupContatinerCCBS__LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_setupMessage==other_value.field_setupMessage;
}

boolean SetupContatinerCCBS__LV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_setupMessage.is_bound());
}
boolean SetupContatinerCCBS__LV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_setupMessage.is_value();
}
void SetupContatinerCCBS__LV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", setupMessage := ");
field_setupMessage.log();
TTCN_Logger::log_event_str(" }");
}

void SetupContatinerCCBS__LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (setupMessage().is_bound()) setupMessage().set_implicit_omit();
}

void SetupContatinerCCBS__LV::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_CC_Types.SetupContatinerCCBS_LV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) setupMessage().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "setupMessage")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          setupMessage().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_CC_Types.SetupContatinerCCBS_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.SetupContatinerCCBS_LV");
  }
}

void SetupContatinerCCBS__LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_setupMessage.encode_text(text_buf);
}

void SetupContatinerCCBS__LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_setupMessage.decode_text(text_buf);
}

void SetupContatinerCCBS__LV::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 SetupContatinerCCBS__LV::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 SetupContatinerCCBS__LV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SetupContatinerCCBS__LV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(SetupContatinerCCBS__LV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(SetupContatinerCCBS__LV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_setupMessage.RAW_decode(General__Types::OCTN_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SetupContatinerCCBS__LV::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, SetupContatinerCCBS__LV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCTN_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &SetupContatinerCCBS__LV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_setupMessage.RAW_encode(General__Types::OCTN_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct SetupContatinerCCBS__LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_setupMessage;
};

void SetupContatinerCCBS__LV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_setupMessage = ANY_VALUE;
}
}
}

void SetupContatinerCCBS__LV_template::copy_value(const SetupContatinerCCBS__LV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.setupMessage().is_bound()) {
  single_value->field_setupMessage = other_value.setupMessage();
} else {
  single_value->field_setupMessage.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SetupContatinerCCBS__LV_template::copy_template(const SetupContatinerCCBS__LV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.setupMessage().get_selection()) {
single_value->field_setupMessage = other_value.setupMessage();
} else {
single_value->field_setupMessage.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 SetupContatinerCCBS__LV_template[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 SetupContatinerCCBS__LV_template(*other_value.implication_.precondition);
implication_.implied_template = new SetupContatinerCCBS__LV_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_CC_Types.SetupContatinerCCBS_LV.");
break;
}
set_selection(other_value);
}

SetupContatinerCCBS__LV_template::SetupContatinerCCBS__LV_template()
{
}

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

SetupContatinerCCBS__LV_template::SetupContatinerCCBS__LV_template(const SetupContatinerCCBS__LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SetupContatinerCCBS__LV_template::match(const SetupContatinerCCBS__LV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.setupMessage().is_bound()) return FALSE;
if(!single_value->field_setupMessage.match(other_value.setupMessage(), 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_CC_Types.SetupContatinerCCBS_LV.");
}
return FALSE;
}

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

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

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

SetupContatinerCCBS__LV SetupContatinerCCBS__LV_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_CC_Types.SetupContatinerCCBS_LV.");
SetupContatinerCCBS__LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_setupMessage.is_bound()) {
ret_val.setupMessage() = single_value->field_setupMessage.valueof();
}
return ret_val;
}

void SetupContatinerCCBS__LV_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_CC_Types.SetupContatinerCCBS_LV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SetupContatinerCCBS__LV_template[list_length];
}

SetupContatinerCCBS__LV_template& SetupContatinerCCBS__LV_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_CC_Types.SetupContatinerCCBS_LV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.SetupContatinerCCBS_LV.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& SetupContatinerCCBS__LV_template::setupMessage()
{
set_specific();
return single_value->field_setupMessage;
}

const OCTETSTRING_template& SetupContatinerCCBS__LV_template::setupMessage() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field setupMessage of a non-specific template of type @MobileL3_CC_Types.SetupContatinerCCBS_LV.");
return single_value->field_setupMessage;
}

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

void SetupContatinerCCBS__LV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", setupMessage := ");
single_value->field_setupMessage.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 SetupContatinerCCBS__LV_template::log_match(const SetupContatinerCCBS__LV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_setupMessage.match(match_value.setupMessage(), legacy)){
TTCN_Logger::log_logmatch_info(".setupMessage");
single_value->field_setupMessage.log_match(match_value.setupMessage(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", setupMessage := ");
single_value->field_setupMessage.log_match(match_value.setupMessage(), 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 SetupContatinerCCBS__LV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (setupMessage().is_bound()) setupMessage().set_implicit_omit();
}

void SetupContatinerCCBS__LV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_setupMessage.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_CC_Types.SetupContatinerCCBS_LV.");
}
}

void SetupContatinerCCBS__LV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_setupMessage.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 SetupContatinerCCBS__LV_template[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_CC_Types.SetupContatinerCCBS_LV.");
}
}

void SetupContatinerCCBS__LV_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: {
    SetupContatinerCCBS__LV_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_CC_Types.SetupContatinerCCBS_LV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) setupMessage().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "setupMessage")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          setupMessage().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_CC_Types.SetupContatinerCCBS_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SetupContatinerCCBS__LV_template* precondition = new SetupContatinerCCBS__LV_template;
    precondition->set_param(*param.get_elem(0));
    SetupContatinerCCBS__LV_template* implied_template = new SetupContatinerCCBS__LV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SetupContatinerCCBS__LV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.SetupContatinerCCBS_LV");
  }
  is_ifpresent = param.get_ifpresent();
}

void SetupContatinerCCBS__LV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.SetupContatinerCCBS_LV");
single_value->field_setupMessage.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.SetupContatinerCCBS_LV");
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_CC_Types.SetupContatinerCCBS_LV");
}

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

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

ML3__Signal::ML3__Signal()
{
}

ML3__Signal::ML3__Signal(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_signalValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_signalValue(par_signalValue)
{
}

ML3__Signal::ML3__Signal(const ML3__Signal& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.ML3_Signal.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.signalValue().is_bound()) field_signalValue = other_value.signalValue();
else field_signalValue.clean_up();
}

void ML3__Signal::clean_up()
{
field_elementIdentifier.clean_up();
field_signalValue.clean_up();
}

const TTCN_Typedescriptor_t* ML3__Signal::get_descriptor() const { return &ML3__Signal_descr_; }
ML3__Signal& ML3__Signal::operator=(const ML3__Signal& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.ML3_Signal.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.signalValue().is_bound()) field_signalValue = other_value.signalValue();
  else field_signalValue.clean_up();
}
return *this;
}

boolean ML3__Signal::operator==(const ML3__Signal& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_signalValue==other_value.field_signalValue;
}

boolean ML3__Signal::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_signalValue.is_bound());
}
boolean ML3__Signal::is_value() const
{
return field_elementIdentifier.is_value()
  && field_signalValue.is_value();
}
void ML3__Signal::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", signalValue := ");
field_signalValue.log();
TTCN_Logger::log_event_str(" }");
}

void ML3__Signal::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (signalValue().is_bound()) signalValue().set_implicit_omit();
}

void ML3__Signal::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_CC_Types.ML3_Signal has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) signalValue().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "signalValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          signalValue().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_CC_Types.ML3_Signal: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.ML3_Signal");
  }
}

void ML3__Signal::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_signalValue.encode_text(text_buf);
}

void ML3__Signal::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_signalValue.decode_text(text_buf);
}

void ML3__Signal::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 ML3__Signal::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 ML3__Signal::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_signalValue.RAW_decode(General__Types::OCT1_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 ML3__Signal::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT1_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_signalValue.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct ML3__Signal_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_signalValue;
};

void ML3__Signal_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_signalValue = ANY_VALUE;
}
}
}

void ML3__Signal_template::copy_value(const ML3__Signal& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.signalValue().is_bound()) {
  single_value->field_signalValue = other_value.signalValue();
} else {
  single_value->field_signalValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ML3__Signal_template::copy_template(const ML3__Signal_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.signalValue().get_selection()) {
single_value->field_signalValue = other_value.signalValue();
} else {
single_value->field_signalValue.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 ML3__Signal_template[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 ML3__Signal_template(*other_value.implication_.precondition);
implication_.implied_template = new ML3__Signal_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_CC_Types.ML3_Signal.");
break;
}
set_selection(other_value);
}

ML3__Signal_template::ML3__Signal_template()
{
}

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

ML3__Signal_template::ML3__Signal_template(const ML3__Signal& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ML3__Signal_template::match(const ML3__Signal& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.signalValue().is_bound()) return FALSE;
if(!single_value->field_signalValue.match(other_value.signalValue(), 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_CC_Types.ML3_Signal.");
}
return FALSE;
}

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

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

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

ML3__Signal ML3__Signal_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_CC_Types.ML3_Signal.");
ML3__Signal ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_signalValue.is_bound()) {
ret_val.signalValue() = single_value->field_signalValue.valueof();
}
return ret_val;
}

void ML3__Signal_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_CC_Types.ML3_Signal.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ML3__Signal_template[list_length];
}

ML3__Signal_template& ML3__Signal_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_CC_Types.ML3_Signal.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.ML3_Signal.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& ML3__Signal_template::signalValue()
{
set_specific();
return single_value->field_signalValue;
}

const OCTETSTRING_template& ML3__Signal_template::signalValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field signalValue of a non-specific template of type @MobileL3_CC_Types.ML3_Signal.");
return single_value->field_signalValue;
}

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

void ML3__Signal_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", signalValue := ");
single_value->field_signalValue.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 ML3__Signal_template::log_match(const ML3__Signal& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_signalValue.match(match_value.signalValue(), legacy)){
TTCN_Logger::log_logmatch_info(".signalValue");
single_value->field_signalValue.log_match(match_value.signalValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", signalValue := ");
single_value->field_signalValue.log_match(match_value.signalValue(), 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 ML3__Signal_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (signalValue().is_bound()) signalValue().set_implicit_omit();
}

void ML3__Signal_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_signalValue.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_CC_Types.ML3_Signal.");
}
}

void ML3__Signal_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_signalValue.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 ML3__Signal_template[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_CC_Types.ML3_Signal.");
}
}

void ML3__Signal_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: {
    ML3__Signal_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_CC_Types.ML3_Signal has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) signalValue().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "signalValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          signalValue().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_CC_Types.ML3_Signal: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ML3__Signal_template* precondition = new ML3__Signal_template;
    precondition->set_param(*param.get_elem(0));
    ML3__Signal_template* implied_template = new ML3__Signal_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ML3__Signal_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.ML3_Signal");
  }
  is_ifpresent = param.get_ifpresent();
}

void ML3__Signal_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.ML3_Signal");
single_value->field_signalValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.ML3_Signal");
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_CC_Types.ML3_Signal");
}

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

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

User__user__LV::User__user__LV()
{
}

User__user__LV::User__user__LV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_user__userProtocolDiscriminator,
    const OCTETSTRING& par_user__userInformation)
  :   field_lengthIndicator(par_lengthIndicator),
  field_user__userProtocolDiscriminator(par_user__userProtocolDiscriminator),
  field_user__userInformation(par_user__userInformation)
{
}

User__user__LV::User__user__LV(const User__user__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.User_user_LV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.user__userProtocolDiscriminator().is_bound()) field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
else field_user__userProtocolDiscriminator.clean_up();
if (other_value.user__userInformation().is_bound()) field_user__userInformation = other_value.user__userInformation();
else field_user__userInformation.clean_up();
}

void User__user__LV::clean_up()
{
field_lengthIndicator.clean_up();
field_user__userProtocolDiscriminator.clean_up();
field_user__userInformation.clean_up();
}

const TTCN_Typedescriptor_t* User__user__LV::get_descriptor() const { return &User__user__LV_descr_; }
User__user__LV& User__user__LV::operator=(const User__user__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.User_user_LV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.user__userProtocolDiscriminator().is_bound()) field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
  else field_user__userProtocolDiscriminator.clean_up();
  if (other_value.user__userInformation().is_bound()) field_user__userInformation = other_value.user__userInformation();
  else field_user__userInformation.clean_up();
}
return *this;
}

boolean User__user__LV::operator==(const User__user__LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_user__userProtocolDiscriminator==other_value.field_user__userProtocolDiscriminator
  && field_user__userInformation==other_value.field_user__userInformation;
}

boolean User__user__LV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_user__userProtocolDiscriminator.is_bound())
  || (field_user__userInformation.is_bound());
}
boolean User__user__LV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_user__userProtocolDiscriminator.is_value()
  && field_user__userInformation.is_value();
}
void User__user__LV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", user_userProtocolDiscriminator := ");
field_user__userProtocolDiscriminator.log();
TTCN_Logger::log_event_str(", user_userInformation := ");
field_user__userInformation.log();
TTCN_Logger::log_event_str(" }");
}

void User__user__LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (user__userProtocolDiscriminator().is_bound()) user__userProtocolDiscriminator().set_implicit_omit();
if (user__userInformation().is_bound()) user__userInformation().set_implicit_omit();
}

void User__user__LV::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_CC_Types.User_user_LV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) user__userProtocolDiscriminator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) user__userInformation().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userProtocolDiscriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userProtocolDiscriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userInformation().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_CC_Types.User_user_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.User_user_LV");
  }
}

void User__user__LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_user__userProtocolDiscriminator.encode_text(text_buf);
field_user__userInformation.encode_text(text_buf);
}

void User__user__LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_user__userProtocolDiscriminator.decode_text(text_buf);
field_user__userInformation.decode_text(text_buf);
}

void User__user__LV::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 User__user__LV::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 User__user__LV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, User__user__LV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(User__user__LV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(User__user__LV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_user__userProtocolDiscriminator.RAW_decode(General__Types::OCT1_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, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_user__userInformation.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int User__user__LV::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, User__user__LV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &User__user__LV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_user__userProtocolDiscriminator.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_user__userInformation.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct User__user__LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_user__userProtocolDiscriminator;
OCTETSTRING_template field_user__userInformation;
};

void User__user__LV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_user__userProtocolDiscriminator = ANY_VALUE;
single_value->field_user__userInformation = ANY_VALUE;
}
}
}

void User__user__LV_template::copy_value(const User__user__LV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.user__userProtocolDiscriminator().is_bound()) {
  single_value->field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
} else {
  single_value->field_user__userProtocolDiscriminator.clean_up();
}
if (other_value.user__userInformation().is_bound()) {
  single_value->field_user__userInformation = other_value.user__userInformation();
} else {
  single_value->field_user__userInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void User__user__LV_template::copy_template(const User__user__LV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__userProtocolDiscriminator().get_selection()) {
single_value->field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
} else {
single_value->field_user__userProtocolDiscriminator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__userInformation().get_selection()) {
single_value->field_user__userInformation = other_value.user__userInformation();
} else {
single_value->field_user__userInformation.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 User__user__LV_template[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 User__user__LV_template(*other_value.implication_.precondition);
implication_.implied_template = new User__user__LV_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_CC_Types.User_user_LV.");
break;
}
set_selection(other_value);
}

User__user__LV_template::User__user__LV_template()
{
}

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

User__user__LV_template::User__user__LV_template(const User__user__LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean User__user__LV_template::match(const User__user__LV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.user__userProtocolDiscriminator().is_bound()) return FALSE;
if(!single_value->field_user__userProtocolDiscriminator.match(other_value.user__userProtocolDiscriminator(), legacy))return FALSE;
if(!other_value.user__userInformation().is_bound()) return FALSE;
if(!single_value->field_user__userInformation.match(other_value.user__userInformation(), 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_CC_Types.User_user_LV.");
}
return FALSE;
}

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

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

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

User__user__LV User__user__LV_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_CC_Types.User_user_LV.");
User__user__LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_user__userProtocolDiscriminator.is_bound()) {
ret_val.user__userProtocolDiscriminator() = single_value->field_user__userProtocolDiscriminator.valueof();
}
if (single_value->field_user__userInformation.is_bound()) {
ret_val.user__userInformation() = single_value->field_user__userInformation.valueof();
}
return ret_val;
}

void User__user__LV_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_CC_Types.User_user_LV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new User__user__LV_template[list_length];
}

User__user__LV_template& User__user__LV_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_CC_Types.User_user_LV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.User_user_LV.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& User__user__LV_template::user__userProtocolDiscriminator()
{
set_specific();
return single_value->field_user__userProtocolDiscriminator;
}

const OCTETSTRING_template& User__user__LV_template::user__userProtocolDiscriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_userProtocolDiscriminator of a non-specific template of type @MobileL3_CC_Types.User_user_LV.");
return single_value->field_user__userProtocolDiscriminator;
}

OCTETSTRING_template& User__user__LV_template::user__userInformation()
{
set_specific();
return single_value->field_user__userInformation;
}

const OCTETSTRING_template& User__user__LV_template::user__userInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_userInformation of a non-specific template of type @MobileL3_CC_Types.User_user_LV.");
return single_value->field_user__userInformation;
}

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

void User__user__LV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", user_userProtocolDiscriminator := ");
single_value->field_user__userProtocolDiscriminator.log();
TTCN_Logger::log_event_str(", user_userInformation := ");
single_value->field_user__userInformation.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 User__user__LV_template::log_match(const User__user__LV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_user__userProtocolDiscriminator.match(match_value.user__userProtocolDiscriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".user_userProtocolDiscriminator");
single_value->field_user__userProtocolDiscriminator.log_match(match_value.user__userProtocolDiscriminator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_user__userInformation.match(match_value.user__userInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".user_userInformation");
single_value->field_user__userInformation.log_match(match_value.user__userInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", user_userProtocolDiscriminator := ");
single_value->field_user__userProtocolDiscriminator.log_match(match_value.user__userProtocolDiscriminator(), legacy);
TTCN_Logger::log_event_str(", user_userInformation := ");
single_value->field_user__userInformation.log_match(match_value.user__userInformation(), 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 User__user__LV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (user__userProtocolDiscriminator().is_bound()) user__userProtocolDiscriminator().set_implicit_omit();
if (user__userInformation().is_bound()) user__userInformation().set_implicit_omit();
}

void User__user__LV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_user__userProtocolDiscriminator.encode_text(text_buf);
single_value->field_user__userInformation.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_CC_Types.User_user_LV.");
}
}

void User__user__LV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_user__userProtocolDiscriminator.decode_text(text_buf);
single_value->field_user__userInformation.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 User__user__LV_template[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_CC_Types.User_user_LV.");
}
}

void User__user__LV_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: {
    User__user__LV_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_CC_Types.User_user_LV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) user__userProtocolDiscriminator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) user__userInformation().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userProtocolDiscriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userProtocolDiscriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userInformation().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_CC_Types.User_user_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    User__user__LV_template* precondition = new User__user__LV_template;
    precondition->set_param(*param.get_elem(0));
    User__user__LV_template* implied_template = new User__user__LV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = User__user__LV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.User_user_LV");
  }
  is_ifpresent = param.get_ifpresent();
}

void User__user__LV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.User_user_LV");
single_value->field_user__userProtocolDiscriminator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.User_user_LV");
single_value->field_user__userInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.User_user_LV");
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_CC_Types.User_user_LV");
}

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

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

User__user__TLV::User__user__TLV()
{
}

User__user__TLV::User__user__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_user__userProtocolDiscriminator,
    const OCTETSTRING& par_user__userInformation)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_user__userProtocolDiscriminator(par_user__userProtocolDiscriminator),
  field_user__userInformation(par_user__userInformation)
{
}

User__user__TLV::User__user__TLV(const User__user__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.User_user_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.user__userProtocolDiscriminator().is_bound()) field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
else field_user__userProtocolDiscriminator.clean_up();
if (other_value.user__userInformation().is_bound()) field_user__userInformation = other_value.user__userInformation();
else field_user__userInformation.clean_up();
}

void User__user__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_user__userProtocolDiscriminator.clean_up();
field_user__userInformation.clean_up();
}

const TTCN_Typedescriptor_t* User__user__TLV::get_descriptor() const { return &User__user__TLV_descr_; }
User__user__TLV& User__user__TLV::operator=(const User__user__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.User_user_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.user__userProtocolDiscriminator().is_bound()) field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
  else field_user__userProtocolDiscriminator.clean_up();
  if (other_value.user__userInformation().is_bound()) field_user__userInformation = other_value.user__userInformation();
  else field_user__userInformation.clean_up();
}
return *this;
}

boolean User__user__TLV::operator==(const User__user__TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_user__userProtocolDiscriminator==other_value.field_user__userProtocolDiscriminator
  && field_user__userInformation==other_value.field_user__userInformation;
}

boolean User__user__TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_user__userProtocolDiscriminator.is_bound())
  || (field_user__userInformation.is_bound());
}
boolean User__user__TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_user__userProtocolDiscriminator.is_value()
  && field_user__userInformation.is_value();
}
void User__user__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", user_userProtocolDiscriminator := ");
field_user__userProtocolDiscriminator.log();
TTCN_Logger::log_event_str(", user_userInformation := ");
field_user__userInformation.log();
TTCN_Logger::log_event_str(" }");
}

void User__user__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (user__userProtocolDiscriminator().is_bound()) user__userProtocolDiscriminator().set_implicit_omit();
if (user__userInformation().is_bound()) user__userInformation().set_implicit_omit();
}

void User__user__TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.User_user_TLV has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) user__userProtocolDiscriminator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__userInformation().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userProtocolDiscriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userProtocolDiscriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userInformation().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_CC_Types.User_user_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.User_user_TLV");
  }
}

void User__user__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_user__userProtocolDiscriminator.encode_text(text_buf);
field_user__userInformation.encode_text(text_buf);
}

void User__user__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_user__userProtocolDiscriminator.decode_text(text_buf);
field_user__userInformation.decode_text(text_buf);
}

void User__user__TLV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  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 User__user__TLV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  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 User__user__TLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, User__user__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(User__user__TLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(User__user__TLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_user__userProtocolDiscriminator.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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_user__userInformation.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int User__user__TLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, User__user__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, OCTETSTRING_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &User__user__TLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_user__userProtocolDiscriminator.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_user__userInformation.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct User__user__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_user__userProtocolDiscriminator;
OCTETSTRING_template field_user__userInformation;
};

void User__user__TLV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_user__userProtocolDiscriminator = ANY_VALUE;
single_value->field_user__userInformation = ANY_VALUE;
}
}
}

void User__user__TLV_template::copy_value(const User__user__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.user__userProtocolDiscriminator().is_bound()) {
  single_value->field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
} else {
  single_value->field_user__userProtocolDiscriminator.clean_up();
}
if (other_value.user__userInformation().is_bound()) {
  single_value->field_user__userInformation = other_value.user__userInformation();
} else {
  single_value->field_user__userInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void User__user__TLV_template::copy_template(const User__user__TLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__userProtocolDiscriminator().get_selection()) {
single_value->field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
} else {
single_value->field_user__userProtocolDiscriminator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__userInformation().get_selection()) {
single_value->field_user__userInformation = other_value.user__userInformation();
} else {
single_value->field_user__userInformation.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 User__user__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new User__user__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new User__user__TLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_CC_Types.User_user_TLV.");
break;
}
set_selection(other_value);
}

User__user__TLV_template::User__user__TLV_template()
{
}

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

User__user__TLV_template::User__user__TLV_template(const User__user__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean User__user__TLV_template::match(const User__user__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.user__userProtocolDiscriminator().is_bound()) return FALSE;
if(!single_value->field_user__userProtocolDiscriminator.match(other_value.user__userProtocolDiscriminator(), legacy))return FALSE;
if(!other_value.user__userInformation().is_bound()) return FALSE;
if(!single_value->field_user__userInformation.match(other_value.user__userInformation(), 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_CC_Types.User_user_TLV.");
}
return FALSE;
}

boolean User__user__TLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_user__userProtocolDiscriminator.is_bound()
 || single_value->field_user__userInformation.is_bound();
}

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

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

User__user__TLV User__user__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_CC_Types.User_user_TLV.");
User__user__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_user__userProtocolDiscriminator.is_bound()) {
ret_val.user__userProtocolDiscriminator() = single_value->field_user__userProtocolDiscriminator.valueof();
}
if (single_value->field_user__userInformation.is_bound()) {
ret_val.user__userInformation() = single_value->field_user__userInformation.valueof();
}
return ret_val;
}

void User__user__TLV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_CC_Types.User_user_TLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new User__user__TLV_template[list_length];
}

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

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

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

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

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

OCTETSTRING_template& User__user__TLV_template::user__userProtocolDiscriminator()
{
set_specific();
return single_value->field_user__userProtocolDiscriminator;
}

const OCTETSTRING_template& User__user__TLV_template::user__userProtocolDiscriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_userProtocolDiscriminator of a non-specific template of type @MobileL3_CC_Types.User_user_TLV.");
return single_value->field_user__userProtocolDiscriminator;
}

OCTETSTRING_template& User__user__TLV_template::user__userInformation()
{
set_specific();
return single_value->field_user__userInformation;
}

const OCTETSTRING_template& User__user__TLV_template::user__userInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_userInformation of a non-specific template of type @MobileL3_CC_Types.User_user_TLV.");
return single_value->field_user__userInformation;
}

int User__user__TLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.User_user_TLV 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_CC_Types.User_user_TLV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.User_user_TLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.User_user_TLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.User_user_TLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.User_user_TLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.User_user_TLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.User_user_TLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.User_user_TLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.User_user_TLV.");
  }
  return 0;
}

void User__user__TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", user_userProtocolDiscriminator := ");
single_value->field_user__userProtocolDiscriminator.log();
TTCN_Logger::log_event_str(", user_userInformation := ");
single_value->field_user__userInformation.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 User__user__TLV_template::log_match(const User__user__TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_user__userProtocolDiscriminator.match(match_value.user__userProtocolDiscriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".user_userProtocolDiscriminator");
single_value->field_user__userProtocolDiscriminator.log_match(match_value.user__userProtocolDiscriminator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_user__userInformation.match(match_value.user__userInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".user_userInformation");
single_value->field_user__userInformation.log_match(match_value.user__userInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", user_userProtocolDiscriminator := ");
single_value->field_user__userProtocolDiscriminator.log_match(match_value.user__userProtocolDiscriminator(), legacy);
TTCN_Logger::log_event_str(", user_userInformation := ");
single_value->field_user__userInformation.log_match(match_value.user__userInformation(), 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 User__user__TLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (user__userProtocolDiscriminator().is_bound()) user__userProtocolDiscriminator().set_implicit_omit();
if (user__userInformation().is_bound()) user__userInformation().set_implicit_omit();
}

void User__user__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_user__userProtocolDiscriminator.encode_text(text_buf);
single_value->field_user__userInformation.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_CC_Types.User_user_TLV.");
}
}

void User__user__TLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_user__userProtocolDiscriminator.decode_text(text_buf);
single_value->field_user__userInformation.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 User__user__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_CC_Types.User_user_TLV.");
}
}

void User__user__TLV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    User__user__TLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.User_user_TLV has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) user__userProtocolDiscriminator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__userInformation().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userProtocolDiscriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userProtocolDiscriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userInformation().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_CC_Types.User_user_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    User__user__TLV_template* precondition = new User__user__TLV_template;
    precondition->set_param(*param.get_elem(0));
    User__user__TLV_template* implied_template = new User__user__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = User__user__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.User_user_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

User__userShort::User__userShort()
{
}

User__userShort::User__userShort(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_user__userProtocolDiscriminator,
    const OCTETSTRING& par_user__userInformation)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_user__userProtocolDiscriminator(par_user__userProtocolDiscriminator),
  field_user__userInformation(par_user__userInformation)
{
}

User__userShort::User__userShort(const User__userShort& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.User_userShort.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.user__userProtocolDiscriminator().is_bound()) field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
else field_user__userProtocolDiscriminator.clean_up();
if (other_value.user__userInformation().is_bound()) field_user__userInformation = other_value.user__userInformation();
else field_user__userInformation.clean_up();
}

void User__userShort::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_user__userProtocolDiscriminator.clean_up();
field_user__userInformation.clean_up();
}

const TTCN_Typedescriptor_t* User__userShort::get_descriptor() const { return &User__userShort_descr_; }
User__userShort& User__userShort::operator=(const User__userShort& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.User_userShort.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.user__userProtocolDiscriminator().is_bound()) field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
  else field_user__userProtocolDiscriminator.clean_up();
  if (other_value.user__userInformation().is_bound()) field_user__userInformation = other_value.user__userInformation();
  else field_user__userInformation.clean_up();
}
return *this;
}

boolean User__userShort::operator==(const User__userShort& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_user__userProtocolDiscriminator==other_value.field_user__userProtocolDiscriminator
  && field_user__userInformation==other_value.field_user__userInformation;
}

boolean User__userShort::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_user__userProtocolDiscriminator.is_bound())
  || (field_user__userInformation.is_bound());
}
boolean User__userShort::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_user__userProtocolDiscriminator.is_value()
  && field_user__userInformation.is_value();
}
void User__userShort::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", user_userProtocolDiscriminator := ");
field_user__userProtocolDiscriminator.log();
TTCN_Logger::log_event_str(", user_userInformation := ");
field_user__userInformation.log();
TTCN_Logger::log_event_str(" }");
}

void User__userShort::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (user__userProtocolDiscriminator().is_bound()) user__userProtocolDiscriminator().set_implicit_omit();
if (user__userInformation().is_bound()) user__userInformation().set_implicit_omit();
}

void User__userShort::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_CC_Types.User_userShort has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) user__userProtocolDiscriminator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__userInformation().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userProtocolDiscriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userProtocolDiscriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userInformation().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_CC_Types.User_userShort: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.User_userShort");
  }
}

void User__userShort::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_user__userProtocolDiscriminator.encode_text(text_buf);
field_user__userInformation.encode_text(text_buf);
}

void User__userShort::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_user__userProtocolDiscriminator.decode_text(text_buf);
field_user__userInformation.decode_text(text_buf);
}

void User__userShort::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 User__userShort::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 User__userShort::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, User__userShort_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(User__userShort_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(User__userShort_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_user__userProtocolDiscriminator.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());
  RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_user__userInformation.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int User__userShort::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, User__userShort_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, OCTETSTRING_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &User__userShort_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_user__userProtocolDiscriminator.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_user__userInformation.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct User__userShort_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_user__userProtocolDiscriminator;
OCTETSTRING_template field_user__userInformation;
};

void User__userShort_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_user__userProtocolDiscriminator = ANY_VALUE;
single_value->field_user__userInformation = ANY_VALUE;
}
}
}

void User__userShort_template::copy_value(const User__userShort& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.user__userProtocolDiscriminator().is_bound()) {
  single_value->field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
} else {
  single_value->field_user__userProtocolDiscriminator.clean_up();
}
if (other_value.user__userInformation().is_bound()) {
  single_value->field_user__userInformation = other_value.user__userInformation();
} else {
  single_value->field_user__userInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void User__userShort_template::copy_template(const User__userShort_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__userProtocolDiscriminator().get_selection()) {
single_value->field_user__userProtocolDiscriminator = other_value.user__userProtocolDiscriminator();
} else {
single_value->field_user__userProtocolDiscriminator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__userInformation().get_selection()) {
single_value->field_user__userInformation = other_value.user__userInformation();
} else {
single_value->field_user__userInformation.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 User__userShort_template[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 User__userShort_template(*other_value.implication_.precondition);
implication_.implied_template = new User__userShort_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_CC_Types.User_userShort.");
break;
}
set_selection(other_value);
}

User__userShort_template::User__userShort_template()
{
}

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

User__userShort_template::User__userShort_template(const User__userShort& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean User__userShort_template::match(const User__userShort& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.user__userProtocolDiscriminator().is_bound()) return FALSE;
if(!single_value->field_user__userProtocolDiscriminator.match(other_value.user__userProtocolDiscriminator(), legacy))return FALSE;
if(!other_value.user__userInformation().is_bound()) return FALSE;
if(!single_value->field_user__userInformation.match(other_value.user__userInformation(), 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_CC_Types.User_userShort.");
}
return FALSE;
}

boolean User__userShort_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_user__userProtocolDiscriminator.is_bound()
 || single_value->field_user__userInformation.is_bound();
}

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

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

User__userShort User__userShort_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_CC_Types.User_userShort.");
User__userShort ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_user__userProtocolDiscriminator.is_bound()) {
ret_val.user__userProtocolDiscriminator() = single_value->field_user__userProtocolDiscriminator.valueof();
}
if (single_value->field_user__userInformation.is_bound()) {
ret_val.user__userInformation() = single_value->field_user__userInformation.valueof();
}
return ret_val;
}

void User__userShort_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_CC_Types.User_userShort.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new User__userShort_template[list_length];
}

User__userShort_template& User__userShort_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_CC_Types.User_userShort.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.User_userShort.");
return value_list.list_value[list_index];
}

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

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

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

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

OCTETSTRING_template& User__userShort_template::user__userProtocolDiscriminator()
{
set_specific();
return single_value->field_user__userProtocolDiscriminator;
}

const OCTETSTRING_template& User__userShort_template::user__userProtocolDiscriminator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_userProtocolDiscriminator of a non-specific template of type @MobileL3_CC_Types.User_userShort.");
return single_value->field_user__userProtocolDiscriminator;
}

OCTETSTRING_template& User__userShort_template::user__userInformation()
{
set_specific();
return single_value->field_user__userInformation;
}

const OCTETSTRING_template& User__userShort_template::user__userInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_userInformation of a non-specific template of type @MobileL3_CC_Types.User_userShort.");
return single_value->field_user__userInformation;
}

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

void User__userShort_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", user_userProtocolDiscriminator := ");
single_value->field_user__userProtocolDiscriminator.log();
TTCN_Logger::log_event_str(", user_userInformation := ");
single_value->field_user__userInformation.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 User__userShort_template::log_match(const User__userShort& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_user__userProtocolDiscriminator.match(match_value.user__userProtocolDiscriminator(), legacy)){
TTCN_Logger::log_logmatch_info(".user_userProtocolDiscriminator");
single_value->field_user__userProtocolDiscriminator.log_match(match_value.user__userProtocolDiscriminator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_user__userInformation.match(match_value.user__userInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".user_userInformation");
single_value->field_user__userInformation.log_match(match_value.user__userInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", user_userProtocolDiscriminator := ");
single_value->field_user__userProtocolDiscriminator.log_match(match_value.user__userProtocolDiscriminator(), legacy);
TTCN_Logger::log_event_str(", user_userInformation := ");
single_value->field_user__userInformation.log_match(match_value.user__userInformation(), 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 User__userShort_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (user__userProtocolDiscriminator().is_bound()) user__userProtocolDiscriminator().set_implicit_omit();
if (user__userInformation().is_bound()) user__userInformation().set_implicit_omit();
}

void User__userShort_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_user__userProtocolDiscriminator.encode_text(text_buf);
single_value->field_user__userInformation.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_CC_Types.User_userShort.");
}
}

void User__userShort_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_user__userProtocolDiscriminator.decode_text(text_buf);
single_value->field_user__userInformation.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 User__userShort_template[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_CC_Types.User_userShort.");
}
}

void User__userShort_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: {
    User__userShort_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_CC_Types.User_userShort has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) user__userProtocolDiscriminator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__userInformation().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userProtocolDiscriminator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userProtocolDiscriminator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_userInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__userInformation().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_CC_Types.User_userShort: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    User__userShort_template* precondition = new User__userShort_template;
    precondition->set_param(*param.get_elem(0));
    User__userShort_template* implied_template = new User__userShort_template;
    implied_template->set_param(*param.get_elem(1));
    *this = User__userShort_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.User_userShort");
  }
  is_ifpresent = param.get_ifpresent();
}

void User__userShort_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.User_userShort");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.User_userShort");
single_value->field_user__userProtocolDiscriminator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.User_userShort");
single_value->field_user__userInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.User_userShort");
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_CC_Types.User_userShort");
}

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

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

AlertingPattern::AlertingPattern()
{
}

AlertingPattern::AlertingPattern(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_alertingPattern__FIELD,
    const BITSTRING& par_spare)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_alertingPattern__FIELD(par_alertingPattern__FIELD),
  field_spare(par_spare)
{
}

AlertingPattern::AlertingPattern(const AlertingPattern& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.AlertingPattern.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.alertingPattern__FIELD().is_bound()) field_alertingPattern__FIELD = other_value.alertingPattern__FIELD();
else field_alertingPattern__FIELD.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void AlertingPattern::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_alertingPattern__FIELD.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* AlertingPattern::get_descriptor() const { return &AlertingPattern_descr_; }
AlertingPattern& AlertingPattern::operator=(const AlertingPattern& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.AlertingPattern.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.alertingPattern__FIELD().is_bound()) field_alertingPattern__FIELD = other_value.alertingPattern__FIELD();
  else field_alertingPattern__FIELD.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean AlertingPattern::operator==(const AlertingPattern& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_alertingPattern__FIELD==other_value.field_alertingPattern__FIELD
  && field_spare==other_value.field_spare;
}

boolean AlertingPattern::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_alertingPattern__FIELD.is_bound())
  || (field_spare.is_bound());
}
boolean AlertingPattern::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_alertingPattern__FIELD.is_value()
  && field_spare.is_value();
}
void AlertingPattern::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", alertingPattern_FIELD := ");
field_alertingPattern__FIELD.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void AlertingPattern::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (alertingPattern__FIELD().is_bound()) alertingPattern__FIELD().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void AlertingPattern::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_CC_Types.AlertingPattern has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) alertingPattern__FIELD().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alertingPattern_FIELD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alertingPattern__FIELD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CC_Types.AlertingPattern: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.AlertingPattern");
  }
}

void AlertingPattern::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_alertingPattern__FIELD.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void AlertingPattern::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_alertingPattern__FIELD.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void AlertingPattern::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 AlertingPattern::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 AlertingPattern::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AlertingPattern_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(AlertingPattern_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(AlertingPattern_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_alertingPattern__FIELD.RAW_decode(General__Types::BIT4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AlertingPattern::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AlertingPattern_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &AlertingPattern_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_alertingPattern__FIELD.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct AlertingPattern_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_alertingPattern__FIELD;
BITSTRING_template field_spare;
};

void AlertingPattern_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_alertingPattern__FIELD = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void AlertingPattern_template::copy_value(const AlertingPattern& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.alertingPattern__FIELD().is_bound()) {
  single_value->field_alertingPattern__FIELD = other_value.alertingPattern__FIELD();
} else {
  single_value->field_alertingPattern__FIELD.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AlertingPattern_template::copy_template(const AlertingPattern_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.alertingPattern__FIELD().get_selection()) {
single_value->field_alertingPattern__FIELD = other_value.alertingPattern__FIELD();
} else {
single_value->field_alertingPattern__FIELD.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AlertingPattern_template[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 AlertingPattern_template(*other_value.implication_.precondition);
implication_.implied_template = new AlertingPattern_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_CC_Types.AlertingPattern.");
break;
}
set_selection(other_value);
}

AlertingPattern_template::AlertingPattern_template()
{
}

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

AlertingPattern_template::AlertingPattern_template(const AlertingPattern& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AlertingPattern_template::match(const AlertingPattern& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.alertingPattern__FIELD().is_bound()) return FALSE;
if(!single_value->field_alertingPattern__FIELD.match(other_value.alertingPattern__FIELD(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_CC_Types.AlertingPattern.");
}
return FALSE;
}

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

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

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

AlertingPattern AlertingPattern_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_CC_Types.AlertingPattern.");
AlertingPattern ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_alertingPattern__FIELD.is_bound()) {
ret_val.alertingPattern__FIELD() = single_value->field_alertingPattern__FIELD.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void AlertingPattern_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_CC_Types.AlertingPattern.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AlertingPattern_template[list_length];
}

AlertingPattern_template& AlertingPattern_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_CC_Types.AlertingPattern.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.AlertingPattern.");
return value_list.list_value[list_index];
}

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

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

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

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

BITSTRING_template& AlertingPattern_template::alertingPattern__FIELD()
{
set_specific();
return single_value->field_alertingPattern__FIELD;
}

const BITSTRING_template& AlertingPattern_template::alertingPattern__FIELD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field alertingPattern_FIELD of a non-specific template of type @MobileL3_CC_Types.AlertingPattern.");
return single_value->field_alertingPattern__FIELD;
}

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

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

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

void AlertingPattern_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", alertingPattern_FIELD := ");
single_value->field_alertingPattern__FIELD.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void AlertingPattern_template::log_match(const AlertingPattern& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_alertingPattern__FIELD.match(match_value.alertingPattern__FIELD(), legacy)){
TTCN_Logger::log_logmatch_info(".alertingPattern_FIELD");
single_value->field_alertingPattern__FIELD.log_match(match_value.alertingPattern__FIELD(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", alertingPattern_FIELD := ");
single_value->field_alertingPattern__FIELD.log_match(match_value.alertingPattern__FIELD(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void AlertingPattern_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (alertingPattern__FIELD().is_bound()) alertingPattern__FIELD().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void AlertingPattern_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_alertingPattern__FIELD.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_CC_Types.AlertingPattern.");
}
}

void AlertingPattern_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_alertingPattern__FIELD.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AlertingPattern_template[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_CC_Types.AlertingPattern.");
}
}

void AlertingPattern_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: {
    AlertingPattern_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_CC_Types.AlertingPattern has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) alertingPattern__FIELD().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alertingPattern_FIELD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alertingPattern__FIELD().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CC_Types.AlertingPattern: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AlertingPattern_template* precondition = new AlertingPattern_template;
    precondition->set_param(*param.get_elem(0));
    AlertingPattern_template* implied_template = new AlertingPattern_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AlertingPattern_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.AlertingPattern");
  }
  is_ifpresent = param.get_ifpresent();
}

void AlertingPattern_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.AlertingPattern");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.AlertingPattern");
single_value->field_alertingPattern__FIELD.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.AlertingPattern");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.AlertingPattern");
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_CC_Types.AlertingPattern");
}

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

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

AllowedActions::AllowedActions()
{
}

AllowedActions::AllowedActions(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_spare__7,
    const BITSTRING& par_ccbsActivation)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_spare__7(par_spare__7),
  field_ccbsActivation(par_ccbsActivation)
{
}

AllowedActions::AllowedActions(const AllowedActions& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.AllowedActions.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.spare__7().is_bound()) field_spare__7 = other_value.spare__7();
else field_spare__7.clean_up();
if (other_value.ccbsActivation().is_bound()) field_ccbsActivation = other_value.ccbsActivation();
else field_ccbsActivation.clean_up();
}

void AllowedActions::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_spare__7.clean_up();
field_ccbsActivation.clean_up();
}

const TTCN_Typedescriptor_t* AllowedActions::get_descriptor() const { return &AllowedActions_descr_; }
AllowedActions& AllowedActions::operator=(const AllowedActions& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.AllowedActions.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.spare__7().is_bound()) field_spare__7 = other_value.spare__7();
  else field_spare__7.clean_up();
  if (other_value.ccbsActivation().is_bound()) field_ccbsActivation = other_value.ccbsActivation();
  else field_ccbsActivation.clean_up();
}
return *this;
}

boolean AllowedActions::operator==(const AllowedActions& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_spare__7==other_value.field_spare__7
  && field_ccbsActivation==other_value.field_ccbsActivation;
}

boolean AllowedActions::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_spare__7.is_bound())
  || (field_ccbsActivation.is_bound());
}
boolean AllowedActions::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_spare__7.is_value()
  && field_ccbsActivation.is_value();
}
void AllowedActions::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare_7 := ");
field_spare__7.log();
TTCN_Logger::log_event_str(", ccbsActivation := ");
field_ccbsActivation.log();
TTCN_Logger::log_event_str(" }");
}

void AllowedActions::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare__7().is_bound()) spare__7().set_implicit_omit();
if (ccbsActivation().is_bound()) ccbsActivation().set_implicit_omit();
}

void AllowedActions::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_CC_Types.AllowedActions has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare__7().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ccbsActivation().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ccbsActivation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ccbsActivation().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_CC_Types.AllowedActions: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.AllowedActions");
  }
}

void AllowedActions::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_spare__7.encode_text(text_buf);
field_ccbsActivation.encode_text(text_buf);
}

void AllowedActions::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_spare__7.decode_text(text_buf);
field_ccbsActivation.decode_text(text_buf);
}

void AllowedActions::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 AllowedActions::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 AllowedActions::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, AllowedActions_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(AllowedActions_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(AllowedActions_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_spare__7.RAW_decode(General__Types::BIT7_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_ccbsActivation.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AllowedActions::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AllowedActions_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT7_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &AllowedActions_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_spare__7.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_ccbsActivation.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct AllowedActions_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_spare__7;
BITSTRING_template field_ccbsActivation;
};

void AllowedActions_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_spare__7 = ANY_VALUE;
single_value->field_ccbsActivation = ANY_VALUE;
}
}
}

void AllowedActions_template::copy_value(const AllowedActions& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.spare__7().is_bound()) {
  single_value->field_spare__7 = other_value.spare__7();
} else {
  single_value->field_spare__7.clean_up();
}
if (other_value.ccbsActivation().is_bound()) {
  single_value->field_ccbsActivation = other_value.ccbsActivation();
} else {
  single_value->field_ccbsActivation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AllowedActions_template::copy_template(const AllowedActions_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare__7().get_selection()) {
single_value->field_spare__7 = other_value.spare__7();
} else {
single_value->field_spare__7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ccbsActivation().get_selection()) {
single_value->field_ccbsActivation = other_value.ccbsActivation();
} else {
single_value->field_ccbsActivation.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 AllowedActions_template[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 AllowedActions_template(*other_value.implication_.precondition);
implication_.implied_template = new AllowedActions_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_CC_Types.AllowedActions.");
break;
}
set_selection(other_value);
}

AllowedActions_template::AllowedActions_template()
{
}

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

AllowedActions_template::AllowedActions_template(const AllowedActions& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AllowedActions_template::match(const AllowedActions& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.spare__7().is_bound()) return FALSE;
if(!single_value->field_spare__7.match(other_value.spare__7(), legacy))return FALSE;
if(!other_value.ccbsActivation().is_bound()) return FALSE;
if(!single_value->field_ccbsActivation.match(other_value.ccbsActivation(), 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_CC_Types.AllowedActions.");
}
return FALSE;
}

boolean AllowedActions_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_spare__7.is_bound()
 || single_value->field_ccbsActivation.is_bound();
}

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

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

AllowedActions AllowedActions_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_CC_Types.AllowedActions.");
AllowedActions ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_spare__7.is_bound()) {
ret_val.spare__7() = single_value->field_spare__7.valueof();
}
if (single_value->field_ccbsActivation.is_bound()) {
ret_val.ccbsActivation() = single_value->field_ccbsActivation.valueof();
}
return ret_val;
}

void AllowedActions_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_CC_Types.AllowedActions.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AllowedActions_template[list_length];
}

AllowedActions_template& AllowedActions_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_CC_Types.AllowedActions.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.AllowedActions.");
return value_list.list_value[list_index];
}

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

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

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

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

BITSTRING_template& AllowedActions_template::spare__7()
{
set_specific();
return single_value->field_spare__7;
}

const BITSTRING_template& AllowedActions_template::spare__7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare_7 of a non-specific template of type @MobileL3_CC_Types.AllowedActions.");
return single_value->field_spare__7;
}

BITSTRING_template& AllowedActions_template::ccbsActivation()
{
set_specific();
return single_value->field_ccbsActivation;
}

const BITSTRING_template& AllowedActions_template::ccbsActivation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ccbsActivation of a non-specific template of type @MobileL3_CC_Types.AllowedActions.");
return single_value->field_ccbsActivation;
}

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

void AllowedActions_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare_7 := ");
single_value->field_spare__7.log();
TTCN_Logger::log_event_str(", ccbsActivation := ");
single_value->field_ccbsActivation.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 AllowedActions_template::log_match(const AllowedActions& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare__7.match(match_value.spare__7(), legacy)){
TTCN_Logger::log_logmatch_info(".spare_7");
single_value->field_spare__7.log_match(match_value.spare__7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ccbsActivation.match(match_value.ccbsActivation(), legacy)){
TTCN_Logger::log_logmatch_info(".ccbsActivation");
single_value->field_ccbsActivation.log_match(match_value.ccbsActivation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", spare_7 := ");
single_value->field_spare__7.log_match(match_value.spare__7(), legacy);
TTCN_Logger::log_event_str(", ccbsActivation := ");
single_value->field_ccbsActivation.log_match(match_value.ccbsActivation(), 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 AllowedActions_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare__7().is_bound()) spare__7().set_implicit_omit();
if (ccbsActivation().is_bound()) ccbsActivation().set_implicit_omit();
}

void AllowedActions_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_spare__7.encode_text(text_buf);
single_value->field_ccbsActivation.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_CC_Types.AllowedActions.");
}
}

void AllowedActions_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_spare__7.decode_text(text_buf);
single_value->field_ccbsActivation.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 AllowedActions_template[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_CC_Types.AllowedActions.");
}
}

void AllowedActions_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: {
    AllowedActions_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_CC_Types.AllowedActions has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare__7().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ccbsActivation().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ccbsActivation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ccbsActivation().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_CC_Types.AllowedActions: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AllowedActions_template* precondition = new AllowedActions_template;
    precondition->set_param(*param.get_elem(0));
    AllowedActions_template* implied_template = new AllowedActions_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AllowedActions_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.AllowedActions");
  }
  is_ifpresent = param.get_ifpresent();
}

void AllowedActions_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.AllowedActions");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.AllowedActions");
single_value->field_spare__7.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.AllowedActions");
single_value->field_ccbsActivation.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.AllowedActions");
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_CC_Types.AllowedActions");
}

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

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

StreamIdentifier::StreamIdentifier()
{
}

StreamIdentifier::StreamIdentifier(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthf,
    const OCTETSTRING& par_streamIdentifierValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthf(par_lengthf),
  field_streamIdentifierValue(par_streamIdentifierValue)
{
}

StreamIdentifier::StreamIdentifier(const StreamIdentifier& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.StreamIdentifier.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthf().is_bound()) field_lengthf = other_value.lengthf();
else field_lengthf.clean_up();
if (other_value.streamIdentifierValue().is_bound()) field_streamIdentifierValue = other_value.streamIdentifierValue();
else field_streamIdentifierValue.clean_up();
}

void StreamIdentifier::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthf.clean_up();
field_streamIdentifierValue.clean_up();
}

const TTCN_Typedescriptor_t* StreamIdentifier::get_descriptor() const { return &StreamIdentifier_descr_; }
StreamIdentifier& StreamIdentifier::operator=(const StreamIdentifier& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.StreamIdentifier.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthf().is_bound()) field_lengthf = other_value.lengthf();
  else field_lengthf.clean_up();
  if (other_value.streamIdentifierValue().is_bound()) field_streamIdentifierValue = other_value.streamIdentifierValue();
  else field_streamIdentifierValue.clean_up();
}
return *this;
}

boolean StreamIdentifier::operator==(const StreamIdentifier& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthf==other_value.field_lengthf
  && field_streamIdentifierValue==other_value.field_streamIdentifierValue;
}

boolean StreamIdentifier::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthf.is_bound())
  || (field_streamIdentifierValue.is_bound());
}
boolean StreamIdentifier::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthf.is_value()
  && field_streamIdentifierValue.is_value();
}
void StreamIdentifier::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthf := ");
field_lengthf.log();
TTCN_Logger::log_event_str(", streamIdentifierValue := ");
field_streamIdentifierValue.log();
TTCN_Logger::log_event_str(" }");
}

void StreamIdentifier::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthf().is_bound()) lengthf().set_implicit_omit();
if (streamIdentifierValue().is_bound()) streamIdentifierValue().set_implicit_omit();
}

void StreamIdentifier::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_CC_Types.StreamIdentifier has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthf().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) streamIdentifierValue().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthf")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthf().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifierValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifierValue().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_CC_Types.StreamIdentifier: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.StreamIdentifier");
  }
}

void StreamIdentifier::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthf.encode_text(text_buf);
field_streamIdentifierValue.encode_text(text_buf);
}

void StreamIdentifier::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthf.decode_text(text_buf);
field_streamIdentifierValue.decode_text(text_buf);
}

void StreamIdentifier::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 StreamIdentifier::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 StreamIdentifier::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, StreamIdentifier_lengthf_descr_.raw->forceomit);
  decoded_field_length = field_lengthf.RAW_decode(StreamIdentifier_lengthf_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthf.convert_to_Integer(StreamIdentifier_lengthf_descr_);
  field_lengthf = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_streamIdentifierValue.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int StreamIdentifier::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, StreamIdentifier_lengthf_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_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &StreamIdentifier_lengthf_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_streamIdentifierValue.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct StreamIdentifier_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthf;
OCTETSTRING_template field_streamIdentifierValue;
};

void StreamIdentifier_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthf = ANY_VALUE;
single_value->field_streamIdentifierValue = ANY_VALUE;
}
}
}

void StreamIdentifier_template::copy_value(const StreamIdentifier& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthf().is_bound()) {
  single_value->field_lengthf = other_value.lengthf();
} else {
  single_value->field_lengthf.clean_up();
}
if (other_value.streamIdentifierValue().is_bound()) {
  single_value->field_streamIdentifierValue = other_value.streamIdentifierValue();
} else {
  single_value->field_streamIdentifierValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void StreamIdentifier_template::copy_template(const StreamIdentifier_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthf().get_selection()) {
single_value->field_lengthf = other_value.lengthf();
} else {
single_value->field_lengthf.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.streamIdentifierValue().get_selection()) {
single_value->field_streamIdentifierValue = other_value.streamIdentifierValue();
} else {
single_value->field_streamIdentifierValue.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 StreamIdentifier_template[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 StreamIdentifier_template(*other_value.implication_.precondition);
implication_.implied_template = new StreamIdentifier_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_CC_Types.StreamIdentifier.");
break;
}
set_selection(other_value);
}

StreamIdentifier_template::StreamIdentifier_template()
{
}

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

StreamIdentifier_template::StreamIdentifier_template(const StreamIdentifier& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean StreamIdentifier_template::match(const StreamIdentifier& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthf().is_bound()) return FALSE;
if(!single_value->field_lengthf.match(other_value.lengthf(), legacy))return FALSE;
if(!other_value.streamIdentifierValue().is_bound()) return FALSE;
if(!single_value->field_streamIdentifierValue.match(other_value.streamIdentifierValue(), 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_CC_Types.StreamIdentifier.");
}
return FALSE;
}

boolean StreamIdentifier_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthf.is_bound()
 || single_value->field_streamIdentifierValue.is_bound();
}

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

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

StreamIdentifier StreamIdentifier_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_CC_Types.StreamIdentifier.");
StreamIdentifier ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthf.is_bound()) {
ret_val.lengthf() = single_value->field_lengthf.valueof();
}
if (single_value->field_streamIdentifierValue.is_bound()) {
ret_val.streamIdentifierValue() = single_value->field_streamIdentifierValue.valueof();
}
return ret_val;
}

void StreamIdentifier_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_CC_Types.StreamIdentifier.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new StreamIdentifier_template[list_length];
}

StreamIdentifier_template& StreamIdentifier_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_CC_Types.StreamIdentifier.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.StreamIdentifier.");
return value_list.list_value[list_index];
}

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

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

INTEGER_template& StreamIdentifier_template::lengthf()
{
set_specific();
return single_value->field_lengthf;
}

const INTEGER_template& StreamIdentifier_template::lengthf() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthf of a non-specific template of type @MobileL3_CC_Types.StreamIdentifier.");
return single_value->field_lengthf;
}

OCTETSTRING_template& StreamIdentifier_template::streamIdentifierValue()
{
set_specific();
return single_value->field_streamIdentifierValue;
}

const OCTETSTRING_template& StreamIdentifier_template::streamIdentifierValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field streamIdentifierValue of a non-specific template of type @MobileL3_CC_Types.StreamIdentifier.");
return single_value->field_streamIdentifierValue;
}

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

void StreamIdentifier_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthf := ");
single_value->field_lengthf.log();
TTCN_Logger::log_event_str(", streamIdentifierValue := ");
single_value->field_streamIdentifierValue.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 StreamIdentifier_template::log_match(const StreamIdentifier& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthf.match(match_value.lengthf(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthf");
single_value->field_lengthf.log_match(match_value.lengthf(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_streamIdentifierValue.match(match_value.streamIdentifierValue(), legacy)){
TTCN_Logger::log_logmatch_info(".streamIdentifierValue");
single_value->field_streamIdentifierValue.log_match(match_value.streamIdentifierValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthf := ");
single_value->field_lengthf.log_match(match_value.lengthf(), legacy);
TTCN_Logger::log_event_str(", streamIdentifierValue := ");
single_value->field_streamIdentifierValue.log_match(match_value.streamIdentifierValue(), 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 StreamIdentifier_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthf().is_bound()) lengthf().set_implicit_omit();
if (streamIdentifierValue().is_bound()) streamIdentifierValue().set_implicit_omit();
}

void StreamIdentifier_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthf.encode_text(text_buf);
single_value->field_streamIdentifierValue.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_CC_Types.StreamIdentifier.");
}
}

void StreamIdentifier_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthf.decode_text(text_buf);
single_value->field_streamIdentifierValue.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 StreamIdentifier_template[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_CC_Types.StreamIdentifier.");
}
}

void StreamIdentifier_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: {
    StreamIdentifier_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_CC_Types.StreamIdentifier has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthf().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) streamIdentifierValue().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthf")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthf().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifierValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifierValue().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_CC_Types.StreamIdentifier: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    StreamIdentifier_template* precondition = new StreamIdentifier_template;
    precondition->set_param(*param.get_elem(0));
    StreamIdentifier_template* implied_template = new StreamIdentifier_template;
    implied_template->set_param(*param.get_elem(1));
    *this = StreamIdentifier_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.StreamIdentifier");
  }
  is_ifpresent = param.get_ifpresent();
}

void StreamIdentifier_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.StreamIdentifier");
single_value->field_lengthf.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.StreamIdentifier");
single_value->field_streamIdentifierValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.StreamIdentifier");
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_CC_Types.StreamIdentifier");
}

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

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

NetworkCallControlCapabilities::NetworkCallControlCapabilities()
{
}

NetworkCallControlCapabilities::NetworkCallControlCapabilities(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_mcs,
    const BITSTRING& par_spare)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_mcs(par_mcs),
  field_spare(par_spare)
{
}

NetworkCallControlCapabilities::NetworkCallControlCapabilities(const NetworkCallControlCapabilities& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.NetworkCallControlCapabilities.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mcs().is_bound()) field_mcs = other_value.mcs();
else field_mcs.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void NetworkCallControlCapabilities::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_mcs.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* NetworkCallControlCapabilities::get_descriptor() const { return &NetworkCallControlCapabilities_descr_; }
NetworkCallControlCapabilities& NetworkCallControlCapabilities::operator=(const NetworkCallControlCapabilities& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.NetworkCallControlCapabilities.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mcs().is_bound()) field_mcs = other_value.mcs();
  else field_mcs.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean NetworkCallControlCapabilities::operator==(const NetworkCallControlCapabilities& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_mcs==other_value.field_mcs
  && field_spare==other_value.field_spare;
}

boolean NetworkCallControlCapabilities::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mcs.is_bound())
  || (field_spare.is_bound());
}
boolean NetworkCallControlCapabilities::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_mcs.is_value()
  && field_spare.is_value();
}
void NetworkCallControlCapabilities::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mcs := ");
field_mcs.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void NetworkCallControlCapabilities::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mcs().is_bound()) mcs().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void NetworkCallControlCapabilities::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_CC_Types.NetworkCallControlCapabilities has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mcs().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mcs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mcs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CC_Types.NetworkCallControlCapabilities: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.NetworkCallControlCapabilities");
  }
}

void NetworkCallControlCapabilities::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mcs.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void NetworkCallControlCapabilities::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mcs.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void NetworkCallControlCapabilities::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 NetworkCallControlCapabilities::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 NetworkCallControlCapabilities::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, NetworkCallControlCapabilities_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NetworkCallControlCapabilities_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(NetworkCallControlCapabilities_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_mcs.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT7_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NetworkCallControlCapabilities::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, NetworkCallControlCapabilities_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT7_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &NetworkCallControlCapabilities_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_mcs.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct NetworkCallControlCapabilities_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_mcs;
BITSTRING_template field_spare;
};

void NetworkCallControlCapabilities_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_mcs = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void NetworkCallControlCapabilities_template::copy_value(const NetworkCallControlCapabilities& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mcs().is_bound()) {
  single_value->field_mcs = other_value.mcs();
} else {
  single_value->field_mcs.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NetworkCallControlCapabilities_template::copy_template(const NetworkCallControlCapabilities_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mcs().get_selection()) {
single_value->field_mcs = other_value.mcs();
} else {
single_value->field_mcs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NetworkCallControlCapabilities_template[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 NetworkCallControlCapabilities_template(*other_value.implication_.precondition);
implication_.implied_template = new NetworkCallControlCapabilities_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_CC_Types.NetworkCallControlCapabilities.");
break;
}
set_selection(other_value);
}

NetworkCallControlCapabilities_template::NetworkCallControlCapabilities_template()
{
}

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

NetworkCallControlCapabilities_template::NetworkCallControlCapabilities_template(const NetworkCallControlCapabilities& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean NetworkCallControlCapabilities_template::match(const NetworkCallControlCapabilities& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.mcs().is_bound()) return FALSE;
if(!single_value->field_mcs.match(other_value.mcs(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_CC_Types.NetworkCallControlCapabilities.");
}
return FALSE;
}

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

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

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

NetworkCallControlCapabilities NetworkCallControlCapabilities_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_CC_Types.NetworkCallControlCapabilities.");
NetworkCallControlCapabilities ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mcs.is_bound()) {
ret_val.mcs() = single_value->field_mcs.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void NetworkCallControlCapabilities_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_CC_Types.NetworkCallControlCapabilities.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NetworkCallControlCapabilities_template[list_length];
}

NetworkCallControlCapabilities_template& NetworkCallControlCapabilities_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_CC_Types.NetworkCallControlCapabilities.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.NetworkCallControlCapabilities.");
return value_list.list_value[list_index];
}

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

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

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

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

BITSTRING_template& NetworkCallControlCapabilities_template::mcs()
{
set_specific();
return single_value->field_mcs;
}

const BITSTRING_template& NetworkCallControlCapabilities_template::mcs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mcs of a non-specific template of type @MobileL3_CC_Types.NetworkCallControlCapabilities.");
return single_value->field_mcs;
}

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

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

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

void NetworkCallControlCapabilities_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mcs := ");
single_value->field_mcs.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void NetworkCallControlCapabilities_template::log_match(const NetworkCallControlCapabilities& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mcs.match(match_value.mcs(), legacy)){
TTCN_Logger::log_logmatch_info(".mcs");
single_value->field_mcs.log_match(match_value.mcs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", mcs := ");
single_value->field_mcs.log_match(match_value.mcs(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void NetworkCallControlCapabilities_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mcs().is_bound()) mcs().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void NetworkCallControlCapabilities_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_mcs.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_CC_Types.NetworkCallControlCapabilities.");
}
}

void NetworkCallControlCapabilities_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_mcs.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NetworkCallControlCapabilities_template[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_CC_Types.NetworkCallControlCapabilities.");
}
}

void NetworkCallControlCapabilities_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: {
    NetworkCallControlCapabilities_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_CC_Types.NetworkCallControlCapabilities has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mcs().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mcs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mcs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CC_Types.NetworkCallControlCapabilities: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NetworkCallControlCapabilities_template* precondition = new NetworkCallControlCapabilities_template;
    precondition->set_param(*param.get_elem(0));
    NetworkCallControlCapabilities_template* implied_template = new NetworkCallControlCapabilities_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NetworkCallControlCapabilities_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.NetworkCallControlCapabilities");
  }
  is_ifpresent = param.get_ifpresent();
}

void NetworkCallControlCapabilities_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.NetworkCallControlCapabilities");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.NetworkCallControlCapabilities");
single_value->field_mcs.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.NetworkCallControlCapabilities");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.NetworkCallControlCapabilities");
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_CC_Types.NetworkCallControlCapabilities");
}

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

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

CauseofNoCli::CauseofNoCli()
{
}

CauseofNoCli::CauseofNoCli(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_causeofNoCli__FIELD)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_causeofNoCli__FIELD(par_causeofNoCli__FIELD)
{
}

CauseofNoCli::CauseofNoCli(const CauseofNoCli& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.CauseofNoCli.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.causeofNoCli__FIELD().is_bound()) field_causeofNoCli__FIELD = other_value.causeofNoCli__FIELD();
else field_causeofNoCli__FIELD.clean_up();
}

void CauseofNoCli::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_causeofNoCli__FIELD.clean_up();
}

const TTCN_Typedescriptor_t* CauseofNoCli::get_descriptor() const { return &CauseofNoCli_descr_; }
CauseofNoCli& CauseofNoCli::operator=(const CauseofNoCli& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.CauseofNoCli.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.causeofNoCli__FIELD().is_bound()) field_causeofNoCli__FIELD = other_value.causeofNoCli__FIELD();
  else field_causeofNoCli__FIELD.clean_up();
}
return *this;
}

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

boolean CauseofNoCli::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_causeofNoCli__FIELD.is_bound());
}
boolean CauseofNoCli::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_causeofNoCli__FIELD.is_value();
}
void CauseofNoCli::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", causeofNoCli_FIELD := ");
field_causeofNoCli__FIELD.log();
TTCN_Logger::log_event_str(" }");
}

void CauseofNoCli::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (causeofNoCli__FIELD().is_bound()) causeofNoCli__FIELD().set_implicit_omit();
}

void CauseofNoCli::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_CC_Types.CauseofNoCli has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) causeofNoCli__FIELD().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "causeofNoCli_FIELD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeofNoCli__FIELD().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_CC_Types.CauseofNoCli: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.CauseofNoCli");
  }
}

void CauseofNoCli::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_causeofNoCli__FIELD.encode_text(text_buf);
}

void CauseofNoCli::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_causeofNoCli__FIELD.decode_text(text_buf);
}

void CauseofNoCli::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 CauseofNoCli::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 CauseofNoCli::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, CauseofNoCli_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(CauseofNoCli_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(CauseofNoCli_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_causeofNoCli__FIELD.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CauseofNoCli::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CauseofNoCli_lengthIndicator_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_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &CauseofNoCli_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_causeofNoCli__FIELD.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct CauseofNoCli_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_causeofNoCli__FIELD;
};

void CauseofNoCli_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_causeofNoCli__FIELD = ANY_VALUE;
}
}
}

void CauseofNoCli_template::copy_value(const CauseofNoCli& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.causeofNoCli__FIELD().is_bound()) {
  single_value->field_causeofNoCli__FIELD = other_value.causeofNoCli__FIELD();
} else {
  single_value->field_causeofNoCli__FIELD.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CauseofNoCli_template::copy_template(const CauseofNoCli_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.causeofNoCli__FIELD().get_selection()) {
single_value->field_causeofNoCli__FIELD = other_value.causeofNoCli__FIELD();
} else {
single_value->field_causeofNoCli__FIELD.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 CauseofNoCli_template[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 CauseofNoCli_template(*other_value.implication_.precondition);
implication_.implied_template = new CauseofNoCli_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_CC_Types.CauseofNoCli.");
break;
}
set_selection(other_value);
}

CauseofNoCli_template::CauseofNoCli_template()
{
}

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

CauseofNoCli_template::CauseofNoCli_template(const CauseofNoCli& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CauseofNoCli_template::match(const CauseofNoCli& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.causeofNoCli__FIELD().is_bound()) return FALSE;
if(!single_value->field_causeofNoCli__FIELD.match(other_value.causeofNoCli__FIELD(), 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_CC_Types.CauseofNoCli.");
}
return FALSE;
}

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

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

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

CauseofNoCli CauseofNoCli_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_CC_Types.CauseofNoCli.");
CauseofNoCli ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_causeofNoCli__FIELD.is_bound()) {
ret_val.causeofNoCli__FIELD() = single_value->field_causeofNoCli__FIELD.valueof();
}
return ret_val;
}

void CauseofNoCli_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_CC_Types.CauseofNoCli.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CauseofNoCli_template[list_length];
}

CauseofNoCli_template& CauseofNoCli_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_CC_Types.CauseofNoCli.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.CauseofNoCli.");
return value_list.list_value[list_index];
}

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

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

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

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

OCTETSTRING_template& CauseofNoCli_template::causeofNoCli__FIELD()
{
set_specific();
return single_value->field_causeofNoCli__FIELD;
}

const OCTETSTRING_template& CauseofNoCli_template::causeofNoCli__FIELD() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field causeofNoCli_FIELD of a non-specific template of type @MobileL3_CC_Types.CauseofNoCli.");
return single_value->field_causeofNoCli__FIELD;
}

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

void CauseofNoCli_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", causeofNoCli_FIELD := ");
single_value->field_causeofNoCli__FIELD.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 CauseofNoCli_template::log_match(const CauseofNoCli& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_causeofNoCli__FIELD.match(match_value.causeofNoCli__FIELD(), legacy)){
TTCN_Logger::log_logmatch_info(".causeofNoCli_FIELD");
single_value->field_causeofNoCli__FIELD.log_match(match_value.causeofNoCli__FIELD(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", causeofNoCli_FIELD := ");
single_value->field_causeofNoCli__FIELD.log_match(match_value.causeofNoCli__FIELD(), 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 CauseofNoCli_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (causeofNoCli__FIELD().is_bound()) causeofNoCli__FIELD().set_implicit_omit();
}

void CauseofNoCli_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_causeofNoCli__FIELD.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_CC_Types.CauseofNoCli.");
}
}

void CauseofNoCli_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_causeofNoCli__FIELD.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 CauseofNoCli_template[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_CC_Types.CauseofNoCli.");
}
}

void CauseofNoCli_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: {
    CauseofNoCli_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_CC_Types.CauseofNoCli has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) causeofNoCli__FIELD().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "causeofNoCli_FIELD")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeofNoCli__FIELD().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_CC_Types.CauseofNoCli: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CauseofNoCli_template* precondition = new CauseofNoCli_template;
    precondition->set_param(*param.get_elem(0));
    CauseofNoCli_template* implied_template = new CauseofNoCli_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CauseofNoCli_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.CauseofNoCli");
  }
  is_ifpresent = param.get_ifpresent();
}

void CauseofNoCli_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.CauseofNoCli");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.CauseofNoCli");
single_value->field_causeofNoCli__FIELD.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.CauseofNoCli");
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_CC_Types.CauseofNoCli");
}

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

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

ServiceCategory::ServiceCategory()
{
}

ServiceCategory::ServiceCategory(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_emergencyServiceCategory,
    const BITSTRING& par_spare__1)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_emergencyServiceCategory(par_emergencyServiceCategory),
  field_spare__1(par_spare__1)
{
}

ServiceCategory::ServiceCategory(const ServiceCategory& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.ServiceCategory.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.emergencyServiceCategory().is_bound()) field_emergencyServiceCategory = other_value.emergencyServiceCategory();
else field_emergencyServiceCategory.clean_up();
if (other_value.spare__1().is_bound()) field_spare__1 = other_value.spare__1();
else field_spare__1.clean_up();
}

void ServiceCategory::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_emergencyServiceCategory.clean_up();
field_spare__1.clean_up();
}

const TTCN_Typedescriptor_t* ServiceCategory::get_descriptor() const { return &ServiceCategory_descr_; }
ServiceCategory& ServiceCategory::operator=(const ServiceCategory& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.ServiceCategory.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.emergencyServiceCategory().is_bound()) field_emergencyServiceCategory = other_value.emergencyServiceCategory();
  else field_emergencyServiceCategory.clean_up();
  if (other_value.spare__1().is_bound()) field_spare__1 = other_value.spare__1();
  else field_spare__1.clean_up();
}
return *this;
}

boolean ServiceCategory::operator==(const ServiceCategory& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_emergencyServiceCategory==other_value.field_emergencyServiceCategory
  && field_spare__1==other_value.field_spare__1;
}

boolean ServiceCategory::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_emergencyServiceCategory.is_bound())
  || (field_spare__1.is_bound());
}
boolean ServiceCategory::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_emergencyServiceCategory.is_value()
  && field_spare__1.is_value();
}
void ServiceCategory::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", emergencyServiceCategory := ");
field_emergencyServiceCategory.log();
TTCN_Logger::log_event_str(", spare_1 := ");
field_spare__1.log();
TTCN_Logger::log_event_str(" }");
}

void ServiceCategory::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (emergencyServiceCategory().is_bound()) emergencyServiceCategory().set_implicit_omit();
if (spare__1().is_bound()) spare__1().set_implicit_omit();
}

void ServiceCategory::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_CC_Types.ServiceCategory has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) emergencyServiceCategory().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare__1().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyServiceCategory")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyServiceCategory().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__1().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_CC_Types.ServiceCategory: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.ServiceCategory");
  }
}

void ServiceCategory::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_emergencyServiceCategory.encode_text(text_buf);
field_spare__1.encode_text(text_buf);
}

void ServiceCategory::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_emergencyServiceCategory.decode_text(text_buf);
field_spare__1.decode_text(text_buf);
}

void ServiceCategory::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 ServiceCategory::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 ServiceCategory::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, ServiceCategory_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(ServiceCategory_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(ServiceCategory_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_emergencyServiceCategory.RAW_decode(General__Types::BIT7_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare__1.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ServiceCategory::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ServiceCategory_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT7_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &ServiceCategory_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_emergencyServiceCategory.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare__1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct ServiceCategory_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_emergencyServiceCategory;
BITSTRING_template field_spare__1;
};

void ServiceCategory_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_emergencyServiceCategory = ANY_VALUE;
single_value->field_spare__1 = ANY_VALUE;
}
}
}

void ServiceCategory_template::copy_value(const ServiceCategory& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.emergencyServiceCategory().is_bound()) {
  single_value->field_emergencyServiceCategory = other_value.emergencyServiceCategory();
} else {
  single_value->field_emergencyServiceCategory.clean_up();
}
if (other_value.spare__1().is_bound()) {
  single_value->field_spare__1 = other_value.spare__1();
} else {
  single_value->field_spare__1.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ServiceCategory_template::copy_template(const ServiceCategory_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.emergencyServiceCategory().get_selection()) {
single_value->field_emergencyServiceCategory = other_value.emergencyServiceCategory();
} else {
single_value->field_emergencyServiceCategory.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare__1().get_selection()) {
single_value->field_spare__1 = other_value.spare__1();
} else {
single_value->field_spare__1.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 ServiceCategory_template[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 ServiceCategory_template(*other_value.implication_.precondition);
implication_.implied_template = new ServiceCategory_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_CC_Types.ServiceCategory.");
break;
}
set_selection(other_value);
}

ServiceCategory_template::ServiceCategory_template()
{
}

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

ServiceCategory_template::ServiceCategory_template(const ServiceCategory& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ServiceCategory_template::match(const ServiceCategory& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.emergencyServiceCategory().is_bound()) return FALSE;
if(!single_value->field_emergencyServiceCategory.match(other_value.emergencyServiceCategory(), legacy))return FALSE;
if(!other_value.spare__1().is_bound()) return FALSE;
if(!single_value->field_spare__1.match(other_value.spare__1(), 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_CC_Types.ServiceCategory.");
}
return FALSE;
}

boolean ServiceCategory_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_emergencyServiceCategory.is_bound()
 || single_value->field_spare__1.is_bound();
}

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

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

ServiceCategory ServiceCategory_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_CC_Types.ServiceCategory.");
ServiceCategory ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_emergencyServiceCategory.is_bound()) {
ret_val.emergencyServiceCategory() = single_value->field_emergencyServiceCategory.valueof();
}
if (single_value->field_spare__1.is_bound()) {
ret_val.spare__1() = single_value->field_spare__1.valueof();
}
return ret_val;
}

void ServiceCategory_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_CC_Types.ServiceCategory.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ServiceCategory_template[list_length];
}

ServiceCategory_template& ServiceCategory_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_CC_Types.ServiceCategory.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.ServiceCategory.");
return value_list.list_value[list_index];
}

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

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

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

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

BITSTRING_template& ServiceCategory_template::emergencyServiceCategory()
{
set_specific();
return single_value->field_emergencyServiceCategory;
}

const BITSTRING_template& ServiceCategory_template::emergencyServiceCategory() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field emergencyServiceCategory of a non-specific template of type @MobileL3_CC_Types.ServiceCategory.");
return single_value->field_emergencyServiceCategory;
}

BITSTRING_template& ServiceCategory_template::spare__1()
{
set_specific();
return single_value->field_spare__1;
}

const BITSTRING_template& ServiceCategory_template::spare__1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare_1 of a non-specific template of type @MobileL3_CC_Types.ServiceCategory.");
return single_value->field_spare__1;
}

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

void ServiceCategory_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", emergencyServiceCategory := ");
single_value->field_emergencyServiceCategory.log();
TTCN_Logger::log_event_str(", spare_1 := ");
single_value->field_spare__1.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 ServiceCategory_template::log_match(const ServiceCategory& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_emergencyServiceCategory.match(match_value.emergencyServiceCategory(), legacy)){
TTCN_Logger::log_logmatch_info(".emergencyServiceCategory");
single_value->field_emergencyServiceCategory.log_match(match_value.emergencyServiceCategory(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare__1.match(match_value.spare__1(), legacy)){
TTCN_Logger::log_logmatch_info(".spare_1");
single_value->field_spare__1.log_match(match_value.spare__1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", emergencyServiceCategory := ");
single_value->field_emergencyServiceCategory.log_match(match_value.emergencyServiceCategory(), legacy);
TTCN_Logger::log_event_str(", spare_1 := ");
single_value->field_spare__1.log_match(match_value.spare__1(), 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 ServiceCategory_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (emergencyServiceCategory().is_bound()) emergencyServiceCategory().set_implicit_omit();
if (spare__1().is_bound()) spare__1().set_implicit_omit();
}

void ServiceCategory_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_emergencyServiceCategory.encode_text(text_buf);
single_value->field_spare__1.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_CC_Types.ServiceCategory.");
}
}

void ServiceCategory_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_emergencyServiceCategory.decode_text(text_buf);
single_value->field_spare__1.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 ServiceCategory_template[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_CC_Types.ServiceCategory.");
}
}

void ServiceCategory_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: {
    ServiceCategory_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_CC_Types.ServiceCategory has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) emergencyServiceCategory().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare__1().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyServiceCategory")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyServiceCategory().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare_1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__1().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_CC_Types.ServiceCategory: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ServiceCategory_template* precondition = new ServiceCategory_template;
    precondition->set_param(*param.get_elem(0));
    ServiceCategory_template* implied_template = new ServiceCategory_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ServiceCategory_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.ServiceCategory");
  }
  is_ifpresent = param.get_ifpresent();
}

void ServiceCategory_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.ServiceCategory");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.ServiceCategory");
single_value->field_emergencyServiceCategory.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.ServiceCategory");
single_value->field_spare__1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.ServiceCategory");
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_CC_Types.ServiceCategory");
}

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

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

NetworkInitiatedServiceUpgradeIndicator::NetworkInitiatedServiceUpgradeIndicator()
{
}

NetworkInitiatedServiceUpgradeIndicator::NetworkInitiatedServiceUpgradeIndicator(const OCTETSTRING& par_elementIdentifier)
  :   field_elementIdentifier(par_elementIdentifier)
{
}

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

void NetworkInitiatedServiceUpgradeIndicator::clean_up()
{
field_elementIdentifier.clean_up();
}

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

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

boolean NetworkInitiatedServiceUpgradeIndicator::is_bound() const
{
return (field_elementIdentifier.is_bound());
}
boolean NetworkInitiatedServiceUpgradeIndicator::is_value() const
{
return field_elementIdentifier.is_value();
}
void NetworkInitiatedServiceUpgradeIndicator::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

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

void NetworkInitiatedServiceUpgradeIndicator::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.NetworkInitiatedServiceUpgradeIndicator has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CC_Types.NetworkInitiatedServiceUpgradeIndicator: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.NetworkInitiatedServiceUpgradeIndicator");
  }
}

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

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

void NetworkInitiatedServiceUpgradeIndicator::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 NetworkInitiatedServiceUpgradeIndicator::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 NetworkInitiatedServiceUpgradeIndicator::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NetworkInitiatedServiceUpgradeIndicator::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct NetworkInitiatedServiceUpgradeIndicator_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
};

void NetworkInitiatedServiceUpgradeIndicator_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void NetworkInitiatedServiceUpgradeIndicator_template::copy_value(const NetworkInitiatedServiceUpgradeIndicator& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NetworkInitiatedServiceUpgradeIndicator_template::copy_template(const NetworkInitiatedServiceUpgradeIndicator_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NetworkInitiatedServiceUpgradeIndicator_template[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 NetworkInitiatedServiceUpgradeIndicator_template(*other_value.implication_.precondition);
implication_.implied_template = new NetworkInitiatedServiceUpgradeIndicator_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_CC_Types.NetworkInitiatedServiceUpgradeIndicator.");
break;
}
set_selection(other_value);
}

NetworkInitiatedServiceUpgradeIndicator_template::NetworkInitiatedServiceUpgradeIndicator_template()
{
}

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

NetworkInitiatedServiceUpgradeIndicator_template::NetworkInitiatedServiceUpgradeIndicator_template(const NetworkInitiatedServiceUpgradeIndicator& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

NetworkInitiatedServiceUpgradeIndicator NetworkInitiatedServiceUpgradeIndicator_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_CC_Types.NetworkInitiatedServiceUpgradeIndicator.");
NetworkInitiatedServiceUpgradeIndicator ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void NetworkInitiatedServiceUpgradeIndicator_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_CC_Types.NetworkInitiatedServiceUpgradeIndicator.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NetworkInitiatedServiceUpgradeIndicator_template[list_length];
}

NetworkInitiatedServiceUpgradeIndicator_template& NetworkInitiatedServiceUpgradeIndicator_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_CC_Types.NetworkInitiatedServiceUpgradeIndicator.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.NetworkInitiatedServiceUpgradeIndicator.");
return value_list.list_value[list_index];
}

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

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

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

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

void NetworkInitiatedServiceUpgradeIndicator_template::log_match(const NetworkInitiatedServiceUpgradeIndicator& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void NetworkInitiatedServiceUpgradeIndicator_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void NetworkInitiatedServiceUpgradeIndicator_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NetworkInitiatedServiceUpgradeIndicator_template[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_CC_Types.NetworkInitiatedServiceUpgradeIndicator.");
}
}

void NetworkInitiatedServiceUpgradeIndicator_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: {
    NetworkInitiatedServiceUpgradeIndicator_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.NetworkInitiatedServiceUpgradeIndicator has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CC_Types.NetworkInitiatedServiceUpgradeIndicator: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NetworkInitiatedServiceUpgradeIndicator_template* precondition = new NetworkInitiatedServiceUpgradeIndicator_template;
    precondition->set_param(*param.get_elem(0));
    NetworkInitiatedServiceUpgradeIndicator_template* implied_template = new NetworkInitiatedServiceUpgradeIndicator_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NetworkInitiatedServiceUpgradeIndicator_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.NetworkInitiatedServiceUpgradeIndicator");
  }
  is_ifpresent = param.get_ifpresent();
}

void NetworkInitiatedServiceUpgradeIndicator_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.NetworkInitiatedServiceUpgradeIndicator");
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_CC_Types.NetworkInitiatedServiceUpgradeIndicator");
}

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

boolean NetworkInitiatedServiceUpgradeIndicator_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__Alerting__NW__MS::PDU__ML3__Alerting__NW__MS()
{
}

PDU__ML3__Alerting__NW__MS::PDU__ML3__Alerting__NW__MS(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< ProgressIndicator__TLV >& par_progressIndicator,
    const OPTIONAL< User__user__TLV >& par_user__user)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_facility(par_facility),
  field_progressIndicator(par_progressIndicator),
  field_user__user(par_user__user)
{
}

PDU__ML3__Alerting__NW__MS::PDU__ML3__Alerting__NW__MS(const PDU__ML3__Alerting__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
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.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
else field_progressIndicator.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
}

void PDU__ML3__Alerting__NW__MS::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_facility.clean_up();
field_progressIndicator.clean_up();
field_user__user.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Alerting__NW__MS::get_descriptor() const { return &PDU__ML3__Alerting__NW__MS_descr_; }
PDU__ML3__Alerting__NW__MS& PDU__ML3__Alerting__NW__MS::operator=(const PDU__ML3__Alerting__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
  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.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
  else field_progressIndicator.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
}
return *this;
}

boolean PDU__ML3__Alerting__NW__MS::operator==(const PDU__ML3__Alerting__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_facility==other_value.field_facility
  && field_progressIndicator==other_value.field_progressIndicator
  && field_user__user==other_value.field_user__user;
}

boolean PDU__ML3__Alerting__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound());
}
boolean PDU__ML3__Alerting__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value());
}
int PDU__ML3__Alerting__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_facility.ispresent()) ret_val++;
  if (field_progressIndicator.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Alerting__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
field_progressIndicator.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Alerting__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__Alerting__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_Alerting_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS");
  }
}

void PDU__ML3__Alerting__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_progressIndicator.encode_text(text_buf);
field_user__user.encode_text(text_buf);
}

void PDU__ML3__Alerting__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_progressIndicator.decode_text(text_buf);
field_user__user.decode_text(text_buf);
}

void PDU__ML3__Alerting__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  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__Alerting__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  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__Alerting__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::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_facility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_progressIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, ProgressIndicator__TLV_descr_.raw->forceomit);
  decoded_field_length = field_progressIndicator().RAW_decode(ProgressIndicator__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_progressIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1){
  field_progressIndicator=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_progressIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=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__Alerting__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_facility.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_progressIndicator.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ProgressIndicator__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = 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_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_progressIndicator.ispresent()) {
  encoded_length += field_progressIndicator().RAW_encode(ProgressIndicator__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_progressIndicator.ispresent() && (!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.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_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  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_2.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__Alerting__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
ProgressIndicator__TLV_template field_progressIndicator;
User__user__TLV_template field_user__user;
};

void PDU__ML3__Alerting__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_progressIndicator = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Alerting__NW__MS_template::copy_value(const PDU__ML3__Alerting__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.progressIndicator().is_bound()) {
  if (other_value.progressIndicator().ispresent()) single_value->field_progressIndicator = other_value.progressIndicator()();
  else single_value->field_progressIndicator = OMIT_VALUE;
} else {
  single_value->field_progressIndicator.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Alerting__NW__MS_template::copy_template(const PDU__ML3__Alerting__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.progressIndicator().get_selection()) {
single_value->field_progressIndicator = other_value.progressIndicator();
} else {
single_value->field_progressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.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__Alerting__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__Alerting__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Alerting__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__ML3__Alerting__NW__MS_template::PDU__ML3__Alerting__NW__MS_template()
{
}

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

PDU__ML3__Alerting__NW__MS_template::PDU__ML3__Alerting__NW__MS_template(const PDU__ML3__Alerting__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Alerting__NW__MS_template::match(const PDU__ML3__Alerting__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.progressIndicator().is_bound()) return FALSE;
if((other_value.progressIndicator().ispresent() ? !single_value->field_progressIndicator.match((const ProgressIndicator__TLV&)other_value.progressIndicator(), legacy) : !single_value->field_progressIndicator.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.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_CC_Types.PDU_ML3_Alerting_NW_MS.");
}
return FALSE;
}

boolean PDU__ML3__Alerting__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound());
}

boolean PDU__ML3__Alerting__NW__MS_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_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value());
}

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

PDU__ML3__Alerting__NW__MS PDU__ML3__Alerting__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
PDU__ML3__Alerting__NW__MS 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_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_progressIndicator.is_omit()) ret_val.progressIndicator() = OMIT_VALUE;
else if (single_value->field_progressIndicator.is_bound()) {
ret_val.progressIndicator() = single_value->field_progressIndicator.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
return ret_val;
}

void PDU__ML3__Alerting__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Alerting__NW__MS_template[list_length];
}

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

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

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

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

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

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Alerting__NW__MS_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Alerting__NW__MS_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
return single_value->field_facility;
}

ProgressIndicator__TLV_template& PDU__ML3__Alerting__NW__MS_template::progressIndicator()
{
set_specific();
return single_value->field_progressIndicator;
}

const ProgressIndicator__TLV_template& PDU__ML3__Alerting__NW__MS_template::progressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field progressIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
return single_value->field_progressIndicator;
}

User__user__TLV_template& PDU__ML3__Alerting__NW__MS_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__Alerting__NW__MS_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
return single_value->field_user__user;
}

int PDU__ML3__Alerting__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_facility.is_present()) ret_val++;
      if (single_value->field_progressIndicator.is_present()) ret_val++;
      if (single_value->field_user__user.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_CC_Types.PDU_ML3_Alerting_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
  }
  return 0;
}

void PDU__ML3__Alerting__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.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__Alerting__NW__MS_template::log_match(const PDU__ML3__Alerting__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.progressIndicator().ispresent()){
if(!single_value->field_progressIndicator.match(match_value.progressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".progressIndicator");
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_progressIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".progressIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.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(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", progressIndicator := ");
if (match_value.progressIndicator().ispresent()) {
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_progressIndicator.log();
if (single_value->field_progressIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.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__Alerting__NW__MS_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 (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__Alerting__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_progressIndicator.encode_text(text_buf);
single_value->field_user__user.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_CC_Types.PDU_ML3_Alerting_NW_MS.");
}
}

void PDU__ML3__Alerting__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_progressIndicator.decode_text(text_buf);
single_value->field_user__user.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__Alerting__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS.");
}
}

void PDU__ML3__Alerting__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__Alerting__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_Alerting_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Alerting__NW__MS_template* precondition = new PDU__ML3__Alerting__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Alerting__NW__MS_template* implied_template = new PDU__ML3__Alerting__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Alerting__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Alerting__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS");
single_value->field_progressIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_NW_MS");
}

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

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

PDU__ML3__Alerting__MS__NW::PDU__ML3__Alerting__MS__NW()
{
}

PDU__ML3__Alerting__MS__NW::PDU__ML3__Alerting__MS__NW(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< User__user__TLV >& par_user__user,
    const OPTIONAL< MobileL3__CommonIE__Types::SS__VersionIndicator >& par_ss__VersionIndicator)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_facility(par_facility),
  field_user__user(par_user__user),
  field_ss__VersionIndicator(par_ss__VersionIndicator)
{
}

PDU__ML3__Alerting__MS__NW::PDU__ML3__Alerting__MS__NW(const PDU__ML3__Alerting__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW.");
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.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
else field_ss__VersionIndicator.clean_up();
}

void PDU__ML3__Alerting__MS__NW::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_facility.clean_up();
field_user__user.clean_up();
field_ss__VersionIndicator.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Alerting__MS__NW::get_descriptor() const { return &PDU__ML3__Alerting__MS__NW_descr_; }
PDU__ML3__Alerting__MS__NW& PDU__ML3__Alerting__MS__NW::operator=(const PDU__ML3__Alerting__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW.");
  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.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
  if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
  else field_ss__VersionIndicator.clean_up();
}
return *this;
}

boolean PDU__ML3__Alerting__MS__NW::operator==(const PDU__ML3__Alerting__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_facility==other_value.field_facility
  && field_user__user==other_value.field_user__user
  && field_ss__VersionIndicator==other_value.field_ss__VersionIndicator;
}

boolean PDU__ML3__Alerting__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound())
  || (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_bound());
}
boolean PDU__ML3__Alerting__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value())
  && (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_value());
}
int PDU__ML3__Alerting__MS__NW::size_of() const
{
  int ret_val = 2;
  if (field_facility.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  if (field_ss__VersionIndicator.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Alerting__MS__NW::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(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Alerting__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
}

void PDU__ML3__Alerting__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().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_CC_Types.PDU_ML3_Alerting_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW");
  }
}

void PDU__ML3__Alerting__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_user__user.encode_text(text_buf);
field_ss__VersionIndicator.encode_text(text_buf);
}

void PDU__ML3__Alerting__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_user__user.decode_text(text_buf);
field_ss__VersionIndicator.decode_text(text_buf);
}

void PDU__ML3__Alerting__MS__NW::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__Alerting__MS__NW::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__Alerting__MS__NW::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_facility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_ss__VersionIndicator = 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::SS__VersionIndicator_descr_.raw->forceomit);
  decoded_field_length = field_ss__VersionIndicator().RAW_decode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_ss__VersionIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().elementIdentifier() !=  os_3){
  field_ss__VersionIndicator=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_ss__VersionIndicator=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__Alerting__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_facility.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_ss__VersionIndicator.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::SS__VersionIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = 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_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_ss__VersionIndicator.ispresent()) {
  encoded_length += field_ss__VersionIndicator().RAW_encode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.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_ss__VersionIndicator.ispresent() && (!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().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[]={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_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__Alerting__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
User__user__TLV_template field_user__user;
MobileL3__CommonIE__Types::SS__VersionIndicator_template field_ss__VersionIndicator;
};

void PDU__ML3__Alerting__MS__NW_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_facility = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
single_value->field_ss__VersionIndicator = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Alerting__MS__NW_template::copy_value(const PDU__ML3__Alerting__MS__NW& 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.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
if (other_value.ss__VersionIndicator().is_bound()) {
  if (other_value.ss__VersionIndicator().ispresent()) single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator()();
  else single_value->field_ss__VersionIndicator = OMIT_VALUE;
} else {
  single_value->field_ss__VersionIndicator.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Alerting__MS__NW_template::copy_template(const PDU__ML3__Alerting__MS__NW_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.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ss__VersionIndicator().get_selection()) {
single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator();
} else {
single_value->field_ss__VersionIndicator.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__Alerting__MS__NW_template[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__Alerting__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Alerting__MS__NW_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_CC_Types.PDU_ML3_Alerting_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__ML3__Alerting__MS__NW_template::PDU__ML3__Alerting__MS__NW_template()
{
}

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

PDU__ML3__Alerting__MS__NW_template::PDU__ML3__Alerting__MS__NW_template(const PDU__ML3__Alerting__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Alerting__MS__NW_template::match(const PDU__ML3__Alerting__MS__NW& 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.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.match_omit(legacy)))return FALSE;
if(!other_value.ss__VersionIndicator().is_bound()) return FALSE;
if((other_value.ss__VersionIndicator().ispresent() ? !single_value->field_ss__VersionIndicator.match((const MobileL3__CommonIE__Types::SS__VersionIndicator&)other_value.ss__VersionIndicator(), legacy) : !single_value->field_ss__VersionIndicator.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_CC_Types.PDU_ML3_Alerting_MS_NW.");
}
return FALSE;
}

boolean PDU__ML3__Alerting__MS__NW_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_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound())
 || (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_bound());
}

boolean PDU__ML3__Alerting__MS__NW_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_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value())
 && (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_value());
}

void PDU__ML3__Alerting__MS__NW_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__Alerting__MS__NW PDU__ML3__Alerting__MS__NW_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_CC_Types.PDU_ML3_Alerting_MS_NW.");
PDU__ML3__Alerting__MS__NW 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_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
if (single_value->field_ss__VersionIndicator.is_omit()) ret_val.ss__VersionIndicator() = OMIT_VALUE;
else if (single_value->field_ss__VersionIndicator.is_bound()) {
ret_val.ss__VersionIndicator() = single_value->field_ss__VersionIndicator.valueof();
}
return ret_val;
}

void PDU__ML3__Alerting__MS__NW_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_CC_Types.PDU_ML3_Alerting_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Alerting__MS__NW_template[list_length];
}

PDU__ML3__Alerting__MS__NW_template& PDU__ML3__Alerting__MS__NW_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_CC_Types.PDU_ML3_Alerting_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW.");
return value_list.list_value[list_index];
}

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

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

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

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

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Alerting__MS__NW_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Alerting__MS__NW_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW.");
return single_value->field_facility;
}

User__user__TLV_template& PDU__ML3__Alerting__MS__NW_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__Alerting__MS__NW_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW.");
return single_value->field_user__user;
}

MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Alerting__MS__NW_template::ss__VersionIndicator()
{
set_specific();
return single_value->field_ss__VersionIndicator;
}

const MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Alerting__MS__NW_template::ss__VersionIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ss_VersionIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW.");
return single_value->field_ss__VersionIndicator;
}

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

void PDU__ML3__Alerting__MS__NW_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(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
single_value->field_ss__VersionIndicator.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__Alerting__MS__NW_template::log_match(const PDU__ML3__Alerting__MS__NW& 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.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ss__VersionIndicator().ispresent()){
if(!single_value->field_ss__VersionIndicator.match(match_value.ss__VersionIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ss_VersionIndicator");
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ss__VersionIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ss_VersionIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ss__VersionIndicator.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(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
if (match_value.ss__VersionIndicator().ispresent()) {
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ss__VersionIndicator.log();
if (single_value->field_ss__VersionIndicator.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__Alerting__MS__NW_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 (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
}

void PDU__ML3__Alerting__MS__NW_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_facility.encode_text(text_buf);
single_value->field_user__user.encode_text(text_buf);
single_value->field_ss__VersionIndicator.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_CC_Types.PDU_ML3_Alerting_MS_NW.");
}
}

void PDU__ML3__Alerting__MS__NW_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_facility.decode_text(text_buf);
single_value->field_user__user.decode_text(text_buf);
single_value->field_ss__VersionIndicator.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__Alerting__MS__NW_template[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_CC_Types.PDU_ML3_Alerting_MS_NW.");
}
}

void PDU__ML3__Alerting__MS__NW_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__Alerting__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().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_CC_Types.PDU_ML3_Alerting_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Alerting__MS__NW_template* precondition = new PDU__ML3__Alerting__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Alerting__MS__NW_template* implied_template = new PDU__ML3__Alerting__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Alerting__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Alerting__MS__NW_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_CC_Types.PDU_ML3_Alerting_MS_NW");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW");
single_value->field_ss__VersionIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Alerting_MS_NW");
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_CC_Types.PDU_ML3_Alerting_MS_NW");
}

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

boolean PDU__ML3__Alerting__MS__NW_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__CallConfirmed::PDU__ML3__CallConfirmed()
{
}

PDU__ML3__CallConfirmed::PDU__ML3__CallConfirmed(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< RepeatIndicator >& par_repeatIndicator,
    const OPTIONAL< BearerCapability__TLV >& par_bearerCapability1,
    const OPTIONAL< BearerCapability__TLV >& par_bearerCapability2,
    const OPTIONAL< MobileL3__CommonIE__Types::ML3__Cause__TLV >& par_cause,
    const OPTIONAL< CallControlCapabilities >& par_cC__Capabilities,
    const OPTIONAL< StreamIdentifier >& par_streamIdentifier,
    const OPTIONAL< MobileL3__CommonIE__Types::SupportedCodecList >& par_supportedCodecs)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_repeatIndicator(par_repeatIndicator),
  field_bearerCapability1(par_bearerCapability1),
  field_bearerCapability2(par_bearerCapability2),
  field_cause(par_cause),
  field_cC__Capabilities(par_cC__Capabilities),
  field_streamIdentifier(par_streamIdentifier),
  field_supportedCodecs(par_supportedCodecs)
{
}

PDU__ML3__CallConfirmed::PDU__ML3__CallConfirmed(const PDU__ML3__CallConfirmed& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
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.repeatIndicator().is_bound()) field_repeatIndicator = other_value.repeatIndicator();
else field_repeatIndicator.clean_up();
if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
else field_bearerCapability1.clean_up();
if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
else field_bearerCapability2.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.cC__Capabilities().is_bound()) field_cC__Capabilities = other_value.cC__Capabilities();
else field_cC__Capabilities.clean_up();
if (other_value.streamIdentifier().is_bound()) field_streamIdentifier = other_value.streamIdentifier();
else field_streamIdentifier.clean_up();
if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
else field_supportedCodecs.clean_up();
}

void PDU__ML3__CallConfirmed::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_repeatIndicator.clean_up();
field_bearerCapability1.clean_up();
field_bearerCapability2.clean_up();
field_cause.clean_up();
field_cC__Capabilities.clean_up();
field_streamIdentifier.clean_up();
field_supportedCodecs.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CallConfirmed::get_descriptor() const { return &PDU__ML3__CallConfirmed_descr_; }
PDU__ML3__CallConfirmed& PDU__ML3__CallConfirmed::operator=(const PDU__ML3__CallConfirmed& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
  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.repeatIndicator().is_bound()) field_repeatIndicator = other_value.repeatIndicator();
  else field_repeatIndicator.clean_up();
  if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
  else field_bearerCapability1.clean_up();
  if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
  else field_bearerCapability2.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.cC__Capabilities().is_bound()) field_cC__Capabilities = other_value.cC__Capabilities();
  else field_cC__Capabilities.clean_up();
  if (other_value.streamIdentifier().is_bound()) field_streamIdentifier = other_value.streamIdentifier();
  else field_streamIdentifier.clean_up();
  if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
  else field_supportedCodecs.clean_up();
}
return *this;
}

boolean PDU__ML3__CallConfirmed::operator==(const PDU__ML3__CallConfirmed& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_repeatIndicator==other_value.field_repeatIndicator
  && field_bearerCapability1==other_value.field_bearerCapability1
  && field_bearerCapability2==other_value.field_bearerCapability2
  && field_cause==other_value.field_cause
  && field_cC__Capabilities==other_value.field_cC__Capabilities
  && field_streamIdentifier==other_value.field_streamIdentifier
  && field_supportedCodecs==other_value.field_supportedCodecs;
}

boolean PDU__ML3__CallConfirmed::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_repeatIndicator.get_selection() || field_repeatIndicator.is_bound())
  || (OPTIONAL_OMIT == field_bearerCapability1.get_selection() || field_bearerCapability1.is_bound())
  || (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound())
  || (OPTIONAL_OMIT == field_cC__Capabilities.get_selection() || field_cC__Capabilities.is_bound())
  || (OPTIONAL_OMIT == field_streamIdentifier.get_selection() || field_streamIdentifier.is_bound())
  || (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_bound());
}
boolean PDU__ML3__CallConfirmed::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_repeatIndicator.get_selection() || field_repeatIndicator.is_value())
  && (OPTIONAL_OMIT == field_bearerCapability1.get_selection() || field_bearerCapability1.is_value())
  && (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_value())
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value())
  && (OPTIONAL_OMIT == field_cC__Capabilities.get_selection() || field_cC__Capabilities.is_value())
  && (OPTIONAL_OMIT == field_streamIdentifier.get_selection() || field_streamIdentifier.is_value())
  && (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_value());
}
int PDU__ML3__CallConfirmed::size_of() const
{
  int ret_val = 2;
  if (field_repeatIndicator.ispresent()) ret_val++;
  if (field_bearerCapability1.ispresent()) ret_val++;
  if (field_bearerCapability2.ispresent()) ret_val++;
  if (field_cause.ispresent()) ret_val++;
  if (field_cC__Capabilities.ispresent()) ret_val++;
  if (field_streamIdentifier.ispresent()) ret_val++;
  if (field_supportedCodecs.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__CallConfirmed::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(", repeatIndicator := ");
field_repeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
field_bearerCapability2.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", cC_Capabilities := ");
field_cC__Capabilities.log();
TTCN_Logger::log_event_str(", streamIdentifier := ");
field_streamIdentifier.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
field_supportedCodecs.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CallConfirmed::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!repeatIndicator().is_bound()) repeatIndicator() = OMIT_VALUE;
else repeatIndicator().set_implicit_omit();
if (!bearerCapability1().is_bound()) bearerCapability1() = OMIT_VALUE;
else bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!cC__Capabilities().is_bound()) cC__Capabilities() = OMIT_VALUE;
else cC__Capabilities().set_implicit_omit();
if (!streamIdentifier().is_bound()) streamIdentifier() = OMIT_VALUE;
else streamIdentifier().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
}

void PDU__ML3__CallConfirmed::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_CC_Types.PDU_ML3_CallConfirmed 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) repeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cC__Capabilities().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) streamIdentifier().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().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(), "repeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cC_Capabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cC__Capabilities().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CC_Types.PDU_ML3_CallConfirmed: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
  }
}

void PDU__ML3__CallConfirmed::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_repeatIndicator.encode_text(text_buf);
field_bearerCapability1.encode_text(text_buf);
field_bearerCapability2.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_cC__Capabilities.encode_text(text_buf);
field_streamIdentifier.encode_text(text_buf);
field_supportedCodecs.encode_text(text_buf);
}

void PDU__ML3__CallConfirmed::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_repeatIndicator.decode_text(text_buf);
field_bearerCapability1.decode_text(text_buf);
field_bearerCapability2.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_cC__Capabilities.decode_text(text_buf);
field_streamIdentifier.decode_text(text_buf);
field_supportedCodecs.decode_text(text_buf);
}

void PDU__ML3__CallConfirmed::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__CallConfirmed::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__CallConfirmed::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_repeatIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, RepeatIndicator_descr_.raw->forceomit);
  decoded_field_length = field_repeatIndicator().RAW_decode(RepeatIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_repeatIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_repeatIndicator.ispresent() || field_repeatIndicator().elementIdentifier() !=  bs_0){
  field_repeatIndicator=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_repeatIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_bearerCapability1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability1().RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_bearerCapability1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bearerCapability1.ispresent() || field_bearerCapability1().elementIdentifier() !=  os_4){
  field_bearerCapability1=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_bearerCapability1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_bearerCapability2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability2().RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_bearerCapability2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bearerCapability2.ispresent() || field_bearerCapability2().elementIdentifier() !=  os_4){
  field_bearerCapability2=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_bearerCapability2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_cause = 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::ML3__Cause__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5){
  field_cause=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_cause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_cC__Capabilities = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, CallControlCapabilities_descr_.raw->forceomit);
  decoded_field_length = field_cC__Capabilities().RAW_decode(CallControlCapabilities_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_cC__Capabilities = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cC__Capabilities.ispresent() || field_cC__Capabilities().elementIdentifier() !=  os_6){
  field_cC__Capabilities=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_cC__Capabilities=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_streamIdentifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, StreamIdentifier_descr_.raw->forceomit);
  decoded_field_length = field_streamIdentifier().RAW_decode(StreamIdentifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_streamIdentifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_streamIdentifier.ispresent() || field_streamIdentifier().elementIdentifier() !=  os_7){
  field_streamIdentifier=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_streamIdentifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_supportedCodecs = 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::SupportedCodecList_descr_.raw->forceomit);
  decoded_field_length = field_supportedCodecs().RAW_decode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_supportedCodecs = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_supportedCodecs=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__CallConfirmed::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);
  if (field_repeatIndicator.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RepeatIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_bearerCapability1.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, BearerCapability__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_bearerCapability2.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, BearerCapability__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_cause.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_cC__Capabilities.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, CallControlCapabilities_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_streamIdentifier.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, StreamIdentifier_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_supportedCodecs.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, MobileL3__CommonIE__Types::SupportedCodecList_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]);
  if (field_repeatIndicator.ispresent()) {
  encoded_length += field_repeatIndicator().RAW_encode(RepeatIndicator_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_bearerCapability1.ispresent()) {
  encoded_length += field_bearerCapability1().RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_bearerCapability2.ispresent()) {
  encoded_length += field_bearerCapability2().RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_cC__Capabilities.ispresent()) {
  encoded_length += field_cC__Capabilities().RAW_encode(CallControlCapabilities_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_streamIdentifier.ispresent()) {
  encoded_length += field_streamIdentifier().RAW_encode(StreamIdentifier_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_supportedCodecs.ispresent()) {
  encoded_length += field_supportedCodecs().RAW_encode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_repeatIndicator.ispresent() && (!field_repeatIndicator.ispresent() || field_repeatIndicator().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[]={2,1};
  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::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_bearerCapability1.ispresent() && (!field_bearerCapability1.ispresent() || field_bearerCapability1().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[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_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);
  }
  }
  if (field_bearerCapability2.ispresent() && (!field_bearerCapability2.ispresent() || field_bearerCapability2().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[]={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_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);
  }
  }
  if (field_cause.ispresent() && (!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5)) {
  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_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_cC__Capabilities.ispresent() && (!field_cC__Capabilities.ispresent() || field_cC__Capabilities().elementIdentifier() !=  os_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){
   os_6.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_streamIdentifier.ispresent() && (!field_streamIdentifier.ispresent() || field_streamIdentifier().elementIdentifier() !=  os_7)) {
  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_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__CallConfirmed_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
RepeatIndicator_template field_repeatIndicator;
BearerCapability__TLV_template field_bearerCapability1;
BearerCapability__TLV_template field_bearerCapability2;
MobileL3__CommonIE__Types::ML3__Cause__TLV_template field_cause;
CallControlCapabilities_template field_cC__Capabilities;
StreamIdentifier_template field_streamIdentifier;
MobileL3__CommonIE__Types::SupportedCodecList_template field_supportedCodecs;
};

void PDU__ML3__CallConfirmed_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_repeatIndicator = ANY_OR_OMIT;
single_value->field_bearerCapability1 = ANY_OR_OMIT;
single_value->field_bearerCapability2 = ANY_OR_OMIT;
single_value->field_cause = ANY_OR_OMIT;
single_value->field_cC__Capabilities = ANY_OR_OMIT;
single_value->field_streamIdentifier = ANY_OR_OMIT;
single_value->field_supportedCodecs = ANY_OR_OMIT;
}
}
}

void PDU__ML3__CallConfirmed_template::copy_value(const PDU__ML3__CallConfirmed& 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.repeatIndicator().is_bound()) {
  if (other_value.repeatIndicator().ispresent()) single_value->field_repeatIndicator = other_value.repeatIndicator()();
  else single_value->field_repeatIndicator = OMIT_VALUE;
} else {
  single_value->field_repeatIndicator.clean_up();
}
if (other_value.bearerCapability1().is_bound()) {
  if (other_value.bearerCapability1().ispresent()) single_value->field_bearerCapability1 = other_value.bearerCapability1()();
  else single_value->field_bearerCapability1 = OMIT_VALUE;
} else {
  single_value->field_bearerCapability1.clean_up();
}
if (other_value.bearerCapability2().is_bound()) {
  if (other_value.bearerCapability2().ispresent()) single_value->field_bearerCapability2 = other_value.bearerCapability2()();
  else single_value->field_bearerCapability2 = OMIT_VALUE;
} else {
  single_value->field_bearerCapability2.clean_up();
}
if (other_value.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
if (other_value.cC__Capabilities().is_bound()) {
  if (other_value.cC__Capabilities().ispresent()) single_value->field_cC__Capabilities = other_value.cC__Capabilities()();
  else single_value->field_cC__Capabilities = OMIT_VALUE;
} else {
  single_value->field_cC__Capabilities.clean_up();
}
if (other_value.streamIdentifier().is_bound()) {
  if (other_value.streamIdentifier().ispresent()) single_value->field_streamIdentifier = other_value.streamIdentifier()();
  else single_value->field_streamIdentifier = OMIT_VALUE;
} else {
  single_value->field_streamIdentifier.clean_up();
}
if (other_value.supportedCodecs().is_bound()) {
  if (other_value.supportedCodecs().ispresent()) single_value->field_supportedCodecs = other_value.supportedCodecs()();
  else single_value->field_supportedCodecs = OMIT_VALUE;
} else {
  single_value->field_supportedCodecs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CallConfirmed_template::copy_template(const PDU__ML3__CallConfirmed_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.repeatIndicator().get_selection()) {
single_value->field_repeatIndicator = other_value.repeatIndicator();
} else {
single_value->field_repeatIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability1().get_selection()) {
single_value->field_bearerCapability1 = other_value.bearerCapability1();
} else {
single_value->field_bearerCapability1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability2().get_selection()) {
single_value->field_bearerCapability2 = other_value.bearerCapability2();
} else {
single_value->field_bearerCapability2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cC__Capabilities().get_selection()) {
single_value->field_cC__Capabilities = other_value.cC__Capabilities();
} else {
single_value->field_cC__Capabilities.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.streamIdentifier().get_selection()) {
single_value->field_streamIdentifier = other_value.streamIdentifier();
} else {
single_value->field_streamIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.supportedCodecs().get_selection()) {
single_value->field_supportedCodecs = other_value.supportedCodecs();
} else {
single_value->field_supportedCodecs.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__CallConfirmed_template[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__CallConfirmed_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CallConfirmed_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_CC_Types.PDU_ML3_CallConfirmed.");
break;
}
set_selection(other_value);
}

PDU__ML3__CallConfirmed_template::PDU__ML3__CallConfirmed_template()
{
}

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

PDU__ML3__CallConfirmed_template::PDU__ML3__CallConfirmed_template(const PDU__ML3__CallConfirmed& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CallConfirmed_template::match(const PDU__ML3__CallConfirmed& 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.repeatIndicator().is_bound()) return FALSE;
if((other_value.repeatIndicator().ispresent() ? !single_value->field_repeatIndicator.match((const RepeatIndicator&)other_value.repeatIndicator(), legacy) : !single_value->field_repeatIndicator.match_omit(legacy)))return FALSE;
if(!other_value.bearerCapability1().is_bound()) return FALSE;
if((other_value.bearerCapability1().ispresent() ? !single_value->field_bearerCapability1.match((const BearerCapability__TLV&)other_value.bearerCapability1(), legacy) : !single_value->field_bearerCapability1.match_omit(legacy)))return FALSE;
if(!other_value.bearerCapability2().is_bound()) return FALSE;
if((other_value.bearerCapability2().ispresent() ? !single_value->field_bearerCapability2.match((const BearerCapability__TLV&)other_value.bearerCapability2(), legacy) : !single_value->field_bearerCapability2.match_omit(legacy)))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const MobileL3__CommonIE__Types::ML3__Cause__TLV&)other_value.cause(), legacy) : !single_value->field_cause.match_omit(legacy)))return FALSE;
if(!other_value.cC__Capabilities().is_bound()) return FALSE;
if((other_value.cC__Capabilities().ispresent() ? !single_value->field_cC__Capabilities.match((const CallControlCapabilities&)other_value.cC__Capabilities(), legacy) : !single_value->field_cC__Capabilities.match_omit(legacy)))return FALSE;
if(!other_value.streamIdentifier().is_bound()) return FALSE;
if((other_value.streamIdentifier().ispresent() ? !single_value->field_streamIdentifier.match((const StreamIdentifier&)other_value.streamIdentifier(), legacy) : !single_value->field_streamIdentifier.match_omit(legacy)))return FALSE;
if(!other_value.supportedCodecs().is_bound()) return FALSE;
if((other_value.supportedCodecs().ispresent() ? !single_value->field_supportedCodecs.match((const MobileL3__CommonIE__Types::SupportedCodecList&)other_value.supportedCodecs(), legacy) : !single_value->field_supportedCodecs.match_omit(legacy)))return FALSE;
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_CC_Types.PDU_ML3_CallConfirmed.");
}
return FALSE;
}

boolean PDU__ML3__CallConfirmed_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_repeatIndicator.is_omit() || single_value->field_repeatIndicator.is_bound())
 || (single_value->field_bearerCapability1.is_omit() || single_value->field_bearerCapability1.is_bound())
 || (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_bound())
 || (single_value->field_cause.is_omit() || single_value->field_cause.is_bound())
 || (single_value->field_cC__Capabilities.is_omit() || single_value->field_cC__Capabilities.is_bound())
 || (single_value->field_streamIdentifier.is_omit() || single_value->field_streamIdentifier.is_bound())
 || (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_bound());
}

boolean PDU__ML3__CallConfirmed_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_repeatIndicator.is_omit() || single_value->field_repeatIndicator.is_value())
 && (single_value->field_bearerCapability1.is_omit() || single_value->field_bearerCapability1.is_value())
 && (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_value())
 && (single_value->field_cause.is_omit() || single_value->field_cause.is_value())
 && (single_value->field_cC__Capabilities.is_omit() || single_value->field_cC__Capabilities.is_value())
 && (single_value->field_streamIdentifier.is_omit() || single_value->field_streamIdentifier.is_value())
 && (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_value());
}

void PDU__ML3__CallConfirmed_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__CallConfirmed PDU__ML3__CallConfirmed_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_CC_Types.PDU_ML3_CallConfirmed.");
PDU__ML3__CallConfirmed 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_repeatIndicator.is_omit()) ret_val.repeatIndicator() = OMIT_VALUE;
else if (single_value->field_repeatIndicator.is_bound()) {
ret_val.repeatIndicator() = single_value->field_repeatIndicator.valueof();
}
if (single_value->field_bearerCapability1.is_omit()) ret_val.bearerCapability1() = OMIT_VALUE;
else if (single_value->field_bearerCapability1.is_bound()) {
ret_val.bearerCapability1() = single_value->field_bearerCapability1.valueof();
}
if (single_value->field_bearerCapability2.is_omit()) ret_val.bearerCapability2() = OMIT_VALUE;
else if (single_value->field_bearerCapability2.is_bound()) {
ret_val.bearerCapability2() = single_value->field_bearerCapability2.valueof();
}
if (single_value->field_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_cC__Capabilities.is_omit()) ret_val.cC__Capabilities() = OMIT_VALUE;
else if (single_value->field_cC__Capabilities.is_bound()) {
ret_val.cC__Capabilities() = single_value->field_cC__Capabilities.valueof();
}
if (single_value->field_streamIdentifier.is_omit()) ret_val.streamIdentifier() = OMIT_VALUE;
else if (single_value->field_streamIdentifier.is_bound()) {
ret_val.streamIdentifier() = single_value->field_streamIdentifier.valueof();
}
if (single_value->field_supportedCodecs.is_omit()) ret_val.supportedCodecs() = OMIT_VALUE;
else if (single_value->field_supportedCodecs.is_bound()) {
ret_val.supportedCodecs() = single_value->field_supportedCodecs.valueof();
}
return ret_val;
}

void PDU__ML3__CallConfirmed_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_CC_Types.PDU_ML3_CallConfirmed.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CallConfirmed_template[list_length];
}

PDU__ML3__CallConfirmed_template& PDU__ML3__CallConfirmed_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_CC_Types.PDU_ML3_CallConfirmed.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
return value_list.list_value[list_index];
}

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

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

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

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

RepeatIndicator_template& PDU__ML3__CallConfirmed_template::repeatIndicator()
{
set_specific();
return single_value->field_repeatIndicator;
}

const RepeatIndicator_template& PDU__ML3__CallConfirmed_template::repeatIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field repeatIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
return single_value->field_repeatIndicator;
}

BearerCapability__TLV_template& PDU__ML3__CallConfirmed_template::bearerCapability1()
{
set_specific();
return single_value->field_bearerCapability1;
}

const BearerCapability__TLV_template& PDU__ML3__CallConfirmed_template::bearerCapability1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
return single_value->field_bearerCapability1;
}

BearerCapability__TLV_template& PDU__ML3__CallConfirmed_template::bearerCapability2()
{
set_specific();
return single_value->field_bearerCapability2;
}

const BearerCapability__TLV_template& PDU__ML3__CallConfirmed_template::bearerCapability2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
return single_value->field_bearerCapability2;
}

MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__CallConfirmed_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__CallConfirmed_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
return single_value->field_cause;
}

CallControlCapabilities_template& PDU__ML3__CallConfirmed_template::cC__Capabilities()
{
set_specific();
return single_value->field_cC__Capabilities;
}

const CallControlCapabilities_template& PDU__ML3__CallConfirmed_template::cC__Capabilities() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cC_Capabilities of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
return single_value->field_cC__Capabilities;
}

StreamIdentifier_template& PDU__ML3__CallConfirmed_template::streamIdentifier()
{
set_specific();
return single_value->field_streamIdentifier;
}

const StreamIdentifier_template& PDU__ML3__CallConfirmed_template::streamIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field streamIdentifier of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
return single_value->field_streamIdentifier;
}

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

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

int PDU__ML3__CallConfirmed_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_repeatIndicator.is_present()) ret_val++;
      if (single_value->field_bearerCapability1.is_present()) ret_val++;
      if (single_value->field_bearerCapability2.is_present()) ret_val++;
      if (single_value->field_cause.is_present()) ret_val++;
      if (single_value->field_cC__Capabilities.is_present()) ret_val++;
      if (single_value->field_streamIdentifier.is_present()) ret_val++;
      if (single_value->field_supportedCodecs.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_CC_Types.PDU_ML3_CallConfirmed 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_CC_Types.PDU_ML3_CallConfirmed containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_CallConfirmed.");
  }
  return 0;
}

void PDU__ML3__CallConfirmed_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(", repeatIndicator := ");
single_value->field_repeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
single_value->field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", cC_Capabilities := ");
single_value->field_cC__Capabilities.log();
TTCN_Logger::log_event_str(", streamIdentifier := ");
single_value->field_streamIdentifier.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
single_value->field_supportedCodecs.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__CallConfirmed_template::log_match(const PDU__ML3__CallConfirmed& 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.repeatIndicator().ispresent()){
if(!single_value->field_repeatIndicator.match(match_value.repeatIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".repeatIndicator");
single_value->field_repeatIndicator.log_match(match_value.repeatIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_repeatIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".repeatIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_repeatIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bearerCapability1().ispresent()){
if(!single_value->field_bearerCapability1.match(match_value.bearerCapability1(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability1");
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bearerCapability1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bearerCapability1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bearerCapability1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bearerCapability2().ispresent()){
if(!single_value->field_bearerCapability2.match(match_value.bearerCapability2(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability2");
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bearerCapability2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bearerCapability2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cC__Capabilities().ispresent()){
if(!single_value->field_cC__Capabilities.match(match_value.cC__Capabilities(), legacy)){
TTCN_Logger::log_logmatch_info(".cC_Capabilities");
single_value->field_cC__Capabilities.log_match(match_value.cC__Capabilities(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cC__Capabilities.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cC_Capabilities := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cC__Capabilities.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.streamIdentifier().ispresent()){
if(!single_value->field_streamIdentifier.match(match_value.streamIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".streamIdentifier");
single_value->field_streamIdentifier.log_match(match_value.streamIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_streamIdentifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".streamIdentifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_streamIdentifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.supportedCodecs().ispresent()){
if(!single_value->field_supportedCodecs.match(match_value.supportedCodecs(), legacy)){
TTCN_Logger::log_logmatch_info(".supportedCodecs");
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_supportedCodecs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".supportedCodecs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}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(", repeatIndicator := ");
if (match_value.repeatIndicator().ispresent()) {
single_value->field_repeatIndicator.log_match(match_value.repeatIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_repeatIndicator.log();
if (single_value->field_repeatIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bearerCapability1 := ");
if (match_value.bearerCapability1().ispresent()) {
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bearerCapability1.log();
if (single_value->field_bearerCapability1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bearerCapability2 := ");
if (match_value.bearerCapability2().ispresent()) {
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bearerCapability2.log();
if (single_value->field_bearerCapability2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cC_Capabilities := ");
if (match_value.cC__Capabilities().ispresent()) {
single_value->field_cC__Capabilities.log_match(match_value.cC__Capabilities(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cC__Capabilities.log();
if (single_value->field_cC__Capabilities.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", streamIdentifier := ");
if (match_value.streamIdentifier().ispresent()) {
single_value->field_streamIdentifier.log_match(match_value.streamIdentifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_streamIdentifier.log();
if (single_value->field_streamIdentifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", supportedCodecs := ");
if (match_value.supportedCodecs().ispresent()) {
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_supportedCodecs.log();
if (single_value->field_supportedCodecs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} 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__CallConfirmed_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 (!repeatIndicator().is_bound()) repeatIndicator() = OMIT_VALUE;
else repeatIndicator().set_implicit_omit();
if (!bearerCapability1().is_bound()) bearerCapability1() = OMIT_VALUE;
else bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!cC__Capabilities().is_bound()) cC__Capabilities() = OMIT_VALUE;
else cC__Capabilities().set_implicit_omit();
if (!streamIdentifier().is_bound()) streamIdentifier() = OMIT_VALUE;
else streamIdentifier().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
}

void PDU__ML3__CallConfirmed_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_repeatIndicator.encode_text(text_buf);
single_value->field_bearerCapability1.encode_text(text_buf);
single_value->field_bearerCapability2.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_cC__Capabilities.encode_text(text_buf);
single_value->field_streamIdentifier.encode_text(text_buf);
single_value->field_supportedCodecs.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_CC_Types.PDU_ML3_CallConfirmed.");
}
}

void PDU__ML3__CallConfirmed_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_repeatIndicator.decode_text(text_buf);
single_value->field_bearerCapability1.decode_text(text_buf);
single_value->field_bearerCapability2.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_cC__Capabilities.decode_text(text_buf);
single_value->field_streamIdentifier.decode_text(text_buf);
single_value->field_supportedCodecs.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__CallConfirmed_template[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_CC_Types.PDU_ML3_CallConfirmed.");
}
}

void PDU__ML3__CallConfirmed_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__CallConfirmed_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_CC_Types.PDU_ML3_CallConfirmed 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) repeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cC__Capabilities().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) streamIdentifier().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().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(), "repeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cC_Capabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cC__Capabilities().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CC_Types.PDU_ML3_CallConfirmed: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CallConfirmed_template* precondition = new PDU__ML3__CallConfirmed_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CallConfirmed_template* implied_template = new PDU__ML3__CallConfirmed_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CallConfirmed_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CallConfirmed_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_CC_Types.PDU_ML3_CallConfirmed");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
single_value->field_repeatIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
single_value->field_bearerCapability1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
single_value->field_bearerCapability2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
single_value->field_cC__Capabilities.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
single_value->field_streamIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
single_value->field_supportedCodecs.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallConfirmed");
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_CC_Types.PDU_ML3_CallConfirmed");
}

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

boolean PDU__ML3__CallConfirmed_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__CallProceeding::PDU__ML3__CallProceeding()
{
}

PDU__ML3__CallProceeding::PDU__ML3__CallProceeding(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< RepeatIndicator >& par_repeatIndicator,
    const OPTIONAL< BearerCapability__TLV >& par_bearerCapability1,
    const OPTIONAL< BearerCapability__TLV >& par_bearerCapability2,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< ProgressIndicator__TLV >& par_progressIndicator,
    const OPTIONAL< MobileL3__CommonIE__Types::PriorityLevel__ML3 >& par_priorityGranted,
    const OPTIONAL< NetworkCallControlCapabilities >& par_networkCCCapabilities)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_repeatIndicator(par_repeatIndicator),
  field_bearerCapability1(par_bearerCapability1),
  field_bearerCapability2(par_bearerCapability2),
  field_facility(par_facility),
  field_progressIndicator(par_progressIndicator),
  field_priorityGranted(par_priorityGranted),
  field_networkCCCapabilities(par_networkCCCapabilities)
{
}

PDU__ML3__CallProceeding::PDU__ML3__CallProceeding(const PDU__ML3__CallProceeding& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
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.repeatIndicator().is_bound()) field_repeatIndicator = other_value.repeatIndicator();
else field_repeatIndicator.clean_up();
if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
else field_bearerCapability1.clean_up();
if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
else field_bearerCapability2.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
else field_progressIndicator.clean_up();
if (other_value.priorityGranted().is_bound()) field_priorityGranted = other_value.priorityGranted();
else field_priorityGranted.clean_up();
if (other_value.networkCCCapabilities().is_bound()) field_networkCCCapabilities = other_value.networkCCCapabilities();
else field_networkCCCapabilities.clean_up();
}

void PDU__ML3__CallProceeding::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_repeatIndicator.clean_up();
field_bearerCapability1.clean_up();
field_bearerCapability2.clean_up();
field_facility.clean_up();
field_progressIndicator.clean_up();
field_priorityGranted.clean_up();
field_networkCCCapabilities.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CallProceeding::get_descriptor() const { return &PDU__ML3__CallProceeding_descr_; }
PDU__ML3__CallProceeding& PDU__ML3__CallProceeding::operator=(const PDU__ML3__CallProceeding& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
  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.repeatIndicator().is_bound()) field_repeatIndicator = other_value.repeatIndicator();
  else field_repeatIndicator.clean_up();
  if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
  else field_bearerCapability1.clean_up();
  if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
  else field_bearerCapability2.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
  else field_progressIndicator.clean_up();
  if (other_value.priorityGranted().is_bound()) field_priorityGranted = other_value.priorityGranted();
  else field_priorityGranted.clean_up();
  if (other_value.networkCCCapabilities().is_bound()) field_networkCCCapabilities = other_value.networkCCCapabilities();
  else field_networkCCCapabilities.clean_up();
}
return *this;
}

boolean PDU__ML3__CallProceeding::operator==(const PDU__ML3__CallProceeding& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_repeatIndicator==other_value.field_repeatIndicator
  && field_bearerCapability1==other_value.field_bearerCapability1
  && field_bearerCapability2==other_value.field_bearerCapability2
  && field_facility==other_value.field_facility
  && field_progressIndicator==other_value.field_progressIndicator
  && field_priorityGranted==other_value.field_priorityGranted
  && field_networkCCCapabilities==other_value.field_networkCCCapabilities;
}

boolean PDU__ML3__CallProceeding::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_repeatIndicator.get_selection() || field_repeatIndicator.is_bound())
  || (OPTIONAL_OMIT == field_bearerCapability1.get_selection() || field_bearerCapability1.is_bound())
  || (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_bound())
  || (OPTIONAL_OMIT == field_priorityGranted.get_selection() || field_priorityGranted.is_bound())
  || (OPTIONAL_OMIT == field_networkCCCapabilities.get_selection() || field_networkCCCapabilities.is_bound());
}
boolean PDU__ML3__CallProceeding::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_repeatIndicator.get_selection() || field_repeatIndicator.is_value())
  && (OPTIONAL_OMIT == field_bearerCapability1.get_selection() || field_bearerCapability1.is_value())
  && (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_value())
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_value())
  && (OPTIONAL_OMIT == field_priorityGranted.get_selection() || field_priorityGranted.is_value())
  && (OPTIONAL_OMIT == field_networkCCCapabilities.get_selection() || field_networkCCCapabilities.is_value());
}
int PDU__ML3__CallProceeding::size_of() const
{
  int ret_val = 2;
  if (field_repeatIndicator.ispresent()) ret_val++;
  if (field_bearerCapability1.ispresent()) ret_val++;
  if (field_bearerCapability2.ispresent()) ret_val++;
  if (field_facility.ispresent()) ret_val++;
  if (field_progressIndicator.ispresent()) ret_val++;
  if (field_priorityGranted.ispresent()) ret_val++;
  if (field_networkCCCapabilities.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__CallProceeding::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(", repeatIndicator := ");
field_repeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
field_bearerCapability2.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
field_progressIndicator.log();
TTCN_Logger::log_event_str(", priorityGranted := ");
field_priorityGranted.log();
TTCN_Logger::log_event_str(", networkCCCapabilities := ");
field_networkCCCapabilities.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CallProceeding::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!repeatIndicator().is_bound()) repeatIndicator() = OMIT_VALUE;
else repeatIndicator().set_implicit_omit();
if (!bearerCapability1().is_bound()) bearerCapability1() = OMIT_VALUE;
else bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!priorityGranted().is_bound()) priorityGranted() = OMIT_VALUE;
else priorityGranted().set_implicit_omit();
if (!networkCCCapabilities().is_bound()) networkCCCapabilities() = OMIT_VALUE;
else networkCCCapabilities().set_implicit_omit();
}

void PDU__ML3__CallProceeding::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_CC_Types.PDU_ML3_CallProceeding 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) repeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) priorityGranted().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) networkCCCapabilities().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(), "repeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priorityGranted")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityGranted().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkCCCapabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkCCCapabilities().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_CC_Types.PDU_ML3_CallProceeding: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
  }
}

void PDU__ML3__CallProceeding::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_repeatIndicator.encode_text(text_buf);
field_bearerCapability1.encode_text(text_buf);
field_bearerCapability2.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_progressIndicator.encode_text(text_buf);
field_priorityGranted.encode_text(text_buf);
field_networkCCCapabilities.encode_text(text_buf);
}

void PDU__ML3__CallProceeding::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_repeatIndicator.decode_text(text_buf);
field_bearerCapability1.decode_text(text_buf);
field_bearerCapability2.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_progressIndicator.decode_text(text_buf);
field_priorityGranted.decode_text(text_buf);
field_networkCCCapabilities.decode_text(text_buf);
}

void PDU__ML3__CallProceeding::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__CallProceeding::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__CallProceeding::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_repeatIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, RepeatIndicator_descr_.raw->forceomit);
  decoded_field_length = field_repeatIndicator().RAW_decode(RepeatIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_repeatIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_repeatIndicator.ispresent() || field_repeatIndicator().elementIdentifier() !=  bs_0){
  field_repeatIndicator=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_repeatIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_bearerCapability1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability1().RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_bearerCapability1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bearerCapability1.ispresent() || field_bearerCapability1().elementIdentifier() !=  os_4){
  field_bearerCapability1=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_bearerCapability1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_bearerCapability2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability2().RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_bearerCapability2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bearerCapability2.ispresent() || field_bearerCapability2().elementIdentifier() !=  os_4){
  field_bearerCapability2=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_bearerCapability2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_facility = 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::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_progressIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ProgressIndicator__TLV_descr_.raw->forceomit);
  decoded_field_length = field_progressIndicator().RAW_decode(ProgressIndicator__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_progressIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1){
  field_progressIndicator=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_progressIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_priorityGranted = 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::PriorityLevel__ML3_descr_.raw->forceomit);
  decoded_field_length = field_priorityGranted().RAW_decode(MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_priorityGranted = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_priorityGranted.ispresent() || field_priorityGranted().elementIdentifier() !=  bs_1){
  field_priorityGranted=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_priorityGranted=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_networkCCCapabilities = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, NetworkCallControlCapabilities_descr_.raw->forceomit);
  decoded_field_length = field_networkCCCapabilities().RAW_decode(NetworkCallControlCapabilities_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_networkCCCapabilities = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_networkCCCapabilities.ispresent() || field_networkCCCapabilities().elementIdentifier() !=  os_8){
  field_networkCCCapabilities=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_networkCCCapabilities=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__CallProceeding::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);
  if (field_repeatIndicator.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RepeatIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_bearerCapability1.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, BearerCapability__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_bearerCapability2.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, BearerCapability__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_facility.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_progressIndicator.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ProgressIndicator__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_priorityGranted.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_networkCCCapabilities.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, NetworkCallControlCapabilities_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]);
  if (field_repeatIndicator.ispresent()) {
  encoded_length += field_repeatIndicator().RAW_encode(RepeatIndicator_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_bearerCapability1.ispresent()) {
  encoded_length += field_bearerCapability1().RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_bearerCapability2.ispresent()) {
  encoded_length += field_bearerCapability2().RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_progressIndicator.ispresent()) {
  encoded_length += field_progressIndicator().RAW_encode(ProgressIndicator__TLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_priorityGranted.ispresent()) {
  encoded_length += field_priorityGranted().RAW_encode(MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_networkCCCapabilities.ispresent()) {
  encoded_length += field_networkCCCapabilities().RAW_encode(NetworkCallControlCapabilities_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_repeatIndicator.ispresent() && (!field_repeatIndicator.ispresent() || field_repeatIndicator().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[]={2,1};
  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::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_bearerCapability1.ispresent() && (!field_bearerCapability1.ispresent() || field_bearerCapability1().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[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_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);
  }
  }
  if (field_bearerCapability2.ispresent() && (!field_bearerCapability2.ispresent() || field_bearerCapability2().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[]={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_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);
  }
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  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_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_progressIndicator.ispresent() && (!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1)) {
  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){
   os_1.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_priorityGranted.ispresent() && (!field_priorityGranted.ispresent() || field_priorityGranted().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[]={7,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.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_networkCCCapabilities.ispresent() && (!field_networkCCCapabilities.ispresent() || field_networkCCCapabilities().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[]={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){
   os_8.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__CallProceeding_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
RepeatIndicator_template field_repeatIndicator;
BearerCapability__TLV_template field_bearerCapability1;
BearerCapability__TLV_template field_bearerCapability2;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
ProgressIndicator__TLV_template field_progressIndicator;
MobileL3__CommonIE__Types::PriorityLevel__ML3_template field_priorityGranted;
NetworkCallControlCapabilities_template field_networkCCCapabilities;
};

void PDU__ML3__CallProceeding_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_repeatIndicator = ANY_OR_OMIT;
single_value->field_bearerCapability1 = ANY_OR_OMIT;
single_value->field_bearerCapability2 = ANY_OR_OMIT;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_progressIndicator = ANY_OR_OMIT;
single_value->field_priorityGranted = ANY_OR_OMIT;
single_value->field_networkCCCapabilities = ANY_OR_OMIT;
}
}
}

void PDU__ML3__CallProceeding_template::copy_value(const PDU__ML3__CallProceeding& 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.repeatIndicator().is_bound()) {
  if (other_value.repeatIndicator().ispresent()) single_value->field_repeatIndicator = other_value.repeatIndicator()();
  else single_value->field_repeatIndicator = OMIT_VALUE;
} else {
  single_value->field_repeatIndicator.clean_up();
}
if (other_value.bearerCapability1().is_bound()) {
  if (other_value.bearerCapability1().ispresent()) single_value->field_bearerCapability1 = other_value.bearerCapability1()();
  else single_value->field_bearerCapability1 = OMIT_VALUE;
} else {
  single_value->field_bearerCapability1.clean_up();
}
if (other_value.bearerCapability2().is_bound()) {
  if (other_value.bearerCapability2().ispresent()) single_value->field_bearerCapability2 = other_value.bearerCapability2()();
  else single_value->field_bearerCapability2 = OMIT_VALUE;
} else {
  single_value->field_bearerCapability2.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.progressIndicator().is_bound()) {
  if (other_value.progressIndicator().ispresent()) single_value->field_progressIndicator = other_value.progressIndicator()();
  else single_value->field_progressIndicator = OMIT_VALUE;
} else {
  single_value->field_progressIndicator.clean_up();
}
if (other_value.priorityGranted().is_bound()) {
  if (other_value.priorityGranted().ispresent()) single_value->field_priorityGranted = other_value.priorityGranted()();
  else single_value->field_priorityGranted = OMIT_VALUE;
} else {
  single_value->field_priorityGranted.clean_up();
}
if (other_value.networkCCCapabilities().is_bound()) {
  if (other_value.networkCCCapabilities().ispresent()) single_value->field_networkCCCapabilities = other_value.networkCCCapabilities()();
  else single_value->field_networkCCCapabilities = OMIT_VALUE;
} else {
  single_value->field_networkCCCapabilities.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CallProceeding_template::copy_template(const PDU__ML3__CallProceeding_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.repeatIndicator().get_selection()) {
single_value->field_repeatIndicator = other_value.repeatIndicator();
} else {
single_value->field_repeatIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability1().get_selection()) {
single_value->field_bearerCapability1 = other_value.bearerCapability1();
} else {
single_value->field_bearerCapability1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability2().get_selection()) {
single_value->field_bearerCapability2 = other_value.bearerCapability2();
} else {
single_value->field_bearerCapability2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.progressIndicator().get_selection()) {
single_value->field_progressIndicator = other_value.progressIndicator();
} else {
single_value->field_progressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.priorityGranted().get_selection()) {
single_value->field_priorityGranted = other_value.priorityGranted();
} else {
single_value->field_priorityGranted.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkCCCapabilities().get_selection()) {
single_value->field_networkCCCapabilities = other_value.networkCCCapabilities();
} else {
single_value->field_networkCCCapabilities.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__CallProceeding_template[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__CallProceeding_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CallProceeding_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_CC_Types.PDU_ML3_CallProceeding.");
break;
}
set_selection(other_value);
}

PDU__ML3__CallProceeding_template::PDU__ML3__CallProceeding_template()
{
}

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

PDU__ML3__CallProceeding_template::PDU__ML3__CallProceeding_template(const PDU__ML3__CallProceeding& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CallProceeding_template::match(const PDU__ML3__CallProceeding& 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.repeatIndicator().is_bound()) return FALSE;
if((other_value.repeatIndicator().ispresent() ? !single_value->field_repeatIndicator.match((const RepeatIndicator&)other_value.repeatIndicator(), legacy) : !single_value->field_repeatIndicator.match_omit(legacy)))return FALSE;
if(!other_value.bearerCapability1().is_bound()) return FALSE;
if((other_value.bearerCapability1().ispresent() ? !single_value->field_bearerCapability1.match((const BearerCapability__TLV&)other_value.bearerCapability1(), legacy) : !single_value->field_bearerCapability1.match_omit(legacy)))return FALSE;
if(!other_value.bearerCapability2().is_bound()) return FALSE;
if((other_value.bearerCapability2().ispresent() ? !single_value->field_bearerCapability2.match((const BearerCapability__TLV&)other_value.bearerCapability2(), legacy) : !single_value->field_bearerCapability2.match_omit(legacy)))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.progressIndicator().is_bound()) return FALSE;
if((other_value.progressIndicator().ispresent() ? !single_value->field_progressIndicator.match((const ProgressIndicator__TLV&)other_value.progressIndicator(), legacy) : !single_value->field_progressIndicator.match_omit(legacy)))return FALSE;
if(!other_value.priorityGranted().is_bound()) return FALSE;
if((other_value.priorityGranted().ispresent() ? !single_value->field_priorityGranted.match((const MobileL3__CommonIE__Types::PriorityLevel__ML3&)other_value.priorityGranted(), legacy) : !single_value->field_priorityGranted.match_omit(legacy)))return FALSE;
if(!other_value.networkCCCapabilities().is_bound()) return FALSE;
if((other_value.networkCCCapabilities().ispresent() ? !single_value->field_networkCCCapabilities.match((const NetworkCallControlCapabilities&)other_value.networkCCCapabilities(), legacy) : !single_value->field_networkCCCapabilities.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_CC_Types.PDU_ML3_CallProceeding.");
}
return FALSE;
}

boolean PDU__ML3__CallProceeding_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_repeatIndicator.is_omit() || single_value->field_repeatIndicator.is_bound())
 || (single_value->field_bearerCapability1.is_omit() || single_value->field_bearerCapability1.is_bound())
 || (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_bound())
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_bound())
 || (single_value->field_priorityGranted.is_omit() || single_value->field_priorityGranted.is_bound())
 || (single_value->field_networkCCCapabilities.is_omit() || single_value->field_networkCCCapabilities.is_bound());
}

boolean PDU__ML3__CallProceeding_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_repeatIndicator.is_omit() || single_value->field_repeatIndicator.is_value())
 && (single_value->field_bearerCapability1.is_omit() || single_value->field_bearerCapability1.is_value())
 && (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_value())
 && (single_value->field_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_value())
 && (single_value->field_priorityGranted.is_omit() || single_value->field_priorityGranted.is_value())
 && (single_value->field_networkCCCapabilities.is_omit() || single_value->field_networkCCCapabilities.is_value());
}

void PDU__ML3__CallProceeding_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__CallProceeding PDU__ML3__CallProceeding_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_CC_Types.PDU_ML3_CallProceeding.");
PDU__ML3__CallProceeding 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_repeatIndicator.is_omit()) ret_val.repeatIndicator() = OMIT_VALUE;
else if (single_value->field_repeatIndicator.is_bound()) {
ret_val.repeatIndicator() = single_value->field_repeatIndicator.valueof();
}
if (single_value->field_bearerCapability1.is_omit()) ret_val.bearerCapability1() = OMIT_VALUE;
else if (single_value->field_bearerCapability1.is_bound()) {
ret_val.bearerCapability1() = single_value->field_bearerCapability1.valueof();
}
if (single_value->field_bearerCapability2.is_omit()) ret_val.bearerCapability2() = OMIT_VALUE;
else if (single_value->field_bearerCapability2.is_bound()) {
ret_val.bearerCapability2() = single_value->field_bearerCapability2.valueof();
}
if (single_value->field_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_progressIndicator.is_omit()) ret_val.progressIndicator() = OMIT_VALUE;
else if (single_value->field_progressIndicator.is_bound()) {
ret_val.progressIndicator() = single_value->field_progressIndicator.valueof();
}
if (single_value->field_priorityGranted.is_omit()) ret_val.priorityGranted() = OMIT_VALUE;
else if (single_value->field_priorityGranted.is_bound()) {
ret_val.priorityGranted() = single_value->field_priorityGranted.valueof();
}
if (single_value->field_networkCCCapabilities.is_omit()) ret_val.networkCCCapabilities() = OMIT_VALUE;
else if (single_value->field_networkCCCapabilities.is_bound()) {
ret_val.networkCCCapabilities() = single_value->field_networkCCCapabilities.valueof();
}
return ret_val;
}

void PDU__ML3__CallProceeding_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_CC_Types.PDU_ML3_CallProceeding.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CallProceeding_template[list_length];
}

PDU__ML3__CallProceeding_template& PDU__ML3__CallProceeding_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_CC_Types.PDU_ML3_CallProceeding.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
return value_list.list_value[list_index];
}

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

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

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

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

RepeatIndicator_template& PDU__ML3__CallProceeding_template::repeatIndicator()
{
set_specific();
return single_value->field_repeatIndicator;
}

const RepeatIndicator_template& PDU__ML3__CallProceeding_template::repeatIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field repeatIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
return single_value->field_repeatIndicator;
}

BearerCapability__TLV_template& PDU__ML3__CallProceeding_template::bearerCapability1()
{
set_specific();
return single_value->field_bearerCapability1;
}

const BearerCapability__TLV_template& PDU__ML3__CallProceeding_template::bearerCapability1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
return single_value->field_bearerCapability1;
}

BearerCapability__TLV_template& PDU__ML3__CallProceeding_template::bearerCapability2()
{
set_specific();
return single_value->field_bearerCapability2;
}

const BearerCapability__TLV_template& PDU__ML3__CallProceeding_template::bearerCapability2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
return single_value->field_bearerCapability2;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__CallProceeding_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__CallProceeding_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
return single_value->field_facility;
}

ProgressIndicator__TLV_template& PDU__ML3__CallProceeding_template::progressIndicator()
{
set_specific();
return single_value->field_progressIndicator;
}

const ProgressIndicator__TLV_template& PDU__ML3__CallProceeding_template::progressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field progressIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
return single_value->field_progressIndicator;
}

MobileL3__CommonIE__Types::PriorityLevel__ML3_template& PDU__ML3__CallProceeding_template::priorityGranted()
{
set_specific();
return single_value->field_priorityGranted;
}

const MobileL3__CommonIE__Types::PriorityLevel__ML3_template& PDU__ML3__CallProceeding_template::priorityGranted() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priorityGranted of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
return single_value->field_priorityGranted;
}

NetworkCallControlCapabilities_template& PDU__ML3__CallProceeding_template::networkCCCapabilities()
{
set_specific();
return single_value->field_networkCCCapabilities;
}

const NetworkCallControlCapabilities_template& PDU__ML3__CallProceeding_template::networkCCCapabilities() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkCCCapabilities of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
return single_value->field_networkCCCapabilities;
}

int PDU__ML3__CallProceeding_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_repeatIndicator.is_present()) ret_val++;
      if (single_value->field_bearerCapability1.is_present()) ret_val++;
      if (single_value->field_bearerCapability2.is_present()) ret_val++;
      if (single_value->field_facility.is_present()) ret_val++;
      if (single_value->field_progressIndicator.is_present()) ret_val++;
      if (single_value->field_priorityGranted.is_present()) ret_val++;
      if (single_value->field_networkCCCapabilities.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_CC_Types.PDU_ML3_CallProceeding 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_CC_Types.PDU_ML3_CallProceeding containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_CallProceeding.");
  }
  return 0;
}

void PDU__ML3__CallProceeding_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(", repeatIndicator := ");
single_value->field_repeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
single_value->field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(", priorityGranted := ");
single_value->field_priorityGranted.log();
TTCN_Logger::log_event_str(", networkCCCapabilities := ");
single_value->field_networkCCCapabilities.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__CallProceeding_template::log_match(const PDU__ML3__CallProceeding& 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.repeatIndicator().ispresent()){
if(!single_value->field_repeatIndicator.match(match_value.repeatIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".repeatIndicator");
single_value->field_repeatIndicator.log_match(match_value.repeatIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_repeatIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".repeatIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_repeatIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bearerCapability1().ispresent()){
if(!single_value->field_bearerCapability1.match(match_value.bearerCapability1(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability1");
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bearerCapability1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bearerCapability1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bearerCapability1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bearerCapability2().ispresent()){
if(!single_value->field_bearerCapability2.match(match_value.bearerCapability2(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability2");
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bearerCapability2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bearerCapability2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.progressIndicator().ispresent()){
if(!single_value->field_progressIndicator.match(match_value.progressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".progressIndicator");
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_progressIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".progressIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.priorityGranted().ispresent()){
if(!single_value->field_priorityGranted.match(match_value.priorityGranted(), legacy)){
TTCN_Logger::log_logmatch_info(".priorityGranted");
single_value->field_priorityGranted.log_match(match_value.priorityGranted(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_priorityGranted.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".priorityGranted := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_priorityGranted.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkCCCapabilities().ispresent()){
if(!single_value->field_networkCCCapabilities.match(match_value.networkCCCapabilities(), legacy)){
TTCN_Logger::log_logmatch_info(".networkCCCapabilities");
single_value->field_networkCCCapabilities.log_match(match_value.networkCCCapabilities(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkCCCapabilities.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkCCCapabilities := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkCCCapabilities.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(", repeatIndicator := ");
if (match_value.repeatIndicator().ispresent()) {
single_value->field_repeatIndicator.log_match(match_value.repeatIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_repeatIndicator.log();
if (single_value->field_repeatIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bearerCapability1 := ");
if (match_value.bearerCapability1().ispresent()) {
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bearerCapability1.log();
if (single_value->field_bearerCapability1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bearerCapability2 := ");
if (match_value.bearerCapability2().ispresent()) {
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bearerCapability2.log();
if (single_value->field_bearerCapability2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", progressIndicator := ");
if (match_value.progressIndicator().ispresent()) {
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_progressIndicator.log();
if (single_value->field_progressIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", priorityGranted := ");
if (match_value.priorityGranted().ispresent()) {
single_value->field_priorityGranted.log_match(match_value.priorityGranted(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_priorityGranted.log();
if (single_value->field_priorityGranted.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkCCCapabilities := ");
if (match_value.networkCCCapabilities().ispresent()) {
single_value->field_networkCCCapabilities.log_match(match_value.networkCCCapabilities(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkCCCapabilities.log();
if (single_value->field_networkCCCapabilities.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__CallProceeding_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 (!repeatIndicator().is_bound()) repeatIndicator() = OMIT_VALUE;
else repeatIndicator().set_implicit_omit();
if (!bearerCapability1().is_bound()) bearerCapability1() = OMIT_VALUE;
else bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!priorityGranted().is_bound()) priorityGranted() = OMIT_VALUE;
else priorityGranted().set_implicit_omit();
if (!networkCCCapabilities().is_bound()) networkCCCapabilities() = OMIT_VALUE;
else networkCCCapabilities().set_implicit_omit();
}

void PDU__ML3__CallProceeding_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_repeatIndicator.encode_text(text_buf);
single_value->field_bearerCapability1.encode_text(text_buf);
single_value->field_bearerCapability2.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_progressIndicator.encode_text(text_buf);
single_value->field_priorityGranted.encode_text(text_buf);
single_value->field_networkCCCapabilities.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_CC_Types.PDU_ML3_CallProceeding.");
}
}

void PDU__ML3__CallProceeding_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_repeatIndicator.decode_text(text_buf);
single_value->field_bearerCapability1.decode_text(text_buf);
single_value->field_bearerCapability2.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_progressIndicator.decode_text(text_buf);
single_value->field_priorityGranted.decode_text(text_buf);
single_value->field_networkCCCapabilities.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__CallProceeding_template[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_CC_Types.PDU_ML3_CallProceeding.");
}
}

void PDU__ML3__CallProceeding_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__CallProceeding_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_CC_Types.PDU_ML3_CallProceeding 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) repeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) priorityGranted().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) networkCCCapabilities().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(), "repeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priorityGranted")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityGranted().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkCCCapabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkCCCapabilities().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_CC_Types.PDU_ML3_CallProceeding: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CallProceeding_template* precondition = new PDU__ML3__CallProceeding_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CallProceeding_template* implied_template = new PDU__ML3__CallProceeding_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CallProceeding_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CallProceeding_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_CC_Types.PDU_ML3_CallProceeding");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
single_value->field_repeatIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
single_value->field_bearerCapability1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
single_value->field_bearerCapability2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
single_value->field_progressIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
single_value->field_priorityGranted.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
single_value->field_networkCCCapabilities.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CallProceeding");
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_CC_Types.PDU_ML3_CallProceeding");
}

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

boolean PDU__ML3__CallProceeding_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__CongestionControl::PDU__ML3__CongestionControl()
{
}

PDU__ML3__CongestionControl::PDU__ML3__CongestionControl(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const BITSTRING& par_congestionLevel,
    const BITSTRING& par_spare__4,
    const OPTIONAL< MobileL3__CommonIE__Types::ML3__Cause__TLV >& par_cause)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_congestionLevel(par_congestionLevel),
  field_spare__4(par_spare__4),
  field_cause(par_cause)
{
}

PDU__ML3__CongestionControl::PDU__ML3__CongestionControl(const PDU__ML3__CongestionControl& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_CongestionControl.");
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.congestionLevel().is_bound()) field_congestionLevel = other_value.congestionLevel();
else field_congestionLevel.clean_up();
if (other_value.spare__4().is_bound()) field_spare__4 = other_value.spare__4();
else field_spare__4.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__ML3__CongestionControl::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_congestionLevel.clean_up();
field_spare__4.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CongestionControl::get_descriptor() const { return &PDU__ML3__CongestionControl_descr_; }
PDU__ML3__CongestionControl& PDU__ML3__CongestionControl::operator=(const PDU__ML3__CongestionControl& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_CongestionControl.");
  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.congestionLevel().is_bound()) field_congestionLevel = other_value.congestionLevel();
  else field_congestionLevel.clean_up();
  if (other_value.spare__4().is_bound()) field_spare__4 = other_value.spare__4();
  else field_spare__4.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean PDU__ML3__CongestionControl::operator==(const PDU__ML3__CongestionControl& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_congestionLevel==other_value.field_congestionLevel
  && field_spare__4==other_value.field_spare__4
  && field_cause==other_value.field_cause;
}

boolean PDU__ML3__CongestionControl::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_congestionLevel.is_bound())
  || (field_spare__4.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound());
}
boolean PDU__ML3__CongestionControl::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_congestionLevel.is_value()
  && field_spare__4.is_value()
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value());
}
int PDU__ML3__CongestionControl::size_of() const
{
  int ret_val = 4;
  if (field_cause.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__CongestionControl::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(", congestionLevel := ");
field_congestionLevel.log();
TTCN_Logger::log_event_str(", spare_4 := ");
field_spare__4.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CongestionControl::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (congestionLevel().is_bound()) congestionLevel().set_implicit_omit();
if (spare__4().is_bound()) spare__4().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
}

void PDU__ML3__CongestionControl::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_CongestionControl has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) congestionLevel().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare__4().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "congestionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          congestionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare_4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().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_CC_Types.PDU_ML3_CongestionControl: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_CongestionControl");
  }
}

void PDU__ML3__CongestionControl::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_congestionLevel.encode_text(text_buf);
field_spare__4.encode_text(text_buf);
field_cause.encode_text(text_buf);
}

void PDU__ML3__CongestionControl::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_congestionLevel.decode_text(text_buf);
field_spare__4.decode_text(text_buf);
field_cause.decode_text(text_buf);
}

void PDU__ML3__CongestionControl::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__CongestionControl::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__CongestionControl::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, CongestionLevelV_descr_.raw->forceomit);
  decoded_field_length = field_congestionLevel.RAW_decode(CongestionLevelV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare__4.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_cause = 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::ML3__Cause__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5){
  field_cause=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_cause=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__CongestionControl::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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, CongestionLevelV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  if (field_cause.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = 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_congestionLevel.RAW_encode(CongestionLevelV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare__4.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  if (field_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_cause.ispresent() && (!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5)) {
  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_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__CongestionControl_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
BITSTRING_template field_congestionLevel;
BITSTRING_template field_spare__4;
MobileL3__CommonIE__Types::ML3__Cause__TLV_template field_cause;
};

void PDU__ML3__CongestionControl_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_congestionLevel = ANY_VALUE;
single_value->field_spare__4 = ANY_VALUE;
single_value->field_cause = ANY_OR_OMIT;
}
}
}

void PDU__ML3__CongestionControl_template::copy_value(const PDU__ML3__CongestionControl& 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.congestionLevel().is_bound()) {
  single_value->field_congestionLevel = other_value.congestionLevel();
} else {
  single_value->field_congestionLevel.clean_up();
}
if (other_value.spare__4().is_bound()) {
  single_value->field_spare__4 = other_value.spare__4();
} else {
  single_value->field_spare__4.clean_up();
}
if (other_value.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CongestionControl_template::copy_template(const PDU__ML3__CongestionControl_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.congestionLevel().get_selection()) {
single_value->field_congestionLevel = other_value.congestionLevel();
} else {
single_value->field_congestionLevel.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare__4().get_selection()) {
single_value->field_spare__4 = other_value.spare__4();
} else {
single_value->field_spare__4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.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__CongestionControl_template[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__CongestionControl_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CongestionControl_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_CC_Types.PDU_ML3_CongestionControl.");
break;
}
set_selection(other_value);
}

PDU__ML3__CongestionControl_template::PDU__ML3__CongestionControl_template()
{
}

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

PDU__ML3__CongestionControl_template::PDU__ML3__CongestionControl_template(const PDU__ML3__CongestionControl& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CongestionControl_template::match(const PDU__ML3__CongestionControl& 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.congestionLevel().is_bound()) return FALSE;
if(!single_value->field_congestionLevel.match(other_value.congestionLevel(), legacy))return FALSE;
if(!other_value.spare__4().is_bound()) return FALSE;
if(!single_value->field_spare__4.match(other_value.spare__4(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const MobileL3__CommonIE__Types::ML3__Cause__TLV&)other_value.cause(), legacy) : !single_value->field_cause.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_CC_Types.PDU_ML3_CongestionControl.");
}
return FALSE;
}

boolean PDU__ML3__CongestionControl_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_congestionLevel.is_bound()
 || single_value->field_spare__4.is_bound()
 || (single_value->field_cause.is_omit() || single_value->field_cause.is_bound());
}

boolean PDU__ML3__CongestionControl_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_congestionLevel.is_value()
 && single_value->field_spare__4.is_value()
 && (single_value->field_cause.is_omit() || single_value->field_cause.is_value());
}

void PDU__ML3__CongestionControl_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__CongestionControl PDU__ML3__CongestionControl_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_CC_Types.PDU_ML3_CongestionControl.");
PDU__ML3__CongestionControl 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_congestionLevel.is_bound()) {
ret_val.congestionLevel() = single_value->field_congestionLevel.valueof();
}
if (single_value->field_spare__4.is_bound()) {
ret_val.spare__4() = single_value->field_spare__4.valueof();
}
if (single_value->field_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

void PDU__ML3__CongestionControl_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_CC_Types.PDU_ML3_CongestionControl.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CongestionControl_template[list_length];
}

PDU__ML3__CongestionControl_template& PDU__ML3__CongestionControl_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_CC_Types.PDU_ML3_CongestionControl.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_CongestionControl.");
return value_list.list_value[list_index];
}

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

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

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

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

BITSTRING_template& PDU__ML3__CongestionControl_template::congestionLevel()
{
set_specific();
return single_value->field_congestionLevel;
}

const BITSTRING_template& PDU__ML3__CongestionControl_template::congestionLevel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field congestionLevel of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CongestionControl.");
return single_value->field_congestionLevel;
}

BITSTRING_template& PDU__ML3__CongestionControl_template::spare__4()
{
set_specific();
return single_value->field_spare__4;
}

const BITSTRING_template& PDU__ML3__CongestionControl_template::spare__4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare_4 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CongestionControl.");
return single_value->field_spare__4;
}

MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__CongestionControl_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__CongestionControl_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CongestionControl.");
return single_value->field_cause;
}

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

void PDU__ML3__CongestionControl_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(", congestionLevel := ");
single_value->field_congestionLevel.log();
TTCN_Logger::log_event_str(", spare_4 := ");
single_value->field_spare__4.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.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__CongestionControl_template::log_match(const PDU__ML3__CongestionControl& 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_congestionLevel.match(match_value.congestionLevel(), legacy)){
TTCN_Logger::log_logmatch_info(".congestionLevel");
single_value->field_congestionLevel.log_match(match_value.congestionLevel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare__4.match(match_value.spare__4(), legacy)){
TTCN_Logger::log_logmatch_info(".spare_4");
single_value->field_spare__4.log_match(match_value.spare__4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.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(", congestionLevel := ");
single_value->field_congestionLevel.log_match(match_value.congestionLevel(), legacy);
TTCN_Logger::log_event_str(", spare_4 := ");
single_value->field_spare__4.log_match(match_value.spare__4(), legacy);
TTCN_Logger::log_event_str(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.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__CongestionControl_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 (congestionLevel().is_bound()) congestionLevel().set_implicit_omit();
if (spare__4().is_bound()) spare__4().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
}

void PDU__ML3__CongestionControl_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_congestionLevel.encode_text(text_buf);
single_value->field_spare__4.encode_text(text_buf);
single_value->field_cause.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_CC_Types.PDU_ML3_CongestionControl.");
}
}

void PDU__ML3__CongestionControl_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_congestionLevel.decode_text(text_buf);
single_value->field_spare__4.decode_text(text_buf);
single_value->field_cause.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__CongestionControl_template[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_CC_Types.PDU_ML3_CongestionControl.");
}
}

void PDU__ML3__CongestionControl_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__CongestionControl_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_CongestionControl has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) congestionLevel().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare__4().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "congestionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          congestionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare_4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare__4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().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_CC_Types.PDU_ML3_CongestionControl: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CongestionControl_template* precondition = new PDU__ML3__CongestionControl_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CongestionControl_template* implied_template = new PDU__ML3__CongestionControl_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CongestionControl_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_CongestionControl");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CongestionControl_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_CC_Types.PDU_ML3_CongestionControl");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CongestionControl");
single_value->field_congestionLevel.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CongestionControl");
single_value->field_spare__4.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CongestionControl");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CongestionControl");
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_CC_Types.PDU_ML3_CongestionControl");
}

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

boolean PDU__ML3__CongestionControl_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__Connect__NW__MS::PDU__ML3__Connect__NW__MS()
{
}

PDU__ML3__Connect__NW__MS::PDU__ML3__Connect__NW__MS(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< ProgressIndicator__TLV >& par_progressIndicator,
    const OPTIONAL< ConnectedNumber >& par_connectedNumber,
    const OPTIONAL< ConnectedSubAddress >& par_connectedSubAddress,
    const OPTIONAL< User__user__TLV >& par_user__user)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_facility(par_facility),
  field_progressIndicator(par_progressIndicator),
  field_connectedNumber(par_connectedNumber),
  field_connectedSubAddress(par_connectedSubAddress),
  field_user__user(par_user__user)
{
}

PDU__ML3__Connect__NW__MS::PDU__ML3__Connect__NW__MS(const PDU__ML3__Connect__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
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.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
else field_progressIndicator.clean_up();
if (other_value.connectedNumber().is_bound()) field_connectedNumber = other_value.connectedNumber();
else field_connectedNumber.clean_up();
if (other_value.connectedSubAddress().is_bound()) field_connectedSubAddress = other_value.connectedSubAddress();
else field_connectedSubAddress.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
}

void PDU__ML3__Connect__NW__MS::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_facility.clean_up();
field_progressIndicator.clean_up();
field_connectedNumber.clean_up();
field_connectedSubAddress.clean_up();
field_user__user.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Connect__NW__MS::get_descriptor() const { return &PDU__ML3__Connect__NW__MS_descr_; }
PDU__ML3__Connect__NW__MS& PDU__ML3__Connect__NW__MS::operator=(const PDU__ML3__Connect__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
  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.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
  else field_progressIndicator.clean_up();
  if (other_value.connectedNumber().is_bound()) field_connectedNumber = other_value.connectedNumber();
  else field_connectedNumber.clean_up();
  if (other_value.connectedSubAddress().is_bound()) field_connectedSubAddress = other_value.connectedSubAddress();
  else field_connectedSubAddress.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
}
return *this;
}

boolean PDU__ML3__Connect__NW__MS::operator==(const PDU__ML3__Connect__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_facility==other_value.field_facility
  && field_progressIndicator==other_value.field_progressIndicator
  && field_connectedNumber==other_value.field_connectedNumber
  && field_connectedSubAddress==other_value.field_connectedSubAddress
  && field_user__user==other_value.field_user__user;
}

boolean PDU__ML3__Connect__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_bound())
  || (OPTIONAL_OMIT == field_connectedNumber.get_selection() || field_connectedNumber.is_bound())
  || (OPTIONAL_OMIT == field_connectedSubAddress.get_selection() || field_connectedSubAddress.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound());
}
boolean PDU__ML3__Connect__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_value())
  && (OPTIONAL_OMIT == field_connectedNumber.get_selection() || field_connectedNumber.is_value())
  && (OPTIONAL_OMIT == field_connectedSubAddress.get_selection() || field_connectedSubAddress.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value());
}
int PDU__ML3__Connect__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_facility.ispresent()) ret_val++;
  if (field_progressIndicator.ispresent()) ret_val++;
  if (field_connectedNumber.ispresent()) ret_val++;
  if (field_connectedSubAddress.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Connect__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
field_progressIndicator.log();
TTCN_Logger::log_event_str(", connectedNumber := ");
field_connectedNumber.log();
TTCN_Logger::log_event_str(", connectedSubAddress := ");
field_connectedSubAddress.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Connect__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!connectedNumber().is_bound()) connectedNumber() = OMIT_VALUE;
else connectedNumber().set_implicit_omit();
if (!connectedSubAddress().is_bound()) connectedSubAddress() = OMIT_VALUE;
else connectedSubAddress().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__Connect__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) connectedNumber().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) connectedSubAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "connectedNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          connectedNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "connectedSubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          connectedSubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_Connect_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
  }
}

void PDU__ML3__Connect__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_progressIndicator.encode_text(text_buf);
field_connectedNumber.encode_text(text_buf);
field_connectedSubAddress.encode_text(text_buf);
field_user__user.encode_text(text_buf);
}

void PDU__ML3__Connect__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_progressIndicator.decode_text(text_buf);
field_connectedNumber.decode_text(text_buf);
field_connectedSubAddress.decode_text(text_buf);
field_user__user.decode_text(text_buf);
}

void PDU__ML3__Connect__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  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__Connect__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  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__Connect__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::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_facility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_progressIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, ProgressIndicator__TLV_descr_.raw->forceomit);
  decoded_field_length = field_progressIndicator().RAW_decode(ProgressIndicator__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_progressIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1){
  field_progressIndicator=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_progressIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_connectedNumber = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, ConnectedNumber_descr_.raw->forceomit);
  decoded_field_length = field_connectedNumber().RAW_decode(ConnectedNumber_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_connectedNumber = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_connectedNumber.ispresent() || field_connectedNumber().elementIdentifier() !=  os_9){
  field_connectedNumber=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_connectedNumber=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_connectedSubAddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, ConnectedSubAddress_descr_.raw->forceomit);
  decoded_field_length = field_connectedSubAddress().RAW_decode(ConnectedSubAddress_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_connectedSubAddress = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_connectedSubAddress.ispresent() || field_connectedSubAddress().elementIdentifier() !=  os_10){
  field_connectedSubAddress=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_connectedSubAddress=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=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__Connect__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_facility.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_progressIndicator.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ProgressIndicator__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_connectedNumber.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ConnectedNumber_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_connectedSubAddress.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ConnectedSubAddress_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = 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_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_progressIndicator.ispresent()) {
  encoded_length += field_progressIndicator().RAW_encode(ProgressIndicator__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_connectedNumber.ispresent()) {
  encoded_length += field_connectedNumber().RAW_encode(ConnectedNumber_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_connectedSubAddress.ispresent()) {
  encoded_length += field_connectedSubAddress().RAW_encode(ConnectedSubAddress_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_progressIndicator.ispresent() && (!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.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_connectedNumber.ispresent() && (!field_connectedNumber.ispresent() || field_connectedNumber().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[]={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_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_connectedSubAddress.ispresent() && (!field_connectedSubAddress.ispresent() || field_connectedSubAddress().elementIdentifier() !=  os_10)) {
  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_10.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_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){
   os_2.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__Connect__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
ProgressIndicator__TLV_template field_progressIndicator;
ConnectedNumber_template field_connectedNumber;
ConnectedSubAddress_template field_connectedSubAddress;
User__user__TLV_template field_user__user;
};

void PDU__ML3__Connect__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_progressIndicator = ANY_OR_OMIT;
single_value->field_connectedNumber = ANY_OR_OMIT;
single_value->field_connectedSubAddress = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Connect__NW__MS_template::copy_value(const PDU__ML3__Connect__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.progressIndicator().is_bound()) {
  if (other_value.progressIndicator().ispresent()) single_value->field_progressIndicator = other_value.progressIndicator()();
  else single_value->field_progressIndicator = OMIT_VALUE;
} else {
  single_value->field_progressIndicator.clean_up();
}
if (other_value.connectedNumber().is_bound()) {
  if (other_value.connectedNumber().ispresent()) single_value->field_connectedNumber = other_value.connectedNumber()();
  else single_value->field_connectedNumber = OMIT_VALUE;
} else {
  single_value->field_connectedNumber.clean_up();
}
if (other_value.connectedSubAddress().is_bound()) {
  if (other_value.connectedSubAddress().ispresent()) single_value->field_connectedSubAddress = other_value.connectedSubAddress()();
  else single_value->field_connectedSubAddress = OMIT_VALUE;
} else {
  single_value->field_connectedSubAddress.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Connect__NW__MS_template::copy_template(const PDU__ML3__Connect__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.progressIndicator().get_selection()) {
single_value->field_progressIndicator = other_value.progressIndicator();
} else {
single_value->field_progressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.connectedNumber().get_selection()) {
single_value->field_connectedNumber = other_value.connectedNumber();
} else {
single_value->field_connectedNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.connectedSubAddress().get_selection()) {
single_value->field_connectedSubAddress = other_value.connectedSubAddress();
} else {
single_value->field_connectedSubAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.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__Connect__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__Connect__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Connect__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__ML3__Connect__NW__MS_template::PDU__ML3__Connect__NW__MS_template()
{
}

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

PDU__ML3__Connect__NW__MS_template::PDU__ML3__Connect__NW__MS_template(const PDU__ML3__Connect__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Connect__NW__MS_template::match(const PDU__ML3__Connect__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.progressIndicator().is_bound()) return FALSE;
if((other_value.progressIndicator().ispresent() ? !single_value->field_progressIndicator.match((const ProgressIndicator__TLV&)other_value.progressIndicator(), legacy) : !single_value->field_progressIndicator.match_omit(legacy)))return FALSE;
if(!other_value.connectedNumber().is_bound()) return FALSE;
if((other_value.connectedNumber().ispresent() ? !single_value->field_connectedNumber.match((const ConnectedNumber&)other_value.connectedNumber(), legacy) : !single_value->field_connectedNumber.match_omit(legacy)))return FALSE;
if(!other_value.connectedSubAddress().is_bound()) return FALSE;
if((other_value.connectedSubAddress().ispresent() ? !single_value->field_connectedSubAddress.match((const ConnectedSubAddress&)other_value.connectedSubAddress(), legacy) : !single_value->field_connectedSubAddress.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.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_CC_Types.PDU_ML3_Connect_NW_MS.");
}
return FALSE;
}

boolean PDU__ML3__Connect__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_bound())
 || (single_value->field_connectedNumber.is_omit() || single_value->field_connectedNumber.is_bound())
 || (single_value->field_connectedSubAddress.is_omit() || single_value->field_connectedSubAddress.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound());
}

boolean PDU__ML3__Connect__NW__MS_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_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_value())
 && (single_value->field_connectedNumber.is_omit() || single_value->field_connectedNumber.is_value())
 && (single_value->field_connectedSubAddress.is_omit() || single_value->field_connectedSubAddress.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value());
}

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

PDU__ML3__Connect__NW__MS PDU__ML3__Connect__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
PDU__ML3__Connect__NW__MS 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_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_progressIndicator.is_omit()) ret_val.progressIndicator() = OMIT_VALUE;
else if (single_value->field_progressIndicator.is_bound()) {
ret_val.progressIndicator() = single_value->field_progressIndicator.valueof();
}
if (single_value->field_connectedNumber.is_omit()) ret_val.connectedNumber() = OMIT_VALUE;
else if (single_value->field_connectedNumber.is_bound()) {
ret_val.connectedNumber() = single_value->field_connectedNumber.valueof();
}
if (single_value->field_connectedSubAddress.is_omit()) ret_val.connectedSubAddress() = OMIT_VALUE;
else if (single_value->field_connectedSubAddress.is_bound()) {
ret_val.connectedSubAddress() = single_value->field_connectedSubAddress.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
return ret_val;
}

void PDU__ML3__Connect__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Connect__NW__MS_template[list_length];
}

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

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

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

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

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

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Connect__NW__MS_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Connect__NW__MS_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
return single_value->field_facility;
}

ProgressIndicator__TLV_template& PDU__ML3__Connect__NW__MS_template::progressIndicator()
{
set_specific();
return single_value->field_progressIndicator;
}

const ProgressIndicator__TLV_template& PDU__ML3__Connect__NW__MS_template::progressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field progressIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
return single_value->field_progressIndicator;
}

ConnectedNumber_template& PDU__ML3__Connect__NW__MS_template::connectedNumber()
{
set_specific();
return single_value->field_connectedNumber;
}

const ConnectedNumber_template& PDU__ML3__Connect__NW__MS_template::connectedNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field connectedNumber of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
return single_value->field_connectedNumber;
}

ConnectedSubAddress_template& PDU__ML3__Connect__NW__MS_template::connectedSubAddress()
{
set_specific();
return single_value->field_connectedSubAddress;
}

const ConnectedSubAddress_template& PDU__ML3__Connect__NW__MS_template::connectedSubAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field connectedSubAddress of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
return single_value->field_connectedSubAddress;
}

User__user__TLV_template& PDU__ML3__Connect__NW__MS_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__Connect__NW__MS_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
return single_value->field_user__user;
}

int PDU__ML3__Connect__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_facility.is_present()) ret_val++;
      if (single_value->field_progressIndicator.is_present()) ret_val++;
      if (single_value->field_connectedNumber.is_present()) ret_val++;
      if (single_value->field_connectedSubAddress.is_present()) ret_val++;
      if (single_value->field_user__user.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_CC_Types.PDU_ML3_Connect_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
  }
  return 0;
}

void PDU__ML3__Connect__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(", connectedNumber := ");
single_value->field_connectedNumber.log();
TTCN_Logger::log_event_str(", connectedSubAddress := ");
single_value->field_connectedSubAddress.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.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__Connect__NW__MS_template::log_match(const PDU__ML3__Connect__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.progressIndicator().ispresent()){
if(!single_value->field_progressIndicator.match(match_value.progressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".progressIndicator");
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_progressIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".progressIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.connectedNumber().ispresent()){
if(!single_value->field_connectedNumber.match(match_value.connectedNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".connectedNumber");
single_value->field_connectedNumber.log_match(match_value.connectedNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_connectedNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".connectedNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_connectedNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.connectedSubAddress().ispresent()){
if(!single_value->field_connectedSubAddress.match(match_value.connectedSubAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".connectedSubAddress");
single_value->field_connectedSubAddress.log_match(match_value.connectedSubAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_connectedSubAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".connectedSubAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_connectedSubAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.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(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", progressIndicator := ");
if (match_value.progressIndicator().ispresent()) {
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_progressIndicator.log();
if (single_value->field_progressIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", connectedNumber := ");
if (match_value.connectedNumber().ispresent()) {
single_value->field_connectedNumber.log_match(match_value.connectedNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_connectedNumber.log();
if (single_value->field_connectedNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", connectedSubAddress := ");
if (match_value.connectedSubAddress().ispresent()) {
single_value->field_connectedSubAddress.log_match(match_value.connectedSubAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_connectedSubAddress.log();
if (single_value->field_connectedSubAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.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__Connect__NW__MS_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 (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!connectedNumber().is_bound()) connectedNumber() = OMIT_VALUE;
else connectedNumber().set_implicit_omit();
if (!connectedSubAddress().is_bound()) connectedSubAddress() = OMIT_VALUE;
else connectedSubAddress().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__Connect__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_progressIndicator.encode_text(text_buf);
single_value->field_connectedNumber.encode_text(text_buf);
single_value->field_connectedSubAddress.encode_text(text_buf);
single_value->field_user__user.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_CC_Types.PDU_ML3_Connect_NW_MS.");
}
}

void PDU__ML3__Connect__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_progressIndicator.decode_text(text_buf);
single_value->field_connectedNumber.decode_text(text_buf);
single_value->field_connectedSubAddress.decode_text(text_buf);
single_value->field_user__user.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__Connect__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS.");
}
}

void PDU__ML3__Connect__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__Connect__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Connect_NW_MS has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) connectedNumber().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) connectedSubAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "connectedNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          connectedNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "connectedSubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          connectedSubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_Connect_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Connect__NW__MS_template* precondition = new PDU__ML3__Connect__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Connect__NW__MS_template* implied_template = new PDU__ML3__Connect__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Connect__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Connect__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
single_value->field_progressIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
single_value->field_connectedNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
single_value->field_connectedSubAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_NW_MS");
}

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

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

PDU__ML3__Connect__MS__NW::PDU__ML3__Connect__MS__NW()
{
}

PDU__ML3__Connect__MS__NW::PDU__ML3__Connect__MS__NW(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< ConnectedSubAddress >& par_connectedSubAddress,
    const OPTIONAL< User__user__TLV >& par_user__user,
    const OPTIONAL< MobileL3__CommonIE__Types::SS__VersionIndicator >& par_ss__VersionIndicator,
    const OPTIONAL< StreamIdentifier >& par_streamIdentifier)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_facility(par_facility),
  field_connectedSubAddress(par_connectedSubAddress),
  field_user__user(par_user__user),
  field_ss__VersionIndicator(par_ss__VersionIndicator),
  field_streamIdentifier(par_streamIdentifier)
{
}

PDU__ML3__Connect__MS__NW::PDU__ML3__Connect__MS__NW(const PDU__ML3__Connect__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW.");
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.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.connectedSubAddress().is_bound()) field_connectedSubAddress = other_value.connectedSubAddress();
else field_connectedSubAddress.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
else field_ss__VersionIndicator.clean_up();
if (other_value.streamIdentifier().is_bound()) field_streamIdentifier = other_value.streamIdentifier();
else field_streamIdentifier.clean_up();
}

void PDU__ML3__Connect__MS__NW::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_facility.clean_up();
field_connectedSubAddress.clean_up();
field_user__user.clean_up();
field_ss__VersionIndicator.clean_up();
field_streamIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Connect__MS__NW::get_descriptor() const { return &PDU__ML3__Connect__MS__NW_descr_; }
PDU__ML3__Connect__MS__NW& PDU__ML3__Connect__MS__NW::operator=(const PDU__ML3__Connect__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW.");
  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.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.connectedSubAddress().is_bound()) field_connectedSubAddress = other_value.connectedSubAddress();
  else field_connectedSubAddress.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
  if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
  else field_ss__VersionIndicator.clean_up();
  if (other_value.streamIdentifier().is_bound()) field_streamIdentifier = other_value.streamIdentifier();
  else field_streamIdentifier.clean_up();
}
return *this;
}

boolean PDU__ML3__Connect__MS__NW::operator==(const PDU__ML3__Connect__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_facility==other_value.field_facility
  && field_connectedSubAddress==other_value.field_connectedSubAddress
  && field_user__user==other_value.field_user__user
  && field_ss__VersionIndicator==other_value.field_ss__VersionIndicator
  && field_streamIdentifier==other_value.field_streamIdentifier;
}

boolean PDU__ML3__Connect__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_connectedSubAddress.get_selection() || field_connectedSubAddress.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound())
  || (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_bound())
  || (OPTIONAL_OMIT == field_streamIdentifier.get_selection() || field_streamIdentifier.is_bound());
}
boolean PDU__ML3__Connect__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_connectedSubAddress.get_selection() || field_connectedSubAddress.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value())
  && (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_value())
  && (OPTIONAL_OMIT == field_streamIdentifier.get_selection() || field_streamIdentifier.is_value());
}
int PDU__ML3__Connect__MS__NW::size_of() const
{
  int ret_val = 2;
  if (field_facility.ispresent()) ret_val++;
  if (field_connectedSubAddress.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  if (field_ss__VersionIndicator.ispresent()) ret_val++;
  if (field_streamIdentifier.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Connect__MS__NW::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(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", connectedSubAddress := ");
field_connectedSubAddress.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(", streamIdentifier := ");
field_streamIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Connect__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!connectedSubAddress().is_bound()) connectedSubAddress() = OMIT_VALUE;
else connectedSubAddress().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
if (!streamIdentifier().is_bound()) streamIdentifier() = OMIT_VALUE;
else streamIdentifier().set_implicit_omit();
}

void PDU__ML3__Connect__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) connectedSubAddress().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) streamIdentifier().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "connectedSubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          connectedSubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifier().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_CC_Types.PDU_ML3_Connect_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Connect_MS_NW");
  }
}

void PDU__ML3__Connect__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_connectedSubAddress.encode_text(text_buf);
field_user__user.encode_text(text_buf);
field_ss__VersionIndicator.encode_text(text_buf);
field_streamIdentifier.encode_text(text_buf);
}

void PDU__ML3__Connect__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_connectedSubAddress.decode_text(text_buf);
field_user__user.decode_text(text_buf);
field_ss__VersionIndicator.decode_text(text_buf);
field_streamIdentifier.decode_text(text_buf);
}

void PDU__ML3__Connect__MS__NW::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__Connect__MS__NW::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__Connect__MS__NW::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_facility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_connectedSubAddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, ConnectedSubAddress_descr_.raw->forceomit);
  decoded_field_length = field_connectedSubAddress().RAW_decode(ConnectedSubAddress_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_connectedSubAddress = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_connectedSubAddress.ispresent() || field_connectedSubAddress().elementIdentifier() !=  os_10){
  field_connectedSubAddress=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_connectedSubAddress=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_ss__VersionIndicator = 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::SS__VersionIndicator_descr_.raw->forceomit);
  decoded_field_length = field_ss__VersionIndicator().RAW_decode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_ss__VersionIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().elementIdentifier() !=  os_3){
  field_ss__VersionIndicator=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_ss__VersionIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_streamIdentifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, StreamIdentifier_descr_.raw->forceomit);
  decoded_field_length = field_streamIdentifier().RAW_decode(StreamIdentifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_streamIdentifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_streamIdentifier.ispresent() || field_streamIdentifier().elementIdentifier() !=  os_7){
  field_streamIdentifier=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_streamIdentifier=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__Connect__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_facility.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_connectedSubAddress.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ConnectedSubAddress_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_ss__VersionIndicator.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::SS__VersionIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_streamIdentifier.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, StreamIdentifier_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = 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_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_connectedSubAddress.ispresent()) {
  encoded_length += field_connectedSubAddress().RAW_encode(ConnectedSubAddress_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_ss__VersionIndicator.ispresent()) {
  encoded_length += field_ss__VersionIndicator().RAW_encode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_streamIdentifier.ispresent()) {
  encoded_length += field_streamIdentifier().RAW_encode(StreamIdentifier_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_connectedSubAddress.ispresent() && (!field_connectedSubAddress.ispresent() || field_connectedSubAddress().elementIdentifier() !=  os_10)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_10.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  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_2.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_ss__VersionIndicator.ispresent() && (!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().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[]={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_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);
  }
  }
  if (field_streamIdentifier.ispresent() && (!field_streamIdentifier.ispresent() || field_streamIdentifier().elementIdentifier() !=  os_7)) {
  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){
   os_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__Connect__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
ConnectedSubAddress_template field_connectedSubAddress;
User__user__TLV_template field_user__user;
MobileL3__CommonIE__Types::SS__VersionIndicator_template field_ss__VersionIndicator;
StreamIdentifier_template field_streamIdentifier;
};

void PDU__ML3__Connect__MS__NW_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_facility = ANY_OR_OMIT;
single_value->field_connectedSubAddress = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
single_value->field_ss__VersionIndicator = ANY_OR_OMIT;
single_value->field_streamIdentifier = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Connect__MS__NW_template::copy_value(const PDU__ML3__Connect__MS__NW& 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.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.connectedSubAddress().is_bound()) {
  if (other_value.connectedSubAddress().ispresent()) single_value->field_connectedSubAddress = other_value.connectedSubAddress()();
  else single_value->field_connectedSubAddress = OMIT_VALUE;
} else {
  single_value->field_connectedSubAddress.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
if (other_value.ss__VersionIndicator().is_bound()) {
  if (other_value.ss__VersionIndicator().ispresent()) single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator()();
  else single_value->field_ss__VersionIndicator = OMIT_VALUE;
} else {
  single_value->field_ss__VersionIndicator.clean_up();
}
if (other_value.streamIdentifier().is_bound()) {
  if (other_value.streamIdentifier().ispresent()) single_value->field_streamIdentifier = other_value.streamIdentifier()();
  else single_value->field_streamIdentifier = OMIT_VALUE;
} else {
  single_value->field_streamIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Connect__MS__NW_template::copy_template(const PDU__ML3__Connect__MS__NW_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.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.connectedSubAddress().get_selection()) {
single_value->field_connectedSubAddress = other_value.connectedSubAddress();
} else {
single_value->field_connectedSubAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ss__VersionIndicator().get_selection()) {
single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator();
} else {
single_value->field_ss__VersionIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.streamIdentifier().get_selection()) {
single_value->field_streamIdentifier = other_value.streamIdentifier();
} else {
single_value->field_streamIdentifier.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__Connect__MS__NW_template[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__Connect__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Connect__MS__NW_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_CC_Types.PDU_ML3_Connect_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__ML3__Connect__MS__NW_template::PDU__ML3__Connect__MS__NW_template()
{
}

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

PDU__ML3__Connect__MS__NW_template::PDU__ML3__Connect__MS__NW_template(const PDU__ML3__Connect__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Connect__MS__NW_template::match(const PDU__ML3__Connect__MS__NW& 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.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.connectedSubAddress().is_bound()) return FALSE;
if((other_value.connectedSubAddress().ispresent() ? !single_value->field_connectedSubAddress.match((const ConnectedSubAddress&)other_value.connectedSubAddress(), legacy) : !single_value->field_connectedSubAddress.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.match_omit(legacy)))return FALSE;
if(!other_value.ss__VersionIndicator().is_bound()) return FALSE;
if((other_value.ss__VersionIndicator().ispresent() ? !single_value->field_ss__VersionIndicator.match((const MobileL3__CommonIE__Types::SS__VersionIndicator&)other_value.ss__VersionIndicator(), legacy) : !single_value->field_ss__VersionIndicator.match_omit(legacy)))return FALSE;
if(!other_value.streamIdentifier().is_bound()) return FALSE;
if((other_value.streamIdentifier().ispresent() ? !single_value->field_streamIdentifier.match((const StreamIdentifier&)other_value.streamIdentifier(), legacy) : !single_value->field_streamIdentifier.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_CC_Types.PDU_ML3_Connect_MS_NW.");
}
return FALSE;
}

boolean PDU__ML3__Connect__MS__NW_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_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_connectedSubAddress.is_omit() || single_value->field_connectedSubAddress.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound())
 || (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_bound())
 || (single_value->field_streamIdentifier.is_omit() || single_value->field_streamIdentifier.is_bound());
}

boolean PDU__ML3__Connect__MS__NW_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_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_connectedSubAddress.is_omit() || single_value->field_connectedSubAddress.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value())
 && (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_value())
 && (single_value->field_streamIdentifier.is_omit() || single_value->field_streamIdentifier.is_value());
}

void PDU__ML3__Connect__MS__NW_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__Connect__MS__NW PDU__ML3__Connect__MS__NW_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_CC_Types.PDU_ML3_Connect_MS_NW.");
PDU__ML3__Connect__MS__NW 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_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_connectedSubAddress.is_omit()) ret_val.connectedSubAddress() = OMIT_VALUE;
else if (single_value->field_connectedSubAddress.is_bound()) {
ret_val.connectedSubAddress() = single_value->field_connectedSubAddress.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
if (single_value->field_ss__VersionIndicator.is_omit()) ret_val.ss__VersionIndicator() = OMIT_VALUE;
else if (single_value->field_ss__VersionIndicator.is_bound()) {
ret_val.ss__VersionIndicator() = single_value->field_ss__VersionIndicator.valueof();
}
if (single_value->field_streamIdentifier.is_omit()) ret_val.streamIdentifier() = OMIT_VALUE;
else if (single_value->field_streamIdentifier.is_bound()) {
ret_val.streamIdentifier() = single_value->field_streamIdentifier.valueof();
}
return ret_val;
}

void PDU__ML3__Connect__MS__NW_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_CC_Types.PDU_ML3_Connect_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Connect__MS__NW_template[list_length];
}

PDU__ML3__Connect__MS__NW_template& PDU__ML3__Connect__MS__NW_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_CC_Types.PDU_ML3_Connect_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW.");
return value_list.list_value[list_index];
}

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

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

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

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

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Connect__MS__NW_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Connect__MS__NW_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW.");
return single_value->field_facility;
}

ConnectedSubAddress_template& PDU__ML3__Connect__MS__NW_template::connectedSubAddress()
{
set_specific();
return single_value->field_connectedSubAddress;
}

const ConnectedSubAddress_template& PDU__ML3__Connect__MS__NW_template::connectedSubAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field connectedSubAddress of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW.");
return single_value->field_connectedSubAddress;
}

User__user__TLV_template& PDU__ML3__Connect__MS__NW_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__Connect__MS__NW_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW.");
return single_value->field_user__user;
}

MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Connect__MS__NW_template::ss__VersionIndicator()
{
set_specific();
return single_value->field_ss__VersionIndicator;
}

const MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Connect__MS__NW_template::ss__VersionIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ss_VersionIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW.");
return single_value->field_ss__VersionIndicator;
}

StreamIdentifier_template& PDU__ML3__Connect__MS__NW_template::streamIdentifier()
{
set_specific();
return single_value->field_streamIdentifier;
}

const StreamIdentifier_template& PDU__ML3__Connect__MS__NW_template::streamIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field streamIdentifier of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW.");
return single_value->field_streamIdentifier;
}

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

void PDU__ML3__Connect__MS__NW_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(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", connectedSubAddress := ");
single_value->field_connectedSubAddress.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
single_value->field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(", streamIdentifier := ");
single_value->field_streamIdentifier.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__Connect__MS__NW_template::log_match(const PDU__ML3__Connect__MS__NW& 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.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.connectedSubAddress().ispresent()){
if(!single_value->field_connectedSubAddress.match(match_value.connectedSubAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".connectedSubAddress");
single_value->field_connectedSubAddress.log_match(match_value.connectedSubAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_connectedSubAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".connectedSubAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_connectedSubAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ss__VersionIndicator().ispresent()){
if(!single_value->field_ss__VersionIndicator.match(match_value.ss__VersionIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ss_VersionIndicator");
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ss__VersionIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ss_VersionIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.streamIdentifier().ispresent()){
if(!single_value->field_streamIdentifier.match(match_value.streamIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".streamIdentifier");
single_value->field_streamIdentifier.log_match(match_value.streamIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_streamIdentifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".streamIdentifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_streamIdentifier.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(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", connectedSubAddress := ");
if (match_value.connectedSubAddress().ispresent()) {
single_value->field_connectedSubAddress.log_match(match_value.connectedSubAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_connectedSubAddress.log();
if (single_value->field_connectedSubAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
if (match_value.ss__VersionIndicator().ispresent()) {
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ss__VersionIndicator.log();
if (single_value->field_ss__VersionIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", streamIdentifier := ");
if (match_value.streamIdentifier().ispresent()) {
single_value->field_streamIdentifier.log_match(match_value.streamIdentifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_streamIdentifier.log();
if (single_value->field_streamIdentifier.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__Connect__MS__NW_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 (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!connectedSubAddress().is_bound()) connectedSubAddress() = OMIT_VALUE;
else connectedSubAddress().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
if (!streamIdentifier().is_bound()) streamIdentifier() = OMIT_VALUE;
else streamIdentifier().set_implicit_omit();
}

void PDU__ML3__Connect__MS__NW_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_facility.encode_text(text_buf);
single_value->field_connectedSubAddress.encode_text(text_buf);
single_value->field_user__user.encode_text(text_buf);
single_value->field_ss__VersionIndicator.encode_text(text_buf);
single_value->field_streamIdentifier.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_CC_Types.PDU_ML3_Connect_MS_NW.");
}
}

void PDU__ML3__Connect__MS__NW_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_facility.decode_text(text_buf);
single_value->field_connectedSubAddress.decode_text(text_buf);
single_value->field_user__user.decode_text(text_buf);
single_value->field_ss__VersionIndicator.decode_text(text_buf);
single_value->field_streamIdentifier.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__Connect__MS__NW_template[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_CC_Types.PDU_ML3_Connect_MS_NW.");
}
}

void PDU__ML3__Connect__MS__NW_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__Connect__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Connect_MS_NW has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) connectedSubAddress().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) streamIdentifier().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "connectedSubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          connectedSubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifier().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_CC_Types.PDU_ML3_Connect_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Connect__MS__NW_template* precondition = new PDU__ML3__Connect__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Connect__MS__NW_template* implied_template = new PDU__ML3__Connect__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Connect__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Connect_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Connect__MS__NW_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_CC_Types.PDU_ML3_Connect_MS_NW");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_MS_NW");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_MS_NW");
single_value->field_connectedSubAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_MS_NW");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_MS_NW");
single_value->field_ss__VersionIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_MS_NW");
single_value->field_streamIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Connect_MS_NW");
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_CC_Types.PDU_ML3_Connect_MS_NW");
}

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

boolean PDU__ML3__Connect__MS__NW_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__ConnectAck::PDU__ML3__ConnectAck()
{
}

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

PDU__ML3__ConnectAck::PDU__ML3__ConnectAck(const PDU__ML3__ConnectAck& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_ConnectAck.");
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__ConnectAck::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__ConnectAck::get_descriptor() const { return &PDU__ML3__ConnectAck_descr_; }
PDU__ML3__ConnectAck& PDU__ML3__ConnectAck::operator=(const PDU__ML3__ConnectAck& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_ConnectAck.");
  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__ConnectAck::operator==(const PDU__ML3__ConnectAck& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__ConnectAck::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__ConnectAck::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__ConnectAck::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__ConnectAck::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

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

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

void PDU__ML3__ConnectAck::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__ConnectAck::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__ConnectAck::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__ConnectAck::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__ConnectAck_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__ConnectAck_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__ConnectAck_template::copy_value(const PDU__ML3__ConnectAck& 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__ConnectAck_template::copy_template(const PDU__ML3__ConnectAck_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__ConnectAck_template[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__ConnectAck_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__ConnectAck_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_CC_Types.PDU_ML3_ConnectAck.");
break;
}
set_selection(other_value);
}

PDU__ML3__ConnectAck_template::PDU__ML3__ConnectAck_template()
{
}

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

PDU__ML3__ConnectAck_template::PDU__ML3__ConnectAck_template(const PDU__ML3__ConnectAck& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__ConnectAck_template::match(const PDU__ML3__ConnectAck& 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_CC_Types.PDU_ML3_ConnectAck.");
}
return FALSE;
}

boolean PDU__ML3__ConnectAck_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__ConnectAck_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__ConnectAck_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__ConnectAck PDU__ML3__ConnectAck_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_CC_Types.PDU_ML3_ConnectAck.");
PDU__ML3__ConnectAck 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__ConnectAck_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_CC_Types.PDU_ML3_ConnectAck.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__ConnectAck_template[list_length];
}

PDU__ML3__ConnectAck_template& PDU__ML3__ConnectAck_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_CC_Types.PDU_ML3_ConnectAck.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_ConnectAck.");
return value_list.list_value[list_index];
}

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

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

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

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

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

void PDU__ML3__ConnectAck_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__ConnectAck_template::log_match(const PDU__ML3__ConnectAck& 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__ConnectAck_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__ConnectAck_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_CC_Types.PDU_ML3_ConnectAck.");
}
}

void PDU__ML3__ConnectAck_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__ConnectAck_template[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_CC_Types.PDU_ML3_ConnectAck.");
}
}

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

void PDU__ML3__ConnectAck_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_CC_Types.PDU_ML3_ConnectAck");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ConnectAck");
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_CC_Types.PDU_ML3_ConnectAck");
}

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

boolean PDU__ML3__ConnectAck_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__Disconnect__NW__MS::PDU__ML3__Disconnect__NW__MS()
{
}

PDU__ML3__Disconnect__NW__MS::PDU__ML3__Disconnect__NW__MS(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::ML3__Cause__LV& par_cause,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< ProgressIndicator__TLV >& par_progressIndicator,
    const OPTIONAL< User__user__TLV >& par_user__user,
    const OPTIONAL< AllowedActions >& par_allowedActions)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cause(par_cause),
  field_facility(par_facility),
  field_progressIndicator(par_progressIndicator),
  field_user__user(par_user__user),
  field_allowedActions(par_allowedActions)
{
}

PDU__ML3__Disconnect__NW__MS::PDU__ML3__Disconnect__NW__MS(const PDU__ML3__Disconnect__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
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.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
else field_progressIndicator.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
if (other_value.allowedActions().is_bound()) field_allowedActions = other_value.allowedActions();
else field_allowedActions.clean_up();
}

void PDU__ML3__Disconnect__NW__MS::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cause.clean_up();
field_facility.clean_up();
field_progressIndicator.clean_up();
field_user__user.clean_up();
field_allowedActions.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Disconnect__NW__MS::get_descriptor() const { return &PDU__ML3__Disconnect__NW__MS_descr_; }
PDU__ML3__Disconnect__NW__MS& PDU__ML3__Disconnect__NW__MS::operator=(const PDU__ML3__Disconnect__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
  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.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
  else field_progressIndicator.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
  if (other_value.allowedActions().is_bound()) field_allowedActions = other_value.allowedActions();
  else field_allowedActions.clean_up();
}
return *this;
}

boolean PDU__ML3__Disconnect__NW__MS::operator==(const PDU__ML3__Disconnect__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cause==other_value.field_cause
  && field_facility==other_value.field_facility
  && field_progressIndicator==other_value.field_progressIndicator
  && field_user__user==other_value.field_user__user
  && field_allowedActions==other_value.field_allowedActions;
}

boolean PDU__ML3__Disconnect__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_cause.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound())
  || (OPTIONAL_OMIT == field_allowedActions.get_selection() || field_allowedActions.is_bound());
}
boolean PDU__ML3__Disconnect__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_cause.is_value()
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value())
  && (OPTIONAL_OMIT == field_allowedActions.get_selection() || field_allowedActions.is_value());
}
int PDU__ML3__Disconnect__NW__MS::size_of() const
{
  int ret_val = 3;
  if (field_facility.ispresent()) ret_val++;
  if (field_progressIndicator.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  if (field_allowedActions.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Disconnect__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
field_progressIndicator.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(", allowedActions := ");
field_allowedActions.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Disconnect__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!allowedActions().is_bound()) allowedActions() = OMIT_VALUE;
else allowedActions().set_implicit_omit();
}

void PDU__ML3__Disconnect__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) allowedActions().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allowedActions")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allowedActions().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_CC_Types.PDU_ML3_Disconnect_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
  }
}

void PDU__ML3__Disconnect__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_progressIndicator.encode_text(text_buf);
field_user__user.encode_text(text_buf);
field_allowedActions.encode_text(text_buf);
}

void PDU__ML3__Disconnect__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_progressIndicator.decode_text(text_buf);
field_user__user.decode_text(text_buf);
field_allowedActions.decode_text(text_buf);
}

void PDU__ML3__Disconnect__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  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__Disconnect__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  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__Disconnect__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::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::ML3__Cause__LV_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__LV_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_facility = 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::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_progressIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, ProgressIndicator__TLV_descr_.raw->forceomit);
  decoded_field_length = field_progressIndicator().RAW_decode(ProgressIndicator__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_progressIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1){
  field_progressIndicator=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_progressIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_allowedActions = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, AllowedActions_descr_.raw->forceomit);
  decoded_field_length = field_allowedActions().RAW_decode(AllowedActions_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_allowedActions = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_allowedActions.ispresent() || field_allowedActions().elementIdentifier() !=  os_11){
  field_allowedActions=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_allowedActions=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__Disconnect__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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::ML3__Cause__LV_descr_.raw);
  if (field_facility.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_progressIndicator.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ProgressIndicator__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_allowedActions.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AllowedActions_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = 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_cause.RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__LV_descr_, *myleaf.body.node.nodes[2]);
  if (field_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_progressIndicator.ispresent()) {
  encoded_length += field_progressIndicator().RAW_encode(ProgressIndicator__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_allowedActions.ispresent()) {
  encoded_length += field_allowedActions().RAW_encode(AllowedActions_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_progressIndicator.ispresent() && (!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1)) {
  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_1.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_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  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_2.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_allowedActions.ispresent() && (!field_allowedActions.ispresent() || field_allowedActions().elementIdentifier() !=  os_11)) {
  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){
   os_11.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__Disconnect__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::ML3__Cause__LV_template field_cause;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
ProgressIndicator__TLV_template field_progressIndicator;
User__user__TLV_template field_user__user;
AllowedActions_template field_allowedActions;
};

void PDU__ML3__Disconnect__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_progressIndicator = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
single_value->field_allowedActions = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Disconnect__NW__MS_template::copy_value(const PDU__ML3__Disconnect__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.progressIndicator().is_bound()) {
  if (other_value.progressIndicator().ispresent()) single_value->field_progressIndicator = other_value.progressIndicator()();
  else single_value->field_progressIndicator = OMIT_VALUE;
} else {
  single_value->field_progressIndicator.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
if (other_value.allowedActions().is_bound()) {
  if (other_value.allowedActions().ispresent()) single_value->field_allowedActions = other_value.allowedActions()();
  else single_value->field_allowedActions = OMIT_VALUE;
} else {
  single_value->field_allowedActions.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Disconnect__NW__MS_template::copy_template(const PDU__ML3__Disconnect__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.progressIndicator().get_selection()) {
single_value->field_progressIndicator = other_value.progressIndicator();
} else {
single_value->field_progressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.allowedActions().get_selection()) {
single_value->field_allowedActions = other_value.allowedActions();
} else {
single_value->field_allowedActions.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__Disconnect__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__Disconnect__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Disconnect__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__ML3__Disconnect__NW__MS_template::PDU__ML3__Disconnect__NW__MS_template()
{
}

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

PDU__ML3__Disconnect__NW__MS_template::PDU__ML3__Disconnect__NW__MS_template(const PDU__ML3__Disconnect__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Disconnect__NW__MS_template::match(const PDU__ML3__Disconnect__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.progressIndicator().is_bound()) return FALSE;
if((other_value.progressIndicator().ispresent() ? !single_value->field_progressIndicator.match((const ProgressIndicator__TLV&)other_value.progressIndicator(), legacy) : !single_value->field_progressIndicator.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.match_omit(legacy)))return FALSE;
if(!other_value.allowedActions().is_bound()) return FALSE;
if((other_value.allowedActions().ispresent() ? !single_value->field_allowedActions.match((const AllowedActions&)other_value.allowedActions(), legacy) : !single_value->field_allowedActions.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_CC_Types.PDU_ML3_Disconnect_NW_MS.");
}
return FALSE;
}

boolean PDU__ML3__Disconnect__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || single_value->field_cause.is_bound()
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound())
 || (single_value->field_allowedActions.is_omit() || single_value->field_allowedActions.is_bound());
}

boolean PDU__ML3__Disconnect__NW__MS_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_cause.is_value()
 && (single_value->field_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value())
 && (single_value->field_allowedActions.is_omit() || single_value->field_allowedActions.is_value());
}

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

PDU__ML3__Disconnect__NW__MS PDU__ML3__Disconnect__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
PDU__ML3__Disconnect__NW__MS 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_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_progressIndicator.is_omit()) ret_val.progressIndicator() = OMIT_VALUE;
else if (single_value->field_progressIndicator.is_bound()) {
ret_val.progressIndicator() = single_value->field_progressIndicator.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
if (single_value->field_allowedActions.is_omit()) ret_val.allowedActions() = OMIT_VALUE;
else if (single_value->field_allowedActions.is_bound()) {
ret_val.allowedActions() = single_value->field_allowedActions.valueof();
}
return ret_val;
}

void PDU__ML3__Disconnect__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Disconnect__NW__MS_template[list_length];
}

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

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

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

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

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

MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__Disconnect__NW__MS_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__Disconnect__NW__MS_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
return single_value->field_cause;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Disconnect__NW__MS_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Disconnect__NW__MS_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
return single_value->field_facility;
}

ProgressIndicator__TLV_template& PDU__ML3__Disconnect__NW__MS_template::progressIndicator()
{
set_specific();
return single_value->field_progressIndicator;
}

const ProgressIndicator__TLV_template& PDU__ML3__Disconnect__NW__MS_template::progressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field progressIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
return single_value->field_progressIndicator;
}

User__user__TLV_template& PDU__ML3__Disconnect__NW__MS_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__Disconnect__NW__MS_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
return single_value->field_user__user;
}

AllowedActions_template& PDU__ML3__Disconnect__NW__MS_template::allowedActions()
{
set_specific();
return single_value->field_allowedActions;
}

const AllowedActions_template& PDU__ML3__Disconnect__NW__MS_template::allowedActions() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field allowedActions of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
return single_value->field_allowedActions;
}

int PDU__ML3__Disconnect__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_facility.is_present()) ret_val++;
      if (single_value->field_progressIndicator.is_present()) ret_val++;
      if (single_value->field_user__user.is_present()) ret_val++;
      if (single_value->field_allowedActions.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_CC_Types.PDU_ML3_Disconnect_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
  }
  return 0;
}

void PDU__ML3__Disconnect__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.log();
TTCN_Logger::log_event_str(", allowedActions := ");
single_value->field_allowedActions.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__Disconnect__NW__MS_template::log_match(const PDU__ML3__Disconnect__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.progressIndicator().ispresent()){
if(!single_value->field_progressIndicator.match(match_value.progressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".progressIndicator");
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_progressIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".progressIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.allowedActions().ispresent()){
if(!single_value->field_allowedActions.match(match_value.allowedActions(), legacy)){
TTCN_Logger::log_logmatch_info(".allowedActions");
single_value->field_allowedActions.log_match(match_value.allowedActions(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_allowedActions.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".allowedActions := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_allowedActions.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(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", progressIndicator := ");
if (match_value.progressIndicator().ispresent()) {
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_progressIndicator.log();
if (single_value->field_progressIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", allowedActions := ");
if (match_value.allowedActions().ispresent()) {
single_value->field_allowedActions.log_match(match_value.allowedActions(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_allowedActions.log();
if (single_value->field_allowedActions.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__Disconnect__NW__MS_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 (cause().is_bound()) cause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!allowedActions().is_bound()) allowedActions() = OMIT_VALUE;
else allowedActions().set_implicit_omit();
}

void PDU__ML3__Disconnect__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_progressIndicator.encode_text(text_buf);
single_value->field_user__user.encode_text(text_buf);
single_value->field_allowedActions.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_CC_Types.PDU_ML3_Disconnect_NW_MS.");
}
}

void PDU__ML3__Disconnect__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_progressIndicator.decode_text(text_buf);
single_value->field_user__user.decode_text(text_buf);
single_value->field_allowedActions.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__Disconnect__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS.");
}
}

void PDU__ML3__Disconnect__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__Disconnect__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) allowedActions().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allowedActions")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allowedActions().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_CC_Types.PDU_ML3_Disconnect_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Disconnect__NW__MS_template* precondition = new PDU__ML3__Disconnect__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Disconnect__NW__MS_template* implied_template = new PDU__ML3__Disconnect__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Disconnect__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Disconnect__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
single_value->field_progressIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
single_value->field_allowedActions.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_NW_MS");
}

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

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

PDU__ML3__Disconnect__MS__NW::PDU__ML3__Disconnect__MS__NW()
{
}

PDU__ML3__Disconnect__MS__NW::PDU__ML3__Disconnect__MS__NW(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::ML3__Cause__LV& par_cause,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< User__user__TLV >& par_user__user,
    const OPTIONAL< MobileL3__CommonIE__Types::SS__VersionIndicator >& par_ss__VersionIndicator)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cause(par_cause),
  field_facility(par_facility),
  field_user__user(par_user__user),
  field_ss__VersionIndicator(par_ss__VersionIndicator)
{
}

PDU__ML3__Disconnect__MS__NW::PDU__ML3__Disconnect__MS__NW(const PDU__ML3__Disconnect__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW.");
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.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
else field_ss__VersionIndicator.clean_up();
}

void PDU__ML3__Disconnect__MS__NW::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cause.clean_up();
field_facility.clean_up();
field_user__user.clean_up();
field_ss__VersionIndicator.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Disconnect__MS__NW::get_descriptor() const { return &PDU__ML3__Disconnect__MS__NW_descr_; }
PDU__ML3__Disconnect__MS__NW& PDU__ML3__Disconnect__MS__NW::operator=(const PDU__ML3__Disconnect__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW.");
  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.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
  if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
  else field_ss__VersionIndicator.clean_up();
}
return *this;
}

boolean PDU__ML3__Disconnect__MS__NW::operator==(const PDU__ML3__Disconnect__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cause==other_value.field_cause
  && field_facility==other_value.field_facility
  && field_user__user==other_value.field_user__user
  && field_ss__VersionIndicator==other_value.field_ss__VersionIndicator;
}

boolean PDU__ML3__Disconnect__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_cause.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound())
  || (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_bound());
}
boolean PDU__ML3__Disconnect__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_cause.is_value()
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value())
  && (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_value());
}
int PDU__ML3__Disconnect__MS__NW::size_of() const
{
  int ret_val = 3;
  if (field_facility.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  if (field_ss__VersionIndicator.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Disconnect__MS__NW::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(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Disconnect__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
}

void PDU__ML3__Disconnect__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().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_CC_Types.PDU_ML3_Disconnect_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW");
  }
}

void PDU__ML3__Disconnect__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_user__user.encode_text(text_buf);
field_ss__VersionIndicator.encode_text(text_buf);
}

void PDU__ML3__Disconnect__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_user__user.decode_text(text_buf);
field_ss__VersionIndicator.decode_text(text_buf);
}

void PDU__ML3__Disconnect__MS__NW::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__Disconnect__MS__NW::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__Disconnect__MS__NW::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::ML3__Cause__LV_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__LV_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_facility = 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::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_ss__VersionIndicator = 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::SS__VersionIndicator_descr_.raw->forceomit);
  decoded_field_length = field_ss__VersionIndicator().RAW_decode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_ss__VersionIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().elementIdentifier() !=  os_3){
  field_ss__VersionIndicator=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_ss__VersionIndicator=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__Disconnect__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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::ML3__Cause__LV_descr_.raw);
  if (field_facility.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_ss__VersionIndicator.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::SS__VersionIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = 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_cause.RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__LV_descr_, *myleaf.body.node.nodes[2]);
  if (field_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_ss__VersionIndicator.ispresent()) {
  encoded_length += field_ss__VersionIndicator().RAW_encode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  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_2.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_ss__VersionIndicator.ispresent() && (!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().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[]={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_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__Disconnect__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::ML3__Cause__LV_template field_cause;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
User__user__TLV_template field_user__user;
MobileL3__CommonIE__Types::SS__VersionIndicator_template field_ss__VersionIndicator;
};

void PDU__ML3__Disconnect__MS__NW_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_cause = ANY_VALUE;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
single_value->field_ss__VersionIndicator = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Disconnect__MS__NW_template::copy_value(const PDU__ML3__Disconnect__MS__NW& 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.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
if (other_value.ss__VersionIndicator().is_bound()) {
  if (other_value.ss__VersionIndicator().ispresent()) single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator()();
  else single_value->field_ss__VersionIndicator = OMIT_VALUE;
} else {
  single_value->field_ss__VersionIndicator.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Disconnect__MS__NW_template::copy_template(const PDU__ML3__Disconnect__MS__NW_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.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ss__VersionIndicator().get_selection()) {
single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator();
} else {
single_value->field_ss__VersionIndicator.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__Disconnect__MS__NW_template[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__Disconnect__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Disconnect__MS__NW_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_CC_Types.PDU_ML3_Disconnect_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__ML3__Disconnect__MS__NW_template::PDU__ML3__Disconnect__MS__NW_template()
{
}

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

PDU__ML3__Disconnect__MS__NW_template::PDU__ML3__Disconnect__MS__NW_template(const PDU__ML3__Disconnect__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Disconnect__MS__NW_template::match(const PDU__ML3__Disconnect__MS__NW& 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.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.match_omit(legacy)))return FALSE;
if(!other_value.ss__VersionIndicator().is_bound()) return FALSE;
if((other_value.ss__VersionIndicator().ispresent() ? !single_value->field_ss__VersionIndicator.match((const MobileL3__CommonIE__Types::SS__VersionIndicator&)other_value.ss__VersionIndicator(), legacy) : !single_value->field_ss__VersionIndicator.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_CC_Types.PDU_ML3_Disconnect_MS_NW.");
}
return FALSE;
}

boolean PDU__ML3__Disconnect__MS__NW_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_cause.is_bound()
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound())
 || (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_bound());
}

boolean PDU__ML3__Disconnect__MS__NW_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_cause.is_value()
 && (single_value->field_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value())
 && (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_value());
}

void PDU__ML3__Disconnect__MS__NW_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__Disconnect__MS__NW PDU__ML3__Disconnect__MS__NW_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_CC_Types.PDU_ML3_Disconnect_MS_NW.");
PDU__ML3__Disconnect__MS__NW 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_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
if (single_value->field_ss__VersionIndicator.is_omit()) ret_val.ss__VersionIndicator() = OMIT_VALUE;
else if (single_value->field_ss__VersionIndicator.is_bound()) {
ret_val.ss__VersionIndicator() = single_value->field_ss__VersionIndicator.valueof();
}
return ret_val;
}

void PDU__ML3__Disconnect__MS__NW_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_CC_Types.PDU_ML3_Disconnect_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Disconnect__MS__NW_template[list_length];
}

PDU__ML3__Disconnect__MS__NW_template& PDU__ML3__Disconnect__MS__NW_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_CC_Types.PDU_ML3_Disconnect_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW.");
return value_list.list_value[list_index];
}

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

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

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

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

MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__Disconnect__MS__NW_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__Disconnect__MS__NW_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW.");
return single_value->field_cause;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Disconnect__MS__NW_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Disconnect__MS__NW_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW.");
return single_value->field_facility;
}

User__user__TLV_template& PDU__ML3__Disconnect__MS__NW_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__Disconnect__MS__NW_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW.");
return single_value->field_user__user;
}

MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Disconnect__MS__NW_template::ss__VersionIndicator()
{
set_specific();
return single_value->field_ss__VersionIndicator;
}

const MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Disconnect__MS__NW_template::ss__VersionIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ss_VersionIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW.");
return single_value->field_ss__VersionIndicator;
}

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

void PDU__ML3__Disconnect__MS__NW_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(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
single_value->field_ss__VersionIndicator.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__Disconnect__MS__NW_template::log_match(const PDU__ML3__Disconnect__MS__NW& 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_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ss__VersionIndicator().ispresent()){
if(!single_value->field_ss__VersionIndicator.match(match_value.ss__VersionIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ss_VersionIndicator");
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ss__VersionIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ss_VersionIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ss__VersionIndicator.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(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
if (match_value.ss__VersionIndicator().ispresent()) {
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ss__VersionIndicator.log();
if (single_value->field_ss__VersionIndicator.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__Disconnect__MS__NW_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 (cause().is_bound()) cause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
}

void PDU__ML3__Disconnect__MS__NW_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_cause.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_user__user.encode_text(text_buf);
single_value->field_ss__VersionIndicator.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_CC_Types.PDU_ML3_Disconnect_MS_NW.");
}
}

void PDU__ML3__Disconnect__MS__NW_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_cause.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_user__user.decode_text(text_buf);
single_value->field_ss__VersionIndicator.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__Disconnect__MS__NW_template[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_CC_Types.PDU_ML3_Disconnect_MS_NW.");
}
}

void PDU__ML3__Disconnect__MS__NW_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__Disconnect__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().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_CC_Types.PDU_ML3_Disconnect_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Disconnect__MS__NW_template* precondition = new PDU__ML3__Disconnect__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Disconnect__MS__NW_template* implied_template = new PDU__ML3__Disconnect__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Disconnect__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Disconnect__MS__NW_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_CC_Types.PDU_ML3_Disconnect_MS_NW");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW");
single_value->field_ss__VersionIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Disconnect_MS_NW");
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_CC_Types.PDU_ML3_Disconnect_MS_NW");
}

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

boolean PDU__ML3__Disconnect__MS__NW_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__EmergencySetup::PDU__ML3__EmergencySetup()
{
}

PDU__ML3__EmergencySetup::PDU__ML3__EmergencySetup(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< BearerCapability__TLV >& par_bearerCapability,
    const OPTIONAL< StreamIdentifier >& par_streamIdentifier,
    const OPTIONAL< MobileL3__CommonIE__Types::SupportedCodecList >& par_supportedCodecs,
    const OPTIONAL< ServiceCategory >& par_emergencyCategory)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_bearerCapability(par_bearerCapability),
  field_streamIdentifier(par_streamIdentifier),
  field_supportedCodecs(par_supportedCodecs),
  field_emergencyCategory(par_emergencyCategory)
{
}

PDU__ML3__EmergencySetup::PDU__ML3__EmergencySetup(const PDU__ML3__EmergencySetup& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_EmergencySetup.");
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.bearerCapability().is_bound()) field_bearerCapability = other_value.bearerCapability();
else field_bearerCapability.clean_up();
if (other_value.streamIdentifier().is_bound()) field_streamIdentifier = other_value.streamIdentifier();
else field_streamIdentifier.clean_up();
if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
else field_supportedCodecs.clean_up();
if (other_value.emergencyCategory().is_bound()) field_emergencyCategory = other_value.emergencyCategory();
else field_emergencyCategory.clean_up();
}

void PDU__ML3__EmergencySetup::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_bearerCapability.clean_up();
field_streamIdentifier.clean_up();
field_supportedCodecs.clean_up();
field_emergencyCategory.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__EmergencySetup::get_descriptor() const { return &PDU__ML3__EmergencySetup_descr_; }
PDU__ML3__EmergencySetup& PDU__ML3__EmergencySetup::operator=(const PDU__ML3__EmergencySetup& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_EmergencySetup.");
  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.bearerCapability().is_bound()) field_bearerCapability = other_value.bearerCapability();
  else field_bearerCapability.clean_up();
  if (other_value.streamIdentifier().is_bound()) field_streamIdentifier = other_value.streamIdentifier();
  else field_streamIdentifier.clean_up();
  if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
  else field_supportedCodecs.clean_up();
  if (other_value.emergencyCategory().is_bound()) field_emergencyCategory = other_value.emergencyCategory();
  else field_emergencyCategory.clean_up();
}
return *this;
}

boolean PDU__ML3__EmergencySetup::operator==(const PDU__ML3__EmergencySetup& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_bearerCapability==other_value.field_bearerCapability
  && field_streamIdentifier==other_value.field_streamIdentifier
  && field_supportedCodecs==other_value.field_supportedCodecs
  && field_emergencyCategory==other_value.field_emergencyCategory;
}

boolean PDU__ML3__EmergencySetup::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_bearerCapability.get_selection() || field_bearerCapability.is_bound())
  || (OPTIONAL_OMIT == field_streamIdentifier.get_selection() || field_streamIdentifier.is_bound())
  || (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_bound())
  || (OPTIONAL_OMIT == field_emergencyCategory.get_selection() || field_emergencyCategory.is_bound());
}
boolean PDU__ML3__EmergencySetup::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_bearerCapability.get_selection() || field_bearerCapability.is_value())
  && (OPTIONAL_OMIT == field_streamIdentifier.get_selection() || field_streamIdentifier.is_value())
  && (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_value())
  && (OPTIONAL_OMIT == field_emergencyCategory.get_selection() || field_emergencyCategory.is_value());
}
int PDU__ML3__EmergencySetup::size_of() const
{
  int ret_val = 2;
  if (field_bearerCapability.ispresent()) ret_val++;
  if (field_streamIdentifier.ispresent()) ret_val++;
  if (field_supportedCodecs.ispresent()) ret_val++;
  if (field_emergencyCategory.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__EmergencySetup::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(", bearerCapability := ");
field_bearerCapability.log();
TTCN_Logger::log_event_str(", streamIdentifier := ");
field_streamIdentifier.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
field_supportedCodecs.log();
TTCN_Logger::log_event_str(", emergencyCategory := ");
field_emergencyCategory.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__EmergencySetup::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!bearerCapability().is_bound()) bearerCapability() = OMIT_VALUE;
else bearerCapability().set_implicit_omit();
if (!streamIdentifier().is_bound()) streamIdentifier() = OMIT_VALUE;
else streamIdentifier().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!emergencyCategory().is_bound()) emergencyCategory() = OMIT_VALUE;
else emergencyCategory().set_implicit_omit();
}

void PDU__ML3__EmergencySetup::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_EmergencySetup has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bearerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) streamIdentifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) emergencyCategory().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bearerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyCategory")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyCategory().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_CC_Types.PDU_ML3_EmergencySetup: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_EmergencySetup");
  }
}

void PDU__ML3__EmergencySetup::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_bearerCapability.encode_text(text_buf);
field_streamIdentifier.encode_text(text_buf);
field_supportedCodecs.encode_text(text_buf);
field_emergencyCategory.encode_text(text_buf);
}

void PDU__ML3__EmergencySetup::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_bearerCapability.decode_text(text_buf);
field_streamIdentifier.decode_text(text_buf);
field_supportedCodecs.decode_text(text_buf);
field_emergencyCategory.decode_text(text_buf);
}

void PDU__ML3__EmergencySetup::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__EmergencySetup::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__EmergencySetup::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_bearerCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability().RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_bearerCapability = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bearerCapability.ispresent() || field_bearerCapability().elementIdentifier() !=  os_4){
  field_bearerCapability=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_bearerCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_streamIdentifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, StreamIdentifier_descr_.raw->forceomit);
  decoded_field_length = field_streamIdentifier().RAW_decode(StreamIdentifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_streamIdentifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_streamIdentifier.ispresent() || field_streamIdentifier().elementIdentifier() !=  os_7){
  field_streamIdentifier=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_streamIdentifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_supportedCodecs = 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::SupportedCodecList_descr_.raw->forceomit);
  decoded_field_length = field_supportedCodecs().RAW_decode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_supportedCodecs = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_supportedCodecs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_emergencyCategory = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, ServiceCategory_descr_.raw->forceomit);
  decoded_field_length = field_emergencyCategory().RAW_decode(ServiceCategory_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_emergencyCategory = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_emergencyCategory.ispresent() || field_emergencyCategory().elementIdentifier() !=  os_12){
  field_emergencyCategory=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_emergencyCategory=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__EmergencySetup::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_bearerCapability.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, BearerCapability__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_streamIdentifier.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, StreamIdentifier_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_supportedCodecs.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_emergencyCategory.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ServiceCategory_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = 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_bearerCapability.ispresent()) {
  encoded_length += field_bearerCapability().RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_streamIdentifier.ispresent()) {
  encoded_length += field_streamIdentifier().RAW_encode(StreamIdentifier_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_supportedCodecs.ispresent()) {
  encoded_length += field_supportedCodecs().RAW_encode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_emergencyCategory.ispresent()) {
  encoded_length += field_emergencyCategory().RAW_encode(ServiceCategory_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_bearerCapability.ispresent() && (!field_bearerCapability.ispresent() || field_bearerCapability().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[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_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);
  }
  }
  if (field_streamIdentifier.ispresent() && (!field_streamIdentifier.ispresent() || field_streamIdentifier().elementIdentifier() !=  os_7)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_emergencyCategory.ispresent() && (!field_emergencyCategory.ispresent() || field_emergencyCategory().elementIdentifier() !=  os_12)) {
  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_12.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__EmergencySetup_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
BearerCapability__TLV_template field_bearerCapability;
StreamIdentifier_template field_streamIdentifier;
MobileL3__CommonIE__Types::SupportedCodecList_template field_supportedCodecs;
ServiceCategory_template field_emergencyCategory;
};

void PDU__ML3__EmergencySetup_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_bearerCapability = ANY_OR_OMIT;
single_value->field_streamIdentifier = ANY_OR_OMIT;
single_value->field_supportedCodecs = ANY_OR_OMIT;
single_value->field_emergencyCategory = ANY_OR_OMIT;
}
}
}

void PDU__ML3__EmergencySetup_template::copy_value(const PDU__ML3__EmergencySetup& 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.bearerCapability().is_bound()) {
  if (other_value.bearerCapability().ispresent()) single_value->field_bearerCapability = other_value.bearerCapability()();
  else single_value->field_bearerCapability = OMIT_VALUE;
} else {
  single_value->field_bearerCapability.clean_up();
}
if (other_value.streamIdentifier().is_bound()) {
  if (other_value.streamIdentifier().ispresent()) single_value->field_streamIdentifier = other_value.streamIdentifier()();
  else single_value->field_streamIdentifier = OMIT_VALUE;
} else {
  single_value->field_streamIdentifier.clean_up();
}
if (other_value.supportedCodecs().is_bound()) {
  if (other_value.supportedCodecs().ispresent()) single_value->field_supportedCodecs = other_value.supportedCodecs()();
  else single_value->field_supportedCodecs = OMIT_VALUE;
} else {
  single_value->field_supportedCodecs.clean_up();
}
if (other_value.emergencyCategory().is_bound()) {
  if (other_value.emergencyCategory().ispresent()) single_value->field_emergencyCategory = other_value.emergencyCategory()();
  else single_value->field_emergencyCategory = OMIT_VALUE;
} else {
  single_value->field_emergencyCategory.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__EmergencySetup_template::copy_template(const PDU__ML3__EmergencySetup_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.bearerCapability().get_selection()) {
single_value->field_bearerCapability = other_value.bearerCapability();
} else {
single_value->field_bearerCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.streamIdentifier().get_selection()) {
single_value->field_streamIdentifier = other_value.streamIdentifier();
} else {
single_value->field_streamIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.supportedCodecs().get_selection()) {
single_value->field_supportedCodecs = other_value.supportedCodecs();
} else {
single_value->field_supportedCodecs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.emergencyCategory().get_selection()) {
single_value->field_emergencyCategory = other_value.emergencyCategory();
} else {
single_value->field_emergencyCategory.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__EmergencySetup_template[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__EmergencySetup_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__EmergencySetup_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_CC_Types.PDU_ML3_EmergencySetup.");
break;
}
set_selection(other_value);
}

PDU__ML3__EmergencySetup_template::PDU__ML3__EmergencySetup_template()
{
}

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

PDU__ML3__EmergencySetup_template::PDU__ML3__EmergencySetup_template(const PDU__ML3__EmergencySetup& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__EmergencySetup_template::match(const PDU__ML3__EmergencySetup& 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.bearerCapability().is_bound()) return FALSE;
if((other_value.bearerCapability().ispresent() ? !single_value->field_bearerCapability.match((const BearerCapability__TLV&)other_value.bearerCapability(), legacy) : !single_value->field_bearerCapability.match_omit(legacy)))return FALSE;
if(!other_value.streamIdentifier().is_bound()) return FALSE;
if((other_value.streamIdentifier().ispresent() ? !single_value->field_streamIdentifier.match((const StreamIdentifier&)other_value.streamIdentifier(), legacy) : !single_value->field_streamIdentifier.match_omit(legacy)))return FALSE;
if(!other_value.supportedCodecs().is_bound()) return FALSE;
if((other_value.supportedCodecs().ispresent() ? !single_value->field_supportedCodecs.match((const MobileL3__CommonIE__Types::SupportedCodecList&)other_value.supportedCodecs(), legacy) : !single_value->field_supportedCodecs.match_omit(legacy)))return FALSE;
if(!other_value.emergencyCategory().is_bound()) return FALSE;
if((other_value.emergencyCategory().ispresent() ? !single_value->field_emergencyCategory.match((const ServiceCategory&)other_value.emergencyCategory(), legacy) : !single_value->field_emergencyCategory.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_CC_Types.PDU_ML3_EmergencySetup.");
}
return FALSE;
}

boolean PDU__ML3__EmergencySetup_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_bearerCapability.is_omit() || single_value->field_bearerCapability.is_bound())
 || (single_value->field_streamIdentifier.is_omit() || single_value->field_streamIdentifier.is_bound())
 || (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_bound())
 || (single_value->field_emergencyCategory.is_omit() || single_value->field_emergencyCategory.is_bound());
}

boolean PDU__ML3__EmergencySetup_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_bearerCapability.is_omit() || single_value->field_bearerCapability.is_value())
 && (single_value->field_streamIdentifier.is_omit() || single_value->field_streamIdentifier.is_value())
 && (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_value())
 && (single_value->field_emergencyCategory.is_omit() || single_value->field_emergencyCategory.is_value());
}

void PDU__ML3__EmergencySetup_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__EmergencySetup PDU__ML3__EmergencySetup_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_CC_Types.PDU_ML3_EmergencySetup.");
PDU__ML3__EmergencySetup 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_bearerCapability.is_omit()) ret_val.bearerCapability() = OMIT_VALUE;
else if (single_value->field_bearerCapability.is_bound()) {
ret_val.bearerCapability() = single_value->field_bearerCapability.valueof();
}
if (single_value->field_streamIdentifier.is_omit()) ret_val.streamIdentifier() = OMIT_VALUE;
else if (single_value->field_streamIdentifier.is_bound()) {
ret_val.streamIdentifier() = single_value->field_streamIdentifier.valueof();
}
if (single_value->field_supportedCodecs.is_omit()) ret_val.supportedCodecs() = OMIT_VALUE;
else if (single_value->field_supportedCodecs.is_bound()) {
ret_val.supportedCodecs() = single_value->field_supportedCodecs.valueof();
}
if (single_value->field_emergencyCategory.is_omit()) ret_val.emergencyCategory() = OMIT_VALUE;
else if (single_value->field_emergencyCategory.is_bound()) {
ret_val.emergencyCategory() = single_value->field_emergencyCategory.valueof();
}
return ret_val;
}

void PDU__ML3__EmergencySetup_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_CC_Types.PDU_ML3_EmergencySetup.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__EmergencySetup_template[list_length];
}

PDU__ML3__EmergencySetup_template& PDU__ML3__EmergencySetup_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_CC_Types.PDU_ML3_EmergencySetup.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_EmergencySetup.");
return value_list.list_value[list_index];
}

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

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

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

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

BearerCapability__TLV_template& PDU__ML3__EmergencySetup_template::bearerCapability()
{
set_specific();
return single_value->field_bearerCapability;
}

const BearerCapability__TLV_template& PDU__ML3__EmergencySetup_template::bearerCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_EmergencySetup.");
return single_value->field_bearerCapability;
}

StreamIdentifier_template& PDU__ML3__EmergencySetup_template::streamIdentifier()
{
set_specific();
return single_value->field_streamIdentifier;
}

const StreamIdentifier_template& PDU__ML3__EmergencySetup_template::streamIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field streamIdentifier of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_EmergencySetup.");
return single_value->field_streamIdentifier;
}

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

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

ServiceCategory_template& PDU__ML3__EmergencySetup_template::emergencyCategory()
{
set_specific();
return single_value->field_emergencyCategory;
}

const ServiceCategory_template& PDU__ML3__EmergencySetup_template::emergencyCategory() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field emergencyCategory of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_EmergencySetup.");
return single_value->field_emergencyCategory;
}

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

void PDU__ML3__EmergencySetup_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(", bearerCapability := ");
single_value->field_bearerCapability.log();
TTCN_Logger::log_event_str(", streamIdentifier := ");
single_value->field_streamIdentifier.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(", emergencyCategory := ");
single_value->field_emergencyCategory.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__EmergencySetup_template::log_match(const PDU__ML3__EmergencySetup& 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.bearerCapability().ispresent()){
if(!single_value->field_bearerCapability.match(match_value.bearerCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability");
single_value->field_bearerCapability.log_match(match_value.bearerCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bearerCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bearerCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bearerCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.streamIdentifier().ispresent()){
if(!single_value->field_streamIdentifier.match(match_value.streamIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".streamIdentifier");
single_value->field_streamIdentifier.log_match(match_value.streamIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_streamIdentifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".streamIdentifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_streamIdentifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.supportedCodecs().ispresent()){
if(!single_value->field_supportedCodecs.match(match_value.supportedCodecs(), legacy)){
TTCN_Logger::log_logmatch_info(".supportedCodecs");
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_supportedCodecs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".supportedCodecs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.emergencyCategory().ispresent()){
if(!single_value->field_emergencyCategory.match(match_value.emergencyCategory(), legacy)){
TTCN_Logger::log_logmatch_info(".emergencyCategory");
single_value->field_emergencyCategory.log_match(match_value.emergencyCategory(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_emergencyCategory.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".emergencyCategory := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_emergencyCategory.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(", bearerCapability := ");
if (match_value.bearerCapability().ispresent()) {
single_value->field_bearerCapability.log_match(match_value.bearerCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bearerCapability.log();
if (single_value->field_bearerCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", streamIdentifier := ");
if (match_value.streamIdentifier().ispresent()) {
single_value->field_streamIdentifier.log_match(match_value.streamIdentifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_streamIdentifier.log();
if (single_value->field_streamIdentifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", supportedCodecs := ");
if (match_value.supportedCodecs().ispresent()) {
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_supportedCodecs.log();
if (single_value->field_supportedCodecs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", emergencyCategory := ");
if (match_value.emergencyCategory().ispresent()) {
single_value->field_emergencyCategory.log_match(match_value.emergencyCategory(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_emergencyCategory.log();
if (single_value->field_emergencyCategory.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__EmergencySetup_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 (!bearerCapability().is_bound()) bearerCapability() = OMIT_VALUE;
else bearerCapability().set_implicit_omit();
if (!streamIdentifier().is_bound()) streamIdentifier() = OMIT_VALUE;
else streamIdentifier().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!emergencyCategory().is_bound()) emergencyCategory() = OMIT_VALUE;
else emergencyCategory().set_implicit_omit();
}

void PDU__ML3__EmergencySetup_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_bearerCapability.encode_text(text_buf);
single_value->field_streamIdentifier.encode_text(text_buf);
single_value->field_supportedCodecs.encode_text(text_buf);
single_value->field_emergencyCategory.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_CC_Types.PDU_ML3_EmergencySetup.");
}
}

void PDU__ML3__EmergencySetup_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_bearerCapability.decode_text(text_buf);
single_value->field_streamIdentifier.decode_text(text_buf);
single_value->field_supportedCodecs.decode_text(text_buf);
single_value->field_emergencyCategory.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__EmergencySetup_template[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_CC_Types.PDU_ML3_EmergencySetup.");
}
}

void PDU__ML3__EmergencySetup_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__EmergencySetup_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_EmergencySetup has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bearerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) streamIdentifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) emergencyCategory().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bearerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyCategory")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyCategory().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_CC_Types.PDU_ML3_EmergencySetup: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__EmergencySetup_template* precondition = new PDU__ML3__EmergencySetup_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__EmergencySetup_template* implied_template = new PDU__ML3__EmergencySetup_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__EmergencySetup_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_EmergencySetup");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__EmergencySetup_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_CC_Types.PDU_ML3_EmergencySetup");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_EmergencySetup");
single_value->field_bearerCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_EmergencySetup");
single_value->field_streamIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_EmergencySetup");
single_value->field_supportedCodecs.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_EmergencySetup");
single_value->field_emergencyCategory.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_EmergencySetup");
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_CC_Types.PDU_ML3_EmergencySetup");
}

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

boolean PDU__ML3__EmergencySetup_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__Facility::PDU__ML3__Facility()
{
}

PDU__ML3__Facility::PDU__ML3__Facility(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::Facility__LV& par_facility,
    const OPTIONAL< MobileL3__CommonIE__Types::SS__VersionIndicator >& par_ss__version)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_facility(par_facility),
  field_ss__version(par_ss__version)
{
}

PDU__ML3__Facility::PDU__ML3__Facility(const PDU__ML3__Facility& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Facility.");
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.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.ss__version().is_bound()) field_ss__version = other_value.ss__version();
else field_ss__version.clean_up();
}

void PDU__ML3__Facility::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_facility.clean_up();
field_ss__version.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Facility::get_descriptor() const { return &PDU__ML3__Facility_descr_; }
PDU__ML3__Facility& PDU__ML3__Facility::operator=(const PDU__ML3__Facility& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Facility.");
  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.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.ss__version().is_bound()) field_ss__version = other_value.ss__version();
  else field_ss__version.clean_up();
}
return *this;
}

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

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

void PDU__ML3__Facility::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(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", ss_version := ");
field_ss__version.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Facility::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (facility().is_bound()) facility().set_implicit_omit();
if (!ss__version().is_bound()) ss__version() = OMIT_VALUE;
else ss__version().set_implicit_omit();
}

void PDU__ML3__Facility::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_CC_Types.PDU_ML3_Facility 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) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ss__version().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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__version().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_CC_Types.PDU_ML3_Facility: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Facility");
  }
}

void PDU__ML3__Facility::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_ss__version.encode_text(text_buf);
}

void PDU__ML3__Facility::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_ss__version.decode_text(text_buf);
}

void PDU__ML3__Facility::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__Facility::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__Facility::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::Facility__LV_descr_.raw->forceomit);
  decoded_field_length = field_facility.RAW_decode(MobileL3__CommonIE__Types::Facility__LV_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_ss__version = 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::SS__VersionIndicator_descr_.raw->forceomit);
  decoded_field_length = field_ss__version().RAW_decode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_ss__version = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ss__version.ispresent() || field_ss__version().elementIdentifier() !=  os_3){
  field_ss__version=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_ss__version=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__Facility::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::Facility__LV_descr_.raw);
  if (field_ss__version.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::SS__VersionIndicator_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_facility.RAW_encode(MobileL3__CommonIE__Types::Facility__LV_descr_, *myleaf.body.node.nodes[2]);
  if (field_ss__version.ispresent()) {
  encoded_length += field_ss__version().RAW_encode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_ss__version.ispresent() && (!field_ss__version.ispresent() || field_ss__version().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[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_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__Facility_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::Facility__LV_template field_facility;
MobileL3__CommonIE__Types::SS__VersionIndicator_template field_ss__version;
};

void PDU__ML3__Facility_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_facility = ANY_VALUE;
single_value->field_ss__version = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Facility_template::copy_value(const PDU__ML3__Facility& 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.facility().is_bound()) {
  single_value->field_facility = other_value.facility();
} else {
  single_value->field_facility.clean_up();
}
if (other_value.ss__version().is_bound()) {
  if (other_value.ss__version().ispresent()) single_value->field_ss__version = other_value.ss__version()();
  else single_value->field_ss__version = OMIT_VALUE;
} else {
  single_value->field_ss__version.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Facility_template::copy_template(const PDU__ML3__Facility_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.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ss__version().get_selection()) {
single_value->field_ss__version = other_value.ss__version();
} else {
single_value->field_ss__version.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__Facility_template[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__Facility_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Facility_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_CC_Types.PDU_ML3_Facility.");
break;
}
set_selection(other_value);
}

PDU__ML3__Facility_template::PDU__ML3__Facility_template()
{
}

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

PDU__ML3__Facility_template::PDU__ML3__Facility_template(const PDU__ML3__Facility& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Facility_template::match(const PDU__ML3__Facility& 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.facility().is_bound()) return FALSE;
if(!single_value->field_facility.match(other_value.facility(), legacy))return FALSE;
if(!other_value.ss__version().is_bound()) return FALSE;
if((other_value.ss__version().ispresent() ? !single_value->field_ss__version.match((const MobileL3__CommonIE__Types::SS__VersionIndicator&)other_value.ss__version(), legacy) : !single_value->field_ss__version.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_CC_Types.PDU_ML3_Facility.");
}
return FALSE;
}

boolean PDU__ML3__Facility_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_facility.is_bound()
 || (single_value->field_ss__version.is_omit() || single_value->field_ss__version.is_bound());
}

boolean PDU__ML3__Facility_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_facility.is_value()
 && (single_value->field_ss__version.is_omit() || single_value->field_ss__version.is_value());
}

void PDU__ML3__Facility_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__Facility PDU__ML3__Facility_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_CC_Types.PDU_ML3_Facility.");
PDU__ML3__Facility 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_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_ss__version.is_omit()) ret_val.ss__version() = OMIT_VALUE;
else if (single_value->field_ss__version.is_bound()) {
ret_val.ss__version() = single_value->field_ss__version.valueof();
}
return ret_val;
}

void PDU__ML3__Facility_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_CC_Types.PDU_ML3_Facility.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Facility_template[list_length];
}

PDU__ML3__Facility_template& PDU__ML3__Facility_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_CC_Types.PDU_ML3_Facility.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Facility.");
return value_list.list_value[list_index];
}

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

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

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

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

MobileL3__CommonIE__Types::Facility__LV_template& PDU__ML3__Facility_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__LV_template& PDU__ML3__Facility_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Facility.");
return single_value->field_facility;
}

MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Facility_template::ss__version()
{
set_specific();
return single_value->field_ss__version;
}

const MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Facility_template::ss__version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ss_version of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Facility.");
return single_value->field_ss__version;
}

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

void PDU__ML3__Facility_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(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", ss_version := ");
single_value->field_ss__version.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__Facility_template::log_match(const PDU__ML3__Facility& 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_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.ss__version().ispresent()){
if(!single_value->field_ss__version.match(match_value.ss__version(), legacy)){
TTCN_Logger::log_logmatch_info(".ss_version");
single_value->field_ss__version.log_match(match_value.ss__version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ss__version.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ss_version := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ss__version.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(", facility := ");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::log_event_str(", ss_version := ");
if (match_value.ss__version().ispresent()) {
single_value->field_ss__version.log_match(match_value.ss__version(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ss__version.log();
if (single_value->field_ss__version.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__Facility_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 (facility().is_bound()) facility().set_implicit_omit();
if (!ss__version().is_bound()) ss__version() = OMIT_VALUE;
else ss__version().set_implicit_omit();
}

void PDU__ML3__Facility_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_facility.encode_text(text_buf);
single_value->field_ss__version.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_CC_Types.PDU_ML3_Facility.");
}
}

void PDU__ML3__Facility_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_facility.decode_text(text_buf);
single_value->field_ss__version.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__Facility_template[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_CC_Types.PDU_ML3_Facility.");
}
}

void PDU__ML3__Facility_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__Facility_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_CC_Types.PDU_ML3_Facility 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) facility().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ss__version().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(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__version().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_CC_Types.PDU_ML3_Facility: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Facility_template* precondition = new PDU__ML3__Facility_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Facility_template* implied_template = new PDU__ML3__Facility_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Facility_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Facility");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Facility_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_CC_Types.PDU_ML3_Facility");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Facility");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Facility");
single_value->field_ss__version.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Facility");
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_CC_Types.PDU_ML3_Facility");
}

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

boolean PDU__ML3__Facility_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__Hold::PDU__ML3__Hold()
{
}

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

PDU__ML3__Hold::PDU__ML3__Hold(const PDU__ML3__Hold& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Hold.");
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__Hold::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Hold::get_descriptor() const { return &PDU__ML3__Hold_descr_; }
PDU__ML3__Hold& PDU__ML3__Hold::operator=(const PDU__ML3__Hold& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Hold.");
  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__Hold::operator==(const PDU__ML3__Hold& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__Hold::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__Hold::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__Hold::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__Hold::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

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

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

void PDU__ML3__Hold::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__Hold::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__Hold::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__Hold::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__Hold_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__Hold_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__Hold_template::copy_value(const PDU__ML3__Hold& 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__Hold_template::copy_template(const PDU__ML3__Hold_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__Hold_template[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__Hold_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Hold_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_CC_Types.PDU_ML3_Hold.");
break;
}
set_selection(other_value);
}

PDU__ML3__Hold_template::PDU__ML3__Hold_template()
{
}

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

PDU__ML3__Hold_template::PDU__ML3__Hold_template(const PDU__ML3__Hold& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Hold_template::match(const PDU__ML3__Hold& 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_CC_Types.PDU_ML3_Hold.");
}
return FALSE;
}

boolean PDU__ML3__Hold_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__Hold_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__Hold_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__Hold PDU__ML3__Hold_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_CC_Types.PDU_ML3_Hold.");
PDU__ML3__Hold 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__Hold_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_CC_Types.PDU_ML3_Hold.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Hold_template[list_length];
}

PDU__ML3__Hold_template& PDU__ML3__Hold_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_CC_Types.PDU_ML3_Hold.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Hold.");
return value_list.list_value[list_index];
}

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

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

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

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

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

void PDU__ML3__Hold_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__Hold_template::log_match(const PDU__ML3__Hold& 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__Hold_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__Hold_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_CC_Types.PDU_ML3_Hold.");
}
}

void PDU__ML3__Hold_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__Hold_template[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_CC_Types.PDU_ML3_Hold.");
}
}

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

void PDU__ML3__Hold_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_CC_Types.PDU_ML3_Hold");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Hold");
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_CC_Types.PDU_ML3_Hold");
}

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

boolean PDU__ML3__Hold_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__HoldAcknowledge::PDU__ML3__HoldAcknowledge()
{
}

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

PDU__ML3__HoldAcknowledge::PDU__ML3__HoldAcknowledge(const PDU__ML3__HoldAcknowledge& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_HoldAcknowledge.");
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__HoldAcknowledge::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__HoldAcknowledge::get_descriptor() const { return &PDU__ML3__HoldAcknowledge_descr_; }
PDU__ML3__HoldAcknowledge& PDU__ML3__HoldAcknowledge::operator=(const PDU__ML3__HoldAcknowledge& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_HoldAcknowledge.");
  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__HoldAcknowledge::operator==(const PDU__ML3__HoldAcknowledge& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__HoldAcknowledge::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__HoldAcknowledge::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__HoldAcknowledge::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__HoldAcknowledge::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

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

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

void PDU__ML3__HoldAcknowledge::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__HoldAcknowledge::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__HoldAcknowledge::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__HoldAcknowledge::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__HoldAcknowledge_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__HoldAcknowledge_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__HoldAcknowledge_template::copy_value(const PDU__ML3__HoldAcknowledge& 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__HoldAcknowledge_template::copy_template(const PDU__ML3__HoldAcknowledge_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__HoldAcknowledge_template[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__HoldAcknowledge_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__HoldAcknowledge_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_CC_Types.PDU_ML3_HoldAcknowledge.");
break;
}
set_selection(other_value);
}

PDU__ML3__HoldAcknowledge_template::PDU__ML3__HoldAcknowledge_template()
{
}

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

PDU__ML3__HoldAcknowledge_template::PDU__ML3__HoldAcknowledge_template(const PDU__ML3__HoldAcknowledge& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__HoldAcknowledge_template::match(const PDU__ML3__HoldAcknowledge& 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_CC_Types.PDU_ML3_HoldAcknowledge.");
}
return FALSE;
}

boolean PDU__ML3__HoldAcknowledge_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__HoldAcknowledge_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__HoldAcknowledge_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__HoldAcknowledge PDU__ML3__HoldAcknowledge_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_CC_Types.PDU_ML3_HoldAcknowledge.");
PDU__ML3__HoldAcknowledge 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__HoldAcknowledge_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_CC_Types.PDU_ML3_HoldAcknowledge.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__HoldAcknowledge_template[list_length];
}

PDU__ML3__HoldAcknowledge_template& PDU__ML3__HoldAcknowledge_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_CC_Types.PDU_ML3_HoldAcknowledge.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_HoldAcknowledge.");
return value_list.list_value[list_index];
}

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

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

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

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

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

void PDU__ML3__HoldAcknowledge_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__HoldAcknowledge_template::log_match(const PDU__ML3__HoldAcknowledge& 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__HoldAcknowledge_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__HoldAcknowledge_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_CC_Types.PDU_ML3_HoldAcknowledge.");
}
}

void PDU__ML3__HoldAcknowledge_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__HoldAcknowledge_template[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_CC_Types.PDU_ML3_HoldAcknowledge.");
}
}

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

void PDU__ML3__HoldAcknowledge_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_CC_Types.PDU_ML3_HoldAcknowledge");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_HoldAcknowledge");
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_CC_Types.PDU_ML3_HoldAcknowledge");
}

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

boolean PDU__ML3__HoldAcknowledge_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__HoldReject::PDU__ML3__HoldReject()
{
}

PDU__ML3__HoldReject::PDU__ML3__HoldReject(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::ML3__Cause__LV& par_cause)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cause(par_cause)
{
}

PDU__ML3__HoldReject::PDU__ML3__HoldReject(const PDU__ML3__HoldReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_HoldReject.");
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.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__ML3__HoldReject::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__HoldReject::get_descriptor() const { return &PDU__ML3__HoldReject_descr_; }
PDU__ML3__HoldReject& PDU__ML3__HoldReject::operator=(const PDU__ML3__HoldReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_HoldReject.");
  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.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

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

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

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

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

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

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

void PDU__ML3__HoldReject::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__HoldReject::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__HoldReject::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::ML3__Cause__LV_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__LV_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__HoldReject::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, MobileL3__CommonIE__Types::ML3__Cause__LV_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_cause.RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__LV_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__HoldReject_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::ML3__Cause__LV_template field_cause;
};

void PDU__ML3__HoldReject_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_cause = ANY_VALUE;
}
}
}

void PDU__ML3__HoldReject_template::copy_value(const PDU__ML3__HoldReject& 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.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__HoldReject_template::copy_template(const PDU__ML3__HoldReject_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.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.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__HoldReject_template[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__HoldReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__HoldReject_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_CC_Types.PDU_ML3_HoldReject.");
break;
}
set_selection(other_value);
}

PDU__ML3__HoldReject_template::PDU__ML3__HoldReject_template()
{
}

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

PDU__ML3__HoldReject_template::PDU__ML3__HoldReject_template(const PDU__ML3__HoldReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__HoldReject_template::match(const PDU__ML3__HoldReject& 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.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), 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_CC_Types.PDU_ML3_HoldReject.");
}
return FALSE;
}

boolean PDU__ML3__HoldReject_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_cause.is_bound();
}

boolean PDU__ML3__HoldReject_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_cause.is_value();
}

void PDU__ML3__HoldReject_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__HoldReject PDU__ML3__HoldReject_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_CC_Types.PDU_ML3_HoldReject.");
PDU__ML3__HoldReject 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_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

void PDU__ML3__HoldReject_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_CC_Types.PDU_ML3_HoldReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__HoldReject_template[list_length];
}

PDU__ML3__HoldReject_template& PDU__ML3__HoldReject_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_CC_Types.PDU_ML3_HoldReject.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_HoldReject.");
return value_list.list_value[list_index];
}

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

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

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

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

MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__HoldReject_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__HoldReject_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_HoldReject.");
return single_value->field_cause;
}

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

void PDU__ML3__HoldReject_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(", cause := ");
single_value->field_cause.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__HoldReject_template::log_match(const PDU__ML3__HoldReject& 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_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), 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(", cause := ");
single_value->field_cause.log_match(match_value.cause(), 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__HoldReject_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 (cause().is_bound()) cause().set_implicit_omit();
}

void PDU__ML3__HoldReject_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_cause.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_CC_Types.PDU_ML3_HoldReject.");
}
}

void PDU__ML3__HoldReject_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_cause.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__HoldReject_template[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_CC_Types.PDU_ML3_HoldReject.");
}
}

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

void PDU__ML3__HoldReject_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_CC_Types.PDU_ML3_HoldReject");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_HoldReject");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_HoldReject");
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_CC_Types.PDU_ML3_HoldReject");
}

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

boolean PDU__ML3__HoldReject_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__Modify::PDU__ML3__Modify()
{
}

PDU__ML3__Modify::PDU__ML3__Modify(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const BearerCapability__LV& par_bearerCapability,
    const OPTIONAL< LowLayerCompatibility >& par_lowLayerCompatibility,
    const OPTIONAL< HighLayerCompatibility >& par_highLayerCompatibility,
    const OPTIONAL< ReverseCallSetupDirection >& par_reverseCallSetupDirection,
    const OPTIONAL< NetworkInitiatedServiceUpgradeIndicator >& par_networkInitiatedServiceUpgradeIndicator)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_bearerCapability(par_bearerCapability),
  field_lowLayerCompatibility(par_lowLayerCompatibility),
  field_highLayerCompatibility(par_highLayerCompatibility),
  field_reverseCallSetupDirection(par_reverseCallSetupDirection),
  field_networkInitiatedServiceUpgradeIndicator(par_networkInitiatedServiceUpgradeIndicator)
{
}

PDU__ML3__Modify::PDU__ML3__Modify(const PDU__ML3__Modify& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Modify.");
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.bearerCapability().is_bound()) field_bearerCapability = other_value.bearerCapability();
else field_bearerCapability.clean_up();
if (other_value.lowLayerCompatibility().is_bound()) field_lowLayerCompatibility = other_value.lowLayerCompatibility();
else field_lowLayerCompatibility.clean_up();
if (other_value.highLayerCompatibility().is_bound()) field_highLayerCompatibility = other_value.highLayerCompatibility();
else field_highLayerCompatibility.clean_up();
if (other_value.reverseCallSetupDirection().is_bound()) field_reverseCallSetupDirection = other_value.reverseCallSetupDirection();
else field_reverseCallSetupDirection.clean_up();
if (other_value.networkInitiatedServiceUpgradeIndicator().is_bound()) field_networkInitiatedServiceUpgradeIndicator = other_value.networkInitiatedServiceUpgradeIndicator();
else field_networkInitiatedServiceUpgradeIndicator.clean_up();
}

void PDU__ML3__Modify::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_bearerCapability.clean_up();
field_lowLayerCompatibility.clean_up();
field_highLayerCompatibility.clean_up();
field_reverseCallSetupDirection.clean_up();
field_networkInitiatedServiceUpgradeIndicator.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Modify::get_descriptor() const { return &PDU__ML3__Modify_descr_; }
PDU__ML3__Modify& PDU__ML3__Modify::operator=(const PDU__ML3__Modify& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Modify.");
  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.bearerCapability().is_bound()) field_bearerCapability = other_value.bearerCapability();
  else field_bearerCapability.clean_up();
  if (other_value.lowLayerCompatibility().is_bound()) field_lowLayerCompatibility = other_value.lowLayerCompatibility();
  else field_lowLayerCompatibility.clean_up();
  if (other_value.highLayerCompatibility().is_bound()) field_highLayerCompatibility = other_value.highLayerCompatibility();
  else field_highLayerCompatibility.clean_up();
  if (other_value.reverseCallSetupDirection().is_bound()) field_reverseCallSetupDirection = other_value.reverseCallSetupDirection();
  else field_reverseCallSetupDirection.clean_up();
  if (other_value.networkInitiatedServiceUpgradeIndicator().is_bound()) field_networkInitiatedServiceUpgradeIndicator = other_value.networkInitiatedServiceUpgradeIndicator();
  else field_networkInitiatedServiceUpgradeIndicator.clean_up();
}
return *this;
}

boolean PDU__ML3__Modify::operator==(const PDU__ML3__Modify& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_bearerCapability==other_value.field_bearerCapability
  && field_lowLayerCompatibility==other_value.field_lowLayerCompatibility
  && field_highLayerCompatibility==other_value.field_highLayerCompatibility
  && field_reverseCallSetupDirection==other_value.field_reverseCallSetupDirection
  && field_networkInitiatedServiceUpgradeIndicator==other_value.field_networkInitiatedServiceUpgradeIndicator;
}

boolean PDU__ML3__Modify::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_bearerCapability.is_bound())
  || (OPTIONAL_OMIT == field_lowLayerCompatibility.get_selection() || field_lowLayerCompatibility.is_bound())
  || (OPTIONAL_OMIT == field_highLayerCompatibility.get_selection() || field_highLayerCompatibility.is_bound())
  || (OPTIONAL_OMIT == field_reverseCallSetupDirection.get_selection() || field_reverseCallSetupDirection.is_bound())
  || (OPTIONAL_OMIT == field_networkInitiatedServiceUpgradeIndicator.get_selection() || field_networkInitiatedServiceUpgradeIndicator.is_bound());
}
boolean PDU__ML3__Modify::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_bearerCapability.is_value()
  && (OPTIONAL_OMIT == field_lowLayerCompatibility.get_selection() || field_lowLayerCompatibility.is_value())
  && (OPTIONAL_OMIT == field_highLayerCompatibility.get_selection() || field_highLayerCompatibility.is_value())
  && (OPTIONAL_OMIT == field_reverseCallSetupDirection.get_selection() || field_reverseCallSetupDirection.is_value())
  && (OPTIONAL_OMIT == field_networkInitiatedServiceUpgradeIndicator.get_selection() || field_networkInitiatedServiceUpgradeIndicator.is_value());
}
int PDU__ML3__Modify::size_of() const
{
  int ret_val = 3;
  if (field_lowLayerCompatibility.ispresent()) ret_val++;
  if (field_highLayerCompatibility.ispresent()) ret_val++;
  if (field_reverseCallSetupDirection.ispresent()) ret_val++;
  if (field_networkInitiatedServiceUpgradeIndicator.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Modify::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(", bearerCapability := ");
field_bearerCapability.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility := ");
field_lowLayerCompatibility.log();
TTCN_Logger::log_event_str(", highLayerCompatibility := ");
field_highLayerCompatibility.log();
TTCN_Logger::log_event_str(", reverseCallSetupDirection := ");
field_reverseCallSetupDirection.log();
TTCN_Logger::log_event_str(", networkInitiatedServiceUpgradeIndicator := ");
field_networkInitiatedServiceUpgradeIndicator.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Modify::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (bearerCapability().is_bound()) bearerCapability().set_implicit_omit();
if (!lowLayerCompatibility().is_bound()) lowLayerCompatibility() = OMIT_VALUE;
else lowLayerCompatibility().set_implicit_omit();
if (!highLayerCompatibility().is_bound()) highLayerCompatibility() = OMIT_VALUE;
else highLayerCompatibility().set_implicit_omit();
if (!reverseCallSetupDirection().is_bound()) reverseCallSetupDirection() = OMIT_VALUE;
else reverseCallSetupDirection().set_implicit_omit();
if (!networkInitiatedServiceUpgradeIndicator().is_bound()) networkInitiatedServiceUpgradeIndicator() = OMIT_VALUE;
else networkInitiatedServiceUpgradeIndicator().set_implicit_omit();
}

void PDU__ML3__Modify::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Modify has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bearerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) reverseCallSetupDirection().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) networkInitiatedServiceUpgradeIndicator().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bearerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reverseCallSetupDirection")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reverseCallSetupDirection().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkInitiatedServiceUpgradeIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkInitiatedServiceUpgradeIndicator().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_CC_Types.PDU_ML3_Modify: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Modify");
  }
}

void PDU__ML3__Modify::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_bearerCapability.encode_text(text_buf);
field_lowLayerCompatibility.encode_text(text_buf);
field_highLayerCompatibility.encode_text(text_buf);
field_reverseCallSetupDirection.encode_text(text_buf);
field_networkInitiatedServiceUpgradeIndicator.encode_text(text_buf);
}

void PDU__ML3__Modify::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_bearerCapability.decode_text(text_buf);
field_lowLayerCompatibility.decode_text(text_buf);
field_highLayerCompatibility.decode_text(text_buf);
field_reverseCallSetupDirection.decode_text(text_buf);
field_networkInitiatedServiceUpgradeIndicator.decode_text(text_buf);
}

void PDU__ML3__Modify::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__Modify::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__Modify::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, BearerCapability__LV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability.RAW_decode(BearerCapability__LV_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_lowLayerCompatibility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, LowLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_lowLayerCompatibility().RAW_decode(LowLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_lowLayerCompatibility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_lowLayerCompatibility.ispresent() || field_lowLayerCompatibility().elementIdentifier() !=  os_13){
  field_lowLayerCompatibility=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_lowLayerCompatibility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_highLayerCompatibility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, HighLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_highLayerCompatibility().RAW_decode(HighLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_highLayerCompatibility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_highLayerCompatibility.ispresent() || field_highLayerCompatibility().elementIdentifier() !=  os_14){
  field_highLayerCompatibility=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_highLayerCompatibility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_reverseCallSetupDirection = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, ReverseCallSetupDirection_descr_.raw->forceomit);
  decoded_field_length = field_reverseCallSetupDirection().RAW_decode(ReverseCallSetupDirection_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_reverseCallSetupDirection = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_reverseCallSetupDirection.ispresent() || field_reverseCallSetupDirection().elementIdentifier() !=  os_15){
  field_reverseCallSetupDirection=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_reverseCallSetupDirection=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_networkInitiatedServiceUpgradeIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, NetworkInitiatedServiceUpgradeIndicator_descr_.raw->forceomit);
  decoded_field_length = field_networkInitiatedServiceUpgradeIndicator().RAW_decode(NetworkInitiatedServiceUpgradeIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_networkInitiatedServiceUpgradeIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_networkInitiatedServiceUpgradeIndicator.ispresent() || field_networkInitiatedServiceUpgradeIndicator().elementIdentifier() !=  os_16){
  field_networkInitiatedServiceUpgradeIndicator=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_networkInitiatedServiceUpgradeIndicator=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__Modify::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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, BearerCapability__LV_descr_.raw);
  if (field_lowLayerCompatibility.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, LowLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_highLayerCompatibility.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, HighLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_reverseCallSetupDirection.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ReverseCallSetupDirection_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_networkInitiatedServiceUpgradeIndicator.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, NetworkInitiatedServiceUpgradeIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = 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_bearerCapability.RAW_encode(BearerCapability__LV_descr_, *myleaf.body.node.nodes[2]);
  if (field_lowLayerCompatibility.ispresent()) {
  encoded_length += field_lowLayerCompatibility().RAW_encode(LowLayerCompatibility_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_highLayerCompatibility.ispresent()) {
  encoded_length += field_highLayerCompatibility().RAW_encode(HighLayerCompatibility_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_reverseCallSetupDirection.ispresent()) {
  encoded_length += field_reverseCallSetupDirection().RAW_encode(ReverseCallSetupDirection_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_networkInitiatedServiceUpgradeIndicator.ispresent()) {
  encoded_length += field_networkInitiatedServiceUpgradeIndicator().RAW_encode(NetworkInitiatedServiceUpgradeIndicator_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_lowLayerCompatibility.ispresent() && (!field_lowLayerCompatibility.ispresent() || field_lowLayerCompatibility().elementIdentifier() !=  os_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){
   os_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_highLayerCompatibility.ispresent() && (!field_highLayerCompatibility.ispresent() || field_highLayerCompatibility().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_reverseCallSetupDirection.ispresent() && (!field_reverseCallSetupDirection.ispresent() || field_reverseCallSetupDirection().elementIdentifier() !=  os_15)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_15.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_networkInitiatedServiceUpgradeIndicator.ispresent() && (!field_networkInitiatedServiceUpgradeIndicator.ispresent() || field_networkInitiatedServiceUpgradeIndicator().elementIdentifier() !=  os_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){
   os_16.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__Modify_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
BearerCapability__LV_template field_bearerCapability;
LowLayerCompatibility_template field_lowLayerCompatibility;
HighLayerCompatibility_template field_highLayerCompatibility;
ReverseCallSetupDirection_template field_reverseCallSetupDirection;
NetworkInitiatedServiceUpgradeIndicator_template field_networkInitiatedServiceUpgradeIndicator;
};

void PDU__ML3__Modify_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_bearerCapability = ANY_VALUE;
single_value->field_lowLayerCompatibility = ANY_OR_OMIT;
single_value->field_highLayerCompatibility = ANY_OR_OMIT;
single_value->field_reverseCallSetupDirection = ANY_OR_OMIT;
single_value->field_networkInitiatedServiceUpgradeIndicator = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Modify_template::copy_value(const PDU__ML3__Modify& 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.bearerCapability().is_bound()) {
  single_value->field_bearerCapability = other_value.bearerCapability();
} else {
  single_value->field_bearerCapability.clean_up();
}
if (other_value.lowLayerCompatibility().is_bound()) {
  if (other_value.lowLayerCompatibility().ispresent()) single_value->field_lowLayerCompatibility = other_value.lowLayerCompatibility()();
  else single_value->field_lowLayerCompatibility = OMIT_VALUE;
} else {
  single_value->field_lowLayerCompatibility.clean_up();
}
if (other_value.highLayerCompatibility().is_bound()) {
  if (other_value.highLayerCompatibility().ispresent()) single_value->field_highLayerCompatibility = other_value.highLayerCompatibility()();
  else single_value->field_highLayerCompatibility = OMIT_VALUE;
} else {
  single_value->field_highLayerCompatibility.clean_up();
}
if (other_value.reverseCallSetupDirection().is_bound()) {
  if (other_value.reverseCallSetupDirection().ispresent()) single_value->field_reverseCallSetupDirection = other_value.reverseCallSetupDirection()();
  else single_value->field_reverseCallSetupDirection = OMIT_VALUE;
} else {
  single_value->field_reverseCallSetupDirection.clean_up();
}
if (other_value.networkInitiatedServiceUpgradeIndicator().is_bound()) {
  if (other_value.networkInitiatedServiceUpgradeIndicator().ispresent()) single_value->field_networkInitiatedServiceUpgradeIndicator = other_value.networkInitiatedServiceUpgradeIndicator()();
  else single_value->field_networkInitiatedServiceUpgradeIndicator = OMIT_VALUE;
} else {
  single_value->field_networkInitiatedServiceUpgradeIndicator.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Modify_template::copy_template(const PDU__ML3__Modify_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.bearerCapability().get_selection()) {
single_value->field_bearerCapability = other_value.bearerCapability();
} else {
single_value->field_bearerCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lowLayerCompatibility().get_selection()) {
single_value->field_lowLayerCompatibility = other_value.lowLayerCompatibility();
} else {
single_value->field_lowLayerCompatibility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.highLayerCompatibility().get_selection()) {
single_value->field_highLayerCompatibility = other_value.highLayerCompatibility();
} else {
single_value->field_highLayerCompatibility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reverseCallSetupDirection().get_selection()) {
single_value->field_reverseCallSetupDirection = other_value.reverseCallSetupDirection();
} else {
single_value->field_reverseCallSetupDirection.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkInitiatedServiceUpgradeIndicator().get_selection()) {
single_value->field_networkInitiatedServiceUpgradeIndicator = other_value.networkInitiatedServiceUpgradeIndicator();
} else {
single_value->field_networkInitiatedServiceUpgradeIndicator.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__Modify_template[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__Modify_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Modify_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_CC_Types.PDU_ML3_Modify.");
break;
}
set_selection(other_value);
}

PDU__ML3__Modify_template::PDU__ML3__Modify_template()
{
}

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

PDU__ML3__Modify_template::PDU__ML3__Modify_template(const PDU__ML3__Modify& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Modify_template::match(const PDU__ML3__Modify& 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.bearerCapability().is_bound()) return FALSE;
if(!single_value->field_bearerCapability.match(other_value.bearerCapability(), legacy))return FALSE;
if(!other_value.lowLayerCompatibility().is_bound()) return FALSE;
if((other_value.lowLayerCompatibility().ispresent() ? !single_value->field_lowLayerCompatibility.match((const LowLayerCompatibility&)other_value.lowLayerCompatibility(), legacy) : !single_value->field_lowLayerCompatibility.match_omit(legacy)))return FALSE;
if(!other_value.highLayerCompatibility().is_bound()) return FALSE;
if((other_value.highLayerCompatibility().ispresent() ? !single_value->field_highLayerCompatibility.match((const HighLayerCompatibility&)other_value.highLayerCompatibility(), legacy) : !single_value->field_highLayerCompatibility.match_omit(legacy)))return FALSE;
if(!other_value.reverseCallSetupDirection().is_bound()) return FALSE;
if((other_value.reverseCallSetupDirection().ispresent() ? !single_value->field_reverseCallSetupDirection.match((const ReverseCallSetupDirection&)other_value.reverseCallSetupDirection(), legacy) : !single_value->field_reverseCallSetupDirection.match_omit(legacy)))return FALSE;
if(!other_value.networkInitiatedServiceUpgradeIndicator().is_bound()) return FALSE;
if((other_value.networkInitiatedServiceUpgradeIndicator().ispresent() ? !single_value->field_networkInitiatedServiceUpgradeIndicator.match((const NetworkInitiatedServiceUpgradeIndicator&)other_value.networkInitiatedServiceUpgradeIndicator(), legacy) : !single_value->field_networkInitiatedServiceUpgradeIndicator.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_CC_Types.PDU_ML3_Modify.");
}
return FALSE;
}

boolean PDU__ML3__Modify_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_bearerCapability.is_bound()
 || (single_value->field_lowLayerCompatibility.is_omit() || single_value->field_lowLayerCompatibility.is_bound())
 || (single_value->field_highLayerCompatibility.is_omit() || single_value->field_highLayerCompatibility.is_bound())
 || (single_value->field_reverseCallSetupDirection.is_omit() || single_value->field_reverseCallSetupDirection.is_bound())
 || (single_value->field_networkInitiatedServiceUpgradeIndicator.is_omit() || single_value->field_networkInitiatedServiceUpgradeIndicator.is_bound());
}

boolean PDU__ML3__Modify_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_bearerCapability.is_value()
 && (single_value->field_lowLayerCompatibility.is_omit() || single_value->field_lowLayerCompatibility.is_value())
 && (single_value->field_highLayerCompatibility.is_omit() || single_value->field_highLayerCompatibility.is_value())
 && (single_value->field_reverseCallSetupDirection.is_omit() || single_value->field_reverseCallSetupDirection.is_value())
 && (single_value->field_networkInitiatedServiceUpgradeIndicator.is_omit() || single_value->field_networkInitiatedServiceUpgradeIndicator.is_value());
}

void PDU__ML3__Modify_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__Modify PDU__ML3__Modify_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_CC_Types.PDU_ML3_Modify.");
PDU__ML3__Modify 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_bearerCapability.is_bound()) {
ret_val.bearerCapability() = single_value->field_bearerCapability.valueof();
}
if (single_value->field_lowLayerCompatibility.is_omit()) ret_val.lowLayerCompatibility() = OMIT_VALUE;
else if (single_value->field_lowLayerCompatibility.is_bound()) {
ret_val.lowLayerCompatibility() = single_value->field_lowLayerCompatibility.valueof();
}
if (single_value->field_highLayerCompatibility.is_omit()) ret_val.highLayerCompatibility() = OMIT_VALUE;
else if (single_value->field_highLayerCompatibility.is_bound()) {
ret_val.highLayerCompatibility() = single_value->field_highLayerCompatibility.valueof();
}
if (single_value->field_reverseCallSetupDirection.is_omit()) ret_val.reverseCallSetupDirection() = OMIT_VALUE;
else if (single_value->field_reverseCallSetupDirection.is_bound()) {
ret_val.reverseCallSetupDirection() = single_value->field_reverseCallSetupDirection.valueof();
}
if (single_value->field_networkInitiatedServiceUpgradeIndicator.is_omit()) ret_val.networkInitiatedServiceUpgradeIndicator() = OMIT_VALUE;
else if (single_value->field_networkInitiatedServiceUpgradeIndicator.is_bound()) {
ret_val.networkInitiatedServiceUpgradeIndicator() = single_value->field_networkInitiatedServiceUpgradeIndicator.valueof();
}
return ret_val;
}

void PDU__ML3__Modify_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_CC_Types.PDU_ML3_Modify.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Modify_template[list_length];
}

PDU__ML3__Modify_template& PDU__ML3__Modify_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_CC_Types.PDU_ML3_Modify.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Modify.");
return value_list.list_value[list_index];
}

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

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

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

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

BearerCapability__LV_template& PDU__ML3__Modify_template::bearerCapability()
{
set_specific();
return single_value->field_bearerCapability;
}

const BearerCapability__LV_template& PDU__ML3__Modify_template::bearerCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Modify.");
return single_value->field_bearerCapability;
}

LowLayerCompatibility_template& PDU__ML3__Modify_template::lowLayerCompatibility()
{
set_specific();
return single_value->field_lowLayerCompatibility;
}

const LowLayerCompatibility_template& PDU__ML3__Modify_template::lowLayerCompatibility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lowLayerCompatibility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Modify.");
return single_value->field_lowLayerCompatibility;
}

HighLayerCompatibility_template& PDU__ML3__Modify_template::highLayerCompatibility()
{
set_specific();
return single_value->field_highLayerCompatibility;
}

const HighLayerCompatibility_template& PDU__ML3__Modify_template::highLayerCompatibility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field highLayerCompatibility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Modify.");
return single_value->field_highLayerCompatibility;
}

ReverseCallSetupDirection_template& PDU__ML3__Modify_template::reverseCallSetupDirection()
{
set_specific();
return single_value->field_reverseCallSetupDirection;
}

const ReverseCallSetupDirection_template& PDU__ML3__Modify_template::reverseCallSetupDirection() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reverseCallSetupDirection of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Modify.");
return single_value->field_reverseCallSetupDirection;
}

NetworkInitiatedServiceUpgradeIndicator_template& PDU__ML3__Modify_template::networkInitiatedServiceUpgradeIndicator()
{
set_specific();
return single_value->field_networkInitiatedServiceUpgradeIndicator;
}

const NetworkInitiatedServiceUpgradeIndicator_template& PDU__ML3__Modify_template::networkInitiatedServiceUpgradeIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkInitiatedServiceUpgradeIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Modify.");
return single_value->field_networkInitiatedServiceUpgradeIndicator;
}

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

void PDU__ML3__Modify_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(", bearerCapability := ");
single_value->field_bearerCapability.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility := ");
single_value->field_lowLayerCompatibility.log();
TTCN_Logger::log_event_str(", highLayerCompatibility := ");
single_value->field_highLayerCompatibility.log();
TTCN_Logger::log_event_str(", reverseCallSetupDirection := ");
single_value->field_reverseCallSetupDirection.log();
TTCN_Logger::log_event_str(", networkInitiatedServiceUpgradeIndicator := ");
single_value->field_networkInitiatedServiceUpgradeIndicator.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__Modify_template::log_match(const PDU__ML3__Modify& 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_bearerCapability.match(match_value.bearerCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability");
single_value->field_bearerCapability.log_match(match_value.bearerCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.lowLayerCompatibility().ispresent()){
if(!single_value->field_lowLayerCompatibility.match(match_value.lowLayerCompatibility(), legacy)){
TTCN_Logger::log_logmatch_info(".lowLayerCompatibility");
single_value->field_lowLayerCompatibility.log_match(match_value.lowLayerCompatibility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lowLayerCompatibility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lowLayerCompatibility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lowLayerCompatibility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.highLayerCompatibility().ispresent()){
if(!single_value->field_highLayerCompatibility.match(match_value.highLayerCompatibility(), legacy)){
TTCN_Logger::log_logmatch_info(".highLayerCompatibility");
single_value->field_highLayerCompatibility.log_match(match_value.highLayerCompatibility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_highLayerCompatibility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".highLayerCompatibility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_highLayerCompatibility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.reverseCallSetupDirection().ispresent()){
if(!single_value->field_reverseCallSetupDirection.match(match_value.reverseCallSetupDirection(), legacy)){
TTCN_Logger::log_logmatch_info(".reverseCallSetupDirection");
single_value->field_reverseCallSetupDirection.log_match(match_value.reverseCallSetupDirection(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_reverseCallSetupDirection.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".reverseCallSetupDirection := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_reverseCallSetupDirection.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkInitiatedServiceUpgradeIndicator().ispresent()){
if(!single_value->field_networkInitiatedServiceUpgradeIndicator.match(match_value.networkInitiatedServiceUpgradeIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".networkInitiatedServiceUpgradeIndicator");
single_value->field_networkInitiatedServiceUpgradeIndicator.log_match(match_value.networkInitiatedServiceUpgradeIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkInitiatedServiceUpgradeIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkInitiatedServiceUpgradeIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkInitiatedServiceUpgradeIndicator.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(", bearerCapability := ");
single_value->field_bearerCapability.log_match(match_value.bearerCapability(), legacy);
TTCN_Logger::log_event_str(", lowLayerCompatibility := ");
if (match_value.lowLayerCompatibility().ispresent()) {
single_value->field_lowLayerCompatibility.log_match(match_value.lowLayerCompatibility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lowLayerCompatibility.log();
if (single_value->field_lowLayerCompatibility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", highLayerCompatibility := ");
if (match_value.highLayerCompatibility().ispresent()) {
single_value->field_highLayerCompatibility.log_match(match_value.highLayerCompatibility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_highLayerCompatibility.log();
if (single_value->field_highLayerCompatibility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", reverseCallSetupDirection := ");
if (match_value.reverseCallSetupDirection().ispresent()) {
single_value->field_reverseCallSetupDirection.log_match(match_value.reverseCallSetupDirection(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_reverseCallSetupDirection.log();
if (single_value->field_reverseCallSetupDirection.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkInitiatedServiceUpgradeIndicator := ");
if (match_value.networkInitiatedServiceUpgradeIndicator().ispresent()) {
single_value->field_networkInitiatedServiceUpgradeIndicator.log_match(match_value.networkInitiatedServiceUpgradeIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkInitiatedServiceUpgradeIndicator.log();
if (single_value->field_networkInitiatedServiceUpgradeIndicator.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__Modify_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 (bearerCapability().is_bound()) bearerCapability().set_implicit_omit();
if (!lowLayerCompatibility().is_bound()) lowLayerCompatibility() = OMIT_VALUE;
else lowLayerCompatibility().set_implicit_omit();
if (!highLayerCompatibility().is_bound()) highLayerCompatibility() = OMIT_VALUE;
else highLayerCompatibility().set_implicit_omit();
if (!reverseCallSetupDirection().is_bound()) reverseCallSetupDirection() = OMIT_VALUE;
else reverseCallSetupDirection().set_implicit_omit();
if (!networkInitiatedServiceUpgradeIndicator().is_bound()) networkInitiatedServiceUpgradeIndicator() = OMIT_VALUE;
else networkInitiatedServiceUpgradeIndicator().set_implicit_omit();
}

void PDU__ML3__Modify_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_bearerCapability.encode_text(text_buf);
single_value->field_lowLayerCompatibility.encode_text(text_buf);
single_value->field_highLayerCompatibility.encode_text(text_buf);
single_value->field_reverseCallSetupDirection.encode_text(text_buf);
single_value->field_networkInitiatedServiceUpgradeIndicator.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_CC_Types.PDU_ML3_Modify.");
}
}

void PDU__ML3__Modify_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_bearerCapability.decode_text(text_buf);
single_value->field_lowLayerCompatibility.decode_text(text_buf);
single_value->field_highLayerCompatibility.decode_text(text_buf);
single_value->field_reverseCallSetupDirection.decode_text(text_buf);
single_value->field_networkInitiatedServiceUpgradeIndicator.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__Modify_template[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_CC_Types.PDU_ML3_Modify.");
}
}

void PDU__ML3__Modify_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__Modify_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Modify has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bearerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) reverseCallSetupDirection().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) networkInitiatedServiceUpgradeIndicator().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bearerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reverseCallSetupDirection")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reverseCallSetupDirection().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkInitiatedServiceUpgradeIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkInitiatedServiceUpgradeIndicator().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_CC_Types.PDU_ML3_Modify: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Modify_template* precondition = new PDU__ML3__Modify_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Modify_template* implied_template = new PDU__ML3__Modify_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Modify_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Modify");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Modify_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_CC_Types.PDU_ML3_Modify");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Modify");
single_value->field_bearerCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Modify");
single_value->field_lowLayerCompatibility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Modify");
single_value->field_highLayerCompatibility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Modify");
single_value->field_reverseCallSetupDirection.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Modify");
single_value->field_networkInitiatedServiceUpgradeIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Modify");
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_CC_Types.PDU_ML3_Modify");
}

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

boolean PDU__ML3__Modify_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__ModifyComplete::PDU__ML3__ModifyComplete()
{
}

PDU__ML3__ModifyComplete::PDU__ML3__ModifyComplete(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const BearerCapability__LV& par_bearerCapability,
    const OPTIONAL< LowLayerCompatibility >& par_lowLayerCompatibility,
    const OPTIONAL< HighLayerCompatibility >& par_highLayerCompatibility,
    const OPTIONAL< ReverseCallSetupDirection >& par_reverseCallSetupDirection)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_bearerCapability(par_bearerCapability),
  field_lowLayerCompatibility(par_lowLayerCompatibility),
  field_highLayerCompatibility(par_highLayerCompatibility),
  field_reverseCallSetupDirection(par_reverseCallSetupDirection)
{
}

PDU__ML3__ModifyComplete::PDU__ML3__ModifyComplete(const PDU__ML3__ModifyComplete& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_ModifyComplete.");
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.bearerCapability().is_bound()) field_bearerCapability = other_value.bearerCapability();
else field_bearerCapability.clean_up();
if (other_value.lowLayerCompatibility().is_bound()) field_lowLayerCompatibility = other_value.lowLayerCompatibility();
else field_lowLayerCompatibility.clean_up();
if (other_value.highLayerCompatibility().is_bound()) field_highLayerCompatibility = other_value.highLayerCompatibility();
else field_highLayerCompatibility.clean_up();
if (other_value.reverseCallSetupDirection().is_bound()) field_reverseCallSetupDirection = other_value.reverseCallSetupDirection();
else field_reverseCallSetupDirection.clean_up();
}

void PDU__ML3__ModifyComplete::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_bearerCapability.clean_up();
field_lowLayerCompatibility.clean_up();
field_highLayerCompatibility.clean_up();
field_reverseCallSetupDirection.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__ModifyComplete::get_descriptor() const { return &PDU__ML3__ModifyComplete_descr_; }
PDU__ML3__ModifyComplete& PDU__ML3__ModifyComplete::operator=(const PDU__ML3__ModifyComplete& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_ModifyComplete.");
  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.bearerCapability().is_bound()) field_bearerCapability = other_value.bearerCapability();
  else field_bearerCapability.clean_up();
  if (other_value.lowLayerCompatibility().is_bound()) field_lowLayerCompatibility = other_value.lowLayerCompatibility();
  else field_lowLayerCompatibility.clean_up();
  if (other_value.highLayerCompatibility().is_bound()) field_highLayerCompatibility = other_value.highLayerCompatibility();
  else field_highLayerCompatibility.clean_up();
  if (other_value.reverseCallSetupDirection().is_bound()) field_reverseCallSetupDirection = other_value.reverseCallSetupDirection();
  else field_reverseCallSetupDirection.clean_up();
}
return *this;
}

boolean PDU__ML3__ModifyComplete::operator==(const PDU__ML3__ModifyComplete& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_bearerCapability==other_value.field_bearerCapability
  && field_lowLayerCompatibility==other_value.field_lowLayerCompatibility
  && field_highLayerCompatibility==other_value.field_highLayerCompatibility
  && field_reverseCallSetupDirection==other_value.field_reverseCallSetupDirection;
}

boolean PDU__ML3__ModifyComplete::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_bearerCapability.is_bound())
  || (OPTIONAL_OMIT == field_lowLayerCompatibility.get_selection() || field_lowLayerCompatibility.is_bound())
  || (OPTIONAL_OMIT == field_highLayerCompatibility.get_selection() || field_highLayerCompatibility.is_bound())
  || (OPTIONAL_OMIT == field_reverseCallSetupDirection.get_selection() || field_reverseCallSetupDirection.is_bound());
}
boolean PDU__ML3__ModifyComplete::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_bearerCapability.is_value()
  && (OPTIONAL_OMIT == field_lowLayerCompatibility.get_selection() || field_lowLayerCompatibility.is_value())
  && (OPTIONAL_OMIT == field_highLayerCompatibility.get_selection() || field_highLayerCompatibility.is_value())
  && (OPTIONAL_OMIT == field_reverseCallSetupDirection.get_selection() || field_reverseCallSetupDirection.is_value());
}
int PDU__ML3__ModifyComplete::size_of() const
{
  int ret_val = 3;
  if (field_lowLayerCompatibility.ispresent()) ret_val++;
  if (field_highLayerCompatibility.ispresent()) ret_val++;
  if (field_reverseCallSetupDirection.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__ModifyComplete::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(", bearerCapability := ");
field_bearerCapability.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility := ");
field_lowLayerCompatibility.log();
TTCN_Logger::log_event_str(", highLayerCompatibility := ");
field_highLayerCompatibility.log();
TTCN_Logger::log_event_str(", reverseCallSetupDirection := ");
field_reverseCallSetupDirection.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__ModifyComplete::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (bearerCapability().is_bound()) bearerCapability().set_implicit_omit();
if (!lowLayerCompatibility().is_bound()) lowLayerCompatibility() = OMIT_VALUE;
else lowLayerCompatibility().set_implicit_omit();
if (!highLayerCompatibility().is_bound()) highLayerCompatibility() = OMIT_VALUE;
else highLayerCompatibility().set_implicit_omit();
if (!reverseCallSetupDirection().is_bound()) reverseCallSetupDirection() = OMIT_VALUE;
else reverseCallSetupDirection().set_implicit_omit();
}

void PDU__ML3__ModifyComplete::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_ModifyComplete has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bearerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) reverseCallSetupDirection().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bearerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reverseCallSetupDirection")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reverseCallSetupDirection().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_CC_Types.PDU_ML3_ModifyComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_ModifyComplete");
  }
}

void PDU__ML3__ModifyComplete::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_bearerCapability.encode_text(text_buf);
field_lowLayerCompatibility.encode_text(text_buf);
field_highLayerCompatibility.encode_text(text_buf);
field_reverseCallSetupDirection.encode_text(text_buf);
}

void PDU__ML3__ModifyComplete::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_bearerCapability.decode_text(text_buf);
field_lowLayerCompatibility.decode_text(text_buf);
field_highLayerCompatibility.decode_text(text_buf);
field_reverseCallSetupDirection.decode_text(text_buf);
}

void PDU__ML3__ModifyComplete::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__ModifyComplete::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__ModifyComplete::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, BearerCapability__LV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability.RAW_decode(BearerCapability__LV_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_lowLayerCompatibility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, LowLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_lowLayerCompatibility().RAW_decode(LowLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_lowLayerCompatibility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_lowLayerCompatibility.ispresent() || field_lowLayerCompatibility().elementIdentifier() !=  os_13){
  field_lowLayerCompatibility=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_lowLayerCompatibility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_highLayerCompatibility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, HighLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_highLayerCompatibility().RAW_decode(HighLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_highLayerCompatibility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_highLayerCompatibility.ispresent() || field_highLayerCompatibility().elementIdentifier() !=  os_14){
  field_highLayerCompatibility=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_highLayerCompatibility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_reverseCallSetupDirection = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, ReverseCallSetupDirection_descr_.raw->forceomit);
  decoded_field_length = field_reverseCallSetupDirection().RAW_decode(ReverseCallSetupDirection_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_reverseCallSetupDirection = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_reverseCallSetupDirection.ispresent() || field_reverseCallSetupDirection().elementIdentifier() !=  os_15){
  field_reverseCallSetupDirection=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_reverseCallSetupDirection=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__ModifyComplete::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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, BearerCapability__LV_descr_.raw);
  if (field_lowLayerCompatibility.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, LowLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_highLayerCompatibility.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, HighLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_reverseCallSetupDirection.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ReverseCallSetupDirection_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = 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_bearerCapability.RAW_encode(BearerCapability__LV_descr_, *myleaf.body.node.nodes[2]);
  if (field_lowLayerCompatibility.ispresent()) {
  encoded_length += field_lowLayerCompatibility().RAW_encode(LowLayerCompatibility_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_highLayerCompatibility.ispresent()) {
  encoded_length += field_highLayerCompatibility().RAW_encode(HighLayerCompatibility_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_reverseCallSetupDirection.ispresent()) {
  encoded_length += field_reverseCallSetupDirection().RAW_encode(ReverseCallSetupDirection_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_lowLayerCompatibility.ispresent() && (!field_lowLayerCompatibility.ispresent() || field_lowLayerCompatibility().elementIdentifier() !=  os_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){
   os_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_highLayerCompatibility.ispresent() && (!field_highLayerCompatibility.ispresent() || field_highLayerCompatibility().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_reverseCallSetupDirection.ispresent() && (!field_reverseCallSetupDirection.ispresent() || field_reverseCallSetupDirection().elementIdentifier() !=  os_15)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_15.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__ModifyComplete_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
BearerCapability__LV_template field_bearerCapability;
LowLayerCompatibility_template field_lowLayerCompatibility;
HighLayerCompatibility_template field_highLayerCompatibility;
ReverseCallSetupDirection_template field_reverseCallSetupDirection;
};

void PDU__ML3__ModifyComplete_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_bearerCapability = ANY_VALUE;
single_value->field_lowLayerCompatibility = ANY_OR_OMIT;
single_value->field_highLayerCompatibility = ANY_OR_OMIT;
single_value->field_reverseCallSetupDirection = ANY_OR_OMIT;
}
}
}

void PDU__ML3__ModifyComplete_template::copy_value(const PDU__ML3__ModifyComplete& 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.bearerCapability().is_bound()) {
  single_value->field_bearerCapability = other_value.bearerCapability();
} else {
  single_value->field_bearerCapability.clean_up();
}
if (other_value.lowLayerCompatibility().is_bound()) {
  if (other_value.lowLayerCompatibility().ispresent()) single_value->field_lowLayerCompatibility = other_value.lowLayerCompatibility()();
  else single_value->field_lowLayerCompatibility = OMIT_VALUE;
} else {
  single_value->field_lowLayerCompatibility.clean_up();
}
if (other_value.highLayerCompatibility().is_bound()) {
  if (other_value.highLayerCompatibility().ispresent()) single_value->field_highLayerCompatibility = other_value.highLayerCompatibility()();
  else single_value->field_highLayerCompatibility = OMIT_VALUE;
} else {
  single_value->field_highLayerCompatibility.clean_up();
}
if (other_value.reverseCallSetupDirection().is_bound()) {
  if (other_value.reverseCallSetupDirection().ispresent()) single_value->field_reverseCallSetupDirection = other_value.reverseCallSetupDirection()();
  else single_value->field_reverseCallSetupDirection = OMIT_VALUE;
} else {
  single_value->field_reverseCallSetupDirection.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__ModifyComplete_template::copy_template(const PDU__ML3__ModifyComplete_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.bearerCapability().get_selection()) {
single_value->field_bearerCapability = other_value.bearerCapability();
} else {
single_value->field_bearerCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lowLayerCompatibility().get_selection()) {
single_value->field_lowLayerCompatibility = other_value.lowLayerCompatibility();
} else {
single_value->field_lowLayerCompatibility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.highLayerCompatibility().get_selection()) {
single_value->field_highLayerCompatibility = other_value.highLayerCompatibility();
} else {
single_value->field_highLayerCompatibility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reverseCallSetupDirection().get_selection()) {
single_value->field_reverseCallSetupDirection = other_value.reverseCallSetupDirection();
} else {
single_value->field_reverseCallSetupDirection.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__ModifyComplete_template[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__ModifyComplete_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__ModifyComplete_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_CC_Types.PDU_ML3_ModifyComplete.");
break;
}
set_selection(other_value);
}

PDU__ML3__ModifyComplete_template::PDU__ML3__ModifyComplete_template()
{
}

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

PDU__ML3__ModifyComplete_template::PDU__ML3__ModifyComplete_template(const PDU__ML3__ModifyComplete& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__ModifyComplete_template::match(const PDU__ML3__ModifyComplete& 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.bearerCapability().is_bound()) return FALSE;
if(!single_value->field_bearerCapability.match(other_value.bearerCapability(), legacy))return FALSE;
if(!other_value.lowLayerCompatibility().is_bound()) return FALSE;
if((other_value.lowLayerCompatibility().ispresent() ? !single_value->field_lowLayerCompatibility.match((const LowLayerCompatibility&)other_value.lowLayerCompatibility(), legacy) : !single_value->field_lowLayerCompatibility.match_omit(legacy)))return FALSE;
if(!other_value.highLayerCompatibility().is_bound()) return FALSE;
if((other_value.highLayerCompatibility().ispresent() ? !single_value->field_highLayerCompatibility.match((const HighLayerCompatibility&)other_value.highLayerCompatibility(), legacy) : !single_value->field_highLayerCompatibility.match_omit(legacy)))return FALSE;
if(!other_value.reverseCallSetupDirection().is_bound()) return FALSE;
if((other_value.reverseCallSetupDirection().ispresent() ? !single_value->field_reverseCallSetupDirection.match((const ReverseCallSetupDirection&)other_value.reverseCallSetupDirection(), legacy) : !single_value->field_reverseCallSetupDirection.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_CC_Types.PDU_ML3_ModifyComplete.");
}
return FALSE;
}

boolean PDU__ML3__ModifyComplete_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_bearerCapability.is_bound()
 || (single_value->field_lowLayerCompatibility.is_omit() || single_value->field_lowLayerCompatibility.is_bound())
 || (single_value->field_highLayerCompatibility.is_omit() || single_value->field_highLayerCompatibility.is_bound())
 || (single_value->field_reverseCallSetupDirection.is_omit() || single_value->field_reverseCallSetupDirection.is_bound());
}

boolean PDU__ML3__ModifyComplete_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_bearerCapability.is_value()
 && (single_value->field_lowLayerCompatibility.is_omit() || single_value->field_lowLayerCompatibility.is_value())
 && (single_value->field_highLayerCompatibility.is_omit() || single_value->field_highLayerCompatibility.is_value())
 && (single_value->field_reverseCallSetupDirection.is_omit() || single_value->field_reverseCallSetupDirection.is_value());
}

void PDU__ML3__ModifyComplete_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__ModifyComplete PDU__ML3__ModifyComplete_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_CC_Types.PDU_ML3_ModifyComplete.");
PDU__ML3__ModifyComplete 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_bearerCapability.is_bound()) {
ret_val.bearerCapability() = single_value->field_bearerCapability.valueof();
}
if (single_value->field_lowLayerCompatibility.is_omit()) ret_val.lowLayerCompatibility() = OMIT_VALUE;
else if (single_value->field_lowLayerCompatibility.is_bound()) {
ret_val.lowLayerCompatibility() = single_value->field_lowLayerCompatibility.valueof();
}
if (single_value->field_highLayerCompatibility.is_omit()) ret_val.highLayerCompatibility() = OMIT_VALUE;
else if (single_value->field_highLayerCompatibility.is_bound()) {
ret_val.highLayerCompatibility() = single_value->field_highLayerCompatibility.valueof();
}
if (single_value->field_reverseCallSetupDirection.is_omit()) ret_val.reverseCallSetupDirection() = OMIT_VALUE;
else if (single_value->field_reverseCallSetupDirection.is_bound()) {
ret_val.reverseCallSetupDirection() = single_value->field_reverseCallSetupDirection.valueof();
}
return ret_val;
}

void PDU__ML3__ModifyComplete_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_CC_Types.PDU_ML3_ModifyComplete.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__ModifyComplete_template[list_length];
}

PDU__ML3__ModifyComplete_template& PDU__ML3__ModifyComplete_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_CC_Types.PDU_ML3_ModifyComplete.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_ModifyComplete.");
return value_list.list_value[list_index];
}

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

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

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

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

BearerCapability__LV_template& PDU__ML3__ModifyComplete_template::bearerCapability()
{
set_specific();
return single_value->field_bearerCapability;
}

const BearerCapability__LV_template& PDU__ML3__ModifyComplete_template::bearerCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ModifyComplete.");
return single_value->field_bearerCapability;
}

LowLayerCompatibility_template& PDU__ML3__ModifyComplete_template::lowLayerCompatibility()
{
set_specific();
return single_value->field_lowLayerCompatibility;
}

const LowLayerCompatibility_template& PDU__ML3__ModifyComplete_template::lowLayerCompatibility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lowLayerCompatibility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ModifyComplete.");
return single_value->field_lowLayerCompatibility;
}

HighLayerCompatibility_template& PDU__ML3__ModifyComplete_template::highLayerCompatibility()
{
set_specific();
return single_value->field_highLayerCompatibility;
}

const HighLayerCompatibility_template& PDU__ML3__ModifyComplete_template::highLayerCompatibility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field highLayerCompatibility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ModifyComplete.");
return single_value->field_highLayerCompatibility;
}

ReverseCallSetupDirection_template& PDU__ML3__ModifyComplete_template::reverseCallSetupDirection()
{
set_specific();
return single_value->field_reverseCallSetupDirection;
}

const ReverseCallSetupDirection_template& PDU__ML3__ModifyComplete_template::reverseCallSetupDirection() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reverseCallSetupDirection of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ModifyComplete.");
return single_value->field_reverseCallSetupDirection;
}

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

void PDU__ML3__ModifyComplete_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(", bearerCapability := ");
single_value->field_bearerCapability.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility := ");
single_value->field_lowLayerCompatibility.log();
TTCN_Logger::log_event_str(", highLayerCompatibility := ");
single_value->field_highLayerCompatibility.log();
TTCN_Logger::log_event_str(", reverseCallSetupDirection := ");
single_value->field_reverseCallSetupDirection.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__ModifyComplete_template::log_match(const PDU__ML3__ModifyComplete& 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_bearerCapability.match(match_value.bearerCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability");
single_value->field_bearerCapability.log_match(match_value.bearerCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.lowLayerCompatibility().ispresent()){
if(!single_value->field_lowLayerCompatibility.match(match_value.lowLayerCompatibility(), legacy)){
TTCN_Logger::log_logmatch_info(".lowLayerCompatibility");
single_value->field_lowLayerCompatibility.log_match(match_value.lowLayerCompatibility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lowLayerCompatibility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lowLayerCompatibility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lowLayerCompatibility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.highLayerCompatibility().ispresent()){
if(!single_value->field_highLayerCompatibility.match(match_value.highLayerCompatibility(), legacy)){
TTCN_Logger::log_logmatch_info(".highLayerCompatibility");
single_value->field_highLayerCompatibility.log_match(match_value.highLayerCompatibility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_highLayerCompatibility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".highLayerCompatibility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_highLayerCompatibility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.reverseCallSetupDirection().ispresent()){
if(!single_value->field_reverseCallSetupDirection.match(match_value.reverseCallSetupDirection(), legacy)){
TTCN_Logger::log_logmatch_info(".reverseCallSetupDirection");
single_value->field_reverseCallSetupDirection.log_match(match_value.reverseCallSetupDirection(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_reverseCallSetupDirection.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".reverseCallSetupDirection := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_reverseCallSetupDirection.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(", bearerCapability := ");
single_value->field_bearerCapability.log_match(match_value.bearerCapability(), legacy);
TTCN_Logger::log_event_str(", lowLayerCompatibility := ");
if (match_value.lowLayerCompatibility().ispresent()) {
single_value->field_lowLayerCompatibility.log_match(match_value.lowLayerCompatibility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lowLayerCompatibility.log();
if (single_value->field_lowLayerCompatibility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", highLayerCompatibility := ");
if (match_value.highLayerCompatibility().ispresent()) {
single_value->field_highLayerCompatibility.log_match(match_value.highLayerCompatibility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_highLayerCompatibility.log();
if (single_value->field_highLayerCompatibility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", reverseCallSetupDirection := ");
if (match_value.reverseCallSetupDirection().ispresent()) {
single_value->field_reverseCallSetupDirection.log_match(match_value.reverseCallSetupDirection(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_reverseCallSetupDirection.log();
if (single_value->field_reverseCallSetupDirection.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__ModifyComplete_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 (bearerCapability().is_bound()) bearerCapability().set_implicit_omit();
if (!lowLayerCompatibility().is_bound()) lowLayerCompatibility() = OMIT_VALUE;
else lowLayerCompatibility().set_implicit_omit();
if (!highLayerCompatibility().is_bound()) highLayerCompatibility() = OMIT_VALUE;
else highLayerCompatibility().set_implicit_omit();
if (!reverseCallSetupDirection().is_bound()) reverseCallSetupDirection() = OMIT_VALUE;
else reverseCallSetupDirection().set_implicit_omit();
}

void PDU__ML3__ModifyComplete_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_bearerCapability.encode_text(text_buf);
single_value->field_lowLayerCompatibility.encode_text(text_buf);
single_value->field_highLayerCompatibility.encode_text(text_buf);
single_value->field_reverseCallSetupDirection.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_CC_Types.PDU_ML3_ModifyComplete.");
}
}

void PDU__ML3__ModifyComplete_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_bearerCapability.decode_text(text_buf);
single_value->field_lowLayerCompatibility.decode_text(text_buf);
single_value->field_highLayerCompatibility.decode_text(text_buf);
single_value->field_reverseCallSetupDirection.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__ModifyComplete_template[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_CC_Types.PDU_ML3_ModifyComplete.");
}
}

void PDU__ML3__ModifyComplete_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__ModifyComplete_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_ModifyComplete has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bearerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) reverseCallSetupDirection().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bearerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reverseCallSetupDirection")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reverseCallSetupDirection().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_CC_Types.PDU_ML3_ModifyComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__ModifyComplete_template* precondition = new PDU__ML3__ModifyComplete_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__ModifyComplete_template* implied_template = new PDU__ML3__ModifyComplete_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__ModifyComplete_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_ModifyComplete");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__ModifyComplete_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_CC_Types.PDU_ML3_ModifyComplete");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyComplete");
single_value->field_bearerCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyComplete");
single_value->field_lowLayerCompatibility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyComplete");
single_value->field_highLayerCompatibility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyComplete");
single_value->field_reverseCallSetupDirection.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyComplete");
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_CC_Types.PDU_ML3_ModifyComplete");
}

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

boolean PDU__ML3__ModifyComplete_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__ModifyReject::PDU__ML3__ModifyReject()
{
}

PDU__ML3__ModifyReject::PDU__ML3__ModifyReject(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const BearerCapability__LV& par_bearerCapability,
    const MobileL3__CommonIE__Types::ML3__Cause__LV& par_cause,
    const OPTIONAL< LowLayerCompatibility >& par_lowLayerCompatibility,
    const OPTIONAL< HighLayerCompatibility >& par_highLayerCompatibility)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_bearerCapability(par_bearerCapability),
  field_cause(par_cause),
  field_lowLayerCompatibility(par_lowLayerCompatibility),
  field_highLayerCompatibility(par_highLayerCompatibility)
{
}

PDU__ML3__ModifyReject::PDU__ML3__ModifyReject(const PDU__ML3__ModifyReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_ModifyReject.");
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.bearerCapability().is_bound()) field_bearerCapability = other_value.bearerCapability();
else field_bearerCapability.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.lowLayerCompatibility().is_bound()) field_lowLayerCompatibility = other_value.lowLayerCompatibility();
else field_lowLayerCompatibility.clean_up();
if (other_value.highLayerCompatibility().is_bound()) field_highLayerCompatibility = other_value.highLayerCompatibility();
else field_highLayerCompatibility.clean_up();
}

void PDU__ML3__ModifyReject::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_bearerCapability.clean_up();
field_cause.clean_up();
field_lowLayerCompatibility.clean_up();
field_highLayerCompatibility.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__ModifyReject::get_descriptor() const { return &PDU__ML3__ModifyReject_descr_; }
PDU__ML3__ModifyReject& PDU__ML3__ModifyReject::operator=(const PDU__ML3__ModifyReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_ModifyReject.");
  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.bearerCapability().is_bound()) field_bearerCapability = other_value.bearerCapability();
  else field_bearerCapability.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.lowLayerCompatibility().is_bound()) field_lowLayerCompatibility = other_value.lowLayerCompatibility();
  else field_lowLayerCompatibility.clean_up();
  if (other_value.highLayerCompatibility().is_bound()) field_highLayerCompatibility = other_value.highLayerCompatibility();
  else field_highLayerCompatibility.clean_up();
}
return *this;
}

boolean PDU__ML3__ModifyReject::operator==(const PDU__ML3__ModifyReject& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_bearerCapability==other_value.field_bearerCapability
  && field_cause==other_value.field_cause
  && field_lowLayerCompatibility==other_value.field_lowLayerCompatibility
  && field_highLayerCompatibility==other_value.field_highLayerCompatibility;
}

boolean PDU__ML3__ModifyReject::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (field_bearerCapability.is_bound())
  || (field_cause.is_bound())
  || (OPTIONAL_OMIT == field_lowLayerCompatibility.get_selection() || field_lowLayerCompatibility.is_bound())
  || (OPTIONAL_OMIT == field_highLayerCompatibility.get_selection() || field_highLayerCompatibility.is_bound());
}
boolean PDU__ML3__ModifyReject::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && field_bearerCapability.is_value()
  && field_cause.is_value()
  && (OPTIONAL_OMIT == field_lowLayerCompatibility.get_selection() || field_lowLayerCompatibility.is_value())
  && (OPTIONAL_OMIT == field_highLayerCompatibility.get_selection() || field_highLayerCompatibility.is_value());
}
int PDU__ML3__ModifyReject::size_of() const
{
  int ret_val = 4;
  if (field_lowLayerCompatibility.ispresent()) ret_val++;
  if (field_highLayerCompatibility.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__ModifyReject::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(", bearerCapability := ");
field_bearerCapability.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility := ");
field_lowLayerCompatibility.log();
TTCN_Logger::log_event_str(", highLayerCompatibility := ");
field_highLayerCompatibility.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__ModifyReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (bearerCapability().is_bound()) bearerCapability().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (!lowLayerCompatibility().is_bound()) lowLayerCompatibility() = OMIT_VALUE;
else lowLayerCompatibility().set_implicit_omit();
if (!highLayerCompatibility().is_bound()) highLayerCompatibility() = OMIT_VALUE;
else highLayerCompatibility().set_implicit_omit();
}

void PDU__ML3__ModifyReject::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_ModifyReject has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bearerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bearerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility().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_CC_Types.PDU_ML3_ModifyReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_ModifyReject");
  }
}

void PDU__ML3__ModifyReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_bearerCapability.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_lowLayerCompatibility.encode_text(text_buf);
field_highLayerCompatibility.encode_text(text_buf);
}

void PDU__ML3__ModifyReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_bearerCapability.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_lowLayerCompatibility.decode_text(text_buf);
field_highLayerCompatibility.decode_text(text_buf);
}

void PDU__ML3__ModifyReject::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__ModifyReject::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__ModifyReject::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, BearerCapability__LV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability.RAW_decode(BearerCapability__LV_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::ML3__Cause__LV_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__LV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_lowLayerCompatibility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, LowLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_lowLayerCompatibility().RAW_decode(LowLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_lowLayerCompatibility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_lowLayerCompatibility.ispresent() || field_lowLayerCompatibility().elementIdentifier() !=  os_13){
  field_lowLayerCompatibility=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_lowLayerCompatibility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_highLayerCompatibility = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, HighLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_highLayerCompatibility().RAW_decode(HighLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_highLayerCompatibility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_highLayerCompatibility.ispresent() || field_highLayerCompatibility().elementIdentifier() !=  os_14){
  field_highLayerCompatibility=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_highLayerCompatibility=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__ModifyReject::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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, BearerCapability__LV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::ML3__Cause__LV_descr_.raw);
  if (field_lowLayerCompatibility.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, LowLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_highLayerCompatibility.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, HighLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = 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_bearerCapability.RAW_encode(BearerCapability__LV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cause.RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__LV_descr_, *myleaf.body.node.nodes[3]);
  if (field_lowLayerCompatibility.ispresent()) {
  encoded_length += field_lowLayerCompatibility().RAW_encode(LowLayerCompatibility_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_highLayerCompatibility.ispresent()) {
  encoded_length += field_highLayerCompatibility().RAW_encode(HighLayerCompatibility_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_lowLayerCompatibility.ispresent() && (!field_lowLayerCompatibility.ispresent() || field_lowLayerCompatibility().elementIdentifier() !=  os_13)) {
  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_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_highLayerCompatibility.ispresent() && (!field_highLayerCompatibility.ispresent() || field_highLayerCompatibility().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__ModifyReject_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
BearerCapability__LV_template field_bearerCapability;
MobileL3__CommonIE__Types::ML3__Cause__LV_template field_cause;
LowLayerCompatibility_template field_lowLayerCompatibility;
HighLayerCompatibility_template field_highLayerCompatibility;
};

void PDU__ML3__ModifyReject_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_bearerCapability = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
single_value->field_lowLayerCompatibility = ANY_OR_OMIT;
single_value->field_highLayerCompatibility = ANY_OR_OMIT;
}
}
}

void PDU__ML3__ModifyReject_template::copy_value(const PDU__ML3__ModifyReject& 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.bearerCapability().is_bound()) {
  single_value->field_bearerCapability = other_value.bearerCapability();
} else {
  single_value->field_bearerCapability.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.lowLayerCompatibility().is_bound()) {
  if (other_value.lowLayerCompatibility().ispresent()) single_value->field_lowLayerCompatibility = other_value.lowLayerCompatibility()();
  else single_value->field_lowLayerCompatibility = OMIT_VALUE;
} else {
  single_value->field_lowLayerCompatibility.clean_up();
}
if (other_value.highLayerCompatibility().is_bound()) {
  if (other_value.highLayerCompatibility().ispresent()) single_value->field_highLayerCompatibility = other_value.highLayerCompatibility()();
  else single_value->field_highLayerCompatibility = OMIT_VALUE;
} else {
  single_value->field_highLayerCompatibility.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__ModifyReject_template::copy_template(const PDU__ML3__ModifyReject_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.bearerCapability().get_selection()) {
single_value->field_bearerCapability = other_value.bearerCapability();
} else {
single_value->field_bearerCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lowLayerCompatibility().get_selection()) {
single_value->field_lowLayerCompatibility = other_value.lowLayerCompatibility();
} else {
single_value->field_lowLayerCompatibility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.highLayerCompatibility().get_selection()) {
single_value->field_highLayerCompatibility = other_value.highLayerCompatibility();
} else {
single_value->field_highLayerCompatibility.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__ModifyReject_template[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__ModifyReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__ModifyReject_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_CC_Types.PDU_ML3_ModifyReject.");
break;
}
set_selection(other_value);
}

PDU__ML3__ModifyReject_template::PDU__ML3__ModifyReject_template()
{
}

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

PDU__ML3__ModifyReject_template::PDU__ML3__ModifyReject_template(const PDU__ML3__ModifyReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__ModifyReject_template::match(const PDU__ML3__ModifyReject& 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.bearerCapability().is_bound()) return FALSE;
if(!single_value->field_bearerCapability.match(other_value.bearerCapability(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.lowLayerCompatibility().is_bound()) return FALSE;
if((other_value.lowLayerCompatibility().ispresent() ? !single_value->field_lowLayerCompatibility.match((const LowLayerCompatibility&)other_value.lowLayerCompatibility(), legacy) : !single_value->field_lowLayerCompatibility.match_omit(legacy)))return FALSE;
if(!other_value.highLayerCompatibility().is_bound()) return FALSE;
if((other_value.highLayerCompatibility().ispresent() ? !single_value->field_highLayerCompatibility.match((const HighLayerCompatibility&)other_value.highLayerCompatibility(), legacy) : !single_value->field_highLayerCompatibility.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_CC_Types.PDU_ML3_ModifyReject.");
}
return FALSE;
}

boolean PDU__ML3__ModifyReject_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_bearerCapability.is_bound()
 || single_value->field_cause.is_bound()
 || (single_value->field_lowLayerCompatibility.is_omit() || single_value->field_lowLayerCompatibility.is_bound())
 || (single_value->field_highLayerCompatibility.is_omit() || single_value->field_highLayerCompatibility.is_bound());
}

boolean PDU__ML3__ModifyReject_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_bearerCapability.is_value()
 && single_value->field_cause.is_value()
 && (single_value->field_lowLayerCompatibility.is_omit() || single_value->field_lowLayerCompatibility.is_value())
 && (single_value->field_highLayerCompatibility.is_omit() || single_value->field_highLayerCompatibility.is_value());
}

void PDU__ML3__ModifyReject_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__ModifyReject PDU__ML3__ModifyReject_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_CC_Types.PDU_ML3_ModifyReject.");
PDU__ML3__ModifyReject 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_bearerCapability.is_bound()) {
ret_val.bearerCapability() = single_value->field_bearerCapability.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_lowLayerCompatibility.is_omit()) ret_val.lowLayerCompatibility() = OMIT_VALUE;
else if (single_value->field_lowLayerCompatibility.is_bound()) {
ret_val.lowLayerCompatibility() = single_value->field_lowLayerCompatibility.valueof();
}
if (single_value->field_highLayerCompatibility.is_omit()) ret_val.highLayerCompatibility() = OMIT_VALUE;
else if (single_value->field_highLayerCompatibility.is_bound()) {
ret_val.highLayerCompatibility() = single_value->field_highLayerCompatibility.valueof();
}
return ret_val;
}

void PDU__ML3__ModifyReject_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_CC_Types.PDU_ML3_ModifyReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__ModifyReject_template[list_length];
}

PDU__ML3__ModifyReject_template& PDU__ML3__ModifyReject_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_CC_Types.PDU_ML3_ModifyReject.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_ModifyReject.");
return value_list.list_value[list_index];
}

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

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

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

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

BearerCapability__LV_template& PDU__ML3__ModifyReject_template::bearerCapability()
{
set_specific();
return single_value->field_bearerCapability;
}

const BearerCapability__LV_template& PDU__ML3__ModifyReject_template::bearerCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ModifyReject.");
return single_value->field_bearerCapability;
}

MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__ModifyReject_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__ModifyReject_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ModifyReject.");
return single_value->field_cause;
}

LowLayerCompatibility_template& PDU__ML3__ModifyReject_template::lowLayerCompatibility()
{
set_specific();
return single_value->field_lowLayerCompatibility;
}

const LowLayerCompatibility_template& PDU__ML3__ModifyReject_template::lowLayerCompatibility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lowLayerCompatibility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ModifyReject.");
return single_value->field_lowLayerCompatibility;
}

HighLayerCompatibility_template& PDU__ML3__ModifyReject_template::highLayerCompatibility()
{
set_specific();
return single_value->field_highLayerCompatibility;
}

const HighLayerCompatibility_template& PDU__ML3__ModifyReject_template::highLayerCompatibility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field highLayerCompatibility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ModifyReject.");
return single_value->field_highLayerCompatibility;
}

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

void PDU__ML3__ModifyReject_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(", bearerCapability := ");
single_value->field_bearerCapability.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility := ");
single_value->field_lowLayerCompatibility.log();
TTCN_Logger::log_event_str(", highLayerCompatibility := ");
single_value->field_highLayerCompatibility.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__ModifyReject_template::log_match(const PDU__ML3__ModifyReject& 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_bearerCapability.match(match_value.bearerCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability");
single_value->field_bearerCapability.log_match(match_value.bearerCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.lowLayerCompatibility().ispresent()){
if(!single_value->field_lowLayerCompatibility.match(match_value.lowLayerCompatibility(), legacy)){
TTCN_Logger::log_logmatch_info(".lowLayerCompatibility");
single_value->field_lowLayerCompatibility.log_match(match_value.lowLayerCompatibility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lowLayerCompatibility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lowLayerCompatibility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lowLayerCompatibility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.highLayerCompatibility().ispresent()){
if(!single_value->field_highLayerCompatibility.match(match_value.highLayerCompatibility(), legacy)){
TTCN_Logger::log_logmatch_info(".highLayerCompatibility");
single_value->field_highLayerCompatibility.log_match(match_value.highLayerCompatibility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_highLayerCompatibility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".highLayerCompatibility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_highLayerCompatibility.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(", bearerCapability := ");
single_value->field_bearerCapability.log_match(match_value.bearerCapability(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", lowLayerCompatibility := ");
if (match_value.lowLayerCompatibility().ispresent()) {
single_value->field_lowLayerCompatibility.log_match(match_value.lowLayerCompatibility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lowLayerCompatibility.log();
if (single_value->field_lowLayerCompatibility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", highLayerCompatibility := ");
if (match_value.highLayerCompatibility().ispresent()) {
single_value->field_highLayerCompatibility.log_match(match_value.highLayerCompatibility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_highLayerCompatibility.log();
if (single_value->field_highLayerCompatibility.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__ModifyReject_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 (bearerCapability().is_bound()) bearerCapability().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (!lowLayerCompatibility().is_bound()) lowLayerCompatibility() = OMIT_VALUE;
else lowLayerCompatibility().set_implicit_omit();
if (!highLayerCompatibility().is_bound()) highLayerCompatibility() = OMIT_VALUE;
else highLayerCompatibility().set_implicit_omit();
}

void PDU__ML3__ModifyReject_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_bearerCapability.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_lowLayerCompatibility.encode_text(text_buf);
single_value->field_highLayerCompatibility.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_CC_Types.PDU_ML3_ModifyReject.");
}
}

void PDU__ML3__ModifyReject_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_bearerCapability.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_lowLayerCompatibility.decode_text(text_buf);
single_value->field_highLayerCompatibility.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__ModifyReject_template[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_CC_Types.PDU_ML3_ModifyReject.");
}
}

void PDU__ML3__ModifyReject_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__ModifyReject_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_ModifyReject has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bearerCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bearerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility().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_CC_Types.PDU_ML3_ModifyReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__ModifyReject_template* precondition = new PDU__ML3__ModifyReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__ModifyReject_template* implied_template = new PDU__ML3__ModifyReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__ModifyReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_ModifyReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__ModifyReject_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_CC_Types.PDU_ML3_ModifyReject");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyReject");
single_value->field_bearerCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyReject");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyReject");
single_value->field_lowLayerCompatibility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyReject");
single_value->field_highLayerCompatibility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ModifyReject");
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_CC_Types.PDU_ML3_ModifyReject");
}

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

boolean PDU__ML3__ModifyReject_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__Notify::PDU__ML3__Notify()
{
}

PDU__ML3__Notify::PDU__ML3__Notify(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const NotificationIndicator& par_notificationIndicator)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_notificationIndicator(par_notificationIndicator)
{
}

PDU__ML3__Notify::PDU__ML3__Notify(const PDU__ML3__Notify& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Notify.");
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.notificationIndicator().is_bound()) field_notificationIndicator = other_value.notificationIndicator();
else field_notificationIndicator.clean_up();
}

void PDU__ML3__Notify::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_notificationIndicator.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Notify::get_descriptor() const { return &PDU__ML3__Notify_descr_; }
PDU__ML3__Notify& PDU__ML3__Notify::operator=(const PDU__ML3__Notify& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Notify.");
  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.notificationIndicator().is_bound()) field_notificationIndicator = other_value.notificationIndicator();
  else field_notificationIndicator.clean_up();
}
return *this;
}

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

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

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

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

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

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

void PDU__ML3__Notify::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__Notify::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__Notify::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, NotificationIndicator_descr_.raw->forceomit);
  decoded_field_length = field_notificationIndicator.RAW_decode(NotificationIndicator_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__Notify::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, NotificationIndicator_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_notificationIndicator.RAW_encode(NotificationIndicator_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__Notify_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
NotificationIndicator_template field_notificationIndicator;
};

void PDU__ML3__Notify_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_notificationIndicator = ANY_VALUE;
}
}
}

void PDU__ML3__Notify_template::copy_value(const PDU__ML3__Notify& 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.notificationIndicator().is_bound()) {
  single_value->field_notificationIndicator = other_value.notificationIndicator();
} else {
  single_value->field_notificationIndicator.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Notify_template::copy_template(const PDU__ML3__Notify_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.notificationIndicator().get_selection()) {
single_value->field_notificationIndicator = other_value.notificationIndicator();
} else {
single_value->field_notificationIndicator.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__Notify_template[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__Notify_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Notify_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_CC_Types.PDU_ML3_Notify.");
break;
}
set_selection(other_value);
}

PDU__ML3__Notify_template::PDU__ML3__Notify_template()
{
}

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

PDU__ML3__Notify_template::PDU__ML3__Notify_template(const PDU__ML3__Notify& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Notify_template::match(const PDU__ML3__Notify& 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.notificationIndicator().is_bound()) return FALSE;
if(!single_value->field_notificationIndicator.match(other_value.notificationIndicator(), 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_CC_Types.PDU_ML3_Notify.");
}
return FALSE;
}

boolean PDU__ML3__Notify_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_notificationIndicator.is_bound();
}

boolean PDU__ML3__Notify_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_notificationIndicator.is_value();
}

void PDU__ML3__Notify_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__Notify PDU__ML3__Notify_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_CC_Types.PDU_ML3_Notify.");
PDU__ML3__Notify 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_notificationIndicator.is_bound()) {
ret_val.notificationIndicator() = single_value->field_notificationIndicator.valueof();
}
return ret_val;
}

void PDU__ML3__Notify_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_CC_Types.PDU_ML3_Notify.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Notify_template[list_length];
}

PDU__ML3__Notify_template& PDU__ML3__Notify_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_CC_Types.PDU_ML3_Notify.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Notify.");
return value_list.list_value[list_index];
}

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

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

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

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

NotificationIndicator_template& PDU__ML3__Notify_template::notificationIndicator()
{
set_specific();
return single_value->field_notificationIndicator;
}

const NotificationIndicator_template& PDU__ML3__Notify_template::notificationIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field notificationIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Notify.");
return single_value->field_notificationIndicator;
}

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

void PDU__ML3__Notify_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(", notificationIndicator := ");
single_value->field_notificationIndicator.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__Notify_template::log_match(const PDU__ML3__Notify& 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_notificationIndicator.match(match_value.notificationIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".notificationIndicator");
single_value->field_notificationIndicator.log_match(match_value.notificationIndicator(), 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(", notificationIndicator := ");
single_value->field_notificationIndicator.log_match(match_value.notificationIndicator(), 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__Notify_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 (notificationIndicator().is_bound()) notificationIndicator().set_implicit_omit();
}

void PDU__ML3__Notify_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_notificationIndicator.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_CC_Types.PDU_ML3_Notify.");
}
}

void PDU__ML3__Notify_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_notificationIndicator.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__Notify_template[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_CC_Types.PDU_ML3_Notify.");
}
}

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

void PDU__ML3__Notify_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_CC_Types.PDU_ML3_Notify");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Notify");
single_value->field_notificationIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Notify");
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_CC_Types.PDU_ML3_Notify");
}

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

boolean PDU__ML3__Notify_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__Progress::PDU__ML3__Progress()
{
}

PDU__ML3__Progress::PDU__ML3__Progress(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const ProgressIndicator__LV& par_progressIndicator,
    const OPTIONAL< User__user__TLV >& par_user__user)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_progressIndicator(par_progressIndicator),
  field_user__user(par_user__user)
{
}

PDU__ML3__Progress::PDU__ML3__Progress(const PDU__ML3__Progress& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Progress.");
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.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
else field_progressIndicator.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
}

void PDU__ML3__Progress::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_progressIndicator.clean_up();
field_user__user.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Progress::get_descriptor() const { return &PDU__ML3__Progress_descr_; }
PDU__ML3__Progress& PDU__ML3__Progress::operator=(const PDU__ML3__Progress& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Progress.");
  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.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
  else field_progressIndicator.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
}
return *this;
}

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

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

void PDU__ML3__Progress::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(", progressIndicator := ");
field_progressIndicator.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Progress::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (progressIndicator().is_bound()) progressIndicator().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__Progress::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_CC_Types.PDU_ML3_Progress 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) progressIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__user().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(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_Progress: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Progress");
  }
}

void PDU__ML3__Progress::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_progressIndicator.encode_text(text_buf);
field_user__user.encode_text(text_buf);
}

void PDU__ML3__Progress::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_progressIndicator.decode_text(text_buf);
field_user__user.decode_text(text_buf);
}

void PDU__ML3__Progress::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__Progress::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__Progress::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, ProgressIndicator__LV_descr_.raw->forceomit);
  decoded_field_length = field_progressIndicator.RAW_decode(ProgressIndicator__LV_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_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=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__Progress::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, ProgressIndicator__LV_descr_.raw);
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, User__user__TLV_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_progressIndicator.RAW_encode(ProgressIndicator__LV_descr_, *myleaf.body.node.nodes[2]);
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.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__Progress_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
ProgressIndicator__LV_template field_progressIndicator;
User__user__TLV_template field_user__user;
};

void PDU__ML3__Progress_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_progressIndicator = ANY_VALUE;
single_value->field_user__user = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Progress_template::copy_value(const PDU__ML3__Progress& 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.progressIndicator().is_bound()) {
  single_value->field_progressIndicator = other_value.progressIndicator();
} else {
  single_value->field_progressIndicator.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Progress_template::copy_template(const PDU__ML3__Progress_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.progressIndicator().get_selection()) {
single_value->field_progressIndicator = other_value.progressIndicator();
} else {
single_value->field_progressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.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__Progress_template[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__Progress_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Progress_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_CC_Types.PDU_ML3_Progress.");
break;
}
set_selection(other_value);
}

PDU__ML3__Progress_template::PDU__ML3__Progress_template()
{
}

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

PDU__ML3__Progress_template::PDU__ML3__Progress_template(const PDU__ML3__Progress& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Progress_template::match(const PDU__ML3__Progress& 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.progressIndicator().is_bound()) return FALSE;
if(!single_value->field_progressIndicator.match(other_value.progressIndicator(), legacy))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.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_CC_Types.PDU_ML3_Progress.");
}
return FALSE;
}

boolean PDU__ML3__Progress_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_progressIndicator.is_bound()
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound());
}

boolean PDU__ML3__Progress_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_progressIndicator.is_value()
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value());
}

void PDU__ML3__Progress_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__Progress PDU__ML3__Progress_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_CC_Types.PDU_ML3_Progress.");
PDU__ML3__Progress 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_progressIndicator.is_bound()) {
ret_val.progressIndicator() = single_value->field_progressIndicator.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
return ret_val;
}

void PDU__ML3__Progress_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_CC_Types.PDU_ML3_Progress.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Progress_template[list_length];
}

PDU__ML3__Progress_template& PDU__ML3__Progress_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_CC_Types.PDU_ML3_Progress.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Progress.");
return value_list.list_value[list_index];
}

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

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

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

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

ProgressIndicator__LV_template& PDU__ML3__Progress_template::progressIndicator()
{
set_specific();
return single_value->field_progressIndicator;
}

const ProgressIndicator__LV_template& PDU__ML3__Progress_template::progressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field progressIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Progress.");
return single_value->field_progressIndicator;
}

User__user__TLV_template& PDU__ML3__Progress_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__Progress_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Progress.");
return single_value->field_user__user;
}

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

void PDU__ML3__Progress_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(", progressIndicator := ");
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.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__Progress_template::log_match(const PDU__ML3__Progress& 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_progressIndicator.match(match_value.progressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".progressIndicator");
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.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(", progressIndicator := ");
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.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__Progress_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 (progressIndicator().is_bound()) progressIndicator().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__Progress_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_progressIndicator.encode_text(text_buf);
single_value->field_user__user.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_CC_Types.PDU_ML3_Progress.");
}
}

void PDU__ML3__Progress_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_progressIndicator.decode_text(text_buf);
single_value->field_user__user.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__Progress_template[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_CC_Types.PDU_ML3_Progress.");
}
}

void PDU__ML3__Progress_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__Progress_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_CC_Types.PDU_ML3_Progress 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) progressIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__user().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(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_Progress: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Progress_template* precondition = new PDU__ML3__Progress_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Progress_template* implied_template = new PDU__ML3__Progress_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Progress_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Progress");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Progress_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_CC_Types.PDU_ML3_Progress");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Progress");
single_value->field_progressIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Progress");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Progress");
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_CC_Types.PDU_ML3_Progress");
}

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

boolean PDU__ML3__Progress_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__CC__Establishment::PDU__ML3__CC__Establishment()
{
}

PDU__ML3__CC__Establishment::PDU__ML3__CC__Establishment(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const SetupContatinerCCBS__LV& par_container)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_container(par_container)
{
}

PDU__ML3__CC__Establishment::PDU__ML3__CC__Establishment(const PDU__ML3__CC__Establishment& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_CC_Establishment.");
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.container().is_bound()) field_container = other_value.container();
else field_container.clean_up();
}

void PDU__ML3__CC__Establishment::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_container.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CC__Establishment::get_descriptor() const { return &PDU__ML3__CC__Establishment_descr_; }
PDU__ML3__CC__Establishment& PDU__ML3__CC__Establishment::operator=(const PDU__ML3__CC__Establishment& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_CC_Establishment.");
  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.container().is_bound()) field_container = other_value.container();
  else field_container.clean_up();
}
return *this;
}

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

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

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

void PDU__ML3__CC__Establishment::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_CC_Types.PDU_ML3_CC_Establishment 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) container().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(), "container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          container().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CC_Types.PDU_ML3_CC_Establishment: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_CC_Establishment");
  }
}

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

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

void PDU__ML3__CC__Establishment::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__CC__Establishment::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__CC__Establishment::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, SetupContatinerCCBS__LV_descr_.raw->forceomit);
  decoded_field_length = field_container.RAW_decode(SetupContatinerCCBS__LV_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__CC__Establishment::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, SetupContatinerCCBS__LV_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_container.RAW_encode(SetupContatinerCCBS__LV_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__CC__Establishment_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
SetupContatinerCCBS__LV_template field_container;
};

void PDU__ML3__CC__Establishment_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_container = ANY_VALUE;
}
}
}

void PDU__ML3__CC__Establishment_template::copy_value(const PDU__ML3__CC__Establishment& 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.container().is_bound()) {
  single_value->field_container = other_value.container();
} else {
  single_value->field_container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CC__Establishment_template::copy_template(const PDU__ML3__CC__Establishment_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.container().get_selection()) {
single_value->field_container = other_value.container();
} else {
single_value->field_container.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__ML3__CC__Establishment_template[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__CC__Establishment_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CC__Establishment_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_CC_Types.PDU_ML3_CC_Establishment.");
break;
}
set_selection(other_value);
}

PDU__ML3__CC__Establishment_template::PDU__ML3__CC__Establishment_template()
{
}

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

PDU__ML3__CC__Establishment_template::PDU__ML3__CC__Establishment_template(const PDU__ML3__CC__Establishment& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CC__Establishment_template::match(const PDU__ML3__CC__Establishment& 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.container().is_bound()) return FALSE;
if(!single_value->field_container.match(other_value.container(), 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_CC_Types.PDU_ML3_CC_Establishment.");
}
return FALSE;
}

boolean PDU__ML3__CC__Establishment_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_container.is_bound();
}

boolean PDU__ML3__CC__Establishment_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_container.is_value();
}

void PDU__ML3__CC__Establishment_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__CC__Establishment PDU__ML3__CC__Establishment_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_CC_Types.PDU_ML3_CC_Establishment.");
PDU__ML3__CC__Establishment 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_container.is_bound()) {
ret_val.container() = single_value->field_container.valueof();
}
return ret_val;
}

void PDU__ML3__CC__Establishment_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_CC_Types.PDU_ML3_CC_Establishment.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CC__Establishment_template[list_length];
}

PDU__ML3__CC__Establishment_template& PDU__ML3__CC__Establishment_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_CC_Types.PDU_ML3_CC_Establishment.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_CC_Establishment.");
return value_list.list_value[list_index];
}

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

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

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

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

SetupContatinerCCBS__LV_template& PDU__ML3__CC__Establishment_template::container()
{
set_specific();
return single_value->field_container;
}

const SetupContatinerCCBS__LV_template& PDU__ML3__CC__Establishment_template::container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field container of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CC_Establishment.");
return single_value->field_container;
}

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

void PDU__ML3__CC__Establishment_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(", container := ");
single_value->field_container.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__ML3__CC__Establishment_template::log_match(const PDU__ML3__CC__Establishment& 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_container.match(match_value.container(), legacy)){
TTCN_Logger::log_logmatch_info(".container");
single_value->field_container.log_match(match_value.container(), 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(", container := ");
single_value->field_container.log_match(match_value.container(), 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__CC__Establishment_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 (container().is_bound()) container().set_implicit_omit();
}

void PDU__ML3__CC__Establishment_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_container.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_CC_Establishment.");
}
}

void PDU__ML3__CC__Establishment_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_container.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__ML3__CC__Establishment_template[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_CC_Types.PDU_ML3_CC_Establishment.");
}
}

void PDU__ML3__CC__Establishment_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__CC__Establishment_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_CC_Types.PDU_ML3_CC_Establishment 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) container().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(), "container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          container().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_CC_Types.PDU_ML3_CC_Establishment: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CC__Establishment_template* precondition = new PDU__ML3__CC__Establishment_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CC__Establishment_template* implied_template = new PDU__ML3__CC__Establishment_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CC__Establishment_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_CC_Establishment");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CC__Establishment_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_CC_Types.PDU_ML3_CC_Establishment");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CC_Establishment");
single_value->field_container.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CC_Establishment");
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_CC_Types.PDU_ML3_CC_Establishment");
}

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

boolean PDU__ML3__CC__Establishment_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__CC__EstablishmentConf::PDU__ML3__CC__EstablishmentConf()
{
}

PDU__ML3__CC__EstablishmentConf::PDU__ML3__CC__EstablishmentConf(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< RepeatIndicator >& par_repeatIndicator,
    const BearerCapability__TLV& par_bearerCapability1,
    const OPTIONAL< BearerCapability__TLV >& par_bearerCapability2,
    const OPTIONAL< MobileL3__CommonIE__Types::ML3__Cause__TLV >& par_cause,
    const OPTIONAL< MobileL3__CommonIE__Types::SupportedCodecList >& par_supportedCodecs)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_repeatIndicator(par_repeatIndicator),
  field_bearerCapability1(par_bearerCapability1),
  field_bearerCapability2(par_bearerCapability2),
  field_cause(par_cause),
  field_supportedCodecs(par_supportedCodecs)
{
}

PDU__ML3__CC__EstablishmentConf::PDU__ML3__CC__EstablishmentConf(const PDU__ML3__CC__EstablishmentConf& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf.");
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.repeatIndicator().is_bound()) field_repeatIndicator = other_value.repeatIndicator();
else field_repeatIndicator.clean_up();
if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
else field_bearerCapability1.clean_up();
if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
else field_bearerCapability2.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
else field_supportedCodecs.clean_up();
}

void PDU__ML3__CC__EstablishmentConf::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_repeatIndicator.clean_up();
field_bearerCapability1.clean_up();
field_bearerCapability2.clean_up();
field_cause.clean_up();
field_supportedCodecs.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__CC__EstablishmentConf::get_descriptor() const { return &PDU__ML3__CC__EstablishmentConf_descr_; }
PDU__ML3__CC__EstablishmentConf& PDU__ML3__CC__EstablishmentConf::operator=(const PDU__ML3__CC__EstablishmentConf& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf.");
  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.repeatIndicator().is_bound()) field_repeatIndicator = other_value.repeatIndicator();
  else field_repeatIndicator.clean_up();
  if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
  else field_bearerCapability1.clean_up();
  if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
  else field_bearerCapability2.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
  else field_supportedCodecs.clean_up();
}
return *this;
}

boolean PDU__ML3__CC__EstablishmentConf::operator==(const PDU__ML3__CC__EstablishmentConf& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_repeatIndicator==other_value.field_repeatIndicator
  && field_bearerCapability1==other_value.field_bearerCapability1
  && field_bearerCapability2==other_value.field_bearerCapability2
  && field_cause==other_value.field_cause
  && field_supportedCodecs==other_value.field_supportedCodecs;
}

boolean PDU__ML3__CC__EstablishmentConf::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_repeatIndicator.get_selection() || field_repeatIndicator.is_bound())
  || (field_bearerCapability1.is_bound())
  || (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound())
  || (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_bound());
}
boolean PDU__ML3__CC__EstablishmentConf::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_repeatIndicator.get_selection() || field_repeatIndicator.is_value())
  && field_bearerCapability1.is_value()
  && (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_value())
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value())
  && (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_value());
}
int PDU__ML3__CC__EstablishmentConf::size_of() const
{
  int ret_val = 3;
  if (field_repeatIndicator.ispresent()) ret_val++;
  if (field_bearerCapability2.ispresent()) ret_val++;
  if (field_cause.ispresent()) ret_val++;
  if (field_supportedCodecs.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__CC__EstablishmentConf::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(", repeatIndicator := ");
field_repeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
field_bearerCapability2.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
field_supportedCodecs.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__CC__EstablishmentConf::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!repeatIndicator().is_bound()) repeatIndicator() = OMIT_VALUE;
else repeatIndicator().set_implicit_omit();
if (bearerCapability1().is_bound()) bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
}

void PDU__ML3__CC__EstablishmentConf::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) repeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "repeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CC_Types.PDU_ML3_CC_EstablishmentConf: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf");
  }
}

void PDU__ML3__CC__EstablishmentConf::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_repeatIndicator.encode_text(text_buf);
field_bearerCapability1.encode_text(text_buf);
field_bearerCapability2.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_supportedCodecs.encode_text(text_buf);
}

void PDU__ML3__CC__EstablishmentConf::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_repeatIndicator.decode_text(text_buf);
field_bearerCapability1.decode_text(text_buf);
field_bearerCapability2.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_supportedCodecs.decode_text(text_buf);
}

void PDU__ML3__CC__EstablishmentConf::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__CC__EstablishmentConf::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__CC__EstablishmentConf::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_repeatIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, RepeatIndicator_descr_.raw->forceomit);
  decoded_field_length = field_repeatIndicator().RAW_decode(RepeatIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_repeatIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_repeatIndicator.ispresent() || field_repeatIndicator().elementIdentifier() !=  bs_0){
  field_repeatIndicator=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_repeatIndicator=OMIT_VALUE;
  RAW_Force_Omit field_3_force_omit(3, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability1.RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_bearerCapability2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability2().RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_bearerCapability2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bearerCapability2.ispresent() || field_bearerCapability2().elementIdentifier() !=  os_4){
  field_bearerCapability2=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_bearerCapability2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_cause = 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::ML3__Cause__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5){
  field_cause=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_cause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_supportedCodecs = 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::SupportedCodecList_descr_.raw->forceomit);
  decoded_field_length = field_supportedCodecs().RAW_decode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_supportedCodecs = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_supportedCodecs=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__ML3__CC__EstablishmentConf::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_repeatIndicator.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RepeatIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, BearerCapability__TLV_descr_.raw);
  if (field_bearerCapability2.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, BearerCapability__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_cause.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_supportedCodecs.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = 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_repeatIndicator.ispresent()) {
  encoded_length += field_repeatIndicator().RAW_encode(RepeatIndicator_descr_, *myleaf.body.node.nodes[2]);
  }
  encoded_length += field_bearerCapability1.RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[3]);
  if (field_bearerCapability2.ispresent()) {
  encoded_length += field_bearerCapability2().RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_supportedCodecs.ispresent()) {
  encoded_length += field_supportedCodecs().RAW_encode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_repeatIndicator.ispresent() && (!field_repeatIndicator.ispresent() || field_repeatIndicator().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[]={2,1};
  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::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_bearerCapability2.ispresent() && (!field_bearerCapability2.ispresent() || field_bearerCapability2().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[]={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_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);
  }
  }
  if (field_cause.ispresent() && (!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5)) {
  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_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__CC__EstablishmentConf_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
RepeatIndicator_template field_repeatIndicator;
BearerCapability__TLV_template field_bearerCapability1;
BearerCapability__TLV_template field_bearerCapability2;
MobileL3__CommonIE__Types::ML3__Cause__TLV_template field_cause;
MobileL3__CommonIE__Types::SupportedCodecList_template field_supportedCodecs;
};

void PDU__ML3__CC__EstablishmentConf_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_repeatIndicator = ANY_OR_OMIT;
single_value->field_bearerCapability1 = ANY_VALUE;
single_value->field_bearerCapability2 = ANY_OR_OMIT;
single_value->field_cause = ANY_OR_OMIT;
single_value->field_supportedCodecs = ANY_OR_OMIT;
}
}
}

void PDU__ML3__CC__EstablishmentConf_template::copy_value(const PDU__ML3__CC__EstablishmentConf& 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.repeatIndicator().is_bound()) {
  if (other_value.repeatIndicator().ispresent()) single_value->field_repeatIndicator = other_value.repeatIndicator()();
  else single_value->field_repeatIndicator = OMIT_VALUE;
} else {
  single_value->field_repeatIndicator.clean_up();
}
if (other_value.bearerCapability1().is_bound()) {
  single_value->field_bearerCapability1 = other_value.bearerCapability1();
} else {
  single_value->field_bearerCapability1.clean_up();
}
if (other_value.bearerCapability2().is_bound()) {
  if (other_value.bearerCapability2().ispresent()) single_value->field_bearerCapability2 = other_value.bearerCapability2()();
  else single_value->field_bearerCapability2 = OMIT_VALUE;
} else {
  single_value->field_bearerCapability2.clean_up();
}
if (other_value.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
if (other_value.supportedCodecs().is_bound()) {
  if (other_value.supportedCodecs().ispresent()) single_value->field_supportedCodecs = other_value.supportedCodecs()();
  else single_value->field_supportedCodecs = OMIT_VALUE;
} else {
  single_value->field_supportedCodecs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__CC__EstablishmentConf_template::copy_template(const PDU__ML3__CC__EstablishmentConf_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.repeatIndicator().get_selection()) {
single_value->field_repeatIndicator = other_value.repeatIndicator();
} else {
single_value->field_repeatIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability1().get_selection()) {
single_value->field_bearerCapability1 = other_value.bearerCapability1();
} else {
single_value->field_bearerCapability1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability2().get_selection()) {
single_value->field_bearerCapability2 = other_value.bearerCapability2();
} else {
single_value->field_bearerCapability2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.supportedCodecs().get_selection()) {
single_value->field_supportedCodecs = other_value.supportedCodecs();
} else {
single_value->field_supportedCodecs.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__CC__EstablishmentConf_template[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__CC__EstablishmentConf_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__CC__EstablishmentConf_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_CC_Types.PDU_ML3_CC_EstablishmentConf.");
break;
}
set_selection(other_value);
}

PDU__ML3__CC__EstablishmentConf_template::PDU__ML3__CC__EstablishmentConf_template()
{
}

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

PDU__ML3__CC__EstablishmentConf_template::PDU__ML3__CC__EstablishmentConf_template(const PDU__ML3__CC__EstablishmentConf& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__CC__EstablishmentConf_template::match(const PDU__ML3__CC__EstablishmentConf& 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.repeatIndicator().is_bound()) return FALSE;
if((other_value.repeatIndicator().ispresent() ? !single_value->field_repeatIndicator.match((const RepeatIndicator&)other_value.repeatIndicator(), legacy) : !single_value->field_repeatIndicator.match_omit(legacy)))return FALSE;
if(!other_value.bearerCapability1().is_bound()) return FALSE;
if(!single_value->field_bearerCapability1.match(other_value.bearerCapability1(), legacy))return FALSE;
if(!other_value.bearerCapability2().is_bound()) return FALSE;
if((other_value.bearerCapability2().ispresent() ? !single_value->field_bearerCapability2.match((const BearerCapability__TLV&)other_value.bearerCapability2(), legacy) : !single_value->field_bearerCapability2.match_omit(legacy)))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const MobileL3__CommonIE__Types::ML3__Cause__TLV&)other_value.cause(), legacy) : !single_value->field_cause.match_omit(legacy)))return FALSE;
if(!other_value.supportedCodecs().is_bound()) return FALSE;
if((other_value.supportedCodecs().ispresent() ? !single_value->field_supportedCodecs.match((const MobileL3__CommonIE__Types::SupportedCodecList&)other_value.supportedCodecs(), legacy) : !single_value->field_supportedCodecs.match_omit(legacy)))return FALSE;
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_CC_Types.PDU_ML3_CC_EstablishmentConf.");
}
return FALSE;
}

boolean PDU__ML3__CC__EstablishmentConf_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_repeatIndicator.is_omit() || single_value->field_repeatIndicator.is_bound())
 || single_value->field_bearerCapability1.is_bound()
 || (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_bound())
 || (single_value->field_cause.is_omit() || single_value->field_cause.is_bound())
 || (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_bound());
}

boolean PDU__ML3__CC__EstablishmentConf_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_repeatIndicator.is_omit() || single_value->field_repeatIndicator.is_value())
 && single_value->field_bearerCapability1.is_value()
 && (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_value())
 && (single_value->field_cause.is_omit() || single_value->field_cause.is_value())
 && (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_value());
}

void PDU__ML3__CC__EstablishmentConf_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__CC__EstablishmentConf PDU__ML3__CC__EstablishmentConf_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_CC_Types.PDU_ML3_CC_EstablishmentConf.");
PDU__ML3__CC__EstablishmentConf 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_repeatIndicator.is_omit()) ret_val.repeatIndicator() = OMIT_VALUE;
else if (single_value->field_repeatIndicator.is_bound()) {
ret_val.repeatIndicator() = single_value->field_repeatIndicator.valueof();
}
if (single_value->field_bearerCapability1.is_bound()) {
ret_val.bearerCapability1() = single_value->field_bearerCapability1.valueof();
}
if (single_value->field_bearerCapability2.is_omit()) ret_val.bearerCapability2() = OMIT_VALUE;
else if (single_value->field_bearerCapability2.is_bound()) {
ret_val.bearerCapability2() = single_value->field_bearerCapability2.valueof();
}
if (single_value->field_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_supportedCodecs.is_omit()) ret_val.supportedCodecs() = OMIT_VALUE;
else if (single_value->field_supportedCodecs.is_bound()) {
ret_val.supportedCodecs() = single_value->field_supportedCodecs.valueof();
}
return ret_val;
}

void PDU__ML3__CC__EstablishmentConf_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_CC_Types.PDU_ML3_CC_EstablishmentConf.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__CC__EstablishmentConf_template[list_length];
}

PDU__ML3__CC__EstablishmentConf_template& PDU__ML3__CC__EstablishmentConf_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_CC_Types.PDU_ML3_CC_EstablishmentConf.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf.");
return value_list.list_value[list_index];
}

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

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

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

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

RepeatIndicator_template& PDU__ML3__CC__EstablishmentConf_template::repeatIndicator()
{
set_specific();
return single_value->field_repeatIndicator;
}

const RepeatIndicator_template& PDU__ML3__CC__EstablishmentConf_template::repeatIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field repeatIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf.");
return single_value->field_repeatIndicator;
}

BearerCapability__TLV_template& PDU__ML3__CC__EstablishmentConf_template::bearerCapability1()
{
set_specific();
return single_value->field_bearerCapability1;
}

const BearerCapability__TLV_template& PDU__ML3__CC__EstablishmentConf_template::bearerCapability1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf.");
return single_value->field_bearerCapability1;
}

BearerCapability__TLV_template& PDU__ML3__CC__EstablishmentConf_template::bearerCapability2()
{
set_specific();
return single_value->field_bearerCapability2;
}

const BearerCapability__TLV_template& PDU__ML3__CC__EstablishmentConf_template::bearerCapability2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf.");
return single_value->field_bearerCapability2;
}

MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__CC__EstablishmentConf_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__CC__EstablishmentConf_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf.");
return single_value->field_cause;
}

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

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

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

void PDU__ML3__CC__EstablishmentConf_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(", repeatIndicator := ");
single_value->field_repeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
single_value->field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
single_value->field_supportedCodecs.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__CC__EstablishmentConf_template::log_match(const PDU__ML3__CC__EstablishmentConf& 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.repeatIndicator().ispresent()){
if(!single_value->field_repeatIndicator.match(match_value.repeatIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".repeatIndicator");
single_value->field_repeatIndicator.log_match(match_value.repeatIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_repeatIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".repeatIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_repeatIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_bearerCapability1.match(match_value.bearerCapability1(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability1");
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.bearerCapability2().ispresent()){
if(!single_value->field_bearerCapability2.match(match_value.bearerCapability2(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability2");
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bearerCapability2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bearerCapability2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.supportedCodecs().ispresent()){
if(!single_value->field_supportedCodecs.match(match_value.supportedCodecs(), legacy)){
TTCN_Logger::log_logmatch_info(".supportedCodecs");
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_supportedCodecs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".supportedCodecs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}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(", repeatIndicator := ");
if (match_value.repeatIndicator().ispresent()) {
single_value->field_repeatIndicator.log_match(match_value.repeatIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_repeatIndicator.log();
if (single_value->field_repeatIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bearerCapability1 := ");
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
TTCN_Logger::log_event_str(", bearerCapability2 := ");
if (match_value.bearerCapability2().ispresent()) {
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bearerCapability2.log();
if (single_value->field_bearerCapability2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", supportedCodecs := ");
if (match_value.supportedCodecs().ispresent()) {
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_supportedCodecs.log();
if (single_value->field_supportedCodecs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} 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__CC__EstablishmentConf_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 (!repeatIndicator().is_bound()) repeatIndicator() = OMIT_VALUE;
else repeatIndicator().set_implicit_omit();
if (bearerCapability1().is_bound()) bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
}

void PDU__ML3__CC__EstablishmentConf_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_repeatIndicator.encode_text(text_buf);
single_value->field_bearerCapability1.encode_text(text_buf);
single_value->field_bearerCapability2.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_supportedCodecs.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_CC_Types.PDU_ML3_CC_EstablishmentConf.");
}
}

void PDU__ML3__CC__EstablishmentConf_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_repeatIndicator.decode_text(text_buf);
single_value->field_bearerCapability1.decode_text(text_buf);
single_value->field_bearerCapability2.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_supportedCodecs.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__CC__EstablishmentConf_template[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_CC_Types.PDU_ML3_CC_EstablishmentConf.");
}
}

void PDU__ML3__CC__EstablishmentConf_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__CC__EstablishmentConf_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) repeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "repeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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_CC_Types.PDU_ML3_CC_EstablishmentConf: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__CC__EstablishmentConf_template* precondition = new PDU__ML3__CC__EstablishmentConf_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__CC__EstablishmentConf_template* implied_template = new PDU__ML3__CC__EstablishmentConf_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__CC__EstablishmentConf_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__CC__EstablishmentConf_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_CC_Types.PDU_ML3_CC_EstablishmentConf");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf");
single_value->field_repeatIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf");
single_value->field_bearerCapability1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf");
single_value->field_bearerCapability2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf");
single_value->field_supportedCodecs.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_CC_EstablishmentConf");
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_CC_Types.PDU_ML3_CC_EstablishmentConf");
}

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

boolean PDU__ML3__CC__EstablishmentConf_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__Release__NW__MS::PDU__ML3__Release__NW__MS()
{
}

PDU__ML3__Release__NW__MS::PDU__ML3__Release__NW__MS(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< MobileL3__CommonIE__Types::ML3__Cause__TLV >& par_cause,
    const OPTIONAL< MobileL3__CommonIE__Types::ML3__Cause__TLV >& par_secondCause,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< User__user__TLV >& par_user__user)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cause(par_cause),
  field_secondCause(par_secondCause),
  field_facility(par_facility),
  field_user__user(par_user__user)
{
}

PDU__ML3__Release__NW__MS::PDU__ML3__Release__NW__MS(const PDU__ML3__Release__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
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.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.secondCause().is_bound()) field_secondCause = other_value.secondCause();
else field_secondCause.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
}

void PDU__ML3__Release__NW__MS::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cause.clean_up();
field_secondCause.clean_up();
field_facility.clean_up();
field_user__user.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Release__NW__MS::get_descriptor() const { return &PDU__ML3__Release__NW__MS_descr_; }
PDU__ML3__Release__NW__MS& PDU__ML3__Release__NW__MS::operator=(const PDU__ML3__Release__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
  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.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.secondCause().is_bound()) field_secondCause = other_value.secondCause();
  else field_secondCause.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
}
return *this;
}

boolean PDU__ML3__Release__NW__MS::operator==(const PDU__ML3__Release__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cause==other_value.field_cause
  && field_secondCause==other_value.field_secondCause
  && field_facility==other_value.field_facility
  && field_user__user==other_value.field_user__user;
}

boolean PDU__ML3__Release__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound())
  || (OPTIONAL_OMIT == field_secondCause.get_selection() || field_secondCause.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound());
}
boolean PDU__ML3__Release__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value())
  && (OPTIONAL_OMIT == field_secondCause.get_selection() || field_secondCause.is_value())
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value());
}
int PDU__ML3__Release__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_cause.ispresent()) ret_val++;
  if (field_secondCause.ispresent()) ret_val++;
  if (field_facility.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Release__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", secondCause := ");
field_secondCause.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Release__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!secondCause().is_bound()) secondCause() = OMIT_VALUE;
else secondCause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__Release__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) secondCause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_Release_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Release_NW_MS");
  }
}

void PDU__ML3__Release__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_secondCause.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_user__user.encode_text(text_buf);
}

void PDU__ML3__Release__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_secondCause.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_user__user.decode_text(text_buf);
}

void PDU__ML3__Release__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  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__Release__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  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__Release__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::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_cause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5){
  field_cause=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_cause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_secondCause = 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::ML3__Cause__TLV_descr_.raw->forceomit);
  decoded_field_length = field_secondCause().RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_secondCause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_secondCause.ispresent() || field_secondCause().elementIdentifier() !=  os_5){
  field_secondCause=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_secondCause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_facility = 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::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=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__Release__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_cause.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_secondCause.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_facility.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = 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_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_secondCause.ispresent()) {
  encoded_length += field_secondCause().RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_cause.ispresent() && (!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_secondCause.ispresent() && (!field_secondCause.ispresent() || field_secondCause().elementIdentifier() !=  os_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){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_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){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  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_2.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__Release__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::ML3__Cause__TLV_template field_cause;
MobileL3__CommonIE__Types::ML3__Cause__TLV_template field_secondCause;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
User__user__TLV_template field_user__user;
};

void PDU__ML3__Release__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_cause = ANY_OR_OMIT;
single_value->field_secondCause = ANY_OR_OMIT;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Release__NW__MS_template::copy_value(const PDU__ML3__Release__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
if (other_value.secondCause().is_bound()) {
  if (other_value.secondCause().ispresent()) single_value->field_secondCause = other_value.secondCause()();
  else single_value->field_secondCause = OMIT_VALUE;
} else {
  single_value->field_secondCause.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Release__NW__MS_template::copy_template(const PDU__ML3__Release__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.secondCause().get_selection()) {
single_value->field_secondCause = other_value.secondCause();
} else {
single_value->field_secondCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.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__Release__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__Release__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Release__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__ML3__Release__NW__MS_template::PDU__ML3__Release__NW__MS_template()
{
}

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

PDU__ML3__Release__NW__MS_template::PDU__ML3__Release__NW__MS_template(const PDU__ML3__Release__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Release__NW__MS_template::match(const PDU__ML3__Release__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const MobileL3__CommonIE__Types::ML3__Cause__TLV&)other_value.cause(), legacy) : !single_value->field_cause.match_omit(legacy)))return FALSE;
if(!other_value.secondCause().is_bound()) return FALSE;
if((other_value.secondCause().ispresent() ? !single_value->field_secondCause.match((const MobileL3__CommonIE__Types::ML3__Cause__TLV&)other_value.secondCause(), legacy) : !single_value->field_secondCause.match_omit(legacy)))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.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_CC_Types.PDU_ML3_Release_NW_MS.");
}
return FALSE;
}

boolean PDU__ML3__Release__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || (single_value->field_cause.is_omit() || single_value->field_cause.is_bound())
 || (single_value->field_secondCause.is_omit() || single_value->field_secondCause.is_bound())
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound());
}

boolean PDU__ML3__Release__NW__MS_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_cause.is_omit() || single_value->field_cause.is_value())
 && (single_value->field_secondCause.is_omit() || single_value->field_secondCause.is_value())
 && (single_value->field_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value());
}

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

PDU__ML3__Release__NW__MS PDU__ML3__Release__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
PDU__ML3__Release__NW__MS 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_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_secondCause.is_omit()) ret_val.secondCause() = OMIT_VALUE;
else if (single_value->field_secondCause.is_bound()) {
ret_val.secondCause() = single_value->field_secondCause.valueof();
}
if (single_value->field_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
return ret_val;
}

void PDU__ML3__Release__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Release__NW__MS_template[list_length];
}

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

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

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

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

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

MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__Release__NW__MS_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__Release__NW__MS_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
return single_value->field_cause;
}

MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__Release__NW__MS_template::secondCause()
{
set_specific();
return single_value->field_secondCause;
}

const MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__Release__NW__MS_template::secondCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field secondCause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
return single_value->field_secondCause;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Release__NW__MS_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Release__NW__MS_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
return single_value->field_facility;
}

User__user__TLV_template& PDU__ML3__Release__NW__MS_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__Release__NW__MS_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
return single_value->field_user__user;
}

int PDU__ML3__Release__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_cause.is_present()) ret_val++;
      if (single_value->field_secondCause.is_present()) ret_val++;
      if (single_value->field_facility.is_present()) ret_val++;
      if (single_value->field_user__user.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_CC_Types.PDU_ML3_Release_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
  }
  return 0;
}

void PDU__ML3__Release__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", secondCause := ");
single_value->field_secondCause.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.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__Release__NW__MS_template::log_match(const PDU__ML3__Release__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.secondCause().ispresent()){
if(!single_value->field_secondCause.match(match_value.secondCause(), legacy)){
TTCN_Logger::log_logmatch_info(".secondCause");
single_value->field_secondCause.log_match(match_value.secondCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_secondCause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".secondCause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_secondCause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.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(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", secondCause := ");
if (match_value.secondCause().ispresent()) {
single_value->field_secondCause.log_match(match_value.secondCause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_secondCause.log();
if (single_value->field_secondCause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.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__Release__NW__MS_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 (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!secondCause().is_bound()) secondCause() = OMIT_VALUE;
else secondCause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__Release__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_secondCause.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_user__user.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_CC_Types.PDU_ML3_Release_NW_MS.");
}
}

void PDU__ML3__Release__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_secondCause.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_user__user.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__Release__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS.");
}
}

void PDU__ML3__Release__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__Release__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Release_NW_MS has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) secondCause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_Release_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Release__NW__MS_template* precondition = new PDU__ML3__Release__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Release__NW__MS_template* implied_template = new PDU__ML3__Release__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Release__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Release_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Release__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_NW_MS");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_NW_MS");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_NW_MS");
single_value->field_secondCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_NW_MS");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_NW_MS");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_NW_MS");
}

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

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

PDU__ML3__Release__MS__NW::PDU__ML3__Release__MS__NW()
{
}

PDU__ML3__Release__MS__NW::PDU__ML3__Release__MS__NW(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< MobileL3__CommonIE__Types::ML3__Cause__TLV >& par_cause,
    const OPTIONAL< MobileL3__CommonIE__Types::ML3__Cause__TLV >& par_secondCause,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< User__user__TLV >& par_user__user,
    const OPTIONAL< MobileL3__CommonIE__Types::SS__VersionIndicator >& par_ss__VersionIndicator)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cause(par_cause),
  field_secondCause(par_secondCause),
  field_facility(par_facility),
  field_user__user(par_user__user),
  field_ss__VersionIndicator(par_ss__VersionIndicator)
{
}

PDU__ML3__Release__MS__NW::PDU__ML3__Release__MS__NW(const PDU__ML3__Release__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW.");
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.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.secondCause().is_bound()) field_secondCause = other_value.secondCause();
else field_secondCause.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
else field_ss__VersionIndicator.clean_up();
}

void PDU__ML3__Release__MS__NW::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cause.clean_up();
field_secondCause.clean_up();
field_facility.clean_up();
field_user__user.clean_up();
field_ss__VersionIndicator.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Release__MS__NW::get_descriptor() const { return &PDU__ML3__Release__MS__NW_descr_; }
PDU__ML3__Release__MS__NW& PDU__ML3__Release__MS__NW::operator=(const PDU__ML3__Release__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW.");
  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.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.secondCause().is_bound()) field_secondCause = other_value.secondCause();
  else field_secondCause.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
  if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
  else field_ss__VersionIndicator.clean_up();
}
return *this;
}

boolean PDU__ML3__Release__MS__NW::operator==(const PDU__ML3__Release__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cause==other_value.field_cause
  && field_secondCause==other_value.field_secondCause
  && field_facility==other_value.field_facility
  && field_user__user==other_value.field_user__user
  && field_ss__VersionIndicator==other_value.field_ss__VersionIndicator;
}

boolean PDU__ML3__Release__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound())
  || (OPTIONAL_OMIT == field_secondCause.get_selection() || field_secondCause.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound())
  || (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_bound());
}
boolean PDU__ML3__Release__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value())
  && (OPTIONAL_OMIT == field_secondCause.get_selection() || field_secondCause.is_value())
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value())
  && (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_value());
}
int PDU__ML3__Release__MS__NW::size_of() const
{
  int ret_val = 2;
  if (field_cause.ispresent()) ret_val++;
  if (field_secondCause.ispresent()) ret_val++;
  if (field_facility.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  if (field_ss__VersionIndicator.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Release__MS__NW::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(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", secondCause := ");
field_secondCause.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Release__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!secondCause().is_bound()) secondCause() = OMIT_VALUE;
else secondCause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
}

void PDU__ML3__Release__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) secondCause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().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_CC_Types.PDU_ML3_Release_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Release_MS_NW");
  }
}

void PDU__ML3__Release__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_secondCause.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_user__user.encode_text(text_buf);
field_ss__VersionIndicator.encode_text(text_buf);
}

void PDU__ML3__Release__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_secondCause.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_user__user.decode_text(text_buf);
field_ss__VersionIndicator.decode_text(text_buf);
}

void PDU__ML3__Release__MS__NW::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__Release__MS__NW::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__Release__MS__NW::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_cause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5){
  field_cause=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_cause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_secondCause = 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::ML3__Cause__TLV_descr_.raw->forceomit);
  decoded_field_length = field_secondCause().RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_secondCause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_secondCause.ispresent() || field_secondCause().elementIdentifier() !=  os_5){
  field_secondCause=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_secondCause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_facility = 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::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_ss__VersionIndicator = 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::SS__VersionIndicator_descr_.raw->forceomit);
  decoded_field_length = field_ss__VersionIndicator().RAW_decode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_ss__VersionIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().elementIdentifier() !=  os_3){
  field_ss__VersionIndicator=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_ss__VersionIndicator=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__Release__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_cause.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_secondCause.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_facility.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_ss__VersionIndicator.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::SS__VersionIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = 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_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_secondCause.ispresent()) {
  encoded_length += field_secondCause().RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_ss__VersionIndicator.ispresent()) {
  encoded_length += field_ss__VersionIndicator().RAW_encode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_cause.ispresent() && (!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_secondCause.ispresent() && (!field_secondCause.ispresent() || field_secondCause().elementIdentifier() !=  os_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){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_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){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  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_2.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_ss__VersionIndicator.ispresent() && (!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().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[]={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){
   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__Release__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::ML3__Cause__TLV_template field_cause;
MobileL3__CommonIE__Types::ML3__Cause__TLV_template field_secondCause;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
User__user__TLV_template field_user__user;
MobileL3__CommonIE__Types::SS__VersionIndicator_template field_ss__VersionIndicator;
};

void PDU__ML3__Release__MS__NW_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_cause = ANY_OR_OMIT;
single_value->field_secondCause = ANY_OR_OMIT;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
single_value->field_ss__VersionIndicator = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Release__MS__NW_template::copy_value(const PDU__ML3__Release__MS__NW& 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.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
if (other_value.secondCause().is_bound()) {
  if (other_value.secondCause().ispresent()) single_value->field_secondCause = other_value.secondCause()();
  else single_value->field_secondCause = OMIT_VALUE;
} else {
  single_value->field_secondCause.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
if (other_value.ss__VersionIndicator().is_bound()) {
  if (other_value.ss__VersionIndicator().ispresent()) single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator()();
  else single_value->field_ss__VersionIndicator = OMIT_VALUE;
} else {
  single_value->field_ss__VersionIndicator.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Release__MS__NW_template::copy_template(const PDU__ML3__Release__MS__NW_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.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.secondCause().get_selection()) {
single_value->field_secondCause = other_value.secondCause();
} else {
single_value->field_secondCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ss__VersionIndicator().get_selection()) {
single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator();
} else {
single_value->field_ss__VersionIndicator.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__Release__MS__NW_template[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__Release__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Release__MS__NW_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_CC_Types.PDU_ML3_Release_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__ML3__Release__MS__NW_template::PDU__ML3__Release__MS__NW_template()
{
}

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

PDU__ML3__Release__MS__NW_template::PDU__ML3__Release__MS__NW_template(const PDU__ML3__Release__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Release__MS__NW_template::match(const PDU__ML3__Release__MS__NW& 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.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const MobileL3__CommonIE__Types::ML3__Cause__TLV&)other_value.cause(), legacy) : !single_value->field_cause.match_omit(legacy)))return FALSE;
if(!other_value.secondCause().is_bound()) return FALSE;
if((other_value.secondCause().ispresent() ? !single_value->field_secondCause.match((const MobileL3__CommonIE__Types::ML3__Cause__TLV&)other_value.secondCause(), legacy) : !single_value->field_secondCause.match_omit(legacy)))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.match_omit(legacy)))return FALSE;
if(!other_value.ss__VersionIndicator().is_bound()) return FALSE;
if((other_value.ss__VersionIndicator().ispresent() ? !single_value->field_ss__VersionIndicator.match((const MobileL3__CommonIE__Types::SS__VersionIndicator&)other_value.ss__VersionIndicator(), legacy) : !single_value->field_ss__VersionIndicator.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_CC_Types.PDU_ML3_Release_MS_NW.");
}
return FALSE;
}

boolean PDU__ML3__Release__MS__NW_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_cause.is_omit() || single_value->field_cause.is_bound())
 || (single_value->field_secondCause.is_omit() || single_value->field_secondCause.is_bound())
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound())
 || (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_bound());
}

boolean PDU__ML3__Release__MS__NW_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_cause.is_omit() || single_value->field_cause.is_value())
 && (single_value->field_secondCause.is_omit() || single_value->field_secondCause.is_value())
 && (single_value->field_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value())
 && (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_value());
}

void PDU__ML3__Release__MS__NW_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__Release__MS__NW PDU__ML3__Release__MS__NW_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_CC_Types.PDU_ML3_Release_MS_NW.");
PDU__ML3__Release__MS__NW 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_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_secondCause.is_omit()) ret_val.secondCause() = OMIT_VALUE;
else if (single_value->field_secondCause.is_bound()) {
ret_val.secondCause() = single_value->field_secondCause.valueof();
}
if (single_value->field_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
if (single_value->field_ss__VersionIndicator.is_omit()) ret_val.ss__VersionIndicator() = OMIT_VALUE;
else if (single_value->field_ss__VersionIndicator.is_bound()) {
ret_val.ss__VersionIndicator() = single_value->field_ss__VersionIndicator.valueof();
}
return ret_val;
}

void PDU__ML3__Release__MS__NW_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_CC_Types.PDU_ML3_Release_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Release__MS__NW_template[list_length];
}

PDU__ML3__Release__MS__NW_template& PDU__ML3__Release__MS__NW_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_CC_Types.PDU_ML3_Release_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW.");
return value_list.list_value[list_index];
}

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

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

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

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

MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__Release__MS__NW_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__Release__MS__NW_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW.");
return single_value->field_cause;
}

MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__Release__MS__NW_template::secondCause()
{
set_specific();
return single_value->field_secondCause;
}

const MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__Release__MS__NW_template::secondCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field secondCause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW.");
return single_value->field_secondCause;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Release__MS__NW_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Release__MS__NW_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW.");
return single_value->field_facility;
}

User__user__TLV_template& PDU__ML3__Release__MS__NW_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__Release__MS__NW_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW.");
return single_value->field_user__user;
}

MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Release__MS__NW_template::ss__VersionIndicator()
{
set_specific();
return single_value->field_ss__VersionIndicator;
}

const MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Release__MS__NW_template::ss__VersionIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ss_VersionIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW.");
return single_value->field_ss__VersionIndicator;
}

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

void PDU__ML3__Release__MS__NW_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(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", secondCause := ");
single_value->field_secondCause.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
single_value->field_ss__VersionIndicator.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__Release__MS__NW_template::log_match(const PDU__ML3__Release__MS__NW& 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.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.secondCause().ispresent()){
if(!single_value->field_secondCause.match(match_value.secondCause(), legacy)){
TTCN_Logger::log_logmatch_info(".secondCause");
single_value->field_secondCause.log_match(match_value.secondCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_secondCause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".secondCause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_secondCause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ss__VersionIndicator().ispresent()){
if(!single_value->field_ss__VersionIndicator.match(match_value.ss__VersionIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ss_VersionIndicator");
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ss__VersionIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ss_VersionIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ss__VersionIndicator.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(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", secondCause := ");
if (match_value.secondCause().ispresent()) {
single_value->field_secondCause.log_match(match_value.secondCause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_secondCause.log();
if (single_value->field_secondCause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
if (match_value.ss__VersionIndicator().ispresent()) {
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ss__VersionIndicator.log();
if (single_value->field_ss__VersionIndicator.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__Release__MS__NW_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 (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!secondCause().is_bound()) secondCause() = OMIT_VALUE;
else secondCause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
}

void PDU__ML3__Release__MS__NW_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_cause.encode_text(text_buf);
single_value->field_secondCause.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_user__user.encode_text(text_buf);
single_value->field_ss__VersionIndicator.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_CC_Types.PDU_ML3_Release_MS_NW.");
}
}

void PDU__ML3__Release__MS__NW_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_cause.decode_text(text_buf);
single_value->field_secondCause.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_user__user.decode_text(text_buf);
single_value->field_ss__VersionIndicator.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__Release__MS__NW_template[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_CC_Types.PDU_ML3_Release_MS_NW.");
}
}

void PDU__ML3__Release__MS__NW_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__Release__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Release_MS_NW has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) secondCause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().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_CC_Types.PDU_ML3_Release_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Release__MS__NW_template* precondition = new PDU__ML3__Release__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Release__MS__NW_template* implied_template = new PDU__ML3__Release__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Release__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Release_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Release__MS__NW_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_CC_Types.PDU_ML3_Release_MS_NW");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_MS_NW");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_MS_NW");
single_value->field_secondCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_MS_NW");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_MS_NW");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_MS_NW");
single_value->field_ss__VersionIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Release_MS_NW");
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_CC_Types.PDU_ML3_Release_MS_NW");
}

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

boolean PDU__ML3__Release__MS__NW_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__Recall::PDU__ML3__Recall()
{
}

PDU__ML3__Recall::PDU__ML3__Recall(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const RecallType& par_recallType,
    const MobileL3__CommonIE__Types::Facility__LV& par_facility)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_recallType(par_recallType),
  field_facility(par_facility)
{
}

PDU__ML3__Recall::PDU__ML3__Recall(const PDU__ML3__Recall& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Recall.");
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.recallType().is_bound()) field_recallType = other_value.recallType();
else field_recallType.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
}

void PDU__ML3__Recall::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_recallType.clean_up();
field_facility.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Recall::get_descriptor() const { return &PDU__ML3__Recall_descr_; }
PDU__ML3__Recall& PDU__ML3__Recall::operator=(const PDU__ML3__Recall& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Recall.");
  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.recallType().is_bound()) field_recallType = other_value.recallType();
  else field_recallType.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
}
return *this;
}

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

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

void PDU__ML3__Recall::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (recallType().is_bound()) recallType().set_implicit_omit();
if (facility().is_bound()) facility().set_implicit_omit();
}

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

void PDU__ML3__Recall::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_recallType.encode_text(text_buf);
field_facility.encode_text(text_buf);
}

void PDU__ML3__Recall::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_recallType.decode_text(text_buf);
field_facility.decode_text(text_buf);
}

void PDU__ML3__Recall::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__Recall::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__Recall::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, RecallType_descr_.raw->forceomit);
  decoded_field_length = field_recallType.RAW_decode(RecallType_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::Facility__LV_descr_.raw->forceomit);
  decoded_field_length = field_facility.RAW_decode(MobileL3__CommonIE__Types::Facility__LV_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__Recall::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, RecallType_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::Facility__LV_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_recallType.RAW_encode(RecallType_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_facility.RAW_encode(MobileL3__CommonIE__Types::Facility__LV_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__Recall_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
RecallType_template field_recallType;
MobileL3__CommonIE__Types::Facility__LV_template field_facility;
};

void PDU__ML3__Recall_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_recallType = ANY_VALUE;
single_value->field_facility = ANY_VALUE;
}
}
}

void PDU__ML3__Recall_template::copy_value(const PDU__ML3__Recall& 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.recallType().is_bound()) {
  single_value->field_recallType = other_value.recallType();
} else {
  single_value->field_recallType.clean_up();
}
if (other_value.facility().is_bound()) {
  single_value->field_facility = other_value.facility();
} else {
  single_value->field_facility.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Recall_template::copy_template(const PDU__ML3__Recall_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.recallType().get_selection()) {
single_value->field_recallType = other_value.recallType();
} else {
single_value->field_recallType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.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__Recall_template[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__Recall_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Recall_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_CC_Types.PDU_ML3_Recall.");
break;
}
set_selection(other_value);
}

PDU__ML3__Recall_template::PDU__ML3__Recall_template()
{
}

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

PDU__ML3__Recall_template::PDU__ML3__Recall_template(const PDU__ML3__Recall& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Recall_template::match(const PDU__ML3__Recall& 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.recallType().is_bound()) return FALSE;
if(!single_value->field_recallType.match(other_value.recallType(), legacy))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if(!single_value->field_facility.match(other_value.facility(), 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_CC_Types.PDU_ML3_Recall.");
}
return FALSE;
}

boolean PDU__ML3__Recall_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_recallType.is_bound()
 || single_value->field_facility.is_bound();
}

boolean PDU__ML3__Recall_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_recallType.is_value()
 && single_value->field_facility.is_value();
}

void PDU__ML3__Recall_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__Recall PDU__ML3__Recall_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_CC_Types.PDU_ML3_Recall.");
PDU__ML3__Recall 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_recallType.is_bound()) {
ret_val.recallType() = single_value->field_recallType.valueof();
}
if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
return ret_val;
}

void PDU__ML3__Recall_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_CC_Types.PDU_ML3_Recall.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Recall_template[list_length];
}

PDU__ML3__Recall_template& PDU__ML3__Recall_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_CC_Types.PDU_ML3_Recall.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Recall.");
return value_list.list_value[list_index];
}

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

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

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

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

RecallType_template& PDU__ML3__Recall_template::recallType()
{
set_specific();
return single_value->field_recallType;
}

const RecallType_template& PDU__ML3__Recall_template::recallType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field recallType of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Recall.");
return single_value->field_recallType;
}

MobileL3__CommonIE__Types::Facility__LV_template& PDU__ML3__Recall_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__LV_template& PDU__ML3__Recall_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Recall.");
return single_value->field_facility;
}

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

void PDU__ML3__Recall_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(", recallType := ");
single_value->field_recallType.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.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__Recall_template::log_match(const PDU__ML3__Recall& 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_recallType.match(match_value.recallType(), legacy)){
TTCN_Logger::log_logmatch_info(".recallType");
single_value->field_recallType.log_match(match_value.recallType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), 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(", recallType := ");
single_value->field_recallType.log_match(match_value.recallType(), legacy);
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log_match(match_value.facility(), 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__Recall_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 (recallType().is_bound()) recallType().set_implicit_omit();
if (facility().is_bound()) facility().set_implicit_omit();
}

void PDU__ML3__Recall_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_recallType.encode_text(text_buf);
single_value->field_facility.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_CC_Types.PDU_ML3_Recall.");
}
}

void PDU__ML3__Recall_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_recallType.decode_text(text_buf);
single_value->field_facility.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__Recall_template[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_CC_Types.PDU_ML3_Recall.");
}
}

void PDU__ML3__Recall_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__Recall_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_CC_Types.PDU_ML3_Recall 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) recallType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) facility().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(), "recallType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          recallType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().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_CC_Types.PDU_ML3_Recall: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Recall_template* precondition = new PDU__ML3__Recall_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Recall_template* implied_template = new PDU__ML3__Recall_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Recall_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Recall");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Recall_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_CC_Types.PDU_ML3_Recall");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Recall");
single_value->field_recallType.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Recall");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Recall");
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_CC_Types.PDU_ML3_Recall");
}

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

boolean PDU__ML3__Recall_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__ReleaseComplete__NW__MS::PDU__ML3__ReleaseComplete__NW__MS()
{
}

PDU__ML3__ReleaseComplete__NW__MS::PDU__ML3__ReleaseComplete__NW__MS(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< MobileL3__CommonIE__Types::ML3__Cause__TLV >& par_cause,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< User__user__TLV >& par_user__user)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cause(par_cause),
  field_facility(par_facility),
  field_user__user(par_user__user)
{
}

PDU__ML3__ReleaseComplete__NW__MS::PDU__ML3__ReleaseComplete__NW__MS(const PDU__ML3__ReleaseComplete__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
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.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
}

void PDU__ML3__ReleaseComplete__NW__MS::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cause.clean_up();
field_facility.clean_up();
field_user__user.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__ReleaseComplete__NW__MS::get_descriptor() const { return &PDU__ML3__ReleaseComplete__NW__MS_descr_; }
PDU__ML3__ReleaseComplete__NW__MS& PDU__ML3__ReleaseComplete__NW__MS::operator=(const PDU__ML3__ReleaseComplete__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
  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.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
}
return *this;
}

boolean PDU__ML3__ReleaseComplete__NW__MS::operator==(const PDU__ML3__ReleaseComplete__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cause==other_value.field_cause
  && field_facility==other_value.field_facility
  && field_user__user==other_value.field_user__user;
}

boolean PDU__ML3__ReleaseComplete__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound());
}
boolean PDU__ML3__ReleaseComplete__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value())
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value());
}
int PDU__ML3__ReleaseComplete__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_cause.ispresent()) ret_val++;
  if (field_facility.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__ReleaseComplete__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__ReleaseComplete__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__ReleaseComplete__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_ReleaseComplete_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS");
  }
}

void PDU__ML3__ReleaseComplete__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_user__user.encode_text(text_buf);
}

void PDU__ML3__ReleaseComplete__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_user__user.decode_text(text_buf);
}

void PDU__ML3__ReleaseComplete__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  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__ReleaseComplete__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  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__ReleaseComplete__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::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_cause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5){
  field_cause=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_cause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_facility = 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::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=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__ReleaseComplete__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_cause.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_facility.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = 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_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_cause.ispresent() && (!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  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_2.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__ReleaseComplete__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::ML3__Cause__TLV_template field_cause;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
User__user__TLV_template field_user__user;
};

void PDU__ML3__ReleaseComplete__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_cause = ANY_OR_OMIT;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
}
}
}

void PDU__ML3__ReleaseComplete__NW__MS_template::copy_value(const PDU__ML3__ReleaseComplete__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__ReleaseComplete__NW__MS_template::copy_template(const PDU__ML3__ReleaseComplete__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.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__ReleaseComplete__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__ReleaseComplete__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__ReleaseComplete__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__ML3__ReleaseComplete__NW__MS_template::PDU__ML3__ReleaseComplete__NW__MS_template()
{
}

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

PDU__ML3__ReleaseComplete__NW__MS_template::PDU__ML3__ReleaseComplete__NW__MS_template(const PDU__ML3__ReleaseComplete__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__ReleaseComplete__NW__MS_template::match(const PDU__ML3__ReleaseComplete__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const MobileL3__CommonIE__Types::ML3__Cause__TLV&)other_value.cause(), legacy) : !single_value->field_cause.match_omit(legacy)))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.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_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
}
return FALSE;
}

boolean PDU__ML3__ReleaseComplete__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || (single_value->field_cause.is_omit() || single_value->field_cause.is_bound())
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound());
}

boolean PDU__ML3__ReleaseComplete__NW__MS_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_cause.is_omit() || single_value->field_cause.is_value())
 && (single_value->field_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value());
}

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

PDU__ML3__ReleaseComplete__NW__MS PDU__ML3__ReleaseComplete__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
PDU__ML3__ReleaseComplete__NW__MS 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_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
return ret_val;
}

void PDU__ML3__ReleaseComplete__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__ReleaseComplete__NW__MS_template[list_length];
}

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

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

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

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

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

MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__ReleaseComplete__NW__MS_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__ReleaseComplete__NW__MS_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
return single_value->field_cause;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__ReleaseComplete__NW__MS_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__ReleaseComplete__NW__MS_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
return single_value->field_facility;
}

User__user__TLV_template& PDU__ML3__ReleaseComplete__NW__MS_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__ReleaseComplete__NW__MS_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
return single_value->field_user__user;
}

int PDU__ML3__ReleaseComplete__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_cause.is_present()) ret_val++;
      if (single_value->field_facility.is_present()) ret_val++;
      if (single_value->field_user__user.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_CC_Types.PDU_ML3_ReleaseComplete_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
  }
  return 0;
}

void PDU__ML3__ReleaseComplete__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.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__ReleaseComplete__NW__MS_template::log_match(const PDU__ML3__ReleaseComplete__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.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(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.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__ReleaseComplete__NW__MS_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 (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
}

void PDU__ML3__ReleaseComplete__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_user__user.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_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
}
}

void PDU__ML3__ReleaseComplete__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_user__user.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__ReleaseComplete__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS.");
}
}

void PDU__ML3__ReleaseComplete__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__ReleaseComplete__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().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_CC_Types.PDU_ML3_ReleaseComplete_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__ReleaseComplete__NW__MS_template* precondition = new PDU__ML3__ReleaseComplete__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__ReleaseComplete__NW__MS_template* implied_template = new PDU__ML3__ReleaseComplete__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__ReleaseComplete__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__ReleaseComplete__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_NW_MS");
}

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

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

PDU__ML3__ReleaseComplete__MS__NW::PDU__ML3__ReleaseComplete__MS__NW()
{
}

PDU__ML3__ReleaseComplete__MS__NW::PDU__ML3__ReleaseComplete__MS__NW(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< MobileL3__CommonIE__Types::ML3__Cause__TLV >& par_cause,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< User__user__TLV >& par_user__user,
    const OPTIONAL< MobileL3__CommonIE__Types::SS__VersionIndicator >& par_ss__VersionIndicator)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cause(par_cause),
  field_facility(par_facility),
  field_user__user(par_user__user),
  field_ss__VersionIndicator(par_ss__VersionIndicator)
{
}

PDU__ML3__ReleaseComplete__MS__NW::PDU__ML3__ReleaseComplete__MS__NW(const PDU__ML3__ReleaseComplete__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
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.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
else field_ss__VersionIndicator.clean_up();
}

void PDU__ML3__ReleaseComplete__MS__NW::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cause.clean_up();
field_facility.clean_up();
field_user__user.clean_up();
field_ss__VersionIndicator.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__ReleaseComplete__MS__NW::get_descriptor() const { return &PDU__ML3__ReleaseComplete__MS__NW_descr_; }
PDU__ML3__ReleaseComplete__MS__NW& PDU__ML3__ReleaseComplete__MS__NW::operator=(const PDU__ML3__ReleaseComplete__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
  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.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
  if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
  else field_ss__VersionIndicator.clean_up();
}
return *this;
}

boolean PDU__ML3__ReleaseComplete__MS__NW::operator==(const PDU__ML3__ReleaseComplete__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cause==other_value.field_cause
  && field_facility==other_value.field_facility
  && field_user__user==other_value.field_user__user
  && field_ss__VersionIndicator==other_value.field_ss__VersionIndicator;
}

boolean PDU__ML3__ReleaseComplete__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound())
  || (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_bound());
}
boolean PDU__ML3__ReleaseComplete__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value())
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value())
  && (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_value());
}
int PDU__ML3__ReleaseComplete__MS__NW::size_of() const
{
  int ret_val = 2;
  if (field_cause.ispresent()) ret_val++;
  if (field_facility.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  if (field_ss__VersionIndicator.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__ReleaseComplete__MS__NW::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(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__ReleaseComplete__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
}

void PDU__ML3__ReleaseComplete__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW");
  }
}

void PDU__ML3__ReleaseComplete__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_user__user.encode_text(text_buf);
field_ss__VersionIndicator.encode_text(text_buf);
}

void PDU__ML3__ReleaseComplete__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_user__user.decode_text(text_buf);
field_ss__VersionIndicator.decode_text(text_buf);
}

void PDU__ML3__ReleaseComplete__MS__NW::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__ReleaseComplete__MS__NW::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__ReleaseComplete__MS__NW::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_cause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5){
  field_cause=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_cause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_facility = 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::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, User__user__TLV_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__user__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_ss__VersionIndicator = 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::SS__VersionIndicator_descr_.raw->forceomit);
  decoded_field_length = field_ss__VersionIndicator().RAW_decode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_ss__VersionIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().elementIdentifier() !=  os_3){
  field_ss__VersionIndicator=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_ss__VersionIndicator=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__ReleaseComplete__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_cause.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_facility.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, User__user__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_ss__VersionIndicator.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::SS__VersionIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = 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_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__user__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_ss__VersionIndicator.ispresent()) {
  encoded_length += field_ss__VersionIndicator().RAW_encode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_cause.ispresent() && (!field_cause.ispresent() || field_cause().elementIdentifier() !=  os_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  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_2.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_ss__VersionIndicator.ispresent() && (!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().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[]={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_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__ReleaseComplete__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::ML3__Cause__TLV_template field_cause;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
User__user__TLV_template field_user__user;
MobileL3__CommonIE__Types::SS__VersionIndicator_template field_ss__VersionIndicator;
};

void PDU__ML3__ReleaseComplete__MS__NW_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_cause = ANY_OR_OMIT;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
single_value->field_ss__VersionIndicator = ANY_OR_OMIT;
}
}
}

void PDU__ML3__ReleaseComplete__MS__NW_template::copy_value(const PDU__ML3__ReleaseComplete__MS__NW& 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.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
if (other_value.ss__VersionIndicator().is_bound()) {
  if (other_value.ss__VersionIndicator().ispresent()) single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator()();
  else single_value->field_ss__VersionIndicator = OMIT_VALUE;
} else {
  single_value->field_ss__VersionIndicator.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__ReleaseComplete__MS__NW_template::copy_template(const PDU__ML3__ReleaseComplete__MS__NW_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.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ss__VersionIndicator().get_selection()) {
single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator();
} else {
single_value->field_ss__VersionIndicator.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__ReleaseComplete__MS__NW_template[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__ReleaseComplete__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__ReleaseComplete__MS__NW_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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__ML3__ReleaseComplete__MS__NW_template::PDU__ML3__ReleaseComplete__MS__NW_template()
{
}

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

PDU__ML3__ReleaseComplete__MS__NW_template::PDU__ML3__ReleaseComplete__MS__NW_template(const PDU__ML3__ReleaseComplete__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__ReleaseComplete__MS__NW_template::match(const PDU__ML3__ReleaseComplete__MS__NW& 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.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const MobileL3__CommonIE__Types::ML3__Cause__TLV&)other_value.cause(), legacy) : !single_value->field_cause.match_omit(legacy)))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__user__TLV&)other_value.user__user(), legacy) : !single_value->field_user__user.match_omit(legacy)))return FALSE;
if(!other_value.ss__VersionIndicator().is_bound()) return FALSE;
if((other_value.ss__VersionIndicator().ispresent() ? !single_value->field_ss__VersionIndicator.match((const MobileL3__CommonIE__Types::SS__VersionIndicator&)other_value.ss__VersionIndicator(), legacy) : !single_value->field_ss__VersionIndicator.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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
}
return FALSE;
}

boolean PDU__ML3__ReleaseComplete__MS__NW_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_cause.is_omit() || single_value->field_cause.is_bound())
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound())
 || (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_bound());
}

boolean PDU__ML3__ReleaseComplete__MS__NW_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_cause.is_omit() || single_value->field_cause.is_value())
 && (single_value->field_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value())
 && (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_value());
}

void PDU__ML3__ReleaseComplete__MS__NW_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__ReleaseComplete__MS__NW PDU__ML3__ReleaseComplete__MS__NW_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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
PDU__ML3__ReleaseComplete__MS__NW 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_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
if (single_value->field_ss__VersionIndicator.is_omit()) ret_val.ss__VersionIndicator() = OMIT_VALUE;
else if (single_value->field_ss__VersionIndicator.is_bound()) {
ret_val.ss__VersionIndicator() = single_value->field_ss__VersionIndicator.valueof();
}
return ret_val;
}

void PDU__ML3__ReleaseComplete__MS__NW_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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__ReleaseComplete__MS__NW_template[list_length];
}

PDU__ML3__ReleaseComplete__MS__NW_template& PDU__ML3__ReleaseComplete__MS__NW_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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
return value_list.list_value[list_index];
}

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

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

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

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

MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__ReleaseComplete__MS__NW_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__TLV_template& PDU__ML3__ReleaseComplete__MS__NW_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
return single_value->field_cause;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__ReleaseComplete__MS__NW_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__ReleaseComplete__MS__NW_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
return single_value->field_facility;
}

User__user__TLV_template& PDU__ML3__ReleaseComplete__MS__NW_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__user__TLV_template& PDU__ML3__ReleaseComplete__MS__NW_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
return single_value->field_user__user;
}

MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__ReleaseComplete__MS__NW_template::ss__VersionIndicator()
{
set_specific();
return single_value->field_ss__VersionIndicator;
}

const MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__ReleaseComplete__MS__NW_template::ss__VersionIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ss_VersionIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
return single_value->field_ss__VersionIndicator;
}

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

void PDU__ML3__ReleaseComplete__MS__NW_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(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
single_value->field_ss__VersionIndicator.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__ReleaseComplete__MS__NW_template::log_match(const PDU__ML3__ReleaseComplete__MS__NW& 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.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ss__VersionIndicator().ispresent()){
if(!single_value->field_ss__VersionIndicator.match(match_value.ss__VersionIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ss_VersionIndicator");
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ss__VersionIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ss_VersionIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ss__VersionIndicator.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(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
if (match_value.ss__VersionIndicator().ispresent()) {
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ss__VersionIndicator.log();
if (single_value->field_ss__VersionIndicator.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__ReleaseComplete__MS__NW_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 (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
}

void PDU__ML3__ReleaseComplete__MS__NW_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_cause.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_user__user.encode_text(text_buf);
single_value->field_ss__VersionIndicator.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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
}
}

void PDU__ML3__ReleaseComplete__MS__NW_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_cause.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_user__user.decode_text(text_buf);
single_value->field_ss__VersionIndicator.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__ReleaseComplete__MS__NW_template[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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW.");
}
}

void PDU__ML3__ReleaseComplete__MS__NW_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__ReleaseComplete__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__ReleaseComplete__MS__NW_template* precondition = new PDU__ML3__ReleaseComplete__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__ReleaseComplete__MS__NW_template* implied_template = new PDU__ML3__ReleaseComplete__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__ReleaseComplete__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__ReleaseComplete__MS__NW_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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW");
single_value->field_ss__VersionIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_ReleaseComplete_MS_NW");
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_CC_Types.PDU_ML3_ReleaseComplete_MS_NW");
}

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

boolean PDU__ML3__ReleaseComplete__MS__NW_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__Retrieve::PDU__ML3__Retrieve()
{
}

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

PDU__ML3__Retrieve::PDU__ML3__Retrieve(const PDU__ML3__Retrieve& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Retrieve.");
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__Retrieve::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Retrieve::get_descriptor() const { return &PDU__ML3__Retrieve_descr_; }
PDU__ML3__Retrieve& PDU__ML3__Retrieve::operator=(const PDU__ML3__Retrieve& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Retrieve.");
  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__Retrieve::operator==(const PDU__ML3__Retrieve& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__Retrieve::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__Retrieve::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__Retrieve::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__Retrieve::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

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

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

void PDU__ML3__Retrieve::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__Retrieve::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__Retrieve::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__Retrieve::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__Retrieve_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__Retrieve_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__Retrieve_template::copy_value(const PDU__ML3__Retrieve& 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__Retrieve_template::copy_template(const PDU__ML3__Retrieve_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__Retrieve_template[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__Retrieve_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Retrieve_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_CC_Types.PDU_ML3_Retrieve.");
break;
}
set_selection(other_value);
}

PDU__ML3__Retrieve_template::PDU__ML3__Retrieve_template()
{
}

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

PDU__ML3__Retrieve_template::PDU__ML3__Retrieve_template(const PDU__ML3__Retrieve& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__Retrieve_template::match(const PDU__ML3__Retrieve& 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_CC_Types.PDU_ML3_Retrieve.");
}
return FALSE;
}

boolean PDU__ML3__Retrieve_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__Retrieve_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__Retrieve_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__Retrieve PDU__ML3__Retrieve_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_CC_Types.PDU_ML3_Retrieve.");
PDU__ML3__Retrieve 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__Retrieve_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_CC_Types.PDU_ML3_Retrieve.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Retrieve_template[list_length];
}

PDU__ML3__Retrieve_template& PDU__ML3__Retrieve_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_CC_Types.PDU_ML3_Retrieve.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Retrieve.");
return value_list.list_value[list_index];
}

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

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

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

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

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

void PDU__ML3__Retrieve_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__Retrieve_template::log_match(const PDU__ML3__Retrieve& 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__Retrieve_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__Retrieve_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_CC_Types.PDU_ML3_Retrieve.");
}
}

void PDU__ML3__Retrieve_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__Retrieve_template[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_CC_Types.PDU_ML3_Retrieve.");
}
}

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

void PDU__ML3__Retrieve_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_CC_Types.PDU_ML3_Retrieve");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Retrieve");
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_CC_Types.PDU_ML3_Retrieve");
}

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

boolean PDU__ML3__Retrieve_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__RetrieveAck::PDU__ML3__RetrieveAck()
{
}

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

PDU__ML3__RetrieveAck::PDU__ML3__RetrieveAck(const PDU__ML3__RetrieveAck& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_RetrieveAck.");
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__RetrieveAck::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__RetrieveAck::get_descriptor() const { return &PDU__ML3__RetrieveAck_descr_; }
PDU__ML3__RetrieveAck& PDU__ML3__RetrieveAck::operator=(const PDU__ML3__RetrieveAck& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_RetrieveAck.");
  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__RetrieveAck::operator==(const PDU__ML3__RetrieveAck& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd;
}

boolean PDU__ML3__RetrieveAck::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound());
}
boolean PDU__ML3__RetrieveAck::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value();
}
void PDU__ML3__RetrieveAck::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__RetrieveAck::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
}

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

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

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

void PDU__ML3__RetrieveAck::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__RetrieveAck::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__RetrieveAck::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__RetrieveAck::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__RetrieveAck_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
};

void PDU__ML3__RetrieveAck_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__RetrieveAck_template::copy_value(const PDU__ML3__RetrieveAck& 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__RetrieveAck_template::copy_template(const PDU__ML3__RetrieveAck_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__RetrieveAck_template[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__RetrieveAck_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__RetrieveAck_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_CC_Types.PDU_ML3_RetrieveAck.");
break;
}
set_selection(other_value);
}

PDU__ML3__RetrieveAck_template::PDU__ML3__RetrieveAck_template()
{
}

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

PDU__ML3__RetrieveAck_template::PDU__ML3__RetrieveAck_template(const PDU__ML3__RetrieveAck& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__RetrieveAck_template::match(const PDU__ML3__RetrieveAck& 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_CC_Types.PDU_ML3_RetrieveAck.");
}
return FALSE;
}

boolean PDU__ML3__RetrieveAck_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__RetrieveAck_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__RetrieveAck_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__RetrieveAck PDU__ML3__RetrieveAck_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_CC_Types.PDU_ML3_RetrieveAck.");
PDU__ML3__RetrieveAck 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__RetrieveAck_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_CC_Types.PDU_ML3_RetrieveAck.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__RetrieveAck_template[list_length];
}

PDU__ML3__RetrieveAck_template& PDU__ML3__RetrieveAck_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_CC_Types.PDU_ML3_RetrieveAck.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_RetrieveAck.");
return value_list.list_value[list_index];
}

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

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

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

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

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

void PDU__ML3__RetrieveAck_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__RetrieveAck_template::log_match(const PDU__ML3__RetrieveAck& 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__RetrieveAck_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__RetrieveAck_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_CC_Types.PDU_ML3_RetrieveAck.");
}
}

void PDU__ML3__RetrieveAck_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__RetrieveAck_template[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_CC_Types.PDU_ML3_RetrieveAck.");
}
}

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

void PDU__ML3__RetrieveAck_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_CC_Types.PDU_ML3_RetrieveAck");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_RetrieveAck");
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_CC_Types.PDU_ML3_RetrieveAck");
}

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

boolean PDU__ML3__RetrieveAck_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__RetrieveRej::PDU__ML3__RetrieveRej()
{
}

PDU__ML3__RetrieveRej::PDU__ML3__RetrieveRej(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const MobileL3__CommonIE__Types::ML3__Cause__LV& par_cause)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cause(par_cause)
{
}

PDU__ML3__RetrieveRej::PDU__ML3__RetrieveRej(const PDU__ML3__RetrieveRej& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_RetrieveRej.");
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.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__ML3__RetrieveRej::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__RetrieveRej::get_descriptor() const { return &PDU__ML3__RetrieveRej_descr_; }
PDU__ML3__RetrieveRej& PDU__ML3__RetrieveRej::operator=(const PDU__ML3__RetrieveRej& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_RetrieveRej.");
  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.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

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

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

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

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

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

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

void PDU__ML3__RetrieveRej::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__RetrieveRej::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__RetrieveRej::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::ML3__Cause__LV_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(MobileL3__CommonIE__Types::ML3__Cause__LV_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__RetrieveRej::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, MobileL3__CommonIE__Types::ML3__Cause__LV_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_cause.RAW_encode(MobileL3__CommonIE__Types::ML3__Cause__LV_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__ML3__RetrieveRej_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
MobileL3__CommonIE__Types::ML3__Cause__LV_template field_cause;
};

void PDU__ML3__RetrieveRej_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_cause = ANY_VALUE;
}
}
}

void PDU__ML3__RetrieveRej_template::copy_value(const PDU__ML3__RetrieveRej& 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.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__RetrieveRej_template::copy_template(const PDU__ML3__RetrieveRej_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.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.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__RetrieveRej_template[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__RetrieveRej_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__RetrieveRej_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_CC_Types.PDU_ML3_RetrieveRej.");
break;
}
set_selection(other_value);
}

PDU__ML3__RetrieveRej_template::PDU__ML3__RetrieveRej_template()
{
}

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

PDU__ML3__RetrieveRej_template::PDU__ML3__RetrieveRej_template(const PDU__ML3__RetrieveRej& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__ML3__RetrieveRej_template::match(const PDU__ML3__RetrieveRej& 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.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), 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_CC_Types.PDU_ML3_RetrieveRej.");
}
return FALSE;
}

boolean PDU__ML3__RetrieveRej_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_cause.is_bound();
}

boolean PDU__ML3__RetrieveRej_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_cause.is_value();
}

void PDU__ML3__RetrieveRej_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__RetrieveRej PDU__ML3__RetrieveRej_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_CC_Types.PDU_ML3_RetrieveRej.");
PDU__ML3__RetrieveRej 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_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

void PDU__ML3__RetrieveRej_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_CC_Types.PDU_ML3_RetrieveRej.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__RetrieveRej_template[list_length];
}

PDU__ML3__RetrieveRej_template& PDU__ML3__RetrieveRej_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_CC_Types.PDU_ML3_RetrieveRej.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_RetrieveRej.");
return value_list.list_value[list_index];
}

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

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

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

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

MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__RetrieveRej_template::cause()
{
set_specific();
return single_value->field_cause;
}

const MobileL3__CommonIE__Types::ML3__Cause__LV_template& PDU__ML3__RetrieveRej_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_RetrieveRej.");
return single_value->field_cause;
}

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

void PDU__ML3__RetrieveRej_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(", cause := ");
single_value->field_cause.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__RetrieveRej_template::log_match(const PDU__ML3__RetrieveRej& 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_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), 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(", cause := ");
single_value->field_cause.log_match(match_value.cause(), 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__RetrieveRej_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 (cause().is_bound()) cause().set_implicit_omit();
}

void PDU__ML3__RetrieveRej_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_cause.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_CC_Types.PDU_ML3_RetrieveRej.");
}
}

void PDU__ML3__RetrieveRej_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_cause.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__RetrieveRej_template[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_CC_Types.PDU_ML3_RetrieveRej.");
}
}

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

void PDU__ML3__RetrieveRej_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_CC_Types.PDU_ML3_RetrieveRej");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_RetrieveRej");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_RetrieveRej");
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_CC_Types.PDU_ML3_RetrieveRej");
}

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

boolean PDU__ML3__RetrieveRej_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__Setup__NW__MS::PDU__ML3__Setup__NW__MS()
{
}

PDU__ML3__Setup__NW__MS::PDU__ML3__Setup__NW__MS(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< RepeatIndicator >& par_bcRepeatIndicator,
    const OPTIONAL< BearerCapability__TLV >& par_bearerCapability1,
    const OPTIONAL< BearerCapability__TLV >& par_bearerCapability2,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< ProgressIndicator__TLV >& par_progressIndicator,
    const OPTIONAL< ML3__Signal >& par_signal,
    const OPTIONAL< CallingPartyBCD__Number >& par_callingPartyBCD__Number,
    const OPTIONAL< CallingPartySubAddress >& par_callingPartySubAddress,
    const OPTIONAL< CalledPartyBCD__Number >& par_calledPartyBCD__Number,
    const OPTIONAL< CalledPartySubAddress >& par_calledPartySubAddress,
    const OPTIONAL< RedirectingPartyBCDNumberTLV >& par_redirectingPartyBCDNumber,
    const OPTIONAL< RedirectingPartySubaddressTLV >& par_redirectingPartySubaddress,
    const OPTIONAL< RepeatIndicator >& par_llc__RepeatIndicator,
    const OPTIONAL< LowLayerCompatibility >& par_lowLayerCompatibility1,
    const OPTIONAL< LowLayerCompatibility >& par_lowLayerCompatibility2,
    const OPTIONAL< RepeatIndicator >& par_hlc__RepeatIndicator,
    const OPTIONAL< HighLayerCompatibility >& par_highLayerCompatibility1,
    const OPTIONAL< HighLayerCompatibility >& par_highLayerCompatibility2,
    const OPTIONAL< User__userShort >& par_user__user,
    const OPTIONAL< MobileL3__CommonIE__Types::PriorityLevel__ML3 >& par_priority,
    const OPTIONAL< AlertingPattern >& par_alert,
    const OPTIONAL< NetworkCallControlCapabilities >& par_networkCCCapabilities,
    const OPTIONAL< CauseofNoCli >& par_causeofNoCli,
    const OPTIONAL< BackupBearerCapacity >& par_backupBearerCapacity)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_bcRepeatIndicator(par_bcRepeatIndicator),
  field_bearerCapability1(par_bearerCapability1),
  field_bearerCapability2(par_bearerCapability2),
  field_facility(par_facility),
  field_progressIndicator(par_progressIndicator),
  field_signal(par_signal),
  field_callingPartyBCD__Number(par_callingPartyBCD__Number),
  field_callingPartySubAddress(par_callingPartySubAddress),
  field_calledPartyBCD__Number(par_calledPartyBCD__Number),
  field_calledPartySubAddress(par_calledPartySubAddress),
  field_redirectingPartyBCDNumber(par_redirectingPartyBCDNumber),
  field_redirectingPartySubaddress(par_redirectingPartySubaddress),
  field_llc__RepeatIndicator(par_llc__RepeatIndicator),
  field_lowLayerCompatibility1(par_lowLayerCompatibility1),
  field_lowLayerCompatibility2(par_lowLayerCompatibility2),
  field_hlc__RepeatIndicator(par_hlc__RepeatIndicator),
  field_highLayerCompatibility1(par_highLayerCompatibility1),
  field_highLayerCompatibility2(par_highLayerCompatibility2),
  field_user__user(par_user__user),
  field_priority(par_priority),
  field_alert(par_alert),
  field_networkCCCapabilities(par_networkCCCapabilities),
  field_causeofNoCli(par_causeofNoCli),
  field_backupBearerCapacity(par_backupBearerCapacity)
{
}

PDU__ML3__Setup__NW__MS::PDU__ML3__Setup__NW__MS(const PDU__ML3__Setup__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
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.bcRepeatIndicator().is_bound()) field_bcRepeatIndicator = other_value.bcRepeatIndicator();
else field_bcRepeatIndicator.clean_up();
if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
else field_bearerCapability1.clean_up();
if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
else field_bearerCapability2.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
else field_progressIndicator.clean_up();
if (other_value.signal().is_bound()) field_signal = other_value.signal();
else field_signal.clean_up();
if (other_value.callingPartyBCD__Number().is_bound()) field_callingPartyBCD__Number = other_value.callingPartyBCD__Number();
else field_callingPartyBCD__Number.clean_up();
if (other_value.callingPartySubAddress().is_bound()) field_callingPartySubAddress = other_value.callingPartySubAddress();
else field_callingPartySubAddress.clean_up();
if (other_value.calledPartyBCD__Number().is_bound()) field_calledPartyBCD__Number = other_value.calledPartyBCD__Number();
else field_calledPartyBCD__Number.clean_up();
if (other_value.calledPartySubAddress().is_bound()) field_calledPartySubAddress = other_value.calledPartySubAddress();
else field_calledPartySubAddress.clean_up();
if (other_value.redirectingPartyBCDNumber().is_bound()) field_redirectingPartyBCDNumber = other_value.redirectingPartyBCDNumber();
else field_redirectingPartyBCDNumber.clean_up();
if (other_value.redirectingPartySubaddress().is_bound()) field_redirectingPartySubaddress = other_value.redirectingPartySubaddress();
else field_redirectingPartySubaddress.clean_up();
if (other_value.llc__RepeatIndicator().is_bound()) field_llc__RepeatIndicator = other_value.llc__RepeatIndicator();
else field_llc__RepeatIndicator.clean_up();
if (other_value.lowLayerCompatibility1().is_bound()) field_lowLayerCompatibility1 = other_value.lowLayerCompatibility1();
else field_lowLayerCompatibility1.clean_up();
if (other_value.lowLayerCompatibility2().is_bound()) field_lowLayerCompatibility2 = other_value.lowLayerCompatibility2();
else field_lowLayerCompatibility2.clean_up();
if (other_value.hlc__RepeatIndicator().is_bound()) field_hlc__RepeatIndicator = other_value.hlc__RepeatIndicator();
else field_hlc__RepeatIndicator.clean_up();
if (other_value.highLayerCompatibility1().is_bound()) field_highLayerCompatibility1 = other_value.highLayerCompatibility1();
else field_highLayerCompatibility1.clean_up();
if (other_value.highLayerCompatibility2().is_bound()) field_highLayerCompatibility2 = other_value.highLayerCompatibility2();
else field_highLayerCompatibility2.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
if (other_value.priority().is_bound()) field_priority = other_value.priority();
else field_priority.clean_up();
if (other_value.alert().is_bound()) field_alert = other_value.alert();
else field_alert.clean_up();
if (other_value.networkCCCapabilities().is_bound()) field_networkCCCapabilities = other_value.networkCCCapabilities();
else field_networkCCCapabilities.clean_up();
if (other_value.causeofNoCli().is_bound()) field_causeofNoCli = other_value.causeofNoCli();
else field_causeofNoCli.clean_up();
if (other_value.backupBearerCapacity().is_bound()) field_backupBearerCapacity = other_value.backupBearerCapacity();
else field_backupBearerCapacity.clean_up();
}

void PDU__ML3__Setup__NW__MS::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_bcRepeatIndicator.clean_up();
field_bearerCapability1.clean_up();
field_bearerCapability2.clean_up();
field_facility.clean_up();
field_progressIndicator.clean_up();
field_signal.clean_up();
field_callingPartyBCD__Number.clean_up();
field_callingPartySubAddress.clean_up();
field_calledPartyBCD__Number.clean_up();
field_calledPartySubAddress.clean_up();
field_redirectingPartyBCDNumber.clean_up();
field_redirectingPartySubaddress.clean_up();
field_llc__RepeatIndicator.clean_up();
field_lowLayerCompatibility1.clean_up();
field_lowLayerCompatibility2.clean_up();
field_hlc__RepeatIndicator.clean_up();
field_highLayerCompatibility1.clean_up();
field_highLayerCompatibility2.clean_up();
field_user__user.clean_up();
field_priority.clean_up();
field_alert.clean_up();
field_networkCCCapabilities.clean_up();
field_causeofNoCli.clean_up();
field_backupBearerCapacity.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Setup__NW__MS::get_descriptor() const { return &PDU__ML3__Setup__NW__MS_descr_; }
PDU__ML3__Setup__NW__MS& PDU__ML3__Setup__NW__MS::operator=(const PDU__ML3__Setup__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
  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.bcRepeatIndicator().is_bound()) field_bcRepeatIndicator = other_value.bcRepeatIndicator();
  else field_bcRepeatIndicator.clean_up();
  if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
  else field_bearerCapability1.clean_up();
  if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
  else field_bearerCapability2.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.progressIndicator().is_bound()) field_progressIndicator = other_value.progressIndicator();
  else field_progressIndicator.clean_up();
  if (other_value.signal().is_bound()) field_signal = other_value.signal();
  else field_signal.clean_up();
  if (other_value.callingPartyBCD__Number().is_bound()) field_callingPartyBCD__Number = other_value.callingPartyBCD__Number();
  else field_callingPartyBCD__Number.clean_up();
  if (other_value.callingPartySubAddress().is_bound()) field_callingPartySubAddress = other_value.callingPartySubAddress();
  else field_callingPartySubAddress.clean_up();
  if (other_value.calledPartyBCD__Number().is_bound()) field_calledPartyBCD__Number = other_value.calledPartyBCD__Number();
  else field_calledPartyBCD__Number.clean_up();
  if (other_value.calledPartySubAddress().is_bound()) field_calledPartySubAddress = other_value.calledPartySubAddress();
  else field_calledPartySubAddress.clean_up();
  if (other_value.redirectingPartyBCDNumber().is_bound()) field_redirectingPartyBCDNumber = other_value.redirectingPartyBCDNumber();
  else field_redirectingPartyBCDNumber.clean_up();
  if (other_value.redirectingPartySubaddress().is_bound()) field_redirectingPartySubaddress = other_value.redirectingPartySubaddress();
  else field_redirectingPartySubaddress.clean_up();
  if (other_value.llc__RepeatIndicator().is_bound()) field_llc__RepeatIndicator = other_value.llc__RepeatIndicator();
  else field_llc__RepeatIndicator.clean_up();
  if (other_value.lowLayerCompatibility1().is_bound()) field_lowLayerCompatibility1 = other_value.lowLayerCompatibility1();
  else field_lowLayerCompatibility1.clean_up();
  if (other_value.lowLayerCompatibility2().is_bound()) field_lowLayerCompatibility2 = other_value.lowLayerCompatibility2();
  else field_lowLayerCompatibility2.clean_up();
  if (other_value.hlc__RepeatIndicator().is_bound()) field_hlc__RepeatIndicator = other_value.hlc__RepeatIndicator();
  else field_hlc__RepeatIndicator.clean_up();
  if (other_value.highLayerCompatibility1().is_bound()) field_highLayerCompatibility1 = other_value.highLayerCompatibility1();
  else field_highLayerCompatibility1.clean_up();
  if (other_value.highLayerCompatibility2().is_bound()) field_highLayerCompatibility2 = other_value.highLayerCompatibility2();
  else field_highLayerCompatibility2.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
  if (other_value.priority().is_bound()) field_priority = other_value.priority();
  else field_priority.clean_up();
  if (other_value.alert().is_bound()) field_alert = other_value.alert();
  else field_alert.clean_up();
  if (other_value.networkCCCapabilities().is_bound()) field_networkCCCapabilities = other_value.networkCCCapabilities();
  else field_networkCCCapabilities.clean_up();
  if (other_value.causeofNoCli().is_bound()) field_causeofNoCli = other_value.causeofNoCli();
  else field_causeofNoCli.clean_up();
  if (other_value.backupBearerCapacity().is_bound()) field_backupBearerCapacity = other_value.backupBearerCapacity();
  else field_backupBearerCapacity.clean_up();
}
return *this;
}

boolean PDU__ML3__Setup__NW__MS::operator==(const PDU__ML3__Setup__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_bcRepeatIndicator==other_value.field_bcRepeatIndicator
  && field_bearerCapability1==other_value.field_bearerCapability1
  && field_bearerCapability2==other_value.field_bearerCapability2
  && field_facility==other_value.field_facility
  && field_progressIndicator==other_value.field_progressIndicator
  && field_signal==other_value.field_signal
  && field_callingPartyBCD__Number==other_value.field_callingPartyBCD__Number
  && field_callingPartySubAddress==other_value.field_callingPartySubAddress
  && field_calledPartyBCD__Number==other_value.field_calledPartyBCD__Number
  && field_calledPartySubAddress==other_value.field_calledPartySubAddress
  && field_redirectingPartyBCDNumber==other_value.field_redirectingPartyBCDNumber
  && field_redirectingPartySubaddress==other_value.field_redirectingPartySubaddress
  && field_llc__RepeatIndicator==other_value.field_llc__RepeatIndicator
  && field_lowLayerCompatibility1==other_value.field_lowLayerCompatibility1
  && field_lowLayerCompatibility2==other_value.field_lowLayerCompatibility2
  && field_hlc__RepeatIndicator==other_value.field_hlc__RepeatIndicator
  && field_highLayerCompatibility1==other_value.field_highLayerCompatibility1
  && field_highLayerCompatibility2==other_value.field_highLayerCompatibility2
  && field_user__user==other_value.field_user__user
  && field_priority==other_value.field_priority
  && field_alert==other_value.field_alert
  && field_networkCCCapabilities==other_value.field_networkCCCapabilities
  && field_causeofNoCli==other_value.field_causeofNoCli
  && field_backupBearerCapacity==other_value.field_backupBearerCapacity;
}

boolean PDU__ML3__Setup__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_bcRepeatIndicator.get_selection() || field_bcRepeatIndicator.is_bound())
  || (OPTIONAL_OMIT == field_bearerCapability1.get_selection() || field_bearerCapability1.is_bound())
  || (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_bound())
  || (OPTIONAL_OMIT == field_signal.get_selection() || field_signal.is_bound())
  || (OPTIONAL_OMIT == field_callingPartyBCD__Number.get_selection() || field_callingPartyBCD__Number.is_bound())
  || (OPTIONAL_OMIT == field_callingPartySubAddress.get_selection() || field_callingPartySubAddress.is_bound())
  || (OPTIONAL_OMIT == field_calledPartyBCD__Number.get_selection() || field_calledPartyBCD__Number.is_bound())
  || (OPTIONAL_OMIT == field_calledPartySubAddress.get_selection() || field_calledPartySubAddress.is_bound())
  || (OPTIONAL_OMIT == field_redirectingPartyBCDNumber.get_selection() || field_redirectingPartyBCDNumber.is_bound())
  || (OPTIONAL_OMIT == field_redirectingPartySubaddress.get_selection() || field_redirectingPartySubaddress.is_bound())
  || (OPTIONAL_OMIT == field_llc__RepeatIndicator.get_selection() || field_llc__RepeatIndicator.is_bound())
  || (OPTIONAL_OMIT == field_lowLayerCompatibility1.get_selection() || field_lowLayerCompatibility1.is_bound())
  || (OPTIONAL_OMIT == field_lowLayerCompatibility2.get_selection() || field_lowLayerCompatibility2.is_bound())
  || (OPTIONAL_OMIT == field_hlc__RepeatIndicator.get_selection() || field_hlc__RepeatIndicator.is_bound())
  || (OPTIONAL_OMIT == field_highLayerCompatibility1.get_selection() || field_highLayerCompatibility1.is_bound())
  || (OPTIONAL_OMIT == field_highLayerCompatibility2.get_selection() || field_highLayerCompatibility2.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound())
  || (OPTIONAL_OMIT == field_priority.get_selection() || field_priority.is_bound())
  || (OPTIONAL_OMIT == field_alert.get_selection() || field_alert.is_bound())
  || (OPTIONAL_OMIT == field_networkCCCapabilities.get_selection() || field_networkCCCapabilities.is_bound())
  || (OPTIONAL_OMIT == field_causeofNoCli.get_selection() || field_causeofNoCli.is_bound())
  || (OPTIONAL_OMIT == field_backupBearerCapacity.get_selection() || field_backupBearerCapacity.is_bound());
}
boolean PDU__ML3__Setup__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_bcRepeatIndicator.get_selection() || field_bcRepeatIndicator.is_value())
  && (OPTIONAL_OMIT == field_bearerCapability1.get_selection() || field_bearerCapability1.is_value())
  && (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_value())
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_progressIndicator.get_selection() || field_progressIndicator.is_value())
  && (OPTIONAL_OMIT == field_signal.get_selection() || field_signal.is_value())
  && (OPTIONAL_OMIT == field_callingPartyBCD__Number.get_selection() || field_callingPartyBCD__Number.is_value())
  && (OPTIONAL_OMIT == field_callingPartySubAddress.get_selection() || field_callingPartySubAddress.is_value())
  && (OPTIONAL_OMIT == field_calledPartyBCD__Number.get_selection() || field_calledPartyBCD__Number.is_value())
  && (OPTIONAL_OMIT == field_calledPartySubAddress.get_selection() || field_calledPartySubAddress.is_value())
  && (OPTIONAL_OMIT == field_redirectingPartyBCDNumber.get_selection() || field_redirectingPartyBCDNumber.is_value())
  && (OPTIONAL_OMIT == field_redirectingPartySubaddress.get_selection() || field_redirectingPartySubaddress.is_value())
  && (OPTIONAL_OMIT == field_llc__RepeatIndicator.get_selection() || field_llc__RepeatIndicator.is_value())
  && (OPTIONAL_OMIT == field_lowLayerCompatibility1.get_selection() || field_lowLayerCompatibility1.is_value())
  && (OPTIONAL_OMIT == field_lowLayerCompatibility2.get_selection() || field_lowLayerCompatibility2.is_value())
  && (OPTIONAL_OMIT == field_hlc__RepeatIndicator.get_selection() || field_hlc__RepeatIndicator.is_value())
  && (OPTIONAL_OMIT == field_highLayerCompatibility1.get_selection() || field_highLayerCompatibility1.is_value())
  && (OPTIONAL_OMIT == field_highLayerCompatibility2.get_selection() || field_highLayerCompatibility2.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value())
  && (OPTIONAL_OMIT == field_priority.get_selection() || field_priority.is_value())
  && (OPTIONAL_OMIT == field_alert.get_selection() || field_alert.is_value())
  && (OPTIONAL_OMIT == field_networkCCCapabilities.get_selection() || field_networkCCCapabilities.is_value())
  && (OPTIONAL_OMIT == field_causeofNoCli.get_selection() || field_causeofNoCli.is_value())
  && (OPTIONAL_OMIT == field_backupBearerCapacity.get_selection() || field_backupBearerCapacity.is_value());
}
int PDU__ML3__Setup__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_bcRepeatIndicator.ispresent()) ret_val++;
  if (field_bearerCapability1.ispresent()) ret_val++;
  if (field_bearerCapability2.ispresent()) ret_val++;
  if (field_facility.ispresent()) ret_val++;
  if (field_progressIndicator.ispresent()) ret_val++;
  if (field_signal.ispresent()) ret_val++;
  if (field_callingPartyBCD__Number.ispresent()) ret_val++;
  if (field_callingPartySubAddress.ispresent()) ret_val++;
  if (field_calledPartyBCD__Number.ispresent()) ret_val++;
  if (field_calledPartySubAddress.ispresent()) ret_val++;
  if (field_redirectingPartyBCDNumber.ispresent()) ret_val++;
  if (field_redirectingPartySubaddress.ispresent()) ret_val++;
  if (field_llc__RepeatIndicator.ispresent()) ret_val++;
  if (field_lowLayerCompatibility1.ispresent()) ret_val++;
  if (field_lowLayerCompatibility2.ispresent()) ret_val++;
  if (field_hlc__RepeatIndicator.ispresent()) ret_val++;
  if (field_highLayerCompatibility1.ispresent()) ret_val++;
  if (field_highLayerCompatibility2.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  if (field_priority.ispresent()) ret_val++;
  if (field_alert.ispresent()) ret_val++;
  if (field_networkCCCapabilities.ispresent()) ret_val++;
  if (field_causeofNoCli.ispresent()) ret_val++;
  if (field_backupBearerCapacity.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Setup__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
field_nsd.log();
TTCN_Logger::log_event_str(", bcRepeatIndicator := ");
field_bcRepeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
field_bearerCapability2.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
field_progressIndicator.log();
TTCN_Logger::log_event_str(", signal := ");
field_signal.log();
TTCN_Logger::log_event_str(", callingPartyBCD_Number := ");
field_callingPartyBCD__Number.log();
TTCN_Logger::log_event_str(", callingPartySubAddress := ");
field_callingPartySubAddress.log();
TTCN_Logger::log_event_str(", calledPartyBCD_Number := ");
field_calledPartyBCD__Number.log();
TTCN_Logger::log_event_str(", calledPartySubAddress := ");
field_calledPartySubAddress.log();
TTCN_Logger::log_event_str(", redirectingPartyBCDNumber := ");
field_redirectingPartyBCDNumber.log();
TTCN_Logger::log_event_str(", redirectingPartySubaddress := ");
field_redirectingPartySubaddress.log();
TTCN_Logger::log_event_str(", llc_RepeatIndicator := ");
field_llc__RepeatIndicator.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility1 := ");
field_lowLayerCompatibility1.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility2 := ");
field_lowLayerCompatibility2.log();
TTCN_Logger::log_event_str(", hlc_RepeatIndicator := ");
field_hlc__RepeatIndicator.log();
TTCN_Logger::log_event_str(", highLayerCompatibility1 := ");
field_highLayerCompatibility1.log();
TTCN_Logger::log_event_str(", highLayerCompatibility2 := ");
field_highLayerCompatibility2.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(", priority := ");
field_priority.log();
TTCN_Logger::log_event_str(", alert := ");
field_alert.log();
TTCN_Logger::log_event_str(", networkCCCapabilities := ");
field_networkCCCapabilities.log();
TTCN_Logger::log_event_str(", causeofNoCli := ");
field_causeofNoCli.log();
TTCN_Logger::log_event_str(", backupBearerCapacity := ");
field_backupBearerCapacity.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Setup__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!bcRepeatIndicator().is_bound()) bcRepeatIndicator() = OMIT_VALUE;
else bcRepeatIndicator().set_implicit_omit();
if (!bearerCapability1().is_bound()) bearerCapability1() = OMIT_VALUE;
else bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!signal().is_bound()) signal() = OMIT_VALUE;
else signal().set_implicit_omit();
if (!callingPartyBCD__Number().is_bound()) callingPartyBCD__Number() = OMIT_VALUE;
else callingPartyBCD__Number().set_implicit_omit();
if (!callingPartySubAddress().is_bound()) callingPartySubAddress() = OMIT_VALUE;
else callingPartySubAddress().set_implicit_omit();
if (!calledPartyBCD__Number().is_bound()) calledPartyBCD__Number() = OMIT_VALUE;
else calledPartyBCD__Number().set_implicit_omit();
if (!calledPartySubAddress().is_bound()) calledPartySubAddress() = OMIT_VALUE;
else calledPartySubAddress().set_implicit_omit();
if (!redirectingPartyBCDNumber().is_bound()) redirectingPartyBCDNumber() = OMIT_VALUE;
else redirectingPartyBCDNumber().set_implicit_omit();
if (!redirectingPartySubaddress().is_bound()) redirectingPartySubaddress() = OMIT_VALUE;
else redirectingPartySubaddress().set_implicit_omit();
if (!llc__RepeatIndicator().is_bound()) llc__RepeatIndicator() = OMIT_VALUE;
else llc__RepeatIndicator().set_implicit_omit();
if (!lowLayerCompatibility1().is_bound()) lowLayerCompatibility1() = OMIT_VALUE;
else lowLayerCompatibility1().set_implicit_omit();
if (!lowLayerCompatibility2().is_bound()) lowLayerCompatibility2() = OMIT_VALUE;
else lowLayerCompatibility2().set_implicit_omit();
if (!hlc__RepeatIndicator().is_bound()) hlc__RepeatIndicator() = OMIT_VALUE;
else hlc__RepeatIndicator().set_implicit_omit();
if (!highLayerCompatibility1().is_bound()) highLayerCompatibility1() = OMIT_VALUE;
else highLayerCompatibility1().set_implicit_omit();
if (!highLayerCompatibility2().is_bound()) highLayerCompatibility2() = OMIT_VALUE;
else highLayerCompatibility2().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!priority().is_bound()) priority() = OMIT_VALUE;
else priority().set_implicit_omit();
if (!alert().is_bound()) alert() = OMIT_VALUE;
else alert().set_implicit_omit();
if (!networkCCCapabilities().is_bound()) networkCCCapabilities() = OMIT_VALUE;
else networkCCCapabilities().set_implicit_omit();
if (!causeofNoCli().is_bound()) causeofNoCli() = OMIT_VALUE;
else causeofNoCli().set_implicit_omit();
if (!backupBearerCapacity().is_bound()) backupBearerCapacity() = OMIT_VALUE;
else backupBearerCapacity().set_implicit_omit();
}

void PDU__ML3__Setup__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (26<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS has 26 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) bcRepeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) signal().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) callingPartyBCD__Number().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) callingPartySubAddress().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) calledPartyBCD__Number().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) calledPartySubAddress().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) redirectingPartyBCDNumber().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) redirectingPartySubaddress().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) llc__RepeatIndicator().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility1().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility2().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) hlc__RepeatIndicator().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility1().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility2().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) priority().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) alert().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) networkCCCapabilities().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) causeofNoCli().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) backupBearerCapacity().set_param(*param.get_elem(25));
    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(), "bcRepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bcRepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "signal")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          signal().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPartyBCD_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPartyBCD__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPartySubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPartySubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPartyBCD_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPartyBCD__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPartySubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPartySubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirectingPartyBCDNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirectingPartyBCDNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirectingPartySubaddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirectingPartySubaddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "llc_RepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          llc__RepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hlc_RepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hlc__RepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alert")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alert().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkCCCapabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkCCCapabilities().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "causeofNoCli")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeofNoCli().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "backupBearerCapacity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          backupBearerCapacity().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_CC_Types.PDU_ML3_Setup_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
  }
}

void PDU__ML3__Setup__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_bcRepeatIndicator.encode_text(text_buf);
field_bearerCapability1.encode_text(text_buf);
field_bearerCapability2.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_progressIndicator.encode_text(text_buf);
field_signal.encode_text(text_buf);
field_callingPartyBCD__Number.encode_text(text_buf);
field_callingPartySubAddress.encode_text(text_buf);
field_calledPartyBCD__Number.encode_text(text_buf);
field_calledPartySubAddress.encode_text(text_buf);
field_redirectingPartyBCDNumber.encode_text(text_buf);
field_redirectingPartySubaddress.encode_text(text_buf);
field_llc__RepeatIndicator.encode_text(text_buf);
field_lowLayerCompatibility1.encode_text(text_buf);
field_lowLayerCompatibility2.encode_text(text_buf);
field_hlc__RepeatIndicator.encode_text(text_buf);
field_highLayerCompatibility1.encode_text(text_buf);
field_highLayerCompatibility2.encode_text(text_buf);
field_user__user.encode_text(text_buf);
field_priority.encode_text(text_buf);
field_alert.encode_text(text_buf);
field_networkCCCapabilities.encode_text(text_buf);
field_causeofNoCli.encode_text(text_buf);
field_backupBearerCapacity.encode_text(text_buf);
}

void PDU__ML3__Setup__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_bcRepeatIndicator.decode_text(text_buf);
field_bearerCapability1.decode_text(text_buf);
field_bearerCapability2.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_progressIndicator.decode_text(text_buf);
field_signal.decode_text(text_buf);
field_callingPartyBCD__Number.decode_text(text_buf);
field_callingPartySubAddress.decode_text(text_buf);
field_calledPartyBCD__Number.decode_text(text_buf);
field_calledPartySubAddress.decode_text(text_buf);
field_redirectingPartyBCDNumber.decode_text(text_buf);
field_redirectingPartySubaddress.decode_text(text_buf);
field_llc__RepeatIndicator.decode_text(text_buf);
field_lowLayerCompatibility1.decode_text(text_buf);
field_lowLayerCompatibility2.decode_text(text_buf);
field_hlc__RepeatIndicator.decode_text(text_buf);
field_highLayerCompatibility1.decode_text(text_buf);
field_highLayerCompatibility2.decode_text(text_buf);
field_user__user.decode_text(text_buf);
field_priority.decode_text(text_buf);
field_alert.decode_text(text_buf);
field_networkCCCapabilities.decode_text(text_buf);
field_causeofNoCli.decode_text(text_buf);
field_backupBearerCapacity.decode_text(text_buf);
}

void PDU__ML3__Setup__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  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__Setup__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  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__Setup__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::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_bcRepeatIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, RepeatIndicator_descr_.raw->forceomit);
  decoded_field_length = field_bcRepeatIndicator().RAW_decode(RepeatIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_bcRepeatIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bcRepeatIndicator.ispresent() || field_bcRepeatIndicator().elementIdentifier() !=  bs_0){
  field_bcRepeatIndicator=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_bcRepeatIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_bearerCapability1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability1().RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_bearerCapability1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bearerCapability1.ispresent() || field_bearerCapability1().elementIdentifier() !=  os_4){
  field_bearerCapability1=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_bearerCapability1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_bearerCapability2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability2().RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_bearerCapability2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bearerCapability2.ispresent() || field_bearerCapability2().elementIdentifier() !=  os_4){
  field_bearerCapability2=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_bearerCapability2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_facility = 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::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_progressIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ProgressIndicator__TLV_descr_.raw->forceomit);
  decoded_field_length = field_progressIndicator().RAW_decode(ProgressIndicator__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_progressIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1){
  field_progressIndicator=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_progressIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_signal = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, ML3__Signal_descr_.raw->forceomit);
  decoded_field_length = field_signal().RAW_decode(ML3__Signal_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_signal = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_signal.ispresent() || field_signal().elementIdentifier() !=  os_17){
  field_signal=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_signal=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_callingPartyBCD__Number = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, CallingPartyBCD__Number_descr_.raw->forceomit);
  decoded_field_length = field_callingPartyBCD__Number().RAW_decode(CallingPartyBCD__Number_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_callingPartyBCD__Number = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_callingPartyBCD__Number.ispresent() || field_callingPartyBCD__Number().elementIdentifier() !=  os_18){
  field_callingPartyBCD__Number=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_callingPartyBCD__Number=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_callingPartySubAddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, CallingPartySubAddress_descr_.raw->forceomit);
  decoded_field_length = field_callingPartySubAddress().RAW_decode(CallingPartySubAddress_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_callingPartySubAddress = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_callingPartySubAddress.ispresent() || field_callingPartySubAddress().elementIdentifier() !=  os_19){
  field_callingPartySubAddress=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_callingPartySubAddress=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_calledPartyBCD__Number = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, CalledPartyBCD__Number_descr_.raw->forceomit);
  decoded_field_length = field_calledPartyBCD__Number().RAW_decode(CalledPartyBCD__Number_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_calledPartyBCD__Number = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_calledPartyBCD__Number.ispresent() || field_calledPartyBCD__Number().elementIdentifier() !=  os_20){
  field_calledPartyBCD__Number=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_calledPartyBCD__Number=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_calledPartySubAddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, CalledPartySubAddress_descr_.raw->forceomit);
  decoded_field_length = field_calledPartySubAddress().RAW_decode(CalledPartySubAddress_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_calledPartySubAddress = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_calledPartySubAddress.ispresent() || field_calledPartySubAddress().elementIdentifier() !=  os_21){
  field_calledPartySubAddress=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_calledPartySubAddress=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_redirectingPartyBCDNumber = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, RedirectingPartyBCDNumberTLV_descr_.raw->forceomit);
  decoded_field_length = field_redirectingPartyBCDNumber().RAW_decode(RedirectingPartyBCDNumberTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_redirectingPartyBCDNumber = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_redirectingPartyBCDNumber.ispresent() || field_redirectingPartyBCDNumber().elementIdentifier() !=  os_22){
  field_redirectingPartyBCDNumber=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_redirectingPartyBCDNumber=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_redirectingPartySubaddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, RedirectingPartySubaddressTLV_descr_.raw->forceomit);
  decoded_field_length = field_redirectingPartySubaddress().RAW_decode(RedirectingPartySubaddressTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_redirectingPartySubaddress = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_redirectingPartySubaddress.ispresent() || field_redirectingPartySubaddress().elementIdentifier() !=  os_23){
  field_redirectingPartySubaddress=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_redirectingPartySubaddress=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_llc__RepeatIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, RepeatIndicator_descr_.raw->forceomit);
  decoded_field_length = field_llc__RepeatIndicator().RAW_decode(RepeatIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_llc__RepeatIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_llc__RepeatIndicator.ispresent() || field_llc__RepeatIndicator().elementIdentifier() !=  bs_0){
  field_llc__RepeatIndicator=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_llc__RepeatIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_lowLayerCompatibility1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, LowLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_lowLayerCompatibility1().RAW_decode(LowLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_lowLayerCompatibility1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_lowLayerCompatibility1.ispresent() || field_lowLayerCompatibility1().elementIdentifier() !=  os_13){
  field_lowLayerCompatibility1=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_lowLayerCompatibility1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_lowLayerCompatibility2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, LowLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_lowLayerCompatibility2().RAW_decode(LowLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_lowLayerCompatibility2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_lowLayerCompatibility2.ispresent() || field_lowLayerCompatibility2().elementIdentifier() !=  os_13){
  field_lowLayerCompatibility2=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_lowLayerCompatibility2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_hlc__RepeatIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, RepeatIndicator_descr_.raw->forceomit);
  decoded_field_length = field_hlc__RepeatIndicator().RAW_decode(RepeatIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_hlc__RepeatIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_hlc__RepeatIndicator.ispresent() || field_hlc__RepeatIndicator().elementIdentifier() !=  bs_0){
  field_hlc__RepeatIndicator=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_hlc__RepeatIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_highLayerCompatibility1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, HighLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_highLayerCompatibility1().RAW_decode(HighLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_highLayerCompatibility1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_highLayerCompatibility1.ispresent() || field_highLayerCompatibility1().elementIdentifier() !=  os_14){
  field_highLayerCompatibility1=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_highLayerCompatibility1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_highLayerCompatibility2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, HighLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_highLayerCompatibility2().RAW_decode(HighLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_highLayerCompatibility2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_highLayerCompatibility2.ispresent() || field_highLayerCompatibility2().elementIdentifier() !=  os_14){
  field_highLayerCompatibility2=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_highLayerCompatibility2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, User__userShort_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__userShort_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_priority = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_.raw->forceomit);
  decoded_field_length = field_priority().RAW_decode(MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_priority = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_priority.ispresent() || field_priority().elementIdentifier() !=  bs_1){
  field_priority=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_priority=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_alert = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, AlertingPattern_descr_.raw->forceomit);
  decoded_field_length = field_alert().RAW_decode(AlertingPattern_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_alert = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_alert.ispresent() || field_alert().elementIdentifier() !=  os_24){
  field_alert=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_alert=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_networkCCCapabilities = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, NetworkCallControlCapabilities_descr_.raw->forceomit);
  decoded_field_length = field_networkCCCapabilities().RAW_decode(NetworkCallControlCapabilities_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_networkCCCapabilities = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_networkCCCapabilities.ispresent() || field_networkCCCapabilities().elementIdentifier() !=  os_8){
  field_networkCCCapabilities=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_networkCCCapabilities=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_causeofNoCli = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, CauseofNoCli_descr_.raw->forceomit);
  decoded_field_length = field_causeofNoCli().RAW_decode(CauseofNoCli_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_causeofNoCli = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_causeofNoCli.ispresent() || field_causeofNoCli().elementIdentifier() !=  os_25){
  field_causeofNoCli=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_causeofNoCli=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(25)) {
    field_backupBearerCapacity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_25_force_omit(25, force_omit, BackupBearerCapacity_descr_.raw->forceomit);
  decoded_field_length = field_backupBearerCapacity().RAW_decode(BackupBearerCapacity_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_25_force_omit);
  if (decoded_field_length < 1) {
  field_backupBearerCapacity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_backupBearerCapacity.ispresent() || field_backupBearerCapacity().elementIdentifier() !=  os_26){
  field_backupBearerCapacity=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_backupBearerCapacity=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__Setup__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 26;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(26);
  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_bcRepeatIndicator.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RepeatIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_bearerCapability1.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, BearerCapability__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_bearerCapability2.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, BearerCapability__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_facility.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_progressIndicator.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ProgressIndicator__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_signal.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, ML3__Signal_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_callingPartyBCD__Number.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, CallingPartyBCD__Number_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_callingPartySubAddress.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, CallingPartySubAddress_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_calledPartyBCD__Number.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, CalledPartyBCD__Number_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_calledPartySubAddress.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, CalledPartySubAddress_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_redirectingPartyBCDNumber.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, RedirectingPartyBCDNumberTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_redirectingPartySubaddress.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, RedirectingPartySubaddressTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_llc__RepeatIndicator.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, RepeatIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_lowLayerCompatibility1.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, LowLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_lowLayerCompatibility2.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, LowLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_hlc__RepeatIndicator.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, RepeatIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_highLayerCompatibility1.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, HighLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_highLayerCompatibility2.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, HighLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, User__userShort_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_priority.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_alert.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, AlertingPattern_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_networkCCCapabilities.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, NetworkCallControlCapabilities_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_causeofNoCli.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, CauseofNoCli_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  if (field_backupBearerCapacity.ispresent()) {
  myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 25, BackupBearerCapacity_descr_.raw);
  }
  else myleaf.body.node.nodes[25] = 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_bcRepeatIndicator.ispresent()) {
  encoded_length += field_bcRepeatIndicator().RAW_encode(RepeatIndicator_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_bearerCapability1.ispresent()) {
  encoded_length += field_bearerCapability1().RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_bearerCapability2.ispresent()) {
  encoded_length += field_bearerCapability2().RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_progressIndicator.ispresent()) {
  encoded_length += field_progressIndicator().RAW_encode(ProgressIndicator__TLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_signal.ispresent()) {
  encoded_length += field_signal().RAW_encode(ML3__Signal_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_callingPartyBCD__Number.ispresent()) {
  encoded_length += field_callingPartyBCD__Number().RAW_encode(CallingPartyBCD__Number_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_callingPartySubAddress.ispresent()) {
  encoded_length += field_callingPartySubAddress().RAW_encode(CallingPartySubAddress_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_calledPartyBCD__Number.ispresent()) {
  encoded_length += field_calledPartyBCD__Number().RAW_encode(CalledPartyBCD__Number_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_calledPartySubAddress.ispresent()) {
  encoded_length += field_calledPartySubAddress().RAW_encode(CalledPartySubAddress_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_redirectingPartyBCDNumber.ispresent()) {
  encoded_length += field_redirectingPartyBCDNumber().RAW_encode(RedirectingPartyBCDNumberTLV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_redirectingPartySubaddress.ispresent()) {
  encoded_length += field_redirectingPartySubaddress().RAW_encode(RedirectingPartySubaddressTLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_llc__RepeatIndicator.ispresent()) {
  encoded_length += field_llc__RepeatIndicator().RAW_encode(RepeatIndicator_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_lowLayerCompatibility1.ispresent()) {
  encoded_length += field_lowLayerCompatibility1().RAW_encode(LowLayerCompatibility_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_lowLayerCompatibility2.ispresent()) {
  encoded_length += field_lowLayerCompatibility2().RAW_encode(LowLayerCompatibility_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_hlc__RepeatIndicator.ispresent()) {
  encoded_length += field_hlc__RepeatIndicator().RAW_encode(RepeatIndicator_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_highLayerCompatibility1.ispresent()) {
  encoded_length += field_highLayerCompatibility1().RAW_encode(HighLayerCompatibility_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_highLayerCompatibility2.ispresent()) {
  encoded_length += field_highLayerCompatibility2().RAW_encode(HighLayerCompatibility_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__userShort_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_priority.ispresent()) {
  encoded_length += field_priority().RAW_encode(MobileL3__CommonIE__Types::PriorityLevel__ML3_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_alert.ispresent()) {
  encoded_length += field_alert().RAW_encode(AlertingPattern_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_networkCCCapabilities.ispresent()) {
  encoded_length += field_networkCCCapabilities().RAW_encode(NetworkCallControlCapabilities_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_causeofNoCli.ispresent()) {
  encoded_length += field_causeofNoCli().RAW_encode(CauseofNoCli_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_backupBearerCapacity.ispresent()) {
  encoded_length += field_backupBearerCapacity().RAW_encode(BackupBearerCapacity_descr_, *myleaf.body.node.nodes[25]);
  }
  if (field_bcRepeatIndicator.ispresent() && (!field_bcRepeatIndicator.ispresent() || field_bcRepeatIndicator().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[]={2,1};
  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::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_bearerCapability1.ispresent() && (!field_bearerCapability1.ispresent() || field_bearerCapability1().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[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_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);
  }
  }
  if (field_bearerCapability2.ispresent() && (!field_bearerCapability2.ispresent() || field_bearerCapability2().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[]={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_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);
  }
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  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_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_progressIndicator.ispresent() && (!field_progressIndicator.ispresent() || field_progressIndicator().elementIdentifier() !=  os_1)) {
  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){
   os_1.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_signal.ispresent() && (!field_signal.ispresent() || field_signal().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_17.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_callingPartyBCD__Number.ispresent() && (!field_callingPartyBCD__Number.ispresent() || field_callingPartyBCD__Number().elementIdentifier() !=  os_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){
   os_18.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_callingPartySubAddress.ispresent() && (!field_callingPartySubAddress.ispresent() || field_callingPartySubAddress().elementIdentifier() !=  os_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){
   os_19.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_calledPartyBCD__Number.ispresent() && (!field_calledPartyBCD__Number.ispresent() || field_calledPartyBCD__Number().elementIdentifier() !=  os_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){
   os_20.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_calledPartySubAddress.ispresent() && (!field_calledPartySubAddress.ispresent() || field_calledPartySubAddress().elementIdentifier() !=  os_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){
   os_21.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_redirectingPartyBCDNumber.ispresent() && (!field_redirectingPartyBCDNumber.ispresent() || field_redirectingPartyBCDNumber().elementIdentifier() !=  os_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){
   os_22.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_redirectingPartySubaddress.ispresent() && (!field_redirectingPartySubaddress.ispresent() || field_redirectingPartySubaddress().elementIdentifier() !=  os_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){
   os_23.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_llc__RepeatIndicator.ispresent() && (!field_llc__RepeatIndicator.ispresent() || field_llc__RepeatIndicator().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[]={14,1};
  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::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_lowLayerCompatibility1.ispresent() && (!field_lowLayerCompatibility1.ispresent() || field_lowLayerCompatibility1().elementIdentifier() !=  os_13)) {
  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){
   os_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_lowLayerCompatibility2.ispresent() && (!field_lowLayerCompatibility2.ispresent() || field_lowLayerCompatibility2().elementIdentifier() !=  os_13)) {
  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){
   os_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_hlc__RepeatIndicator.ispresent() && (!field_hlc__RepeatIndicator.ispresent() || field_hlc__RepeatIndicator().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[]={17,1};
  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::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_highLayerCompatibility1.ispresent() && (!field_highLayerCompatibility1.ispresent() || field_highLayerCompatibility1().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={18,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_highLayerCompatibility2.ispresent() && (!field_highLayerCompatibility2.ispresent() || field_highLayerCompatibility2().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={20,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.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_priority.ispresent() && (!field_priority.ispresent() || field_priority().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[]={21,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.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_alert.ispresent() && (!field_alert.ispresent() || field_alert().elementIdentifier() !=  os_24)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={22,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_24.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_networkCCCapabilities.ispresent() && (!field_networkCCCapabilities.ispresent() || field_networkCCCapabilities().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[]={23,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_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_causeofNoCli.ispresent() && (!field_causeofNoCli.ispresent() || field_causeofNoCli().elementIdentifier() !=  os_25)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={24,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_25.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_backupBearerCapacity.ispresent() && (!field_backupBearerCapacity.ispresent() || field_backupBearerCapacity().elementIdentifier() !=  os_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={25,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_26.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__Setup__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
RepeatIndicator_template field_bcRepeatIndicator;
BearerCapability__TLV_template field_bearerCapability1;
BearerCapability__TLV_template field_bearerCapability2;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
ProgressIndicator__TLV_template field_progressIndicator;
ML3__Signal_template field_signal;
CallingPartyBCD__Number_template field_callingPartyBCD__Number;
CallingPartySubAddress_template field_callingPartySubAddress;
CalledPartyBCD__Number_template field_calledPartyBCD__Number;
CalledPartySubAddress_template field_calledPartySubAddress;
RedirectingPartyBCDNumberTLV_template field_redirectingPartyBCDNumber;
RedirectingPartySubaddressTLV_template field_redirectingPartySubaddress;
RepeatIndicator_template field_llc__RepeatIndicator;
LowLayerCompatibility_template field_lowLayerCompatibility1;
LowLayerCompatibility_template field_lowLayerCompatibility2;
RepeatIndicator_template field_hlc__RepeatIndicator;
HighLayerCompatibility_template field_highLayerCompatibility1;
HighLayerCompatibility_template field_highLayerCompatibility2;
User__userShort_template field_user__user;
MobileL3__CommonIE__Types::PriorityLevel__ML3_template field_priority;
AlertingPattern_template field_alert;
NetworkCallControlCapabilities_template field_networkCCCapabilities;
CauseofNoCli_template field_causeofNoCli;
BackupBearerCapacity_template field_backupBearerCapacity;
};

void PDU__ML3__Setup__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_nsd = ANY_VALUE;
single_value->field_bcRepeatIndicator = ANY_OR_OMIT;
single_value->field_bearerCapability1 = ANY_OR_OMIT;
single_value->field_bearerCapability2 = ANY_OR_OMIT;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_progressIndicator = ANY_OR_OMIT;
single_value->field_signal = ANY_OR_OMIT;
single_value->field_callingPartyBCD__Number = ANY_OR_OMIT;
single_value->field_callingPartySubAddress = ANY_OR_OMIT;
single_value->field_calledPartyBCD__Number = ANY_OR_OMIT;
single_value->field_calledPartySubAddress = ANY_OR_OMIT;
single_value->field_redirectingPartyBCDNumber = ANY_OR_OMIT;
single_value->field_redirectingPartySubaddress = ANY_OR_OMIT;
single_value->field_llc__RepeatIndicator = ANY_OR_OMIT;
single_value->field_lowLayerCompatibility1 = ANY_OR_OMIT;
single_value->field_lowLayerCompatibility2 = ANY_OR_OMIT;
single_value->field_hlc__RepeatIndicator = ANY_OR_OMIT;
single_value->field_highLayerCompatibility1 = ANY_OR_OMIT;
single_value->field_highLayerCompatibility2 = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
single_value->field_priority = ANY_OR_OMIT;
single_value->field_alert = ANY_OR_OMIT;
single_value->field_networkCCCapabilities = ANY_OR_OMIT;
single_value->field_causeofNoCli = ANY_OR_OMIT;
single_value->field_backupBearerCapacity = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Setup__NW__MS_template::copy_value(const PDU__ML3__Setup__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.nsd().is_bound()) {
  single_value->field_nsd = other_value.nsd();
} else {
  single_value->field_nsd.clean_up();
}
if (other_value.bcRepeatIndicator().is_bound()) {
  if (other_value.bcRepeatIndicator().ispresent()) single_value->field_bcRepeatIndicator = other_value.bcRepeatIndicator()();
  else single_value->field_bcRepeatIndicator = OMIT_VALUE;
} else {
  single_value->field_bcRepeatIndicator.clean_up();
}
if (other_value.bearerCapability1().is_bound()) {
  if (other_value.bearerCapability1().ispresent()) single_value->field_bearerCapability1 = other_value.bearerCapability1()();
  else single_value->field_bearerCapability1 = OMIT_VALUE;
} else {
  single_value->field_bearerCapability1.clean_up();
}
if (other_value.bearerCapability2().is_bound()) {
  if (other_value.bearerCapability2().ispresent()) single_value->field_bearerCapability2 = other_value.bearerCapability2()();
  else single_value->field_bearerCapability2 = OMIT_VALUE;
} else {
  single_value->field_bearerCapability2.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.progressIndicator().is_bound()) {
  if (other_value.progressIndicator().ispresent()) single_value->field_progressIndicator = other_value.progressIndicator()();
  else single_value->field_progressIndicator = OMIT_VALUE;
} else {
  single_value->field_progressIndicator.clean_up();
}
if (other_value.signal().is_bound()) {
  if (other_value.signal().ispresent()) single_value->field_signal = other_value.signal()();
  else single_value->field_signal = OMIT_VALUE;
} else {
  single_value->field_signal.clean_up();
}
if (other_value.callingPartyBCD__Number().is_bound()) {
  if (other_value.callingPartyBCD__Number().ispresent()) single_value->field_callingPartyBCD__Number = other_value.callingPartyBCD__Number()();
  else single_value->field_callingPartyBCD__Number = OMIT_VALUE;
} else {
  single_value->field_callingPartyBCD__Number.clean_up();
}
if (other_value.callingPartySubAddress().is_bound()) {
  if (other_value.callingPartySubAddress().ispresent()) single_value->field_callingPartySubAddress = other_value.callingPartySubAddress()();
  else single_value->field_callingPartySubAddress = OMIT_VALUE;
} else {
  single_value->field_callingPartySubAddress.clean_up();
}
if (other_value.calledPartyBCD__Number().is_bound()) {
  if (other_value.calledPartyBCD__Number().ispresent()) single_value->field_calledPartyBCD__Number = other_value.calledPartyBCD__Number()();
  else single_value->field_calledPartyBCD__Number = OMIT_VALUE;
} else {
  single_value->field_calledPartyBCD__Number.clean_up();
}
if (other_value.calledPartySubAddress().is_bound()) {
  if (other_value.calledPartySubAddress().ispresent()) single_value->field_calledPartySubAddress = other_value.calledPartySubAddress()();
  else single_value->field_calledPartySubAddress = OMIT_VALUE;
} else {
  single_value->field_calledPartySubAddress.clean_up();
}
if (other_value.redirectingPartyBCDNumber().is_bound()) {
  if (other_value.redirectingPartyBCDNumber().ispresent()) single_value->field_redirectingPartyBCDNumber = other_value.redirectingPartyBCDNumber()();
  else single_value->field_redirectingPartyBCDNumber = OMIT_VALUE;
} else {
  single_value->field_redirectingPartyBCDNumber.clean_up();
}
if (other_value.redirectingPartySubaddress().is_bound()) {
  if (other_value.redirectingPartySubaddress().ispresent()) single_value->field_redirectingPartySubaddress = other_value.redirectingPartySubaddress()();
  else single_value->field_redirectingPartySubaddress = OMIT_VALUE;
} else {
  single_value->field_redirectingPartySubaddress.clean_up();
}
if (other_value.llc__RepeatIndicator().is_bound()) {
  if (other_value.llc__RepeatIndicator().ispresent()) single_value->field_llc__RepeatIndicator = other_value.llc__RepeatIndicator()();
  else single_value->field_llc__RepeatIndicator = OMIT_VALUE;
} else {
  single_value->field_llc__RepeatIndicator.clean_up();
}
if (other_value.lowLayerCompatibility1().is_bound()) {
  if (other_value.lowLayerCompatibility1().ispresent()) single_value->field_lowLayerCompatibility1 = other_value.lowLayerCompatibility1()();
  else single_value->field_lowLayerCompatibility1 = OMIT_VALUE;
} else {
  single_value->field_lowLayerCompatibility1.clean_up();
}
if (other_value.lowLayerCompatibility2().is_bound()) {
  if (other_value.lowLayerCompatibility2().ispresent()) single_value->field_lowLayerCompatibility2 = other_value.lowLayerCompatibility2()();
  else single_value->field_lowLayerCompatibility2 = OMIT_VALUE;
} else {
  single_value->field_lowLayerCompatibility2.clean_up();
}
if (other_value.hlc__RepeatIndicator().is_bound()) {
  if (other_value.hlc__RepeatIndicator().ispresent()) single_value->field_hlc__RepeatIndicator = other_value.hlc__RepeatIndicator()();
  else single_value->field_hlc__RepeatIndicator = OMIT_VALUE;
} else {
  single_value->field_hlc__RepeatIndicator.clean_up();
}
if (other_value.highLayerCompatibility1().is_bound()) {
  if (other_value.highLayerCompatibility1().ispresent()) single_value->field_highLayerCompatibility1 = other_value.highLayerCompatibility1()();
  else single_value->field_highLayerCompatibility1 = OMIT_VALUE;
} else {
  single_value->field_highLayerCompatibility1.clean_up();
}
if (other_value.highLayerCompatibility2().is_bound()) {
  if (other_value.highLayerCompatibility2().ispresent()) single_value->field_highLayerCompatibility2 = other_value.highLayerCompatibility2()();
  else single_value->field_highLayerCompatibility2 = OMIT_VALUE;
} else {
  single_value->field_highLayerCompatibility2.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
if (other_value.priority().is_bound()) {
  if (other_value.priority().ispresent()) single_value->field_priority = other_value.priority()();
  else single_value->field_priority = OMIT_VALUE;
} else {
  single_value->field_priority.clean_up();
}
if (other_value.alert().is_bound()) {
  if (other_value.alert().ispresent()) single_value->field_alert = other_value.alert()();
  else single_value->field_alert = OMIT_VALUE;
} else {
  single_value->field_alert.clean_up();
}
if (other_value.networkCCCapabilities().is_bound()) {
  if (other_value.networkCCCapabilities().ispresent()) single_value->field_networkCCCapabilities = other_value.networkCCCapabilities()();
  else single_value->field_networkCCCapabilities = OMIT_VALUE;
} else {
  single_value->field_networkCCCapabilities.clean_up();
}
if (other_value.causeofNoCli().is_bound()) {
  if (other_value.causeofNoCli().ispresent()) single_value->field_causeofNoCli = other_value.causeofNoCli()();
  else single_value->field_causeofNoCli = OMIT_VALUE;
} else {
  single_value->field_causeofNoCli.clean_up();
}
if (other_value.backupBearerCapacity().is_bound()) {
  if (other_value.backupBearerCapacity().ispresent()) single_value->field_backupBearerCapacity = other_value.backupBearerCapacity()();
  else single_value->field_backupBearerCapacity = OMIT_VALUE;
} else {
  single_value->field_backupBearerCapacity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Setup__NW__MS_template::copy_template(const PDU__ML3__Setup__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nsd().get_selection()) {
single_value->field_nsd = other_value.nsd();
} else {
single_value->field_nsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bcRepeatIndicator().get_selection()) {
single_value->field_bcRepeatIndicator = other_value.bcRepeatIndicator();
} else {
single_value->field_bcRepeatIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability1().get_selection()) {
single_value->field_bearerCapability1 = other_value.bearerCapability1();
} else {
single_value->field_bearerCapability1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability2().get_selection()) {
single_value->field_bearerCapability2 = other_value.bearerCapability2();
} else {
single_value->field_bearerCapability2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.progressIndicator().get_selection()) {
single_value->field_progressIndicator = other_value.progressIndicator();
} else {
single_value->field_progressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.signal().get_selection()) {
single_value->field_signal = other_value.signal();
} else {
single_value->field_signal.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.callingPartyBCD__Number().get_selection()) {
single_value->field_callingPartyBCD__Number = other_value.callingPartyBCD__Number();
} else {
single_value->field_callingPartyBCD__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.callingPartySubAddress().get_selection()) {
single_value->field_callingPartySubAddress = other_value.callingPartySubAddress();
} else {
single_value->field_callingPartySubAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.calledPartyBCD__Number().get_selection()) {
single_value->field_calledPartyBCD__Number = other_value.calledPartyBCD__Number();
} else {
single_value->field_calledPartyBCD__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.calledPartySubAddress().get_selection()) {
single_value->field_calledPartySubAddress = other_value.calledPartySubAddress();
} else {
single_value->field_calledPartySubAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.redirectingPartyBCDNumber().get_selection()) {
single_value->field_redirectingPartyBCDNumber = other_value.redirectingPartyBCDNumber();
} else {
single_value->field_redirectingPartyBCDNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.redirectingPartySubaddress().get_selection()) {
single_value->field_redirectingPartySubaddress = other_value.redirectingPartySubaddress();
} else {
single_value->field_redirectingPartySubaddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.llc__RepeatIndicator().get_selection()) {
single_value->field_llc__RepeatIndicator = other_value.llc__RepeatIndicator();
} else {
single_value->field_llc__RepeatIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lowLayerCompatibility1().get_selection()) {
single_value->field_lowLayerCompatibility1 = other_value.lowLayerCompatibility1();
} else {
single_value->field_lowLayerCompatibility1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lowLayerCompatibility2().get_selection()) {
single_value->field_lowLayerCompatibility2 = other_value.lowLayerCompatibility2();
} else {
single_value->field_lowLayerCompatibility2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.hlc__RepeatIndicator().get_selection()) {
single_value->field_hlc__RepeatIndicator = other_value.hlc__RepeatIndicator();
} else {
single_value->field_hlc__RepeatIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.highLayerCompatibility1().get_selection()) {
single_value->field_highLayerCompatibility1 = other_value.highLayerCompatibility1();
} else {
single_value->field_highLayerCompatibility1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.highLayerCompatibility2().get_selection()) {
single_value->field_highLayerCompatibility2 = other_value.highLayerCompatibility2();
} else {
single_value->field_highLayerCompatibility2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.priority().get_selection()) {
single_value->field_priority = other_value.priority();
} else {
single_value->field_priority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.alert().get_selection()) {
single_value->field_alert = other_value.alert();
} else {
single_value->field_alert.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkCCCapabilities().get_selection()) {
single_value->field_networkCCCapabilities = other_value.networkCCCapabilities();
} else {
single_value->field_networkCCCapabilities.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.causeofNoCli().get_selection()) {
single_value->field_causeofNoCli = other_value.causeofNoCli();
} else {
single_value->field_causeofNoCli.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.backupBearerCapacity().get_selection()) {
single_value->field_backupBearerCapacity = other_value.backupBearerCapacity();
} else {
single_value->field_backupBearerCapacity.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__Setup__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__ML3__Setup__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Setup__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__ML3__Setup__NW__MS_template::PDU__ML3__Setup__NW__MS_template()
{
}

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

PDU__ML3__Setup__NW__MS_template::PDU__ML3__Setup__NW__MS_template(const PDU__ML3__Setup__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

PDU__ML3__Setup__NW__MS_template& PDU__ML3__Setup__NW__MS_template::operator=(const PDU__ML3__Setup__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__ML3__Setup__NW__MS_template::match(const PDU__ML3__Setup__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.nsd().is_bound()) return FALSE;
if(!single_value->field_nsd.match(other_value.nsd(), legacy))return FALSE;
if(!other_value.bcRepeatIndicator().is_bound()) return FALSE;
if((other_value.bcRepeatIndicator().ispresent() ? !single_value->field_bcRepeatIndicator.match((const RepeatIndicator&)other_value.bcRepeatIndicator(), legacy) : !single_value->field_bcRepeatIndicator.match_omit(legacy)))return FALSE;
if(!other_value.bearerCapability1().is_bound()) return FALSE;
if((other_value.bearerCapability1().ispresent() ? !single_value->field_bearerCapability1.match((const BearerCapability__TLV&)other_value.bearerCapability1(), legacy) : !single_value->field_bearerCapability1.match_omit(legacy)))return FALSE;
if(!other_value.bearerCapability2().is_bound()) return FALSE;
if((other_value.bearerCapability2().ispresent() ? !single_value->field_bearerCapability2.match((const BearerCapability__TLV&)other_value.bearerCapability2(), legacy) : !single_value->field_bearerCapability2.match_omit(legacy)))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.progressIndicator().is_bound()) return FALSE;
if((other_value.progressIndicator().ispresent() ? !single_value->field_progressIndicator.match((const ProgressIndicator__TLV&)other_value.progressIndicator(), legacy) : !single_value->field_progressIndicator.match_omit(legacy)))return FALSE;
if(!other_value.signal().is_bound()) return FALSE;
if((other_value.signal().ispresent() ? !single_value->field_signal.match((const ML3__Signal&)other_value.signal(), legacy) : !single_value->field_signal.match_omit(legacy)))return FALSE;
if(!other_value.callingPartyBCD__Number().is_bound()) return FALSE;
if((other_value.callingPartyBCD__Number().ispresent() ? !single_value->field_callingPartyBCD__Number.match((const CallingPartyBCD__Number&)other_value.callingPartyBCD__Number(), legacy) : !single_value->field_callingPartyBCD__Number.match_omit(legacy)))return FALSE;
if(!other_value.callingPartySubAddress().is_bound()) return FALSE;
if((other_value.callingPartySubAddress().ispresent() ? !single_value->field_callingPartySubAddress.match((const CallingPartySubAddress&)other_value.callingPartySubAddress(), legacy) : !single_value->field_callingPartySubAddress.match_omit(legacy)))return FALSE;
if(!other_value.calledPartyBCD__Number().is_bound()) return FALSE;
if((other_value.calledPartyBCD__Number().ispresent() ? !single_value->field_calledPartyBCD__Number.match((const CalledPartyBCD__Number&)other_value.calledPartyBCD__Number(), legacy) : !single_value->field_calledPartyBCD__Number.match_omit(legacy)))return FALSE;
if(!other_value.calledPartySubAddress().is_bound()) return FALSE;
if((other_value.calledPartySubAddress().ispresent() ? !single_value->field_calledPartySubAddress.match((const CalledPartySubAddress&)other_value.calledPartySubAddress(), legacy) : !single_value->field_calledPartySubAddress.match_omit(legacy)))return FALSE;
if(!other_value.redirectingPartyBCDNumber().is_bound()) return FALSE;
if((other_value.redirectingPartyBCDNumber().ispresent() ? !single_value->field_redirectingPartyBCDNumber.match((const RedirectingPartyBCDNumberTLV&)other_value.redirectingPartyBCDNumber(), legacy) : !single_value->field_redirectingPartyBCDNumber.match_omit(legacy)))return FALSE;
if(!other_value.redirectingPartySubaddress().is_bound()) return FALSE;
if((other_value.redirectingPartySubaddress().ispresent() ? !single_value->field_redirectingPartySubaddress.match((const RedirectingPartySubaddressTLV&)other_value.redirectingPartySubaddress(), legacy) : !single_value->field_redirectingPartySubaddress.match_omit(legacy)))return FALSE;
if(!other_value.llc__RepeatIndicator().is_bound()) return FALSE;
if((other_value.llc__RepeatIndicator().ispresent() ? !single_value->field_llc__RepeatIndicator.match((const RepeatIndicator&)other_value.llc__RepeatIndicator(), legacy) : !single_value->field_llc__RepeatIndicator.match_omit(legacy)))return FALSE;
if(!other_value.lowLayerCompatibility1().is_bound()) return FALSE;
if((other_value.lowLayerCompatibility1().ispresent() ? !single_value->field_lowLayerCompatibility1.match((const LowLayerCompatibility&)other_value.lowLayerCompatibility1(), legacy) : !single_value->field_lowLayerCompatibility1.match_omit(legacy)))return FALSE;
if(!other_value.lowLayerCompatibility2().is_bound()) return FALSE;
if((other_value.lowLayerCompatibility2().ispresent() ? !single_value->field_lowLayerCompatibility2.match((const LowLayerCompatibility&)other_value.lowLayerCompatibility2(), legacy) : !single_value->field_lowLayerCompatibility2.match_omit(legacy)))return FALSE;
if(!other_value.hlc__RepeatIndicator().is_bound()) return FALSE;
if((other_value.hlc__RepeatIndicator().ispresent() ? !single_value->field_hlc__RepeatIndicator.match((const RepeatIndicator&)other_value.hlc__RepeatIndicator(), legacy) : !single_value->field_hlc__RepeatIndicator.match_omit(legacy)))return FALSE;
if(!other_value.highLayerCompatibility1().is_bound()) return FALSE;
if((other_value.highLayerCompatibility1().ispresent() ? !single_value->field_highLayerCompatibility1.match((const HighLayerCompatibility&)other_value.highLayerCompatibility1(), legacy) : !single_value->field_highLayerCompatibility1.match_omit(legacy)))return FALSE;
if(!other_value.highLayerCompatibility2().is_bound()) return FALSE;
if((other_value.highLayerCompatibility2().ispresent() ? !single_value->field_highLayerCompatibility2.match((const HighLayerCompatibility&)other_value.highLayerCompatibility2(), legacy) : !single_value->field_highLayerCompatibility2.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__userShort&)other_value.user__user(), legacy) : !single_value->field_user__user.match_omit(legacy)))return FALSE;
if(!other_value.priority().is_bound()) return FALSE;
if((other_value.priority().ispresent() ? !single_value->field_priority.match((const MobileL3__CommonIE__Types::PriorityLevel__ML3&)other_value.priority(), legacy) : !single_value->field_priority.match_omit(legacy)))return FALSE;
if(!other_value.alert().is_bound()) return FALSE;
if((other_value.alert().ispresent() ? !single_value->field_alert.match((const AlertingPattern&)other_value.alert(), legacy) : !single_value->field_alert.match_omit(legacy)))return FALSE;
if(!other_value.networkCCCapabilities().is_bound()) return FALSE;
if((other_value.networkCCCapabilities().ispresent() ? !single_value->field_networkCCCapabilities.match((const NetworkCallControlCapabilities&)other_value.networkCCCapabilities(), legacy) : !single_value->field_networkCCCapabilities.match_omit(legacy)))return FALSE;
if(!other_value.causeofNoCli().is_bound()) return FALSE;
if((other_value.causeofNoCli().ispresent() ? !single_value->field_causeofNoCli.match((const CauseofNoCli&)other_value.causeofNoCli(), legacy) : !single_value->field_causeofNoCli.match_omit(legacy)))return FALSE;
if(!other_value.backupBearerCapacity().is_bound()) return FALSE;
if((other_value.backupBearerCapacity().ispresent() ? !single_value->field_backupBearerCapacity.match((const BackupBearerCapacity&)other_value.backupBearerCapacity(), legacy) : !single_value->field_backupBearerCapacity.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_CC_Types.PDU_ML3_Setup_NW_MS.");
}
return FALSE;
}

boolean PDU__ML3__Setup__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_nsd.is_bound()
 || (single_value->field_bcRepeatIndicator.is_omit() || single_value->field_bcRepeatIndicator.is_bound())
 || (single_value->field_bearerCapability1.is_omit() || single_value->field_bearerCapability1.is_bound())
 || (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_bound())
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_bound())
 || (single_value->field_signal.is_omit() || single_value->field_signal.is_bound())
 || (single_value->field_callingPartyBCD__Number.is_omit() || single_value->field_callingPartyBCD__Number.is_bound())
 || (single_value->field_callingPartySubAddress.is_omit() || single_value->field_callingPartySubAddress.is_bound())
 || (single_value->field_calledPartyBCD__Number.is_omit() || single_value->field_calledPartyBCD__Number.is_bound())
 || (single_value->field_calledPartySubAddress.is_omit() || single_value->field_calledPartySubAddress.is_bound())
 || (single_value->field_redirectingPartyBCDNumber.is_omit() || single_value->field_redirectingPartyBCDNumber.is_bound())
 || (single_value->field_redirectingPartySubaddress.is_omit() || single_value->field_redirectingPartySubaddress.is_bound())
 || (single_value->field_llc__RepeatIndicator.is_omit() || single_value->field_llc__RepeatIndicator.is_bound())
 || (single_value->field_lowLayerCompatibility1.is_omit() || single_value->field_lowLayerCompatibility1.is_bound())
 || (single_value->field_lowLayerCompatibility2.is_omit() || single_value->field_lowLayerCompatibility2.is_bound())
 || (single_value->field_hlc__RepeatIndicator.is_omit() || single_value->field_hlc__RepeatIndicator.is_bound())
 || (single_value->field_highLayerCompatibility1.is_omit() || single_value->field_highLayerCompatibility1.is_bound())
 || (single_value->field_highLayerCompatibility2.is_omit() || single_value->field_highLayerCompatibility2.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound())
 || (single_value->field_priority.is_omit() || single_value->field_priority.is_bound())
 || (single_value->field_alert.is_omit() || single_value->field_alert.is_bound())
 || (single_value->field_networkCCCapabilities.is_omit() || single_value->field_networkCCCapabilities.is_bound())
 || (single_value->field_causeofNoCli.is_omit() || single_value->field_causeofNoCli.is_bound())
 || (single_value->field_backupBearerCapacity.is_omit() || single_value->field_backupBearerCapacity.is_bound());
}

boolean PDU__ML3__Setup__NW__MS_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_bcRepeatIndicator.is_omit() || single_value->field_bcRepeatIndicator.is_value())
 && (single_value->field_bearerCapability1.is_omit() || single_value->field_bearerCapability1.is_value())
 && (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_value())
 && (single_value->field_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_progressIndicator.is_omit() || single_value->field_progressIndicator.is_value())
 && (single_value->field_signal.is_omit() || single_value->field_signal.is_value())
 && (single_value->field_callingPartyBCD__Number.is_omit() || single_value->field_callingPartyBCD__Number.is_value())
 && (single_value->field_callingPartySubAddress.is_omit() || single_value->field_callingPartySubAddress.is_value())
 && (single_value->field_calledPartyBCD__Number.is_omit() || single_value->field_calledPartyBCD__Number.is_value())
 && (single_value->field_calledPartySubAddress.is_omit() || single_value->field_calledPartySubAddress.is_value())
 && (single_value->field_redirectingPartyBCDNumber.is_omit() || single_value->field_redirectingPartyBCDNumber.is_value())
 && (single_value->field_redirectingPartySubaddress.is_omit() || single_value->field_redirectingPartySubaddress.is_value())
 && (single_value->field_llc__RepeatIndicator.is_omit() || single_value->field_llc__RepeatIndicator.is_value())
 && (single_value->field_lowLayerCompatibility1.is_omit() || single_value->field_lowLayerCompatibility1.is_value())
 && (single_value->field_lowLayerCompatibility2.is_omit() || single_value->field_lowLayerCompatibility2.is_value())
 && (single_value->field_hlc__RepeatIndicator.is_omit() || single_value->field_hlc__RepeatIndicator.is_value())
 && (single_value->field_highLayerCompatibility1.is_omit() || single_value->field_highLayerCompatibility1.is_value())
 && (single_value->field_highLayerCompatibility2.is_omit() || single_value->field_highLayerCompatibility2.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value())
 && (single_value->field_priority.is_omit() || single_value->field_priority.is_value())
 && (single_value->field_alert.is_omit() || single_value->field_alert.is_value())
 && (single_value->field_networkCCCapabilities.is_omit() || single_value->field_networkCCCapabilities.is_value())
 && (single_value->field_causeofNoCli.is_omit() || single_value->field_causeofNoCli.is_value())
 && (single_value->field_backupBearerCapacity.is_omit() || single_value->field_backupBearerCapacity.is_value());
}

void PDU__ML3__Setup__NW__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__ML3__Setup__NW__MS PDU__ML3__Setup__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
PDU__ML3__Setup__NW__MS 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_bcRepeatIndicator.is_omit()) ret_val.bcRepeatIndicator() = OMIT_VALUE;
else if (single_value->field_bcRepeatIndicator.is_bound()) {
ret_val.bcRepeatIndicator() = single_value->field_bcRepeatIndicator.valueof();
}
if (single_value->field_bearerCapability1.is_omit()) ret_val.bearerCapability1() = OMIT_VALUE;
else if (single_value->field_bearerCapability1.is_bound()) {
ret_val.bearerCapability1() = single_value->field_bearerCapability1.valueof();
}
if (single_value->field_bearerCapability2.is_omit()) ret_val.bearerCapability2() = OMIT_VALUE;
else if (single_value->field_bearerCapability2.is_bound()) {
ret_val.bearerCapability2() = single_value->field_bearerCapability2.valueof();
}
if (single_value->field_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_progressIndicator.is_omit()) ret_val.progressIndicator() = OMIT_VALUE;
else if (single_value->field_progressIndicator.is_bound()) {
ret_val.progressIndicator() = single_value->field_progressIndicator.valueof();
}
if (single_value->field_signal.is_omit()) ret_val.signal() = OMIT_VALUE;
else if (single_value->field_signal.is_bound()) {
ret_val.signal() = single_value->field_signal.valueof();
}
if (single_value->field_callingPartyBCD__Number.is_omit()) ret_val.callingPartyBCD__Number() = OMIT_VALUE;
else if (single_value->field_callingPartyBCD__Number.is_bound()) {
ret_val.callingPartyBCD__Number() = single_value->field_callingPartyBCD__Number.valueof();
}
if (single_value->field_callingPartySubAddress.is_omit()) ret_val.callingPartySubAddress() = OMIT_VALUE;
else if (single_value->field_callingPartySubAddress.is_bound()) {
ret_val.callingPartySubAddress() = single_value->field_callingPartySubAddress.valueof();
}
if (single_value->field_calledPartyBCD__Number.is_omit()) ret_val.calledPartyBCD__Number() = OMIT_VALUE;
else if (single_value->field_calledPartyBCD__Number.is_bound()) {
ret_val.calledPartyBCD__Number() = single_value->field_calledPartyBCD__Number.valueof();
}
if (single_value->field_calledPartySubAddress.is_omit()) ret_val.calledPartySubAddress() = OMIT_VALUE;
else if (single_value->field_calledPartySubAddress.is_bound()) {
ret_val.calledPartySubAddress() = single_value->field_calledPartySubAddress.valueof();
}
if (single_value->field_redirectingPartyBCDNumber.is_omit()) ret_val.redirectingPartyBCDNumber() = OMIT_VALUE;
else if (single_value->field_redirectingPartyBCDNumber.is_bound()) {
ret_val.redirectingPartyBCDNumber() = single_value->field_redirectingPartyBCDNumber.valueof();
}
if (single_value->field_redirectingPartySubaddress.is_omit()) ret_val.redirectingPartySubaddress() = OMIT_VALUE;
else if (single_value->field_redirectingPartySubaddress.is_bound()) {
ret_val.redirectingPartySubaddress() = single_value->field_redirectingPartySubaddress.valueof();
}
if (single_value->field_llc__RepeatIndicator.is_omit()) ret_val.llc__RepeatIndicator() = OMIT_VALUE;
else if (single_value->field_llc__RepeatIndicator.is_bound()) {
ret_val.llc__RepeatIndicator() = single_value->field_llc__RepeatIndicator.valueof();
}
if (single_value->field_lowLayerCompatibility1.is_omit()) ret_val.lowLayerCompatibility1() = OMIT_VALUE;
else if (single_value->field_lowLayerCompatibility1.is_bound()) {
ret_val.lowLayerCompatibility1() = single_value->field_lowLayerCompatibility1.valueof();
}
if (single_value->field_lowLayerCompatibility2.is_omit()) ret_val.lowLayerCompatibility2() = OMIT_VALUE;
else if (single_value->field_lowLayerCompatibility2.is_bound()) {
ret_val.lowLayerCompatibility2() = single_value->field_lowLayerCompatibility2.valueof();
}
if (single_value->field_hlc__RepeatIndicator.is_omit()) ret_val.hlc__RepeatIndicator() = OMIT_VALUE;
else if (single_value->field_hlc__RepeatIndicator.is_bound()) {
ret_val.hlc__RepeatIndicator() = single_value->field_hlc__RepeatIndicator.valueof();
}
if (single_value->field_highLayerCompatibility1.is_omit()) ret_val.highLayerCompatibility1() = OMIT_VALUE;
else if (single_value->field_highLayerCompatibility1.is_bound()) {
ret_val.highLayerCompatibility1() = single_value->field_highLayerCompatibility1.valueof();
}
if (single_value->field_highLayerCompatibility2.is_omit()) ret_val.highLayerCompatibility2() = OMIT_VALUE;
else if (single_value->field_highLayerCompatibility2.is_bound()) {
ret_val.highLayerCompatibility2() = single_value->field_highLayerCompatibility2.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
if (single_value->field_priority.is_omit()) ret_val.priority() = OMIT_VALUE;
else if (single_value->field_priority.is_bound()) {
ret_val.priority() = single_value->field_priority.valueof();
}
if (single_value->field_alert.is_omit()) ret_val.alert() = OMIT_VALUE;
else if (single_value->field_alert.is_bound()) {
ret_val.alert() = single_value->field_alert.valueof();
}
if (single_value->field_networkCCCapabilities.is_omit()) ret_val.networkCCCapabilities() = OMIT_VALUE;
else if (single_value->field_networkCCCapabilities.is_bound()) {
ret_val.networkCCCapabilities() = single_value->field_networkCCCapabilities.valueof();
}
if (single_value->field_causeofNoCli.is_omit()) ret_val.causeofNoCli() = OMIT_VALUE;
else if (single_value->field_causeofNoCli.is_bound()) {
ret_val.causeofNoCli() = single_value->field_causeofNoCli.valueof();
}
if (single_value->field_backupBearerCapacity.is_omit()) ret_val.backupBearerCapacity() = OMIT_VALUE;
else if (single_value->field_backupBearerCapacity.is_bound()) {
ret_val.backupBearerCapacity() = single_value->field_backupBearerCapacity.valueof();
}
return ret_val;
}

void PDU__ML3__Setup__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Setup__NW__MS_template[list_length];
}

PDU__ML3__Setup__NW__MS_template& PDU__ML3__Setup__NW__MS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__Setup__NW__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__Setup__NW__MS_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__Setup__NW__MS_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__Setup__NW__MS_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_nsd;
}

RepeatIndicator_template& PDU__ML3__Setup__NW__MS_template::bcRepeatIndicator()
{
set_specific();
return single_value->field_bcRepeatIndicator;
}

const RepeatIndicator_template& PDU__ML3__Setup__NW__MS_template::bcRepeatIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bcRepeatIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_bcRepeatIndicator;
}

BearerCapability__TLV_template& PDU__ML3__Setup__NW__MS_template::bearerCapability1()
{
set_specific();
return single_value->field_bearerCapability1;
}

const BearerCapability__TLV_template& PDU__ML3__Setup__NW__MS_template::bearerCapability1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_bearerCapability1;
}

BearerCapability__TLV_template& PDU__ML3__Setup__NW__MS_template::bearerCapability2()
{
set_specific();
return single_value->field_bearerCapability2;
}

const BearerCapability__TLV_template& PDU__ML3__Setup__NW__MS_template::bearerCapability2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_bearerCapability2;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Setup__NW__MS_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Setup__NW__MS_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_facility;
}

ProgressIndicator__TLV_template& PDU__ML3__Setup__NW__MS_template::progressIndicator()
{
set_specific();
return single_value->field_progressIndicator;
}

const ProgressIndicator__TLV_template& PDU__ML3__Setup__NW__MS_template::progressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field progressIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_progressIndicator;
}

ML3__Signal_template& PDU__ML3__Setup__NW__MS_template::signal()
{
set_specific();
return single_value->field_signal;
}

const ML3__Signal_template& PDU__ML3__Setup__NW__MS_template::signal() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field signal of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_signal;
}

CallingPartyBCD__Number_template& PDU__ML3__Setup__NW__MS_template::callingPartyBCD__Number()
{
set_specific();
return single_value->field_callingPartyBCD__Number;
}

const CallingPartyBCD__Number_template& PDU__ML3__Setup__NW__MS_template::callingPartyBCD__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field callingPartyBCD_Number of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_callingPartyBCD__Number;
}

CallingPartySubAddress_template& PDU__ML3__Setup__NW__MS_template::callingPartySubAddress()
{
set_specific();
return single_value->field_callingPartySubAddress;
}

const CallingPartySubAddress_template& PDU__ML3__Setup__NW__MS_template::callingPartySubAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field callingPartySubAddress of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_callingPartySubAddress;
}

CalledPartyBCD__Number_template& PDU__ML3__Setup__NW__MS_template::calledPartyBCD__Number()
{
set_specific();
return single_value->field_calledPartyBCD__Number;
}

const CalledPartyBCD__Number_template& PDU__ML3__Setup__NW__MS_template::calledPartyBCD__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPartyBCD_Number of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_calledPartyBCD__Number;
}

CalledPartySubAddress_template& PDU__ML3__Setup__NW__MS_template::calledPartySubAddress()
{
set_specific();
return single_value->field_calledPartySubAddress;
}

const CalledPartySubAddress_template& PDU__ML3__Setup__NW__MS_template::calledPartySubAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPartySubAddress of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_calledPartySubAddress;
}

RedirectingPartyBCDNumberTLV_template& PDU__ML3__Setup__NW__MS_template::redirectingPartyBCDNumber()
{
set_specific();
return single_value->field_redirectingPartyBCDNumber;
}

const RedirectingPartyBCDNumberTLV_template& PDU__ML3__Setup__NW__MS_template::redirectingPartyBCDNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field redirectingPartyBCDNumber of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_redirectingPartyBCDNumber;
}

RedirectingPartySubaddressTLV_template& PDU__ML3__Setup__NW__MS_template::redirectingPartySubaddress()
{
set_specific();
return single_value->field_redirectingPartySubaddress;
}

const RedirectingPartySubaddressTLV_template& PDU__ML3__Setup__NW__MS_template::redirectingPartySubaddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field redirectingPartySubaddress of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_redirectingPartySubaddress;
}

RepeatIndicator_template& PDU__ML3__Setup__NW__MS_template::llc__RepeatIndicator()
{
set_specific();
return single_value->field_llc__RepeatIndicator;
}

const RepeatIndicator_template& PDU__ML3__Setup__NW__MS_template::llc__RepeatIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field llc_RepeatIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_llc__RepeatIndicator;
}

LowLayerCompatibility_template& PDU__ML3__Setup__NW__MS_template::lowLayerCompatibility1()
{
set_specific();
return single_value->field_lowLayerCompatibility1;
}

const LowLayerCompatibility_template& PDU__ML3__Setup__NW__MS_template::lowLayerCompatibility1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lowLayerCompatibility1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_lowLayerCompatibility1;
}

LowLayerCompatibility_template& PDU__ML3__Setup__NW__MS_template::lowLayerCompatibility2()
{
set_specific();
return single_value->field_lowLayerCompatibility2;
}

const LowLayerCompatibility_template& PDU__ML3__Setup__NW__MS_template::lowLayerCompatibility2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lowLayerCompatibility2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_lowLayerCompatibility2;
}

RepeatIndicator_template& PDU__ML3__Setup__NW__MS_template::hlc__RepeatIndicator()
{
set_specific();
return single_value->field_hlc__RepeatIndicator;
}

const RepeatIndicator_template& PDU__ML3__Setup__NW__MS_template::hlc__RepeatIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field hlc_RepeatIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_hlc__RepeatIndicator;
}

HighLayerCompatibility_template& PDU__ML3__Setup__NW__MS_template::highLayerCompatibility1()
{
set_specific();
return single_value->field_highLayerCompatibility1;
}

const HighLayerCompatibility_template& PDU__ML3__Setup__NW__MS_template::highLayerCompatibility1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field highLayerCompatibility1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_highLayerCompatibility1;
}

HighLayerCompatibility_template& PDU__ML3__Setup__NW__MS_template::highLayerCompatibility2()
{
set_specific();
return single_value->field_highLayerCompatibility2;
}

const HighLayerCompatibility_template& PDU__ML3__Setup__NW__MS_template::highLayerCompatibility2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field highLayerCompatibility2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_highLayerCompatibility2;
}

User__userShort_template& PDU__ML3__Setup__NW__MS_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__userShort_template& PDU__ML3__Setup__NW__MS_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_user__user;
}

MobileL3__CommonIE__Types::PriorityLevel__ML3_template& PDU__ML3__Setup__NW__MS_template::priority()
{
set_specific();
return single_value->field_priority;
}

const MobileL3__CommonIE__Types::PriorityLevel__ML3_template& PDU__ML3__Setup__NW__MS_template::priority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priority of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_priority;
}

AlertingPattern_template& PDU__ML3__Setup__NW__MS_template::alert()
{
set_specific();
return single_value->field_alert;
}

const AlertingPattern_template& PDU__ML3__Setup__NW__MS_template::alert() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field alert of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_alert;
}

NetworkCallControlCapabilities_template& PDU__ML3__Setup__NW__MS_template::networkCCCapabilities()
{
set_specific();
return single_value->field_networkCCCapabilities;
}

const NetworkCallControlCapabilities_template& PDU__ML3__Setup__NW__MS_template::networkCCCapabilities() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkCCCapabilities of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_networkCCCapabilities;
}

CauseofNoCli_template& PDU__ML3__Setup__NW__MS_template::causeofNoCli()
{
set_specific();
return single_value->field_causeofNoCli;
}

const CauseofNoCli_template& PDU__ML3__Setup__NW__MS_template::causeofNoCli() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field causeofNoCli of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_causeofNoCli;
}

BackupBearerCapacity_template& PDU__ML3__Setup__NW__MS_template::backupBearerCapacity()
{
set_specific();
return single_value->field_backupBearerCapacity;
}

const BackupBearerCapacity_template& PDU__ML3__Setup__NW__MS_template::backupBearerCapacity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field backupBearerCapacity of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
return single_value->field_backupBearerCapacity;
}

int PDU__ML3__Setup__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_bcRepeatIndicator.is_present()) ret_val++;
      if (single_value->field_bearerCapability1.is_present()) ret_val++;
      if (single_value->field_bearerCapability2.is_present()) ret_val++;
      if (single_value->field_facility.is_present()) ret_val++;
      if (single_value->field_progressIndicator.is_present()) ret_val++;
      if (single_value->field_signal.is_present()) ret_val++;
      if (single_value->field_callingPartyBCD__Number.is_present()) ret_val++;
      if (single_value->field_callingPartySubAddress.is_present()) ret_val++;
      if (single_value->field_calledPartyBCD__Number.is_present()) ret_val++;
      if (single_value->field_calledPartySubAddress.is_present()) ret_val++;
      if (single_value->field_redirectingPartyBCDNumber.is_present()) ret_val++;
      if (single_value->field_redirectingPartySubaddress.is_present()) ret_val++;
      if (single_value->field_llc__RepeatIndicator.is_present()) ret_val++;
      if (single_value->field_lowLayerCompatibility1.is_present()) ret_val++;
      if (single_value->field_lowLayerCompatibility2.is_present()) ret_val++;
      if (single_value->field_hlc__RepeatIndicator.is_present()) ret_val++;
      if (single_value->field_highLayerCompatibility1.is_present()) ret_val++;
      if (single_value->field_highLayerCompatibility2.is_present()) ret_val++;
      if (single_value->field_user__user.is_present()) ret_val++;
      if (single_value->field_priority.is_present()) ret_val++;
      if (single_value->field_alert.is_present()) ret_val++;
      if (single_value->field_networkCCCapabilities.is_present()) ret_val++;
      if (single_value->field_causeofNoCli.is_present()) ret_val++;
      if (single_value->field_backupBearerCapacity.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_CC_Types.PDU_ML3_Setup_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
  }
  return 0;
}

void PDU__ML3__Setup__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", nsd := ");
single_value->field_nsd.log();
TTCN_Logger::log_event_str(", bcRepeatIndicator := ");
single_value->field_bcRepeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
single_value->field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", progressIndicator := ");
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(", signal := ");
single_value->field_signal.log();
TTCN_Logger::log_event_str(", callingPartyBCD_Number := ");
single_value->field_callingPartyBCD__Number.log();
TTCN_Logger::log_event_str(", callingPartySubAddress := ");
single_value->field_callingPartySubAddress.log();
TTCN_Logger::log_event_str(", calledPartyBCD_Number := ");
single_value->field_calledPartyBCD__Number.log();
TTCN_Logger::log_event_str(", calledPartySubAddress := ");
single_value->field_calledPartySubAddress.log();
TTCN_Logger::log_event_str(", redirectingPartyBCDNumber := ");
single_value->field_redirectingPartyBCDNumber.log();
TTCN_Logger::log_event_str(", redirectingPartySubaddress := ");
single_value->field_redirectingPartySubaddress.log();
TTCN_Logger::log_event_str(", llc_RepeatIndicator := ");
single_value->field_llc__RepeatIndicator.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility1 := ");
single_value->field_lowLayerCompatibility1.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility2 := ");
single_value->field_lowLayerCompatibility2.log();
TTCN_Logger::log_event_str(", hlc_RepeatIndicator := ");
single_value->field_hlc__RepeatIndicator.log();
TTCN_Logger::log_event_str(", highLayerCompatibility1 := ");
single_value->field_highLayerCompatibility1.log();
TTCN_Logger::log_event_str(", highLayerCompatibility2 := ");
single_value->field_highLayerCompatibility2.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.log();
TTCN_Logger::log_event_str(", priority := ");
single_value->field_priority.log();
TTCN_Logger::log_event_str(", alert := ");
single_value->field_alert.log();
TTCN_Logger::log_event_str(", networkCCCapabilities := ");
single_value->field_networkCCCapabilities.log();
TTCN_Logger::log_event_str(", causeofNoCli := ");
single_value->field_causeofNoCli.log();
TTCN_Logger::log_event_str(", backupBearerCapacity := ");
single_value->field_backupBearerCapacity.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__Setup__NW__MS_template::log_match(const PDU__ML3__Setup__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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.bcRepeatIndicator().ispresent()){
if(!single_value->field_bcRepeatIndicator.match(match_value.bcRepeatIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".bcRepeatIndicator");
single_value->field_bcRepeatIndicator.log_match(match_value.bcRepeatIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bcRepeatIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bcRepeatIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bcRepeatIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bearerCapability1().ispresent()){
if(!single_value->field_bearerCapability1.match(match_value.bearerCapability1(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability1");
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bearerCapability1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bearerCapability1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bearerCapability1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bearerCapability2().ispresent()){
if(!single_value->field_bearerCapability2.match(match_value.bearerCapability2(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability2");
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bearerCapability2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bearerCapability2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.progressIndicator().ispresent()){
if(!single_value->field_progressIndicator.match(match_value.progressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".progressIndicator");
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_progressIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".progressIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_progressIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.signal().ispresent()){
if(!single_value->field_signal.match(match_value.signal(), legacy)){
TTCN_Logger::log_logmatch_info(".signal");
single_value->field_signal.log_match(match_value.signal(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_signal.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".signal := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_signal.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.callingPartyBCD__Number().ispresent()){
if(!single_value->field_callingPartyBCD__Number.match(match_value.callingPartyBCD__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".callingPartyBCD_Number");
single_value->field_callingPartyBCD__Number.log_match(match_value.callingPartyBCD__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_callingPartyBCD__Number.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".callingPartyBCD_Number := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_callingPartyBCD__Number.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.callingPartySubAddress().ispresent()){
if(!single_value->field_callingPartySubAddress.match(match_value.callingPartySubAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".callingPartySubAddress");
single_value->field_callingPartySubAddress.log_match(match_value.callingPartySubAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_callingPartySubAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".callingPartySubAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_callingPartySubAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.calledPartyBCD__Number().ispresent()){
if(!single_value->field_calledPartyBCD__Number.match(match_value.calledPartyBCD__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPartyBCD_Number");
single_value->field_calledPartyBCD__Number.log_match(match_value.calledPartyBCD__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_calledPartyBCD__Number.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".calledPartyBCD_Number := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_calledPartyBCD__Number.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.calledPartySubAddress().ispresent()){
if(!single_value->field_calledPartySubAddress.match(match_value.calledPartySubAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPartySubAddress");
single_value->field_calledPartySubAddress.log_match(match_value.calledPartySubAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_calledPartySubAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".calledPartySubAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_calledPartySubAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.redirectingPartyBCDNumber().ispresent()){
if(!single_value->field_redirectingPartyBCDNumber.match(match_value.redirectingPartyBCDNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".redirectingPartyBCDNumber");
single_value->field_redirectingPartyBCDNumber.log_match(match_value.redirectingPartyBCDNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_redirectingPartyBCDNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".redirectingPartyBCDNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_redirectingPartyBCDNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.redirectingPartySubaddress().ispresent()){
if(!single_value->field_redirectingPartySubaddress.match(match_value.redirectingPartySubaddress(), legacy)){
TTCN_Logger::log_logmatch_info(".redirectingPartySubaddress");
single_value->field_redirectingPartySubaddress.log_match(match_value.redirectingPartySubaddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_redirectingPartySubaddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".redirectingPartySubaddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_redirectingPartySubaddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.llc__RepeatIndicator().ispresent()){
if(!single_value->field_llc__RepeatIndicator.match(match_value.llc__RepeatIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".llc_RepeatIndicator");
single_value->field_llc__RepeatIndicator.log_match(match_value.llc__RepeatIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_llc__RepeatIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".llc_RepeatIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_llc__RepeatIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lowLayerCompatibility1().ispresent()){
if(!single_value->field_lowLayerCompatibility1.match(match_value.lowLayerCompatibility1(), legacy)){
TTCN_Logger::log_logmatch_info(".lowLayerCompatibility1");
single_value->field_lowLayerCompatibility1.log_match(match_value.lowLayerCompatibility1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lowLayerCompatibility1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lowLayerCompatibility1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lowLayerCompatibility1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lowLayerCompatibility2().ispresent()){
if(!single_value->field_lowLayerCompatibility2.match(match_value.lowLayerCompatibility2(), legacy)){
TTCN_Logger::log_logmatch_info(".lowLayerCompatibility2");
single_value->field_lowLayerCompatibility2.log_match(match_value.lowLayerCompatibility2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lowLayerCompatibility2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lowLayerCompatibility2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lowLayerCompatibility2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.hlc__RepeatIndicator().ispresent()){
if(!single_value->field_hlc__RepeatIndicator.match(match_value.hlc__RepeatIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".hlc_RepeatIndicator");
single_value->field_hlc__RepeatIndicator.log_match(match_value.hlc__RepeatIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_hlc__RepeatIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".hlc_RepeatIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_hlc__RepeatIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.highLayerCompatibility1().ispresent()){
if(!single_value->field_highLayerCompatibility1.match(match_value.highLayerCompatibility1(), legacy)){
TTCN_Logger::log_logmatch_info(".highLayerCompatibility1");
single_value->field_highLayerCompatibility1.log_match(match_value.highLayerCompatibility1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_highLayerCompatibility1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".highLayerCompatibility1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_highLayerCompatibility1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.highLayerCompatibility2().ispresent()){
if(!single_value->field_highLayerCompatibility2.match(match_value.highLayerCompatibility2(), legacy)){
TTCN_Logger::log_logmatch_info(".highLayerCompatibility2");
single_value->field_highLayerCompatibility2.log_match(match_value.highLayerCompatibility2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_highLayerCompatibility2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".highLayerCompatibility2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_highLayerCompatibility2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.priority().ispresent()){
if(!single_value->field_priority.match(match_value.priority(), legacy)){
TTCN_Logger::log_logmatch_info(".priority");
single_value->field_priority.log_match(match_value.priority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_priority.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".priority := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_priority.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.alert().ispresent()){
if(!single_value->field_alert.match(match_value.alert(), legacy)){
TTCN_Logger::log_logmatch_info(".alert");
single_value->field_alert.log_match(match_value.alert(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_alert.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".alert := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_alert.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkCCCapabilities().ispresent()){
if(!single_value->field_networkCCCapabilities.match(match_value.networkCCCapabilities(), legacy)){
TTCN_Logger::log_logmatch_info(".networkCCCapabilities");
single_value->field_networkCCCapabilities.log_match(match_value.networkCCCapabilities(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkCCCapabilities.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkCCCapabilities := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkCCCapabilities.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.causeofNoCli().ispresent()){
if(!single_value->field_causeofNoCli.match(match_value.causeofNoCli(), legacy)){
TTCN_Logger::log_logmatch_info(".causeofNoCli");
single_value->field_causeofNoCli.log_match(match_value.causeofNoCli(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_causeofNoCli.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".causeofNoCli := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_causeofNoCli.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.backupBearerCapacity().ispresent()){
if(!single_value->field_backupBearerCapacity.match(match_value.backupBearerCapacity(), legacy)){
TTCN_Logger::log_logmatch_info(".backupBearerCapacity");
single_value->field_backupBearerCapacity.log_match(match_value.backupBearerCapacity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_backupBearerCapacity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".backupBearerCapacity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_backupBearerCapacity.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(", bcRepeatIndicator := ");
if (match_value.bcRepeatIndicator().ispresent()) {
single_value->field_bcRepeatIndicator.log_match(match_value.bcRepeatIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bcRepeatIndicator.log();
if (single_value->field_bcRepeatIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bearerCapability1 := ");
if (match_value.bearerCapability1().ispresent()) {
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bearerCapability1.log();
if (single_value->field_bearerCapability1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bearerCapability2 := ");
if (match_value.bearerCapability2().ispresent()) {
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bearerCapability2.log();
if (single_value->field_bearerCapability2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", progressIndicator := ");
if (match_value.progressIndicator().ispresent()) {
single_value->field_progressIndicator.log_match(match_value.progressIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_progressIndicator.log();
if (single_value->field_progressIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", signal := ");
if (match_value.signal().ispresent()) {
single_value->field_signal.log_match(match_value.signal(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_signal.log();
if (single_value->field_signal.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", callingPartyBCD_Number := ");
if (match_value.callingPartyBCD__Number().ispresent()) {
single_value->field_callingPartyBCD__Number.log_match(match_value.callingPartyBCD__Number(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_callingPartyBCD__Number.log();
if (single_value->field_callingPartyBCD__Number.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", callingPartySubAddress := ");
if (match_value.callingPartySubAddress().ispresent()) {
single_value->field_callingPartySubAddress.log_match(match_value.callingPartySubAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_callingPartySubAddress.log();
if (single_value->field_callingPartySubAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", calledPartyBCD_Number := ");
if (match_value.calledPartyBCD__Number().ispresent()) {
single_value->field_calledPartyBCD__Number.log_match(match_value.calledPartyBCD__Number(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_calledPartyBCD__Number.log();
if (single_value->field_calledPartyBCD__Number.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", calledPartySubAddress := ");
if (match_value.calledPartySubAddress().ispresent()) {
single_value->field_calledPartySubAddress.log_match(match_value.calledPartySubAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_calledPartySubAddress.log();
if (single_value->field_calledPartySubAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", redirectingPartyBCDNumber := ");
if (match_value.redirectingPartyBCDNumber().ispresent()) {
single_value->field_redirectingPartyBCDNumber.log_match(match_value.redirectingPartyBCDNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_redirectingPartyBCDNumber.log();
if (single_value->field_redirectingPartyBCDNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", redirectingPartySubaddress := ");
if (match_value.redirectingPartySubaddress().ispresent()) {
single_value->field_redirectingPartySubaddress.log_match(match_value.redirectingPartySubaddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_redirectingPartySubaddress.log();
if (single_value->field_redirectingPartySubaddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", llc_RepeatIndicator := ");
if (match_value.llc__RepeatIndicator().ispresent()) {
single_value->field_llc__RepeatIndicator.log_match(match_value.llc__RepeatIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_llc__RepeatIndicator.log();
if (single_value->field_llc__RepeatIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lowLayerCompatibility1 := ");
if (match_value.lowLayerCompatibility1().ispresent()) {
single_value->field_lowLayerCompatibility1.log_match(match_value.lowLayerCompatibility1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lowLayerCompatibility1.log();
if (single_value->field_lowLayerCompatibility1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lowLayerCompatibility2 := ");
if (match_value.lowLayerCompatibility2().ispresent()) {
single_value->field_lowLayerCompatibility2.log_match(match_value.lowLayerCompatibility2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lowLayerCompatibility2.log();
if (single_value->field_lowLayerCompatibility2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", hlc_RepeatIndicator := ");
if (match_value.hlc__RepeatIndicator().ispresent()) {
single_value->field_hlc__RepeatIndicator.log_match(match_value.hlc__RepeatIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_hlc__RepeatIndicator.log();
if (single_value->field_hlc__RepeatIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", highLayerCompatibility1 := ");
if (match_value.highLayerCompatibility1().ispresent()) {
single_value->field_highLayerCompatibility1.log_match(match_value.highLayerCompatibility1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_highLayerCompatibility1.log();
if (single_value->field_highLayerCompatibility1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", highLayerCompatibility2 := ");
if (match_value.highLayerCompatibility2().ispresent()) {
single_value->field_highLayerCompatibility2.log_match(match_value.highLayerCompatibility2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_highLayerCompatibility2.log();
if (single_value->field_highLayerCompatibility2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", priority := ");
if (match_value.priority().ispresent()) {
single_value->field_priority.log_match(match_value.priority(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_priority.log();
if (single_value->field_priority.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", alert := ");
if (match_value.alert().ispresent()) {
single_value->field_alert.log_match(match_value.alert(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_alert.log();
if (single_value->field_alert.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkCCCapabilities := ");
if (match_value.networkCCCapabilities().ispresent()) {
single_value->field_networkCCCapabilities.log_match(match_value.networkCCCapabilities(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkCCCapabilities.log();
if (single_value->field_networkCCCapabilities.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", causeofNoCli := ");
if (match_value.causeofNoCli().ispresent()) {
single_value->field_causeofNoCli.log_match(match_value.causeofNoCli(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_causeofNoCli.log();
if (single_value->field_causeofNoCli.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", backupBearerCapacity := ");
if (match_value.backupBearerCapacity().ispresent()) {
single_value->field_backupBearerCapacity.log_match(match_value.backupBearerCapacity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_backupBearerCapacity.log();
if (single_value->field_backupBearerCapacity.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__Setup__NW__MS_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 (!bcRepeatIndicator().is_bound()) bcRepeatIndicator() = OMIT_VALUE;
else bcRepeatIndicator().set_implicit_omit();
if (!bearerCapability1().is_bound()) bearerCapability1() = OMIT_VALUE;
else bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!progressIndicator().is_bound()) progressIndicator() = OMIT_VALUE;
else progressIndicator().set_implicit_omit();
if (!signal().is_bound()) signal() = OMIT_VALUE;
else signal().set_implicit_omit();
if (!callingPartyBCD__Number().is_bound()) callingPartyBCD__Number() = OMIT_VALUE;
else callingPartyBCD__Number().set_implicit_omit();
if (!callingPartySubAddress().is_bound()) callingPartySubAddress() = OMIT_VALUE;
else callingPartySubAddress().set_implicit_omit();
if (!calledPartyBCD__Number().is_bound()) calledPartyBCD__Number() = OMIT_VALUE;
else calledPartyBCD__Number().set_implicit_omit();
if (!calledPartySubAddress().is_bound()) calledPartySubAddress() = OMIT_VALUE;
else calledPartySubAddress().set_implicit_omit();
if (!redirectingPartyBCDNumber().is_bound()) redirectingPartyBCDNumber() = OMIT_VALUE;
else redirectingPartyBCDNumber().set_implicit_omit();
if (!redirectingPartySubaddress().is_bound()) redirectingPartySubaddress() = OMIT_VALUE;
else redirectingPartySubaddress().set_implicit_omit();
if (!llc__RepeatIndicator().is_bound()) llc__RepeatIndicator() = OMIT_VALUE;
else llc__RepeatIndicator().set_implicit_omit();
if (!lowLayerCompatibility1().is_bound()) lowLayerCompatibility1() = OMIT_VALUE;
else lowLayerCompatibility1().set_implicit_omit();
if (!lowLayerCompatibility2().is_bound()) lowLayerCompatibility2() = OMIT_VALUE;
else lowLayerCompatibility2().set_implicit_omit();
if (!hlc__RepeatIndicator().is_bound()) hlc__RepeatIndicator() = OMIT_VALUE;
else hlc__RepeatIndicator().set_implicit_omit();
if (!highLayerCompatibility1().is_bound()) highLayerCompatibility1() = OMIT_VALUE;
else highLayerCompatibility1().set_implicit_omit();
if (!highLayerCompatibility2().is_bound()) highLayerCompatibility2() = OMIT_VALUE;
else highLayerCompatibility2().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!priority().is_bound()) priority() = OMIT_VALUE;
else priority().set_implicit_omit();
if (!alert().is_bound()) alert() = OMIT_VALUE;
else alert().set_implicit_omit();
if (!networkCCCapabilities().is_bound()) networkCCCapabilities() = OMIT_VALUE;
else networkCCCapabilities().set_implicit_omit();
if (!causeofNoCli().is_bound()) causeofNoCli() = OMIT_VALUE;
else causeofNoCli().set_implicit_omit();
if (!backupBearerCapacity().is_bound()) backupBearerCapacity() = OMIT_VALUE;
else backupBearerCapacity().set_implicit_omit();
}

void PDU__ML3__Setup__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_nsd.encode_text(text_buf);
single_value->field_bcRepeatIndicator.encode_text(text_buf);
single_value->field_bearerCapability1.encode_text(text_buf);
single_value->field_bearerCapability2.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_progressIndicator.encode_text(text_buf);
single_value->field_signal.encode_text(text_buf);
single_value->field_callingPartyBCD__Number.encode_text(text_buf);
single_value->field_callingPartySubAddress.encode_text(text_buf);
single_value->field_calledPartyBCD__Number.encode_text(text_buf);
single_value->field_calledPartySubAddress.encode_text(text_buf);
single_value->field_redirectingPartyBCDNumber.encode_text(text_buf);
single_value->field_redirectingPartySubaddress.encode_text(text_buf);
single_value->field_llc__RepeatIndicator.encode_text(text_buf);
single_value->field_lowLayerCompatibility1.encode_text(text_buf);
single_value->field_lowLayerCompatibility2.encode_text(text_buf);
single_value->field_hlc__RepeatIndicator.encode_text(text_buf);
single_value->field_highLayerCompatibility1.encode_text(text_buf);
single_value->field_highLayerCompatibility2.encode_text(text_buf);
single_value->field_user__user.encode_text(text_buf);
single_value->field_priority.encode_text(text_buf);
single_value->field_alert.encode_text(text_buf);
single_value->field_networkCCCapabilities.encode_text(text_buf);
single_value->field_causeofNoCli.encode_text(text_buf);
single_value->field_backupBearerCapacity.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_CC_Types.PDU_ML3_Setup_NW_MS.");
}
}

void PDU__ML3__Setup__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_nsd.decode_text(text_buf);
single_value->field_bcRepeatIndicator.decode_text(text_buf);
single_value->field_bearerCapability1.decode_text(text_buf);
single_value->field_bearerCapability2.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_progressIndicator.decode_text(text_buf);
single_value->field_signal.decode_text(text_buf);
single_value->field_callingPartyBCD__Number.decode_text(text_buf);
single_value->field_callingPartySubAddress.decode_text(text_buf);
single_value->field_calledPartyBCD__Number.decode_text(text_buf);
single_value->field_calledPartySubAddress.decode_text(text_buf);
single_value->field_redirectingPartyBCDNumber.decode_text(text_buf);
single_value->field_redirectingPartySubaddress.decode_text(text_buf);
single_value->field_llc__RepeatIndicator.decode_text(text_buf);
single_value->field_lowLayerCompatibility1.decode_text(text_buf);
single_value->field_lowLayerCompatibility2.decode_text(text_buf);
single_value->field_hlc__RepeatIndicator.decode_text(text_buf);
single_value->field_highLayerCompatibility1.decode_text(text_buf);
single_value->field_highLayerCompatibility2.decode_text(text_buf);
single_value->field_user__user.decode_text(text_buf);
single_value->field_priority.decode_text(text_buf);
single_value->field_alert.decode_text(text_buf);
single_value->field_networkCCCapabilities.decode_text(text_buf);
single_value->field_causeofNoCli.decode_text(text_buf);
single_value->field_backupBearerCapacity.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__Setup__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS.");
}
}

void PDU__ML3__Setup__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__ML3__Setup__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (26<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Setup_NW_MS has 26 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) bcRepeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) progressIndicator().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) signal().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) callingPartyBCD__Number().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) callingPartySubAddress().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) calledPartyBCD__Number().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) calledPartySubAddress().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) redirectingPartyBCDNumber().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) redirectingPartySubaddress().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) llc__RepeatIndicator().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility1().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility2().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) hlc__RepeatIndicator().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility1().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility2().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) priority().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) alert().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) networkCCCapabilities().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) causeofNoCli().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) backupBearerCapacity().set_param(*param.get_elem(25));
    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(), "bcRepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bcRepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "progressIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          progressIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "signal")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          signal().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPartyBCD_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPartyBCD__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPartySubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPartySubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPartyBCD_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPartyBCD__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPartySubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPartySubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirectingPartyBCDNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirectingPartyBCDNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirectingPartySubaddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirectingPartySubaddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "llc_RepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          llc__RepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hlc_RepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hlc__RepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alert")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alert().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkCCCapabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkCCCapabilities().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "causeofNoCli")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeofNoCli().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "backupBearerCapacity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          backupBearerCapacity().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_CC_Types.PDU_ML3_Setup_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Setup__NW__MS_template* precondition = new PDU__ML3__Setup__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Setup__NW__MS_template* implied_template = new PDU__ML3__Setup__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Setup__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Setup__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_bcRepeatIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_bearerCapability1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_bearerCapability2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_progressIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_signal.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_callingPartyBCD__Number.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_callingPartySubAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_calledPartyBCD__Number.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_calledPartySubAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_redirectingPartyBCDNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_redirectingPartySubaddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_llc__RepeatIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_lowLayerCompatibility1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_lowLayerCompatibility2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_hlc__RepeatIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_highLayerCompatibility1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_highLayerCompatibility2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_priority.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_alert.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_networkCCCapabilities.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_causeofNoCli.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
single_value->field_backupBearerCapacity.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_NW_MS");
}

boolean PDU__ML3__Setup__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__ML3__Setup__NW__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__ML3__Setup__MS__NW::PDU__ML3__Setup__MS__NW()
{
}

PDU__ML3__Setup__MS__NW::PDU__ML3__Setup__MS__NW(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< RepeatIndicator >& par_bcRepeatIndicator,
    const BearerCapability__TLV& par_bearerCapability1,
    const OPTIONAL< BearerCapability__TLV >& par_bearerCapability2,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility,
    const OPTIONAL< CallingPartySubAddress >& par_callingPartySubAddress,
    const CalledPartyBCD__Number& par_calledPartyBCD__Number,
    const OPTIONAL< CalledPartySubAddress >& par_calledPartySubAddress,
    const OPTIONAL< RepeatIndicator >& par_llc__RepeatIndicator,
    const OPTIONAL< LowLayerCompatibility >& par_lowLayerCompatibility1,
    const OPTIONAL< LowLayerCompatibility >& par_lowLayerCompatibility2,
    const OPTIONAL< RepeatIndicator >& par_hlc__RepeatIndicator,
    const OPTIONAL< HighLayerCompatibility >& par_highLayerCompatibility1,
    const OPTIONAL< HighLayerCompatibility >& par_highLayerCompatibility2,
    const OPTIONAL< User__userShort >& par_user__user,
    const OPTIONAL< MobileL3__CommonIE__Types::SS__VersionIndicator >& par_ss__VersionIndicator,
    const OPTIONAL< CLIR >& par_clir__Suppression,
    const OPTIONAL< CLIR >& par_clir__Invocation,
    const OPTIONAL< CallControlCapabilities >& par_cC__Capabilities,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility__ccbs1,
    const OPTIONAL< MobileL3__CommonIE__Types::Facility__TLV >& par_facility__ccbs2,
    const OPTIONAL< StreamIdentifier >& par_streamIdentifier,
    const OPTIONAL< MobileL3__CommonIE__Types::SupportedCodecList >& par_supportedCodecs,
    const OPTIONAL< MobileL3__CommonIE__Types::Type2 >& par_redial)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_bcRepeatIndicator(par_bcRepeatIndicator),
  field_bearerCapability1(par_bearerCapability1),
  field_bearerCapability2(par_bearerCapability2),
  field_facility(par_facility),
  field_callingPartySubAddress(par_callingPartySubAddress),
  field_calledPartyBCD__Number(par_calledPartyBCD__Number),
  field_calledPartySubAddress(par_calledPartySubAddress),
  field_llc__RepeatIndicator(par_llc__RepeatIndicator),
  field_lowLayerCompatibility1(par_lowLayerCompatibility1),
  field_lowLayerCompatibility2(par_lowLayerCompatibility2),
  field_hlc__RepeatIndicator(par_hlc__RepeatIndicator),
  field_highLayerCompatibility1(par_highLayerCompatibility1),
  field_highLayerCompatibility2(par_highLayerCompatibility2),
  field_user__user(par_user__user),
  field_ss__VersionIndicator(par_ss__VersionIndicator),
  field_clir__Suppression(par_clir__Suppression),
  field_clir__Invocation(par_clir__Invocation),
  field_cC__Capabilities(par_cC__Capabilities),
  field_facility__ccbs1(par_facility__ccbs1),
  field_facility__ccbs2(par_facility__ccbs2),
  field_streamIdentifier(par_streamIdentifier),
  field_supportedCodecs(par_supportedCodecs),
  field_redial(par_redial)
{
}

PDU__ML3__Setup__MS__NW::PDU__ML3__Setup__MS__NW(const PDU__ML3__Setup__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
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.bcRepeatIndicator().is_bound()) field_bcRepeatIndicator = other_value.bcRepeatIndicator();
else field_bcRepeatIndicator.clean_up();
if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
else field_bearerCapability1.clean_up();
if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
else field_bearerCapability2.clean_up();
if (other_value.facility().is_bound()) field_facility = other_value.facility();
else field_facility.clean_up();
if (other_value.callingPartySubAddress().is_bound()) field_callingPartySubAddress = other_value.callingPartySubAddress();
else field_callingPartySubAddress.clean_up();
if (other_value.calledPartyBCD__Number().is_bound()) field_calledPartyBCD__Number = other_value.calledPartyBCD__Number();
else field_calledPartyBCD__Number.clean_up();
if (other_value.calledPartySubAddress().is_bound()) field_calledPartySubAddress = other_value.calledPartySubAddress();
else field_calledPartySubAddress.clean_up();
if (other_value.llc__RepeatIndicator().is_bound()) field_llc__RepeatIndicator = other_value.llc__RepeatIndicator();
else field_llc__RepeatIndicator.clean_up();
if (other_value.lowLayerCompatibility1().is_bound()) field_lowLayerCompatibility1 = other_value.lowLayerCompatibility1();
else field_lowLayerCompatibility1.clean_up();
if (other_value.lowLayerCompatibility2().is_bound()) field_lowLayerCompatibility2 = other_value.lowLayerCompatibility2();
else field_lowLayerCompatibility2.clean_up();
if (other_value.hlc__RepeatIndicator().is_bound()) field_hlc__RepeatIndicator = other_value.hlc__RepeatIndicator();
else field_hlc__RepeatIndicator.clean_up();
if (other_value.highLayerCompatibility1().is_bound()) field_highLayerCompatibility1 = other_value.highLayerCompatibility1();
else field_highLayerCompatibility1.clean_up();
if (other_value.highLayerCompatibility2().is_bound()) field_highLayerCompatibility2 = other_value.highLayerCompatibility2();
else field_highLayerCompatibility2.clean_up();
if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
else field_user__user.clean_up();
if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
else field_ss__VersionIndicator.clean_up();
if (other_value.clir__Suppression().is_bound()) field_clir__Suppression = other_value.clir__Suppression();
else field_clir__Suppression.clean_up();
if (other_value.clir__Invocation().is_bound()) field_clir__Invocation = other_value.clir__Invocation();
else field_clir__Invocation.clean_up();
if (other_value.cC__Capabilities().is_bound()) field_cC__Capabilities = other_value.cC__Capabilities();
else field_cC__Capabilities.clean_up();
if (other_value.facility__ccbs1().is_bound()) field_facility__ccbs1 = other_value.facility__ccbs1();
else field_facility__ccbs1.clean_up();
if (other_value.facility__ccbs2().is_bound()) field_facility__ccbs2 = other_value.facility__ccbs2();
else field_facility__ccbs2.clean_up();
if (other_value.streamIdentifier().is_bound()) field_streamIdentifier = other_value.streamIdentifier();
else field_streamIdentifier.clean_up();
if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
else field_supportedCodecs.clean_up();
if (other_value.redial().is_bound()) field_redial = other_value.redial();
else field_redial.clean_up();
}

void PDU__ML3__Setup__MS__NW::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_bcRepeatIndicator.clean_up();
field_bearerCapability1.clean_up();
field_bearerCapability2.clean_up();
field_facility.clean_up();
field_callingPartySubAddress.clean_up();
field_calledPartyBCD__Number.clean_up();
field_calledPartySubAddress.clean_up();
field_llc__RepeatIndicator.clean_up();
field_lowLayerCompatibility1.clean_up();
field_lowLayerCompatibility2.clean_up();
field_hlc__RepeatIndicator.clean_up();
field_highLayerCompatibility1.clean_up();
field_highLayerCompatibility2.clean_up();
field_user__user.clean_up();
field_ss__VersionIndicator.clean_up();
field_clir__Suppression.clean_up();
field_clir__Invocation.clean_up();
field_cC__Capabilities.clean_up();
field_facility__ccbs1.clean_up();
field_facility__ccbs2.clean_up();
field_streamIdentifier.clean_up();
field_supportedCodecs.clean_up();
field_redial.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__Setup__MS__NW::get_descriptor() const { return &PDU__ML3__Setup__MS__NW_descr_; }
PDU__ML3__Setup__MS__NW& PDU__ML3__Setup__MS__NW::operator=(const PDU__ML3__Setup__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
  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.bcRepeatIndicator().is_bound()) field_bcRepeatIndicator = other_value.bcRepeatIndicator();
  else field_bcRepeatIndicator.clean_up();
  if (other_value.bearerCapability1().is_bound()) field_bearerCapability1 = other_value.bearerCapability1();
  else field_bearerCapability1.clean_up();
  if (other_value.bearerCapability2().is_bound()) field_bearerCapability2 = other_value.bearerCapability2();
  else field_bearerCapability2.clean_up();
  if (other_value.facility().is_bound()) field_facility = other_value.facility();
  else field_facility.clean_up();
  if (other_value.callingPartySubAddress().is_bound()) field_callingPartySubAddress = other_value.callingPartySubAddress();
  else field_callingPartySubAddress.clean_up();
  if (other_value.calledPartyBCD__Number().is_bound()) field_calledPartyBCD__Number = other_value.calledPartyBCD__Number();
  else field_calledPartyBCD__Number.clean_up();
  if (other_value.calledPartySubAddress().is_bound()) field_calledPartySubAddress = other_value.calledPartySubAddress();
  else field_calledPartySubAddress.clean_up();
  if (other_value.llc__RepeatIndicator().is_bound()) field_llc__RepeatIndicator = other_value.llc__RepeatIndicator();
  else field_llc__RepeatIndicator.clean_up();
  if (other_value.lowLayerCompatibility1().is_bound()) field_lowLayerCompatibility1 = other_value.lowLayerCompatibility1();
  else field_lowLayerCompatibility1.clean_up();
  if (other_value.lowLayerCompatibility2().is_bound()) field_lowLayerCompatibility2 = other_value.lowLayerCompatibility2();
  else field_lowLayerCompatibility2.clean_up();
  if (other_value.hlc__RepeatIndicator().is_bound()) field_hlc__RepeatIndicator = other_value.hlc__RepeatIndicator();
  else field_hlc__RepeatIndicator.clean_up();
  if (other_value.highLayerCompatibility1().is_bound()) field_highLayerCompatibility1 = other_value.highLayerCompatibility1();
  else field_highLayerCompatibility1.clean_up();
  if (other_value.highLayerCompatibility2().is_bound()) field_highLayerCompatibility2 = other_value.highLayerCompatibility2();
  else field_highLayerCompatibility2.clean_up();
  if (other_value.user__user().is_bound()) field_user__user = other_value.user__user();
  else field_user__user.clean_up();
  if (other_value.ss__VersionIndicator().is_bound()) field_ss__VersionIndicator = other_value.ss__VersionIndicator();
  else field_ss__VersionIndicator.clean_up();
  if (other_value.clir__Suppression().is_bound()) field_clir__Suppression = other_value.clir__Suppression();
  else field_clir__Suppression.clean_up();
  if (other_value.clir__Invocation().is_bound()) field_clir__Invocation = other_value.clir__Invocation();
  else field_clir__Invocation.clean_up();
  if (other_value.cC__Capabilities().is_bound()) field_cC__Capabilities = other_value.cC__Capabilities();
  else field_cC__Capabilities.clean_up();
  if (other_value.facility__ccbs1().is_bound()) field_facility__ccbs1 = other_value.facility__ccbs1();
  else field_facility__ccbs1.clean_up();
  if (other_value.facility__ccbs2().is_bound()) field_facility__ccbs2 = other_value.facility__ccbs2();
  else field_facility__ccbs2.clean_up();
  if (other_value.streamIdentifier().is_bound()) field_streamIdentifier = other_value.streamIdentifier();
  else field_streamIdentifier.clean_up();
  if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
  else field_supportedCodecs.clean_up();
  if (other_value.redial().is_bound()) field_redial = other_value.redial();
  else field_redial.clean_up();
}
return *this;
}

boolean PDU__ML3__Setup__MS__NW::operator==(const PDU__ML3__Setup__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_bcRepeatIndicator==other_value.field_bcRepeatIndicator
  && field_bearerCapability1==other_value.field_bearerCapability1
  && field_bearerCapability2==other_value.field_bearerCapability2
  && field_facility==other_value.field_facility
  && field_callingPartySubAddress==other_value.field_callingPartySubAddress
  && field_calledPartyBCD__Number==other_value.field_calledPartyBCD__Number
  && field_calledPartySubAddress==other_value.field_calledPartySubAddress
  && field_llc__RepeatIndicator==other_value.field_llc__RepeatIndicator
  && field_lowLayerCompatibility1==other_value.field_lowLayerCompatibility1
  && field_lowLayerCompatibility2==other_value.field_lowLayerCompatibility2
  && field_hlc__RepeatIndicator==other_value.field_hlc__RepeatIndicator
  && field_highLayerCompatibility1==other_value.field_highLayerCompatibility1
  && field_highLayerCompatibility2==other_value.field_highLayerCompatibility2
  && field_user__user==other_value.field_user__user
  && field_ss__VersionIndicator==other_value.field_ss__VersionIndicator
  && field_clir__Suppression==other_value.field_clir__Suppression
  && field_clir__Invocation==other_value.field_clir__Invocation
  && field_cC__Capabilities==other_value.field_cC__Capabilities
  && field_facility__ccbs1==other_value.field_facility__ccbs1
  && field_facility__ccbs2==other_value.field_facility__ccbs2
  && field_streamIdentifier==other_value.field_streamIdentifier
  && field_supportedCodecs==other_value.field_supportedCodecs
  && field_redial==other_value.field_redial;
}

boolean PDU__ML3__Setup__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_bcRepeatIndicator.get_selection() || field_bcRepeatIndicator.is_bound())
  || (field_bearerCapability1.is_bound())
  || (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_bound())
  || (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_bound())
  || (OPTIONAL_OMIT == field_callingPartySubAddress.get_selection() || field_callingPartySubAddress.is_bound())
  || (field_calledPartyBCD__Number.is_bound())
  || (OPTIONAL_OMIT == field_calledPartySubAddress.get_selection() || field_calledPartySubAddress.is_bound())
  || (OPTIONAL_OMIT == field_llc__RepeatIndicator.get_selection() || field_llc__RepeatIndicator.is_bound())
  || (OPTIONAL_OMIT == field_lowLayerCompatibility1.get_selection() || field_lowLayerCompatibility1.is_bound())
  || (OPTIONAL_OMIT == field_lowLayerCompatibility2.get_selection() || field_lowLayerCompatibility2.is_bound())
  || (OPTIONAL_OMIT == field_hlc__RepeatIndicator.get_selection() || field_hlc__RepeatIndicator.is_bound())
  || (OPTIONAL_OMIT == field_highLayerCompatibility1.get_selection() || field_highLayerCompatibility1.is_bound())
  || (OPTIONAL_OMIT == field_highLayerCompatibility2.get_selection() || field_highLayerCompatibility2.is_bound())
  || (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_bound())
  || (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_bound())
  || (OPTIONAL_OMIT == field_clir__Suppression.get_selection() || field_clir__Suppression.is_bound())
  || (OPTIONAL_OMIT == field_clir__Invocation.get_selection() || field_clir__Invocation.is_bound())
  || (OPTIONAL_OMIT == field_cC__Capabilities.get_selection() || field_cC__Capabilities.is_bound())
  || (OPTIONAL_OMIT == field_facility__ccbs1.get_selection() || field_facility__ccbs1.is_bound())
  || (OPTIONAL_OMIT == field_facility__ccbs2.get_selection() || field_facility__ccbs2.is_bound())
  || (OPTIONAL_OMIT == field_streamIdentifier.get_selection() || field_streamIdentifier.is_bound())
  || (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_bound())
  || (OPTIONAL_OMIT == field_redial.get_selection() || field_redial.is_bound());
}
boolean PDU__ML3__Setup__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_bcRepeatIndicator.get_selection() || field_bcRepeatIndicator.is_value())
  && field_bearerCapability1.is_value()
  && (OPTIONAL_OMIT == field_bearerCapability2.get_selection() || field_bearerCapability2.is_value())
  && (OPTIONAL_OMIT == field_facility.get_selection() || field_facility.is_value())
  && (OPTIONAL_OMIT == field_callingPartySubAddress.get_selection() || field_callingPartySubAddress.is_value())
  && field_calledPartyBCD__Number.is_value()
  && (OPTIONAL_OMIT == field_calledPartySubAddress.get_selection() || field_calledPartySubAddress.is_value())
  && (OPTIONAL_OMIT == field_llc__RepeatIndicator.get_selection() || field_llc__RepeatIndicator.is_value())
  && (OPTIONAL_OMIT == field_lowLayerCompatibility1.get_selection() || field_lowLayerCompatibility1.is_value())
  && (OPTIONAL_OMIT == field_lowLayerCompatibility2.get_selection() || field_lowLayerCompatibility2.is_value())
  && (OPTIONAL_OMIT == field_hlc__RepeatIndicator.get_selection() || field_hlc__RepeatIndicator.is_value())
  && (OPTIONAL_OMIT == field_highLayerCompatibility1.get_selection() || field_highLayerCompatibility1.is_value())
  && (OPTIONAL_OMIT == field_highLayerCompatibility2.get_selection() || field_highLayerCompatibility2.is_value())
  && (OPTIONAL_OMIT == field_user__user.get_selection() || field_user__user.is_value())
  && (OPTIONAL_OMIT == field_ss__VersionIndicator.get_selection() || field_ss__VersionIndicator.is_value())
  && (OPTIONAL_OMIT == field_clir__Suppression.get_selection() || field_clir__Suppression.is_value())
  && (OPTIONAL_OMIT == field_clir__Invocation.get_selection() || field_clir__Invocation.is_value())
  && (OPTIONAL_OMIT == field_cC__Capabilities.get_selection() || field_cC__Capabilities.is_value())
  && (OPTIONAL_OMIT == field_facility__ccbs1.get_selection() || field_facility__ccbs1.is_value())
  && (OPTIONAL_OMIT == field_facility__ccbs2.get_selection() || field_facility__ccbs2.is_value())
  && (OPTIONAL_OMIT == field_streamIdentifier.get_selection() || field_streamIdentifier.is_value())
  && (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_value())
  && (OPTIONAL_OMIT == field_redial.get_selection() || field_redial.is_value());
}
int PDU__ML3__Setup__MS__NW::size_of() const
{
  int ret_val = 4;
  if (field_bcRepeatIndicator.ispresent()) ret_val++;
  if (field_bearerCapability2.ispresent()) ret_val++;
  if (field_facility.ispresent()) ret_val++;
  if (field_callingPartySubAddress.ispresent()) ret_val++;
  if (field_calledPartySubAddress.ispresent()) ret_val++;
  if (field_llc__RepeatIndicator.ispresent()) ret_val++;
  if (field_lowLayerCompatibility1.ispresent()) ret_val++;
  if (field_lowLayerCompatibility2.ispresent()) ret_val++;
  if (field_hlc__RepeatIndicator.ispresent()) ret_val++;
  if (field_highLayerCompatibility1.ispresent()) ret_val++;
  if (field_highLayerCompatibility2.ispresent()) ret_val++;
  if (field_user__user.ispresent()) ret_val++;
  if (field_ss__VersionIndicator.ispresent()) ret_val++;
  if (field_clir__Suppression.ispresent()) ret_val++;
  if (field_clir__Invocation.ispresent()) ret_val++;
  if (field_cC__Capabilities.ispresent()) ret_val++;
  if (field_facility__ccbs1.ispresent()) ret_val++;
  if (field_facility__ccbs2.ispresent()) ret_val++;
  if (field_streamIdentifier.ispresent()) ret_val++;
  if (field_supportedCodecs.ispresent()) ret_val++;
  if (field_redial.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__Setup__MS__NW::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(", bcRepeatIndicator := ");
field_bcRepeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
field_bearerCapability2.log();
TTCN_Logger::log_event_str(", facility := ");
field_facility.log();
TTCN_Logger::log_event_str(", callingPartySubAddress := ");
field_callingPartySubAddress.log();
TTCN_Logger::log_event_str(", calledPartyBCD_Number := ");
field_calledPartyBCD__Number.log();
TTCN_Logger::log_event_str(", calledPartySubAddress := ");
field_calledPartySubAddress.log();
TTCN_Logger::log_event_str(", llc_RepeatIndicator := ");
field_llc__RepeatIndicator.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility1 := ");
field_lowLayerCompatibility1.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility2 := ");
field_lowLayerCompatibility2.log();
TTCN_Logger::log_event_str(", hlc_RepeatIndicator := ");
field_hlc__RepeatIndicator.log();
TTCN_Logger::log_event_str(", highLayerCompatibility1 := ");
field_highLayerCompatibility1.log();
TTCN_Logger::log_event_str(", highLayerCompatibility2 := ");
field_highLayerCompatibility2.log();
TTCN_Logger::log_event_str(", user_user := ");
field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(", clir_Suppression := ");
field_clir__Suppression.log();
TTCN_Logger::log_event_str(", clir_Invocation := ");
field_clir__Invocation.log();
TTCN_Logger::log_event_str(", cC_Capabilities := ");
field_cC__Capabilities.log();
TTCN_Logger::log_event_str(", facility_ccbs1 := ");
field_facility__ccbs1.log();
TTCN_Logger::log_event_str(", facility_ccbs2 := ");
field_facility__ccbs2.log();
TTCN_Logger::log_event_str(", streamIdentifier := ");
field_streamIdentifier.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
field_supportedCodecs.log();
TTCN_Logger::log_event_str(", redial := ");
field_redial.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__Setup__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!bcRepeatIndicator().is_bound()) bcRepeatIndicator() = OMIT_VALUE;
else bcRepeatIndicator().set_implicit_omit();
if (bearerCapability1().is_bound()) bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!callingPartySubAddress().is_bound()) callingPartySubAddress() = OMIT_VALUE;
else callingPartySubAddress().set_implicit_omit();
if (calledPartyBCD__Number().is_bound()) calledPartyBCD__Number().set_implicit_omit();
if (!calledPartySubAddress().is_bound()) calledPartySubAddress() = OMIT_VALUE;
else calledPartySubAddress().set_implicit_omit();
if (!llc__RepeatIndicator().is_bound()) llc__RepeatIndicator() = OMIT_VALUE;
else llc__RepeatIndicator().set_implicit_omit();
if (!lowLayerCompatibility1().is_bound()) lowLayerCompatibility1() = OMIT_VALUE;
else lowLayerCompatibility1().set_implicit_omit();
if (!lowLayerCompatibility2().is_bound()) lowLayerCompatibility2() = OMIT_VALUE;
else lowLayerCompatibility2().set_implicit_omit();
if (!hlc__RepeatIndicator().is_bound()) hlc__RepeatIndicator() = OMIT_VALUE;
else hlc__RepeatIndicator().set_implicit_omit();
if (!highLayerCompatibility1().is_bound()) highLayerCompatibility1() = OMIT_VALUE;
else highLayerCompatibility1().set_implicit_omit();
if (!highLayerCompatibility2().is_bound()) highLayerCompatibility2() = OMIT_VALUE;
else highLayerCompatibility2().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
if (!clir__Suppression().is_bound()) clir__Suppression() = OMIT_VALUE;
else clir__Suppression().set_implicit_omit();
if (!clir__Invocation().is_bound()) clir__Invocation() = OMIT_VALUE;
else clir__Invocation().set_implicit_omit();
if (!cC__Capabilities().is_bound()) cC__Capabilities() = OMIT_VALUE;
else cC__Capabilities().set_implicit_omit();
if (!facility__ccbs1().is_bound()) facility__ccbs1() = OMIT_VALUE;
else facility__ccbs1().set_implicit_omit();
if (!facility__ccbs2().is_bound()) facility__ccbs2() = OMIT_VALUE;
else facility__ccbs2().set_implicit_omit();
if (!streamIdentifier().is_bound()) streamIdentifier() = OMIT_VALUE;
else streamIdentifier().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!redial().is_bound()) redial() = OMIT_VALUE;
else redial().set_implicit_omit();
}

void PDU__ML3__Setup__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (25<param.get_size()) {
      param.error("record value of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW has 25 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bcRepeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) callingPartySubAddress().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) calledPartyBCD__Number().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) calledPartySubAddress().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) llc__RepeatIndicator().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility1().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility2().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) hlc__RepeatIndicator().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility1().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility2().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) clir__Suppression().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) clir__Invocation().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) cC__Capabilities().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) facility__ccbs1().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) facility__ccbs2().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) streamIdentifier().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) redial().set_param(*param.get_elem(24));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bcRepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bcRepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPartySubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPartySubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPartyBCD_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPartyBCD__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPartySubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPartySubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "llc_RepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          llc__RepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hlc_RepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hlc__RepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "clir_Suppression")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          clir__Suppression().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "clir_Invocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          clir__Invocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cC_Capabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cC__Capabilities().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility_ccbs1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility__ccbs1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility_ccbs2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility__ccbs2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redial")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redial().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_CC_Types.PDU_ML3_Setup_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
  }
}

void PDU__ML3__Setup__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_bcRepeatIndicator.encode_text(text_buf);
field_bearerCapability1.encode_text(text_buf);
field_bearerCapability2.encode_text(text_buf);
field_facility.encode_text(text_buf);
field_callingPartySubAddress.encode_text(text_buf);
field_calledPartyBCD__Number.encode_text(text_buf);
field_calledPartySubAddress.encode_text(text_buf);
field_llc__RepeatIndicator.encode_text(text_buf);
field_lowLayerCompatibility1.encode_text(text_buf);
field_lowLayerCompatibility2.encode_text(text_buf);
field_hlc__RepeatIndicator.encode_text(text_buf);
field_highLayerCompatibility1.encode_text(text_buf);
field_highLayerCompatibility2.encode_text(text_buf);
field_user__user.encode_text(text_buf);
field_ss__VersionIndicator.encode_text(text_buf);
field_clir__Suppression.encode_text(text_buf);
field_clir__Invocation.encode_text(text_buf);
field_cC__Capabilities.encode_text(text_buf);
field_facility__ccbs1.encode_text(text_buf);
field_facility__ccbs2.encode_text(text_buf);
field_streamIdentifier.encode_text(text_buf);
field_supportedCodecs.encode_text(text_buf);
field_redial.encode_text(text_buf);
}

void PDU__ML3__Setup__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_bcRepeatIndicator.decode_text(text_buf);
field_bearerCapability1.decode_text(text_buf);
field_bearerCapability2.decode_text(text_buf);
field_facility.decode_text(text_buf);
field_callingPartySubAddress.decode_text(text_buf);
field_calledPartyBCD__Number.decode_text(text_buf);
field_calledPartySubAddress.decode_text(text_buf);
field_llc__RepeatIndicator.decode_text(text_buf);
field_lowLayerCompatibility1.decode_text(text_buf);
field_lowLayerCompatibility2.decode_text(text_buf);
field_hlc__RepeatIndicator.decode_text(text_buf);
field_highLayerCompatibility1.decode_text(text_buf);
field_highLayerCompatibility2.decode_text(text_buf);
field_user__user.decode_text(text_buf);
field_ss__VersionIndicator.decode_text(text_buf);
field_clir__Suppression.decode_text(text_buf);
field_clir__Invocation.decode_text(text_buf);
field_cC__Capabilities.decode_text(text_buf);
field_facility__ccbs1.decode_text(text_buf);
field_facility__ccbs2.decode_text(text_buf);
field_streamIdentifier.decode_text(text_buf);
field_supportedCodecs.decode_text(text_buf);
field_redial.decode_text(text_buf);
}

void PDU__ML3__Setup__MS__NW::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__Setup__MS__NW::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__Setup__MS__NW::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_bcRepeatIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, RepeatIndicator_descr_.raw->forceomit);
  decoded_field_length = field_bcRepeatIndicator().RAW_decode(RepeatIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_bcRepeatIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bcRepeatIndicator.ispresent() || field_bcRepeatIndicator().elementIdentifier() !=  bs_0){
  field_bcRepeatIndicator=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_bcRepeatIndicator=OMIT_VALUE;
  RAW_Force_Omit field_3_force_omit(3, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability1.RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_bearerCapability2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, BearerCapability__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bearerCapability2().RAW_decode(BearerCapability__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_bearerCapability2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bearerCapability2.ispresent() || field_bearerCapability2().elementIdentifier() !=  os_4){
  field_bearerCapability2=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_bearerCapability2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_facility = 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::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_facility = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0){
  field_facility=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_facility=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_callingPartySubAddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, CallingPartySubAddress_descr_.raw->forceomit);
  decoded_field_length = field_callingPartySubAddress().RAW_decode(CallingPartySubAddress_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_callingPartySubAddress = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_callingPartySubAddress.ispresent() || field_callingPartySubAddress().elementIdentifier() !=  os_19){
  field_callingPartySubAddress=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_callingPartySubAddress=OMIT_VALUE;
  RAW_Force_Omit field_7_force_omit(7, force_omit, CalledPartyBCD__Number_descr_.raw->forceomit);
  decoded_field_length = field_calledPartyBCD__Number.RAW_decode(CalledPartyBCD__Number_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_calledPartySubAddress = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, CalledPartySubAddress_descr_.raw->forceomit);
  decoded_field_length = field_calledPartySubAddress().RAW_decode(CalledPartySubAddress_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_calledPartySubAddress = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_calledPartySubAddress.ispresent() || field_calledPartySubAddress().elementIdentifier() !=  os_21){
  field_calledPartySubAddress=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_calledPartySubAddress=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_llc__RepeatIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, RepeatIndicator_descr_.raw->forceomit);
  decoded_field_length = field_llc__RepeatIndicator().RAW_decode(RepeatIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_llc__RepeatIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_llc__RepeatIndicator.ispresent() || field_llc__RepeatIndicator().elementIdentifier() !=  bs_0){
  field_llc__RepeatIndicator=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_llc__RepeatIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_lowLayerCompatibility1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, LowLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_lowLayerCompatibility1().RAW_decode(LowLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_lowLayerCompatibility1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_lowLayerCompatibility1.ispresent() || field_lowLayerCompatibility1().elementIdentifier() !=  os_13){
  field_lowLayerCompatibility1=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_lowLayerCompatibility1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_lowLayerCompatibility2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, LowLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_lowLayerCompatibility2().RAW_decode(LowLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_lowLayerCompatibility2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_lowLayerCompatibility2.ispresent() || field_lowLayerCompatibility2().elementIdentifier() !=  os_13){
  field_lowLayerCompatibility2=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_lowLayerCompatibility2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_hlc__RepeatIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, RepeatIndicator_descr_.raw->forceomit);
  decoded_field_length = field_hlc__RepeatIndicator().RAW_decode(RepeatIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_hlc__RepeatIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_hlc__RepeatIndicator.ispresent() || field_hlc__RepeatIndicator().elementIdentifier() !=  bs_0){
  field_hlc__RepeatIndicator=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_hlc__RepeatIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_highLayerCompatibility1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, HighLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_highLayerCompatibility1().RAW_decode(HighLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_highLayerCompatibility1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_highLayerCompatibility1.ispresent() || field_highLayerCompatibility1().elementIdentifier() !=  os_14){
  field_highLayerCompatibility1=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_highLayerCompatibility1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_highLayerCompatibility2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, HighLayerCompatibility_descr_.raw->forceomit);
  decoded_field_length = field_highLayerCompatibility2().RAW_decode(HighLayerCompatibility_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_highLayerCompatibility2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_highLayerCompatibility2.ispresent() || field_highLayerCompatibility2().elementIdentifier() !=  os_14){
  field_highLayerCompatibility2=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_highLayerCompatibility2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_user__user = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, User__userShort_descr_.raw->forceomit);
  decoded_field_length = field_user__user().RAW_decode(User__userShort_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_user__user = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2){
  field_user__user=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_user__user=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_ss__VersionIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__CommonIE__Types::SS__VersionIndicator_descr_.raw->forceomit);
  decoded_field_length = field_ss__VersionIndicator().RAW_decode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_ss__VersionIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().elementIdentifier() !=  os_3){
  field_ss__VersionIndicator=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_ss__VersionIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_clir__Suppression = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, CLIR_descr_.raw->forceomit);
  decoded_field_length = field_clir__Suppression().RAW_decode(CLIR_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_clir__Suppression = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_clir__Suppression.ispresent() || field_clir__Suppression().elementIdentifier() !=  os_27){
  field_clir__Suppression=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_clir__Suppression=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_clir__Invocation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, CLIR_descr_.raw->forceomit);
  decoded_field_length = field_clir__Invocation().RAW_decode(CLIR_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_clir__Invocation = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_clir__Invocation.ispresent() || field_clir__Invocation().elementIdentifier() !=  os_28){
  field_clir__Invocation=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_clir__Invocation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_cC__Capabilities = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, CallControlCapabilities_descr_.raw->forceomit);
  decoded_field_length = field_cC__Capabilities().RAW_decode(CallControlCapabilities_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_cC__Capabilities = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cC__Capabilities.ispresent() || field_cC__Capabilities().elementIdentifier() !=  os_6){
  field_cC__Capabilities=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_cC__Capabilities=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_facility__ccbs1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility__ccbs1().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_facility__ccbs1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility__ccbs1.ispresent() || field_facility__ccbs1().elementIdentifier() !=  os_29){
  field_facility__ccbs1=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_facility__ccbs1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_facility__ccbs2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw->forceomit);
  decoded_field_length = field_facility__ccbs2().RAW_decode(MobileL3__CommonIE__Types::Facility__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_facility__ccbs2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_facility__ccbs2.ispresent() || field_facility__ccbs2().elementIdentifier() !=  os_30){
  field_facility__ccbs2=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_facility__ccbs2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_streamIdentifier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, StreamIdentifier_descr_.raw->forceomit);
  decoded_field_length = field_streamIdentifier().RAW_decode(StreamIdentifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_streamIdentifier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_streamIdentifier.ispresent() || field_streamIdentifier().elementIdentifier() !=  os_7){
  field_streamIdentifier=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_streamIdentifier=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_supportedCodecs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw->forceomit);
  decoded_field_length = field_supportedCodecs().RAW_decode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_supportedCodecs = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_supportedCodecs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_redial = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, MobileL3__CommonIE__Types::Type2_descr_.raw->forceomit);
  decoded_field_length = field_redial().RAW_decode(MobileL3__CommonIE__Types::Type2_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_redial = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_redial.ispresent() || field_redial().elementIdentifier() !=  os_15){
  field_redial=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_redial=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__Setup__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 25;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(25);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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_bcRepeatIndicator.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RepeatIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, BearerCapability__TLV_descr_.raw);
  if (field_bearerCapability2.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, BearerCapability__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_facility.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_callingPartySubAddress.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, CallingPartySubAddress_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, CalledPartyBCD__Number_descr_.raw);
  if (field_calledPartySubAddress.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, CalledPartySubAddress_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_llc__RepeatIndicator.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, RepeatIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_lowLayerCompatibility1.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, LowLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_lowLayerCompatibility2.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, LowLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_hlc__RepeatIndicator.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, RepeatIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_highLayerCompatibility1.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, HighLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_highLayerCompatibility2.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, HighLayerCompatibility_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_user__user.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, User__userShort_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_ss__VersionIndicator.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__CommonIE__Types::SS__VersionIndicator_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_clir__Suppression.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, CLIR_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_clir__Invocation.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, CLIR_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_cC__Capabilities.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, CallControlCapabilities_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_facility__ccbs1.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_facility__ccbs2.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, MobileL3__CommonIE__Types::Facility__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_streamIdentifier.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, StreamIdentifier_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_supportedCodecs.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_redial.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, MobileL3__CommonIE__Types::Type2_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = 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_bcRepeatIndicator.ispresent()) {
  encoded_length += field_bcRepeatIndicator().RAW_encode(RepeatIndicator_descr_, *myleaf.body.node.nodes[2]);
  }
  encoded_length += field_bearerCapability1.RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[3]);
  if (field_bearerCapability2.ispresent()) {
  encoded_length += field_bearerCapability2().RAW_encode(BearerCapability__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_facility.ispresent()) {
  encoded_length += field_facility().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_callingPartySubAddress.ispresent()) {
  encoded_length += field_callingPartySubAddress().RAW_encode(CallingPartySubAddress_descr_, *myleaf.body.node.nodes[6]);
  }
  encoded_length += field_calledPartyBCD__Number.RAW_encode(CalledPartyBCD__Number_descr_, *myleaf.body.node.nodes[7]);
  if (field_calledPartySubAddress.ispresent()) {
  encoded_length += field_calledPartySubAddress().RAW_encode(CalledPartySubAddress_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_llc__RepeatIndicator.ispresent()) {
  encoded_length += field_llc__RepeatIndicator().RAW_encode(RepeatIndicator_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_lowLayerCompatibility1.ispresent()) {
  encoded_length += field_lowLayerCompatibility1().RAW_encode(LowLayerCompatibility_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_lowLayerCompatibility2.ispresent()) {
  encoded_length += field_lowLayerCompatibility2().RAW_encode(LowLayerCompatibility_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_hlc__RepeatIndicator.ispresent()) {
  encoded_length += field_hlc__RepeatIndicator().RAW_encode(RepeatIndicator_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_highLayerCompatibility1.ispresent()) {
  encoded_length += field_highLayerCompatibility1().RAW_encode(HighLayerCompatibility_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_highLayerCompatibility2.ispresent()) {
  encoded_length += field_highLayerCompatibility2().RAW_encode(HighLayerCompatibility_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_user__user.ispresent()) {
  encoded_length += field_user__user().RAW_encode(User__userShort_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_ss__VersionIndicator.ispresent()) {
  encoded_length += field_ss__VersionIndicator().RAW_encode(MobileL3__CommonIE__Types::SS__VersionIndicator_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_clir__Suppression.ispresent()) {
  encoded_length += field_clir__Suppression().RAW_encode(CLIR_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_clir__Invocation.ispresent()) {
  encoded_length += field_clir__Invocation().RAW_encode(CLIR_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_cC__Capabilities.ispresent()) {
  encoded_length += field_cC__Capabilities().RAW_encode(CallControlCapabilities_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_facility__ccbs1.ispresent()) {
  encoded_length += field_facility__ccbs1().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_facility__ccbs2.ispresent()) {
  encoded_length += field_facility__ccbs2().RAW_encode(MobileL3__CommonIE__Types::Facility__TLV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_streamIdentifier.ispresent()) {
  encoded_length += field_streamIdentifier().RAW_encode(StreamIdentifier_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_supportedCodecs.ispresent()) {
  encoded_length += field_supportedCodecs().RAW_encode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_redial.ispresent()) {
  encoded_length += field_redial().RAW_encode(MobileL3__CommonIE__Types::Type2_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_bcRepeatIndicator.ispresent() && (!field_bcRepeatIndicator.ispresent() || field_bcRepeatIndicator().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[]={2,1};
  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::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_bearerCapability2.ispresent() && (!field_bearerCapability2.ispresent() || field_bearerCapability2().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[]={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_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);
  }
  }
  if (field_facility.ispresent() && (!field_facility.ispresent() || field_facility().elementIdentifier() !=  os_0)) {
  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_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_callingPartySubAddress.ispresent() && (!field_callingPartySubAddress.ispresent() || field_callingPartySubAddress().elementIdentifier() !=  os_19)) {
  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){
   os_19.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_calledPartySubAddress.ispresent() && (!field_calledPartySubAddress.ispresent() || field_calledPartySubAddress().elementIdentifier() !=  os_21)) {
  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){
   os_21.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_llc__RepeatIndicator.ispresent() && (!field_llc__RepeatIndicator.ispresent() || field_llc__RepeatIndicator().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[]={9,1};
  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::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_lowLayerCompatibility1.ispresent() && (!field_lowLayerCompatibility1.ispresent() || field_lowLayerCompatibility1().elementIdentifier() !=  os_13)) {
  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){
   os_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_lowLayerCompatibility2.ispresent() && (!field_lowLayerCompatibility2.ispresent() || field_lowLayerCompatibility2().elementIdentifier() !=  os_13)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={11,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_hlc__RepeatIndicator.ispresent() && (!field_hlc__RepeatIndicator.ispresent() || field_hlc__RepeatIndicator().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[]={12,1};
  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::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_highLayerCompatibility1.ispresent() && (!field_highLayerCompatibility1.ispresent() || field_highLayerCompatibility1().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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){
   os_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_highLayerCompatibility2.ispresent() && (!field_highLayerCompatibility2.ispresent() || field_highLayerCompatibility2().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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){
   os_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__user.ispresent() && (!field_user__user.ispresent() || field_user__user().elementIdentifier() !=  os_2)) {
  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){
   os_2.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_ss__VersionIndicator.ispresent() && (!field_ss__VersionIndicator.ispresent() || field_ss__VersionIndicator().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[]={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){
   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);
  }
  }
  if (field_clir__Suppression.ispresent() && (!field_clir__Suppression.ispresent() || field_clir__Suppression().elementIdentifier() !=  os_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){
   os_27.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_clir__Invocation.ispresent() && (!field_clir__Invocation.ispresent() || field_clir__Invocation().elementIdentifier() !=  os_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){
   os_28.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_cC__Capabilities.ispresent() && (!field_cC__Capabilities.ispresent() || field_cC__Capabilities().elementIdentifier() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_facility__ccbs1.ispresent() && (!field_facility__ccbs1.ispresent() || field_facility__ccbs1().elementIdentifier() !=  os_29)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={20,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_29.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_facility__ccbs2.ispresent() && (!field_facility__ccbs2.ispresent() || field_facility__ccbs2().elementIdentifier() !=  os_30)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={21,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_30.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_streamIdentifier.ispresent() && (!field_streamIdentifier.ispresent() || field_streamIdentifier().elementIdentifier() !=  os_7)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={22,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_redial.ispresent() && (!field_redial.ispresent() || field_redial().elementIdentifier() !=  os_15)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={24,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_15.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__Setup__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
RepeatIndicator_template field_bcRepeatIndicator;
BearerCapability__TLV_template field_bearerCapability1;
BearerCapability__TLV_template field_bearerCapability2;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility;
CallingPartySubAddress_template field_callingPartySubAddress;
CalledPartyBCD__Number_template field_calledPartyBCD__Number;
CalledPartySubAddress_template field_calledPartySubAddress;
RepeatIndicator_template field_llc__RepeatIndicator;
LowLayerCompatibility_template field_lowLayerCompatibility1;
LowLayerCompatibility_template field_lowLayerCompatibility2;
RepeatIndicator_template field_hlc__RepeatIndicator;
HighLayerCompatibility_template field_highLayerCompatibility1;
HighLayerCompatibility_template field_highLayerCompatibility2;
User__userShort_template field_user__user;
MobileL3__CommonIE__Types::SS__VersionIndicator_template field_ss__VersionIndicator;
CLIR_template field_clir__Suppression;
CLIR_template field_clir__Invocation;
CallControlCapabilities_template field_cC__Capabilities;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility__ccbs1;
MobileL3__CommonIE__Types::Facility__TLV_template field_facility__ccbs2;
StreamIdentifier_template field_streamIdentifier;
MobileL3__CommonIE__Types::SupportedCodecList_template field_supportedCodecs;
MobileL3__CommonIE__Types::Type2_template field_redial;
};

void PDU__ML3__Setup__MS__NW_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_bcRepeatIndicator = ANY_OR_OMIT;
single_value->field_bearerCapability1 = ANY_VALUE;
single_value->field_bearerCapability2 = ANY_OR_OMIT;
single_value->field_facility = ANY_OR_OMIT;
single_value->field_callingPartySubAddress = ANY_OR_OMIT;
single_value->field_calledPartyBCD__Number = ANY_VALUE;
single_value->field_calledPartySubAddress = ANY_OR_OMIT;
single_value->field_llc__RepeatIndicator = ANY_OR_OMIT;
single_value->field_lowLayerCompatibility1 = ANY_OR_OMIT;
single_value->field_lowLayerCompatibility2 = ANY_OR_OMIT;
single_value->field_hlc__RepeatIndicator = ANY_OR_OMIT;
single_value->field_highLayerCompatibility1 = ANY_OR_OMIT;
single_value->field_highLayerCompatibility2 = ANY_OR_OMIT;
single_value->field_user__user = ANY_OR_OMIT;
single_value->field_ss__VersionIndicator = ANY_OR_OMIT;
single_value->field_clir__Suppression = ANY_OR_OMIT;
single_value->field_clir__Invocation = ANY_OR_OMIT;
single_value->field_cC__Capabilities = ANY_OR_OMIT;
single_value->field_facility__ccbs1 = ANY_OR_OMIT;
single_value->field_facility__ccbs2 = ANY_OR_OMIT;
single_value->field_streamIdentifier = ANY_OR_OMIT;
single_value->field_supportedCodecs = ANY_OR_OMIT;
single_value->field_redial = ANY_OR_OMIT;
}
}
}

void PDU__ML3__Setup__MS__NW_template::copy_value(const PDU__ML3__Setup__MS__NW& 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.bcRepeatIndicator().is_bound()) {
  if (other_value.bcRepeatIndicator().ispresent()) single_value->field_bcRepeatIndicator = other_value.bcRepeatIndicator()();
  else single_value->field_bcRepeatIndicator = OMIT_VALUE;
} else {
  single_value->field_bcRepeatIndicator.clean_up();
}
if (other_value.bearerCapability1().is_bound()) {
  single_value->field_bearerCapability1 = other_value.bearerCapability1();
} else {
  single_value->field_bearerCapability1.clean_up();
}
if (other_value.bearerCapability2().is_bound()) {
  if (other_value.bearerCapability2().ispresent()) single_value->field_bearerCapability2 = other_value.bearerCapability2()();
  else single_value->field_bearerCapability2 = OMIT_VALUE;
} else {
  single_value->field_bearerCapability2.clean_up();
}
if (other_value.facility().is_bound()) {
  if (other_value.facility().ispresent()) single_value->field_facility = other_value.facility()();
  else single_value->field_facility = OMIT_VALUE;
} else {
  single_value->field_facility.clean_up();
}
if (other_value.callingPartySubAddress().is_bound()) {
  if (other_value.callingPartySubAddress().ispresent()) single_value->field_callingPartySubAddress = other_value.callingPartySubAddress()();
  else single_value->field_callingPartySubAddress = OMIT_VALUE;
} else {
  single_value->field_callingPartySubAddress.clean_up();
}
if (other_value.calledPartyBCD__Number().is_bound()) {
  single_value->field_calledPartyBCD__Number = other_value.calledPartyBCD__Number();
} else {
  single_value->field_calledPartyBCD__Number.clean_up();
}
if (other_value.calledPartySubAddress().is_bound()) {
  if (other_value.calledPartySubAddress().ispresent()) single_value->field_calledPartySubAddress = other_value.calledPartySubAddress()();
  else single_value->field_calledPartySubAddress = OMIT_VALUE;
} else {
  single_value->field_calledPartySubAddress.clean_up();
}
if (other_value.llc__RepeatIndicator().is_bound()) {
  if (other_value.llc__RepeatIndicator().ispresent()) single_value->field_llc__RepeatIndicator = other_value.llc__RepeatIndicator()();
  else single_value->field_llc__RepeatIndicator = OMIT_VALUE;
} else {
  single_value->field_llc__RepeatIndicator.clean_up();
}
if (other_value.lowLayerCompatibility1().is_bound()) {
  if (other_value.lowLayerCompatibility1().ispresent()) single_value->field_lowLayerCompatibility1 = other_value.lowLayerCompatibility1()();
  else single_value->field_lowLayerCompatibility1 = OMIT_VALUE;
} else {
  single_value->field_lowLayerCompatibility1.clean_up();
}
if (other_value.lowLayerCompatibility2().is_bound()) {
  if (other_value.lowLayerCompatibility2().ispresent()) single_value->field_lowLayerCompatibility2 = other_value.lowLayerCompatibility2()();
  else single_value->field_lowLayerCompatibility2 = OMIT_VALUE;
} else {
  single_value->field_lowLayerCompatibility2.clean_up();
}
if (other_value.hlc__RepeatIndicator().is_bound()) {
  if (other_value.hlc__RepeatIndicator().ispresent()) single_value->field_hlc__RepeatIndicator = other_value.hlc__RepeatIndicator()();
  else single_value->field_hlc__RepeatIndicator = OMIT_VALUE;
} else {
  single_value->field_hlc__RepeatIndicator.clean_up();
}
if (other_value.highLayerCompatibility1().is_bound()) {
  if (other_value.highLayerCompatibility1().ispresent()) single_value->field_highLayerCompatibility1 = other_value.highLayerCompatibility1()();
  else single_value->field_highLayerCompatibility1 = OMIT_VALUE;
} else {
  single_value->field_highLayerCompatibility1.clean_up();
}
if (other_value.highLayerCompatibility2().is_bound()) {
  if (other_value.highLayerCompatibility2().ispresent()) single_value->field_highLayerCompatibility2 = other_value.highLayerCompatibility2()();
  else single_value->field_highLayerCompatibility2 = OMIT_VALUE;
} else {
  single_value->field_highLayerCompatibility2.clean_up();
}
if (other_value.user__user().is_bound()) {
  if (other_value.user__user().ispresent()) single_value->field_user__user = other_value.user__user()();
  else single_value->field_user__user = OMIT_VALUE;
} else {
  single_value->field_user__user.clean_up();
}
if (other_value.ss__VersionIndicator().is_bound()) {
  if (other_value.ss__VersionIndicator().ispresent()) single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator()();
  else single_value->field_ss__VersionIndicator = OMIT_VALUE;
} else {
  single_value->field_ss__VersionIndicator.clean_up();
}
if (other_value.clir__Suppression().is_bound()) {
  if (other_value.clir__Suppression().ispresent()) single_value->field_clir__Suppression = other_value.clir__Suppression()();
  else single_value->field_clir__Suppression = OMIT_VALUE;
} else {
  single_value->field_clir__Suppression.clean_up();
}
if (other_value.clir__Invocation().is_bound()) {
  if (other_value.clir__Invocation().ispresent()) single_value->field_clir__Invocation = other_value.clir__Invocation()();
  else single_value->field_clir__Invocation = OMIT_VALUE;
} else {
  single_value->field_clir__Invocation.clean_up();
}
if (other_value.cC__Capabilities().is_bound()) {
  if (other_value.cC__Capabilities().ispresent()) single_value->field_cC__Capabilities = other_value.cC__Capabilities()();
  else single_value->field_cC__Capabilities = OMIT_VALUE;
} else {
  single_value->field_cC__Capabilities.clean_up();
}
if (other_value.facility__ccbs1().is_bound()) {
  if (other_value.facility__ccbs1().ispresent()) single_value->field_facility__ccbs1 = other_value.facility__ccbs1()();
  else single_value->field_facility__ccbs1 = OMIT_VALUE;
} else {
  single_value->field_facility__ccbs1.clean_up();
}
if (other_value.facility__ccbs2().is_bound()) {
  if (other_value.facility__ccbs2().ispresent()) single_value->field_facility__ccbs2 = other_value.facility__ccbs2()();
  else single_value->field_facility__ccbs2 = OMIT_VALUE;
} else {
  single_value->field_facility__ccbs2.clean_up();
}
if (other_value.streamIdentifier().is_bound()) {
  if (other_value.streamIdentifier().ispresent()) single_value->field_streamIdentifier = other_value.streamIdentifier()();
  else single_value->field_streamIdentifier = OMIT_VALUE;
} else {
  single_value->field_streamIdentifier.clean_up();
}
if (other_value.supportedCodecs().is_bound()) {
  if (other_value.supportedCodecs().ispresent()) single_value->field_supportedCodecs = other_value.supportedCodecs()();
  else single_value->field_supportedCodecs = OMIT_VALUE;
} else {
  single_value->field_supportedCodecs.clean_up();
}
if (other_value.redial().is_bound()) {
  if (other_value.redial().ispresent()) single_value->field_redial = other_value.redial()();
  else single_value->field_redial = OMIT_VALUE;
} else {
  single_value->field_redial.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__Setup__MS__NW_template::copy_template(const PDU__ML3__Setup__MS__NW_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.bcRepeatIndicator().get_selection()) {
single_value->field_bcRepeatIndicator = other_value.bcRepeatIndicator();
} else {
single_value->field_bcRepeatIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability1().get_selection()) {
single_value->field_bearerCapability1 = other_value.bearerCapability1();
} else {
single_value->field_bearerCapability1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bearerCapability2().get_selection()) {
single_value->field_bearerCapability2 = other_value.bearerCapability2();
} else {
single_value->field_bearerCapability2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility().get_selection()) {
single_value->field_facility = other_value.facility();
} else {
single_value->field_facility.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.callingPartySubAddress().get_selection()) {
single_value->field_callingPartySubAddress = other_value.callingPartySubAddress();
} else {
single_value->field_callingPartySubAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.calledPartyBCD__Number().get_selection()) {
single_value->field_calledPartyBCD__Number = other_value.calledPartyBCD__Number();
} else {
single_value->field_calledPartyBCD__Number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.calledPartySubAddress().get_selection()) {
single_value->field_calledPartySubAddress = other_value.calledPartySubAddress();
} else {
single_value->field_calledPartySubAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.llc__RepeatIndicator().get_selection()) {
single_value->field_llc__RepeatIndicator = other_value.llc__RepeatIndicator();
} else {
single_value->field_llc__RepeatIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lowLayerCompatibility1().get_selection()) {
single_value->field_lowLayerCompatibility1 = other_value.lowLayerCompatibility1();
} else {
single_value->field_lowLayerCompatibility1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lowLayerCompatibility2().get_selection()) {
single_value->field_lowLayerCompatibility2 = other_value.lowLayerCompatibility2();
} else {
single_value->field_lowLayerCompatibility2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.hlc__RepeatIndicator().get_selection()) {
single_value->field_hlc__RepeatIndicator = other_value.hlc__RepeatIndicator();
} else {
single_value->field_hlc__RepeatIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.highLayerCompatibility1().get_selection()) {
single_value->field_highLayerCompatibility1 = other_value.highLayerCompatibility1();
} else {
single_value->field_highLayerCompatibility1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.highLayerCompatibility2().get_selection()) {
single_value->field_highLayerCompatibility2 = other_value.highLayerCompatibility2();
} else {
single_value->field_highLayerCompatibility2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__user().get_selection()) {
single_value->field_user__user = other_value.user__user();
} else {
single_value->field_user__user.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ss__VersionIndicator().get_selection()) {
single_value->field_ss__VersionIndicator = other_value.ss__VersionIndicator();
} else {
single_value->field_ss__VersionIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.clir__Suppression().get_selection()) {
single_value->field_clir__Suppression = other_value.clir__Suppression();
} else {
single_value->field_clir__Suppression.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.clir__Invocation().get_selection()) {
single_value->field_clir__Invocation = other_value.clir__Invocation();
} else {
single_value->field_clir__Invocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cC__Capabilities().get_selection()) {
single_value->field_cC__Capabilities = other_value.cC__Capabilities();
} else {
single_value->field_cC__Capabilities.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility__ccbs1().get_selection()) {
single_value->field_facility__ccbs1 = other_value.facility__ccbs1();
} else {
single_value->field_facility__ccbs1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facility__ccbs2().get_selection()) {
single_value->field_facility__ccbs2 = other_value.facility__ccbs2();
} else {
single_value->field_facility__ccbs2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.streamIdentifier().get_selection()) {
single_value->field_streamIdentifier = other_value.streamIdentifier();
} else {
single_value->field_streamIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.supportedCodecs().get_selection()) {
single_value->field_supportedCodecs = other_value.supportedCodecs();
} else {
single_value->field_supportedCodecs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.redial().get_selection()) {
single_value->field_redial = other_value.redial();
} else {
single_value->field_redial.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__Setup__MS__NW_template[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__Setup__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__Setup__MS__NW_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_CC_Types.PDU_ML3_Setup_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__ML3__Setup__MS__NW_template::PDU__ML3__Setup__MS__NW_template()
{
}

PDU__ML3__Setup__MS__NW_template::PDU__ML3__Setup__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__ML3__Setup__MS__NW_template::PDU__ML3__Setup__MS__NW_template(const PDU__ML3__Setup__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__ML3__Setup__MS__NW_template::PDU__ML3__Setup__MS__NW_template(const OPTIONAL<PDU__ML3__Setup__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__Setup__MS__NW&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW from an unbound optional field.");
}
}

PDU__ML3__Setup__MS__NW_template::PDU__ML3__Setup__MS__NW_template(PDU__ML3__Setup__MS__NW_template* p_precondition, PDU__ML3__Setup__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__ML3__Setup__MS__NW_template::PDU__ML3__Setup__MS__NW_template(Dynamic_Match_Interface<PDU__ML3__Setup__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__ML3__Setup__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__ML3__Setup__MS__NW_template::PDU__ML3__Setup__MS__NW_template(const PDU__ML3__Setup__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__ML3__Setup__MS__NW_template::~PDU__ML3__Setup__MS__NW_template()
{
clean_up();
}

PDU__ML3__Setup__MS__NW_template& PDU__ML3__Setup__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__ML3__Setup__MS__NW_template& PDU__ML3__Setup__MS__NW_template::operator=(const PDU__ML3__Setup__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__ML3__Setup__MS__NW_template& PDU__ML3__Setup__MS__NW_template::operator=(const OPTIONAL<PDU__ML3__Setup__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__Setup__MS__NW&)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_CC_Types.PDU_ML3_Setup_MS_NW.");
}
return *this;
}

PDU__ML3__Setup__MS__NW_template& PDU__ML3__Setup__MS__NW_template::operator=(const PDU__ML3__Setup__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__ML3__Setup__MS__NW_template::match(const PDU__ML3__Setup__MS__NW& 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.bcRepeatIndicator().is_bound()) return FALSE;
if((other_value.bcRepeatIndicator().ispresent() ? !single_value->field_bcRepeatIndicator.match((const RepeatIndicator&)other_value.bcRepeatIndicator(), legacy) : !single_value->field_bcRepeatIndicator.match_omit(legacy)))return FALSE;
if(!other_value.bearerCapability1().is_bound()) return FALSE;
if(!single_value->field_bearerCapability1.match(other_value.bearerCapability1(), legacy))return FALSE;
if(!other_value.bearerCapability2().is_bound()) return FALSE;
if((other_value.bearerCapability2().ispresent() ? !single_value->field_bearerCapability2.match((const BearerCapability__TLV&)other_value.bearerCapability2(), legacy) : !single_value->field_bearerCapability2.match_omit(legacy)))return FALSE;
if(!other_value.facility().is_bound()) return FALSE;
if((other_value.facility().ispresent() ? !single_value->field_facility.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility(), legacy) : !single_value->field_facility.match_omit(legacy)))return FALSE;
if(!other_value.callingPartySubAddress().is_bound()) return FALSE;
if((other_value.callingPartySubAddress().ispresent() ? !single_value->field_callingPartySubAddress.match((const CallingPartySubAddress&)other_value.callingPartySubAddress(), legacy) : !single_value->field_callingPartySubAddress.match_omit(legacy)))return FALSE;
if(!other_value.calledPartyBCD__Number().is_bound()) return FALSE;
if(!single_value->field_calledPartyBCD__Number.match(other_value.calledPartyBCD__Number(), legacy))return FALSE;
if(!other_value.calledPartySubAddress().is_bound()) return FALSE;
if((other_value.calledPartySubAddress().ispresent() ? !single_value->field_calledPartySubAddress.match((const CalledPartySubAddress&)other_value.calledPartySubAddress(), legacy) : !single_value->field_calledPartySubAddress.match_omit(legacy)))return FALSE;
if(!other_value.llc__RepeatIndicator().is_bound()) return FALSE;
if((other_value.llc__RepeatIndicator().ispresent() ? !single_value->field_llc__RepeatIndicator.match((const RepeatIndicator&)other_value.llc__RepeatIndicator(), legacy) : !single_value->field_llc__RepeatIndicator.match_omit(legacy)))return FALSE;
if(!other_value.lowLayerCompatibility1().is_bound()) return FALSE;
if((other_value.lowLayerCompatibility1().ispresent() ? !single_value->field_lowLayerCompatibility1.match((const LowLayerCompatibility&)other_value.lowLayerCompatibility1(), legacy) : !single_value->field_lowLayerCompatibility1.match_omit(legacy)))return FALSE;
if(!other_value.lowLayerCompatibility2().is_bound()) return FALSE;
if((other_value.lowLayerCompatibility2().ispresent() ? !single_value->field_lowLayerCompatibility2.match((const LowLayerCompatibility&)other_value.lowLayerCompatibility2(), legacy) : !single_value->field_lowLayerCompatibility2.match_omit(legacy)))return FALSE;
if(!other_value.hlc__RepeatIndicator().is_bound()) return FALSE;
if((other_value.hlc__RepeatIndicator().ispresent() ? !single_value->field_hlc__RepeatIndicator.match((const RepeatIndicator&)other_value.hlc__RepeatIndicator(), legacy) : !single_value->field_hlc__RepeatIndicator.match_omit(legacy)))return FALSE;
if(!other_value.highLayerCompatibility1().is_bound()) return FALSE;
if((other_value.highLayerCompatibility1().ispresent() ? !single_value->field_highLayerCompatibility1.match((const HighLayerCompatibility&)other_value.highLayerCompatibility1(), legacy) : !single_value->field_highLayerCompatibility1.match_omit(legacy)))return FALSE;
if(!other_value.highLayerCompatibility2().is_bound()) return FALSE;
if((other_value.highLayerCompatibility2().ispresent() ? !single_value->field_highLayerCompatibility2.match((const HighLayerCompatibility&)other_value.highLayerCompatibility2(), legacy) : !single_value->field_highLayerCompatibility2.match_omit(legacy)))return FALSE;
if(!other_value.user__user().is_bound()) return FALSE;
if((other_value.user__user().ispresent() ? !single_value->field_user__user.match((const User__userShort&)other_value.user__user(), legacy) : !single_value->field_user__user.match_omit(legacy)))return FALSE;
if(!other_value.ss__VersionIndicator().is_bound()) return FALSE;
if((other_value.ss__VersionIndicator().ispresent() ? !single_value->field_ss__VersionIndicator.match((const MobileL3__CommonIE__Types::SS__VersionIndicator&)other_value.ss__VersionIndicator(), legacy) : !single_value->field_ss__VersionIndicator.match_omit(legacy)))return FALSE;
if(!other_value.clir__Suppression().is_bound()) return FALSE;
if((other_value.clir__Suppression().ispresent() ? !single_value->field_clir__Suppression.match((const CLIR&)other_value.clir__Suppression(), legacy) : !single_value->field_clir__Suppression.match_omit(legacy)))return FALSE;
if(!other_value.clir__Invocation().is_bound()) return FALSE;
if((other_value.clir__Invocation().ispresent() ? !single_value->field_clir__Invocation.match((const CLIR&)other_value.clir__Invocation(), legacy) : !single_value->field_clir__Invocation.match_omit(legacy)))return FALSE;
if(!other_value.cC__Capabilities().is_bound()) return FALSE;
if((other_value.cC__Capabilities().ispresent() ? !single_value->field_cC__Capabilities.match((const CallControlCapabilities&)other_value.cC__Capabilities(), legacy) : !single_value->field_cC__Capabilities.match_omit(legacy)))return FALSE;
if(!other_value.facility__ccbs1().is_bound()) return FALSE;
if((other_value.facility__ccbs1().ispresent() ? !single_value->field_facility__ccbs1.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility__ccbs1(), legacy) : !single_value->field_facility__ccbs1.match_omit(legacy)))return FALSE;
if(!other_value.facility__ccbs2().is_bound()) return FALSE;
if((other_value.facility__ccbs2().ispresent() ? !single_value->field_facility__ccbs2.match((const MobileL3__CommonIE__Types::Facility__TLV&)other_value.facility__ccbs2(), legacy) : !single_value->field_facility__ccbs2.match_omit(legacy)))return FALSE;
if(!other_value.streamIdentifier().is_bound()) return FALSE;
if((other_value.streamIdentifier().ispresent() ? !single_value->field_streamIdentifier.match((const StreamIdentifier&)other_value.streamIdentifier(), legacy) : !single_value->field_streamIdentifier.match_omit(legacy)))return FALSE;
if(!other_value.supportedCodecs().is_bound()) return FALSE;
if((other_value.supportedCodecs().ispresent() ? !single_value->field_supportedCodecs.match((const MobileL3__CommonIE__Types::SupportedCodecList&)other_value.supportedCodecs(), legacy) : !single_value->field_supportedCodecs.match_omit(legacy)))return FALSE;
if(!other_value.redial().is_bound()) return FALSE;
if((other_value.redial().ispresent() ? !single_value->field_redial.match((const MobileL3__CommonIE__Types::Type2&)other_value.redial(), legacy) : !single_value->field_redial.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_CC_Types.PDU_ML3_Setup_MS_NW.");
}
return FALSE;
}

boolean PDU__ML3__Setup__MS__NW_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_bcRepeatIndicator.is_omit() || single_value->field_bcRepeatIndicator.is_bound())
 || single_value->field_bearerCapability1.is_bound()
 || (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_bound())
 || (single_value->field_facility.is_omit() || single_value->field_facility.is_bound())
 || (single_value->field_callingPartySubAddress.is_omit() || single_value->field_callingPartySubAddress.is_bound())
 || single_value->field_calledPartyBCD__Number.is_bound()
 || (single_value->field_calledPartySubAddress.is_omit() || single_value->field_calledPartySubAddress.is_bound())
 || (single_value->field_llc__RepeatIndicator.is_omit() || single_value->field_llc__RepeatIndicator.is_bound())
 || (single_value->field_lowLayerCompatibility1.is_omit() || single_value->field_lowLayerCompatibility1.is_bound())
 || (single_value->field_lowLayerCompatibility2.is_omit() || single_value->field_lowLayerCompatibility2.is_bound())
 || (single_value->field_hlc__RepeatIndicator.is_omit() || single_value->field_hlc__RepeatIndicator.is_bound())
 || (single_value->field_highLayerCompatibility1.is_omit() || single_value->field_highLayerCompatibility1.is_bound())
 || (single_value->field_highLayerCompatibility2.is_omit() || single_value->field_highLayerCompatibility2.is_bound())
 || (single_value->field_user__user.is_omit() || single_value->field_user__user.is_bound())
 || (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_bound())
 || (single_value->field_clir__Suppression.is_omit() || single_value->field_clir__Suppression.is_bound())
 || (single_value->field_clir__Invocation.is_omit() || single_value->field_clir__Invocation.is_bound())
 || (single_value->field_cC__Capabilities.is_omit() || single_value->field_cC__Capabilities.is_bound())
 || (single_value->field_facility__ccbs1.is_omit() || single_value->field_facility__ccbs1.is_bound())
 || (single_value->field_facility__ccbs2.is_omit() || single_value->field_facility__ccbs2.is_bound())
 || (single_value->field_streamIdentifier.is_omit() || single_value->field_streamIdentifier.is_bound())
 || (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_bound())
 || (single_value->field_redial.is_omit() || single_value->field_redial.is_bound());
}

boolean PDU__ML3__Setup__MS__NW_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_bcRepeatIndicator.is_omit() || single_value->field_bcRepeatIndicator.is_value())
 && single_value->field_bearerCapability1.is_value()
 && (single_value->field_bearerCapability2.is_omit() || single_value->field_bearerCapability2.is_value())
 && (single_value->field_facility.is_omit() || single_value->field_facility.is_value())
 && (single_value->field_callingPartySubAddress.is_omit() || single_value->field_callingPartySubAddress.is_value())
 && single_value->field_calledPartyBCD__Number.is_value()
 && (single_value->field_calledPartySubAddress.is_omit() || single_value->field_calledPartySubAddress.is_value())
 && (single_value->field_llc__RepeatIndicator.is_omit() || single_value->field_llc__RepeatIndicator.is_value())
 && (single_value->field_lowLayerCompatibility1.is_omit() || single_value->field_lowLayerCompatibility1.is_value())
 && (single_value->field_lowLayerCompatibility2.is_omit() || single_value->field_lowLayerCompatibility2.is_value())
 && (single_value->field_hlc__RepeatIndicator.is_omit() || single_value->field_hlc__RepeatIndicator.is_value())
 && (single_value->field_highLayerCompatibility1.is_omit() || single_value->field_highLayerCompatibility1.is_value())
 && (single_value->field_highLayerCompatibility2.is_omit() || single_value->field_highLayerCompatibility2.is_value())
 && (single_value->field_user__user.is_omit() || single_value->field_user__user.is_value())
 && (single_value->field_ss__VersionIndicator.is_omit() || single_value->field_ss__VersionIndicator.is_value())
 && (single_value->field_clir__Suppression.is_omit() || single_value->field_clir__Suppression.is_value())
 && (single_value->field_clir__Invocation.is_omit() || single_value->field_clir__Invocation.is_value())
 && (single_value->field_cC__Capabilities.is_omit() || single_value->field_cC__Capabilities.is_value())
 && (single_value->field_facility__ccbs1.is_omit() || single_value->field_facility__ccbs1.is_value())
 && (single_value->field_facility__ccbs2.is_omit() || single_value->field_facility__ccbs2.is_value())
 && (single_value->field_streamIdentifier.is_omit() || single_value->field_streamIdentifier.is_value())
 && (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_value())
 && (single_value->field_redial.is_omit() || single_value->field_redial.is_value());
}

void PDU__ML3__Setup__MS__NW_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__Setup__MS__NW PDU__ML3__Setup__MS__NW_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_CC_Types.PDU_ML3_Setup_MS_NW.");
PDU__ML3__Setup__MS__NW 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_bcRepeatIndicator.is_omit()) ret_val.bcRepeatIndicator() = OMIT_VALUE;
else if (single_value->field_bcRepeatIndicator.is_bound()) {
ret_val.bcRepeatIndicator() = single_value->field_bcRepeatIndicator.valueof();
}
if (single_value->field_bearerCapability1.is_bound()) {
ret_val.bearerCapability1() = single_value->field_bearerCapability1.valueof();
}
if (single_value->field_bearerCapability2.is_omit()) ret_val.bearerCapability2() = OMIT_VALUE;
else if (single_value->field_bearerCapability2.is_bound()) {
ret_val.bearerCapability2() = single_value->field_bearerCapability2.valueof();
}
if (single_value->field_facility.is_omit()) ret_val.facility() = OMIT_VALUE;
else if (single_value->field_facility.is_bound()) {
ret_val.facility() = single_value->field_facility.valueof();
}
if (single_value->field_callingPartySubAddress.is_omit()) ret_val.callingPartySubAddress() = OMIT_VALUE;
else if (single_value->field_callingPartySubAddress.is_bound()) {
ret_val.callingPartySubAddress() = single_value->field_callingPartySubAddress.valueof();
}
if (single_value->field_calledPartyBCD__Number.is_bound()) {
ret_val.calledPartyBCD__Number() = single_value->field_calledPartyBCD__Number.valueof();
}
if (single_value->field_calledPartySubAddress.is_omit()) ret_val.calledPartySubAddress() = OMIT_VALUE;
else if (single_value->field_calledPartySubAddress.is_bound()) {
ret_val.calledPartySubAddress() = single_value->field_calledPartySubAddress.valueof();
}
if (single_value->field_llc__RepeatIndicator.is_omit()) ret_val.llc__RepeatIndicator() = OMIT_VALUE;
else if (single_value->field_llc__RepeatIndicator.is_bound()) {
ret_val.llc__RepeatIndicator() = single_value->field_llc__RepeatIndicator.valueof();
}
if (single_value->field_lowLayerCompatibility1.is_omit()) ret_val.lowLayerCompatibility1() = OMIT_VALUE;
else if (single_value->field_lowLayerCompatibility1.is_bound()) {
ret_val.lowLayerCompatibility1() = single_value->field_lowLayerCompatibility1.valueof();
}
if (single_value->field_lowLayerCompatibility2.is_omit()) ret_val.lowLayerCompatibility2() = OMIT_VALUE;
else if (single_value->field_lowLayerCompatibility2.is_bound()) {
ret_val.lowLayerCompatibility2() = single_value->field_lowLayerCompatibility2.valueof();
}
if (single_value->field_hlc__RepeatIndicator.is_omit()) ret_val.hlc__RepeatIndicator() = OMIT_VALUE;
else if (single_value->field_hlc__RepeatIndicator.is_bound()) {
ret_val.hlc__RepeatIndicator() = single_value->field_hlc__RepeatIndicator.valueof();
}
if (single_value->field_highLayerCompatibility1.is_omit()) ret_val.highLayerCompatibility1() = OMIT_VALUE;
else if (single_value->field_highLayerCompatibility1.is_bound()) {
ret_val.highLayerCompatibility1() = single_value->field_highLayerCompatibility1.valueof();
}
if (single_value->field_highLayerCompatibility2.is_omit()) ret_val.highLayerCompatibility2() = OMIT_VALUE;
else if (single_value->field_highLayerCompatibility2.is_bound()) {
ret_val.highLayerCompatibility2() = single_value->field_highLayerCompatibility2.valueof();
}
if (single_value->field_user__user.is_omit()) ret_val.user__user() = OMIT_VALUE;
else if (single_value->field_user__user.is_bound()) {
ret_val.user__user() = single_value->field_user__user.valueof();
}
if (single_value->field_ss__VersionIndicator.is_omit()) ret_val.ss__VersionIndicator() = OMIT_VALUE;
else if (single_value->field_ss__VersionIndicator.is_bound()) {
ret_val.ss__VersionIndicator() = single_value->field_ss__VersionIndicator.valueof();
}
if (single_value->field_clir__Suppression.is_omit()) ret_val.clir__Suppression() = OMIT_VALUE;
else if (single_value->field_clir__Suppression.is_bound()) {
ret_val.clir__Suppression() = single_value->field_clir__Suppression.valueof();
}
if (single_value->field_clir__Invocation.is_omit()) ret_val.clir__Invocation() = OMIT_VALUE;
else if (single_value->field_clir__Invocation.is_bound()) {
ret_val.clir__Invocation() = single_value->field_clir__Invocation.valueof();
}
if (single_value->field_cC__Capabilities.is_omit()) ret_val.cC__Capabilities() = OMIT_VALUE;
else if (single_value->field_cC__Capabilities.is_bound()) {
ret_val.cC__Capabilities() = single_value->field_cC__Capabilities.valueof();
}
if (single_value->field_facility__ccbs1.is_omit()) ret_val.facility__ccbs1() = OMIT_VALUE;
else if (single_value->field_facility__ccbs1.is_bound()) {
ret_val.facility__ccbs1() = single_value->field_facility__ccbs1.valueof();
}
if (single_value->field_facility__ccbs2.is_omit()) ret_val.facility__ccbs2() = OMIT_VALUE;
else if (single_value->field_facility__ccbs2.is_bound()) {
ret_val.facility__ccbs2() = single_value->field_facility__ccbs2.valueof();
}
if (single_value->field_streamIdentifier.is_omit()) ret_val.streamIdentifier() = OMIT_VALUE;
else if (single_value->field_streamIdentifier.is_bound()) {
ret_val.streamIdentifier() = single_value->field_streamIdentifier.valueof();
}
if (single_value->field_supportedCodecs.is_omit()) ret_val.supportedCodecs() = OMIT_VALUE;
else if (single_value->field_supportedCodecs.is_bound()) {
ret_val.supportedCodecs() = single_value->field_supportedCodecs.valueof();
}
if (single_value->field_redial.is_omit()) ret_val.redial() = OMIT_VALUE;
else if (single_value->field_redial.is_bound()) {
ret_val.redial() = single_value->field_redial.valueof();
}
return ret_val;
}

void PDU__ML3__Setup__MS__NW_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_CC_Types.PDU_ML3_Setup_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__Setup__MS__NW_template[list_length];
}

PDU__ML3__Setup__MS__NW_template& PDU__ML3__Setup__MS__NW_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_CC_Types.PDU_ML3_Setup_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__Setup__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__Setup__MS__NW_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__Setup__MS__NW_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__Setup__MS__NW_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_nsd;
}

RepeatIndicator_template& PDU__ML3__Setup__MS__NW_template::bcRepeatIndicator()
{
set_specific();
return single_value->field_bcRepeatIndicator;
}

const RepeatIndicator_template& PDU__ML3__Setup__MS__NW_template::bcRepeatIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bcRepeatIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_bcRepeatIndicator;
}

BearerCapability__TLV_template& PDU__ML3__Setup__MS__NW_template::bearerCapability1()
{
set_specific();
return single_value->field_bearerCapability1;
}

const BearerCapability__TLV_template& PDU__ML3__Setup__MS__NW_template::bearerCapability1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_bearerCapability1;
}

BearerCapability__TLV_template& PDU__ML3__Setup__MS__NW_template::bearerCapability2()
{
set_specific();
return single_value->field_bearerCapability2;
}

const BearerCapability__TLV_template& PDU__ML3__Setup__MS__NW_template::bearerCapability2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bearerCapability2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_bearerCapability2;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Setup__MS__NW_template::facility()
{
set_specific();
return single_value->field_facility;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Setup__MS__NW_template::facility() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_facility;
}

CallingPartySubAddress_template& PDU__ML3__Setup__MS__NW_template::callingPartySubAddress()
{
set_specific();
return single_value->field_callingPartySubAddress;
}

const CallingPartySubAddress_template& PDU__ML3__Setup__MS__NW_template::callingPartySubAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field callingPartySubAddress of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_callingPartySubAddress;
}

CalledPartyBCD__Number_template& PDU__ML3__Setup__MS__NW_template::calledPartyBCD__Number()
{
set_specific();
return single_value->field_calledPartyBCD__Number;
}

const CalledPartyBCD__Number_template& PDU__ML3__Setup__MS__NW_template::calledPartyBCD__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPartyBCD_Number of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_calledPartyBCD__Number;
}

CalledPartySubAddress_template& PDU__ML3__Setup__MS__NW_template::calledPartySubAddress()
{
set_specific();
return single_value->field_calledPartySubAddress;
}

const CalledPartySubAddress_template& PDU__ML3__Setup__MS__NW_template::calledPartySubAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPartySubAddress of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_calledPartySubAddress;
}

RepeatIndicator_template& PDU__ML3__Setup__MS__NW_template::llc__RepeatIndicator()
{
set_specific();
return single_value->field_llc__RepeatIndicator;
}

const RepeatIndicator_template& PDU__ML3__Setup__MS__NW_template::llc__RepeatIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field llc_RepeatIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_llc__RepeatIndicator;
}

LowLayerCompatibility_template& PDU__ML3__Setup__MS__NW_template::lowLayerCompatibility1()
{
set_specific();
return single_value->field_lowLayerCompatibility1;
}

const LowLayerCompatibility_template& PDU__ML3__Setup__MS__NW_template::lowLayerCompatibility1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lowLayerCompatibility1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_lowLayerCompatibility1;
}

LowLayerCompatibility_template& PDU__ML3__Setup__MS__NW_template::lowLayerCompatibility2()
{
set_specific();
return single_value->field_lowLayerCompatibility2;
}

const LowLayerCompatibility_template& PDU__ML3__Setup__MS__NW_template::lowLayerCompatibility2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lowLayerCompatibility2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_lowLayerCompatibility2;
}

RepeatIndicator_template& PDU__ML3__Setup__MS__NW_template::hlc__RepeatIndicator()
{
set_specific();
return single_value->field_hlc__RepeatIndicator;
}

const RepeatIndicator_template& PDU__ML3__Setup__MS__NW_template::hlc__RepeatIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field hlc_RepeatIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_hlc__RepeatIndicator;
}

HighLayerCompatibility_template& PDU__ML3__Setup__MS__NW_template::highLayerCompatibility1()
{
set_specific();
return single_value->field_highLayerCompatibility1;
}

const HighLayerCompatibility_template& PDU__ML3__Setup__MS__NW_template::highLayerCompatibility1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field highLayerCompatibility1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_highLayerCompatibility1;
}

HighLayerCompatibility_template& PDU__ML3__Setup__MS__NW_template::highLayerCompatibility2()
{
set_specific();
return single_value->field_highLayerCompatibility2;
}

const HighLayerCompatibility_template& PDU__ML3__Setup__MS__NW_template::highLayerCompatibility2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field highLayerCompatibility2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_highLayerCompatibility2;
}

User__userShort_template& PDU__ML3__Setup__MS__NW_template::user__user()
{
set_specific();
return single_value->field_user__user;
}

const User__userShort_template& PDU__ML3__Setup__MS__NW_template::user__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_user of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_user__user;
}

MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Setup__MS__NW_template::ss__VersionIndicator()
{
set_specific();
return single_value->field_ss__VersionIndicator;
}

const MobileL3__CommonIE__Types::SS__VersionIndicator_template& PDU__ML3__Setup__MS__NW_template::ss__VersionIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ss_VersionIndicator of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_ss__VersionIndicator;
}

CLIR_template& PDU__ML3__Setup__MS__NW_template::clir__Suppression()
{
set_specific();
return single_value->field_clir__Suppression;
}

const CLIR_template& PDU__ML3__Setup__MS__NW_template::clir__Suppression() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field clir_Suppression of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_clir__Suppression;
}

CLIR_template& PDU__ML3__Setup__MS__NW_template::clir__Invocation()
{
set_specific();
return single_value->field_clir__Invocation;
}

const CLIR_template& PDU__ML3__Setup__MS__NW_template::clir__Invocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field clir_Invocation of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_clir__Invocation;
}

CallControlCapabilities_template& PDU__ML3__Setup__MS__NW_template::cC__Capabilities()
{
set_specific();
return single_value->field_cC__Capabilities;
}

const CallControlCapabilities_template& PDU__ML3__Setup__MS__NW_template::cC__Capabilities() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cC_Capabilities of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_cC__Capabilities;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Setup__MS__NW_template::facility__ccbs1()
{
set_specific();
return single_value->field_facility__ccbs1;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Setup__MS__NW_template::facility__ccbs1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility_ccbs1 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_facility__ccbs1;
}

MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Setup__MS__NW_template::facility__ccbs2()
{
set_specific();
return single_value->field_facility__ccbs2;
}

const MobileL3__CommonIE__Types::Facility__TLV_template& PDU__ML3__Setup__MS__NW_template::facility__ccbs2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facility_ccbs2 of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_facility__ccbs2;
}

StreamIdentifier_template& PDU__ML3__Setup__MS__NW_template::streamIdentifier()
{
set_specific();
return single_value->field_streamIdentifier;
}

const StreamIdentifier_template& PDU__ML3__Setup__MS__NW_template::streamIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field streamIdentifier of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_streamIdentifier;
}

MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__ML3__Setup__MS__NW_template::supportedCodecs()
{
set_specific();
return single_value->field_supportedCodecs;
}

const MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__ML3__Setup__MS__NW_template::supportedCodecs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field supportedCodecs of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_supportedCodecs;
}

MobileL3__CommonIE__Types::Type2_template& PDU__ML3__Setup__MS__NW_template::redial()
{
set_specific();
return single_value->field_redial;
}

const MobileL3__CommonIE__Types::Type2_template& PDU__ML3__Setup__MS__NW_template::redial() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field redial of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
return single_value->field_redial;
}

int PDU__ML3__Setup__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 4;
      if (single_value->field_bcRepeatIndicator.is_present()) ret_val++;
      if (single_value->field_bearerCapability2.is_present()) ret_val++;
      if (single_value->field_facility.is_present()) ret_val++;
      if (single_value->field_callingPartySubAddress.is_present()) ret_val++;
      if (single_value->field_calledPartySubAddress.is_present()) ret_val++;
      if (single_value->field_llc__RepeatIndicator.is_present()) ret_val++;
      if (single_value->field_lowLayerCompatibility1.is_present()) ret_val++;
      if (single_value->field_lowLayerCompatibility2.is_present()) ret_val++;
      if (single_value->field_hlc__RepeatIndicator.is_present()) ret_val++;
      if (single_value->field_highLayerCompatibility1.is_present()) ret_val++;
      if (single_value->field_highLayerCompatibility2.is_present()) ret_val++;
      if (single_value->field_user__user.is_present()) ret_val++;
      if (single_value->field_ss__VersionIndicator.is_present()) ret_val++;
      if (single_value->field_clir__Suppression.is_present()) ret_val++;
      if (single_value->field_clir__Invocation.is_present()) ret_val++;
      if (single_value->field_cC__Capabilities.is_present()) ret_val++;
      if (single_value->field_facility__ccbs1.is_present()) ret_val++;
      if (single_value->field_facility__ccbs2.is_present()) ret_val++;
      if (single_value->field_streamIdentifier.is_present()) ret_val++;
      if (single_value->field_supportedCodecs.is_present()) ret_val++;
      if (single_value->field_redial.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_CC_Types.PDU_ML3_Setup_MS_NW 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_CC_Types.PDU_ML3_Setup_MS_NW containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW.");
  }
  return 0;
}

void PDU__ML3__Setup__MS__NW_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(", bcRepeatIndicator := ");
single_value->field_bcRepeatIndicator.log();
TTCN_Logger::log_event_str(", bearerCapability1 := ");
single_value->field_bearerCapability1.log();
TTCN_Logger::log_event_str(", bearerCapability2 := ");
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(", facility := ");
single_value->field_facility.log();
TTCN_Logger::log_event_str(", callingPartySubAddress := ");
single_value->field_callingPartySubAddress.log();
TTCN_Logger::log_event_str(", calledPartyBCD_Number := ");
single_value->field_calledPartyBCD__Number.log();
TTCN_Logger::log_event_str(", calledPartySubAddress := ");
single_value->field_calledPartySubAddress.log();
TTCN_Logger::log_event_str(", llc_RepeatIndicator := ");
single_value->field_llc__RepeatIndicator.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility1 := ");
single_value->field_lowLayerCompatibility1.log();
TTCN_Logger::log_event_str(", lowLayerCompatibility2 := ");
single_value->field_lowLayerCompatibility2.log();
TTCN_Logger::log_event_str(", hlc_RepeatIndicator := ");
single_value->field_hlc__RepeatIndicator.log();
TTCN_Logger::log_event_str(", highLayerCompatibility1 := ");
single_value->field_highLayerCompatibility1.log();
TTCN_Logger::log_event_str(", highLayerCompatibility2 := ");
single_value->field_highLayerCompatibility2.log();
TTCN_Logger::log_event_str(", user_user := ");
single_value->field_user__user.log();
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
single_value->field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(", clir_Suppression := ");
single_value->field_clir__Suppression.log();
TTCN_Logger::log_event_str(", clir_Invocation := ");
single_value->field_clir__Invocation.log();
TTCN_Logger::log_event_str(", cC_Capabilities := ");
single_value->field_cC__Capabilities.log();
TTCN_Logger::log_event_str(", facility_ccbs1 := ");
single_value->field_facility__ccbs1.log();
TTCN_Logger::log_event_str(", facility_ccbs2 := ");
single_value->field_facility__ccbs2.log();
TTCN_Logger::log_event_str(", streamIdentifier := ");
single_value->field_streamIdentifier.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(", redial := ");
single_value->field_redial.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__Setup__MS__NW_template::log_match(const PDU__ML3__Setup__MS__NW& 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.bcRepeatIndicator().ispresent()){
if(!single_value->field_bcRepeatIndicator.match(match_value.bcRepeatIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".bcRepeatIndicator");
single_value->field_bcRepeatIndicator.log_match(match_value.bcRepeatIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bcRepeatIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bcRepeatIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bcRepeatIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_bearerCapability1.match(match_value.bearerCapability1(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability1");
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.bearerCapability2().ispresent()){
if(!single_value->field_bearerCapability2.match(match_value.bearerCapability2(), legacy)){
TTCN_Logger::log_logmatch_info(".bearerCapability2");
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bearerCapability2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bearerCapability2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bearerCapability2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.facility().ispresent()){
if(!single_value->field_facility.match(match_value.facility(), legacy)){
TTCN_Logger::log_logmatch_info(".facility");
single_value->field_facility.log_match(match_value.facility(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.callingPartySubAddress().ispresent()){
if(!single_value->field_callingPartySubAddress.match(match_value.callingPartySubAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".callingPartySubAddress");
single_value->field_callingPartySubAddress.log_match(match_value.callingPartySubAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_callingPartySubAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".callingPartySubAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_callingPartySubAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_calledPartyBCD__Number.match(match_value.calledPartyBCD__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPartyBCD_Number");
single_value->field_calledPartyBCD__Number.log_match(match_value.calledPartyBCD__Number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.calledPartySubAddress().ispresent()){
if(!single_value->field_calledPartySubAddress.match(match_value.calledPartySubAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPartySubAddress");
single_value->field_calledPartySubAddress.log_match(match_value.calledPartySubAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_calledPartySubAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".calledPartySubAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_calledPartySubAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.llc__RepeatIndicator().ispresent()){
if(!single_value->field_llc__RepeatIndicator.match(match_value.llc__RepeatIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".llc_RepeatIndicator");
single_value->field_llc__RepeatIndicator.log_match(match_value.llc__RepeatIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_llc__RepeatIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".llc_RepeatIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_llc__RepeatIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lowLayerCompatibility1().ispresent()){
if(!single_value->field_lowLayerCompatibility1.match(match_value.lowLayerCompatibility1(), legacy)){
TTCN_Logger::log_logmatch_info(".lowLayerCompatibility1");
single_value->field_lowLayerCompatibility1.log_match(match_value.lowLayerCompatibility1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lowLayerCompatibility1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lowLayerCompatibility1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lowLayerCompatibility1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lowLayerCompatibility2().ispresent()){
if(!single_value->field_lowLayerCompatibility2.match(match_value.lowLayerCompatibility2(), legacy)){
TTCN_Logger::log_logmatch_info(".lowLayerCompatibility2");
single_value->field_lowLayerCompatibility2.log_match(match_value.lowLayerCompatibility2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lowLayerCompatibility2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lowLayerCompatibility2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lowLayerCompatibility2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.hlc__RepeatIndicator().ispresent()){
if(!single_value->field_hlc__RepeatIndicator.match(match_value.hlc__RepeatIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".hlc_RepeatIndicator");
single_value->field_hlc__RepeatIndicator.log_match(match_value.hlc__RepeatIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_hlc__RepeatIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".hlc_RepeatIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_hlc__RepeatIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.highLayerCompatibility1().ispresent()){
if(!single_value->field_highLayerCompatibility1.match(match_value.highLayerCompatibility1(), legacy)){
TTCN_Logger::log_logmatch_info(".highLayerCompatibility1");
single_value->field_highLayerCompatibility1.log_match(match_value.highLayerCompatibility1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_highLayerCompatibility1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".highLayerCompatibility1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_highLayerCompatibility1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.highLayerCompatibility2().ispresent()){
if(!single_value->field_highLayerCompatibility2.match(match_value.highLayerCompatibility2(), legacy)){
TTCN_Logger::log_logmatch_info(".highLayerCompatibility2");
single_value->field_highLayerCompatibility2.log_match(match_value.highLayerCompatibility2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_highLayerCompatibility2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".highLayerCompatibility2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_highLayerCompatibility2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.user__user().ispresent()){
if(!single_value->field_user__user.match(match_value.user__user(), legacy)){
TTCN_Logger::log_logmatch_info(".user_user");
single_value->field_user__user.log_match(match_value.user__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_user__user.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".user_user := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_user__user.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ss__VersionIndicator().ispresent()){
if(!single_value->field_ss__VersionIndicator.match(match_value.ss__VersionIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ss_VersionIndicator");
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ss__VersionIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ss_VersionIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ss__VersionIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.clir__Suppression().ispresent()){
if(!single_value->field_clir__Suppression.match(match_value.clir__Suppression(), legacy)){
TTCN_Logger::log_logmatch_info(".clir_Suppression");
single_value->field_clir__Suppression.log_match(match_value.clir__Suppression(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_clir__Suppression.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".clir_Suppression := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_clir__Suppression.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.clir__Invocation().ispresent()){
if(!single_value->field_clir__Invocation.match(match_value.clir__Invocation(), legacy)){
TTCN_Logger::log_logmatch_info(".clir_Invocation");
single_value->field_clir__Invocation.log_match(match_value.clir__Invocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_clir__Invocation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".clir_Invocation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_clir__Invocation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cC__Capabilities().ispresent()){
if(!single_value->field_cC__Capabilities.match(match_value.cC__Capabilities(), legacy)){
TTCN_Logger::log_logmatch_info(".cC_Capabilities");
single_value->field_cC__Capabilities.log_match(match_value.cC__Capabilities(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cC__Capabilities.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cC_Capabilities := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cC__Capabilities.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.facility__ccbs1().ispresent()){
if(!single_value->field_facility__ccbs1.match(match_value.facility__ccbs1(), legacy)){
TTCN_Logger::log_logmatch_info(".facility_ccbs1");
single_value->field_facility__ccbs1.log_match(match_value.facility__ccbs1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility__ccbs1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility_ccbs1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility__ccbs1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.facility__ccbs2().ispresent()){
if(!single_value->field_facility__ccbs2.match(match_value.facility__ccbs2(), legacy)){
TTCN_Logger::log_logmatch_info(".facility_ccbs2");
single_value->field_facility__ccbs2.log_match(match_value.facility__ccbs2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_facility__ccbs2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".facility_ccbs2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_facility__ccbs2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.streamIdentifier().ispresent()){
if(!single_value->field_streamIdentifier.match(match_value.streamIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".streamIdentifier");
single_value->field_streamIdentifier.log_match(match_value.streamIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_streamIdentifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".streamIdentifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_streamIdentifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.supportedCodecs().ispresent()){
if(!single_value->field_supportedCodecs.match(match_value.supportedCodecs(), legacy)){
TTCN_Logger::log_logmatch_info(".supportedCodecs");
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_supportedCodecs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".supportedCodecs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.redial().ispresent()){
if(!single_value->field_redial.match(match_value.redial(), legacy)){
TTCN_Logger::log_logmatch_info(".redial");
single_value->field_redial.log_match(match_value.redial(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_redial.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".redial := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_redial.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(", bcRepeatIndicator := ");
if (match_value.bcRepeatIndicator().ispresent()) {
single_value->field_bcRepeatIndicator.log_match(match_value.bcRepeatIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bcRepeatIndicator.log();
if (single_value->field_bcRepeatIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bearerCapability1 := ");
single_value->field_bearerCapability1.log_match(match_value.bearerCapability1(), legacy);
TTCN_Logger::log_event_str(", bearerCapability2 := ");
if (match_value.bearerCapability2().ispresent()) {
single_value->field_bearerCapability2.log_match(match_value.bearerCapability2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bearerCapability2.log();
if (single_value->field_bearerCapability2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", facility := ");
if (match_value.facility().ispresent()) {
single_value->field_facility.log_match(match_value.facility(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility.log();
if (single_value->field_facility.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", callingPartySubAddress := ");
if (match_value.callingPartySubAddress().ispresent()) {
single_value->field_callingPartySubAddress.log_match(match_value.callingPartySubAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_callingPartySubAddress.log();
if (single_value->field_callingPartySubAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", calledPartyBCD_Number := ");
single_value->field_calledPartyBCD__Number.log_match(match_value.calledPartyBCD__Number(), legacy);
TTCN_Logger::log_event_str(", calledPartySubAddress := ");
if (match_value.calledPartySubAddress().ispresent()) {
single_value->field_calledPartySubAddress.log_match(match_value.calledPartySubAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_calledPartySubAddress.log();
if (single_value->field_calledPartySubAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", llc_RepeatIndicator := ");
if (match_value.llc__RepeatIndicator().ispresent()) {
single_value->field_llc__RepeatIndicator.log_match(match_value.llc__RepeatIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_llc__RepeatIndicator.log();
if (single_value->field_llc__RepeatIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lowLayerCompatibility1 := ");
if (match_value.lowLayerCompatibility1().ispresent()) {
single_value->field_lowLayerCompatibility1.log_match(match_value.lowLayerCompatibility1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lowLayerCompatibility1.log();
if (single_value->field_lowLayerCompatibility1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lowLayerCompatibility2 := ");
if (match_value.lowLayerCompatibility2().ispresent()) {
single_value->field_lowLayerCompatibility2.log_match(match_value.lowLayerCompatibility2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lowLayerCompatibility2.log();
if (single_value->field_lowLayerCompatibility2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", hlc_RepeatIndicator := ");
if (match_value.hlc__RepeatIndicator().ispresent()) {
single_value->field_hlc__RepeatIndicator.log_match(match_value.hlc__RepeatIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_hlc__RepeatIndicator.log();
if (single_value->field_hlc__RepeatIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", highLayerCompatibility1 := ");
if (match_value.highLayerCompatibility1().ispresent()) {
single_value->field_highLayerCompatibility1.log_match(match_value.highLayerCompatibility1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_highLayerCompatibility1.log();
if (single_value->field_highLayerCompatibility1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", highLayerCompatibility2 := ");
if (match_value.highLayerCompatibility2().ispresent()) {
single_value->field_highLayerCompatibility2.log_match(match_value.highLayerCompatibility2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_highLayerCompatibility2.log();
if (single_value->field_highLayerCompatibility2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", user_user := ");
if (match_value.user__user().ispresent()) {
single_value->field_user__user.log_match(match_value.user__user(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_user__user.log();
if (single_value->field_user__user.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ss_VersionIndicator := ");
if (match_value.ss__VersionIndicator().ispresent()) {
single_value->field_ss__VersionIndicator.log_match(match_value.ss__VersionIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ss__VersionIndicator.log();
if (single_value->field_ss__VersionIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", clir_Suppression := ");
if (match_value.clir__Suppression().ispresent()) {
single_value->field_clir__Suppression.log_match(match_value.clir__Suppression(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_clir__Suppression.log();
if (single_value->field_clir__Suppression.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", clir_Invocation := ");
if (match_value.clir__Invocation().ispresent()) {
single_value->field_clir__Invocation.log_match(match_value.clir__Invocation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_clir__Invocation.log();
if (single_value->field_clir__Invocation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cC_Capabilities := ");
if (match_value.cC__Capabilities().ispresent()) {
single_value->field_cC__Capabilities.log_match(match_value.cC__Capabilities(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cC__Capabilities.log();
if (single_value->field_cC__Capabilities.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", facility_ccbs1 := ");
if (match_value.facility__ccbs1().ispresent()) {
single_value->field_facility__ccbs1.log_match(match_value.facility__ccbs1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility__ccbs1.log();
if (single_value->field_facility__ccbs1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", facility_ccbs2 := ");
if (match_value.facility__ccbs2().ispresent()) {
single_value->field_facility__ccbs2.log_match(match_value.facility__ccbs2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_facility__ccbs2.log();
if (single_value->field_facility__ccbs2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", streamIdentifier := ");
if (match_value.streamIdentifier().ispresent()) {
single_value->field_streamIdentifier.log_match(match_value.streamIdentifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_streamIdentifier.log();
if (single_value->field_streamIdentifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", supportedCodecs := ");
if (match_value.supportedCodecs().ispresent()) {
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_supportedCodecs.log();
if (single_value->field_supportedCodecs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", redial := ");
if (match_value.redial().ispresent()) {
single_value->field_redial.log_match(match_value.redial(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_redial.log();
if (single_value->field_redial.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__Setup__MS__NW_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 (!bcRepeatIndicator().is_bound()) bcRepeatIndicator() = OMIT_VALUE;
else bcRepeatIndicator().set_implicit_omit();
if (bearerCapability1().is_bound()) bearerCapability1().set_implicit_omit();
if (!bearerCapability2().is_bound()) bearerCapability2() = OMIT_VALUE;
else bearerCapability2().set_implicit_omit();
if (!facility().is_bound()) facility() = OMIT_VALUE;
else facility().set_implicit_omit();
if (!callingPartySubAddress().is_bound()) callingPartySubAddress() = OMIT_VALUE;
else callingPartySubAddress().set_implicit_omit();
if (calledPartyBCD__Number().is_bound()) calledPartyBCD__Number().set_implicit_omit();
if (!calledPartySubAddress().is_bound()) calledPartySubAddress() = OMIT_VALUE;
else calledPartySubAddress().set_implicit_omit();
if (!llc__RepeatIndicator().is_bound()) llc__RepeatIndicator() = OMIT_VALUE;
else llc__RepeatIndicator().set_implicit_omit();
if (!lowLayerCompatibility1().is_bound()) lowLayerCompatibility1() = OMIT_VALUE;
else lowLayerCompatibility1().set_implicit_omit();
if (!lowLayerCompatibility2().is_bound()) lowLayerCompatibility2() = OMIT_VALUE;
else lowLayerCompatibility2().set_implicit_omit();
if (!hlc__RepeatIndicator().is_bound()) hlc__RepeatIndicator() = OMIT_VALUE;
else hlc__RepeatIndicator().set_implicit_omit();
if (!highLayerCompatibility1().is_bound()) highLayerCompatibility1() = OMIT_VALUE;
else highLayerCompatibility1().set_implicit_omit();
if (!highLayerCompatibility2().is_bound()) highLayerCompatibility2() = OMIT_VALUE;
else highLayerCompatibility2().set_implicit_omit();
if (!user__user().is_bound()) user__user() = OMIT_VALUE;
else user__user().set_implicit_omit();
if (!ss__VersionIndicator().is_bound()) ss__VersionIndicator() = OMIT_VALUE;
else ss__VersionIndicator().set_implicit_omit();
if (!clir__Suppression().is_bound()) clir__Suppression() = OMIT_VALUE;
else clir__Suppression().set_implicit_omit();
if (!clir__Invocation().is_bound()) clir__Invocation() = OMIT_VALUE;
else clir__Invocation().set_implicit_omit();
if (!cC__Capabilities().is_bound()) cC__Capabilities() = OMIT_VALUE;
else cC__Capabilities().set_implicit_omit();
if (!facility__ccbs1().is_bound()) facility__ccbs1() = OMIT_VALUE;
else facility__ccbs1().set_implicit_omit();
if (!facility__ccbs2().is_bound()) facility__ccbs2() = OMIT_VALUE;
else facility__ccbs2().set_implicit_omit();
if (!streamIdentifier().is_bound()) streamIdentifier() = OMIT_VALUE;
else streamIdentifier().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!redial().is_bound()) redial() = OMIT_VALUE;
else redial().set_implicit_omit();
}

void PDU__ML3__Setup__MS__NW_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_bcRepeatIndicator.encode_text(text_buf);
single_value->field_bearerCapability1.encode_text(text_buf);
single_value->field_bearerCapability2.encode_text(text_buf);
single_value->field_facility.encode_text(text_buf);
single_value->field_callingPartySubAddress.encode_text(text_buf);
single_value->field_calledPartyBCD__Number.encode_text(text_buf);
single_value->field_calledPartySubAddress.encode_text(text_buf);
single_value->field_llc__RepeatIndicator.encode_text(text_buf);
single_value->field_lowLayerCompatibility1.encode_text(text_buf);
single_value->field_lowLayerCompatibility2.encode_text(text_buf);
single_value->field_hlc__RepeatIndicator.encode_text(text_buf);
single_value->field_highLayerCompatibility1.encode_text(text_buf);
single_value->field_highLayerCompatibility2.encode_text(text_buf);
single_value->field_user__user.encode_text(text_buf);
single_value->field_ss__VersionIndicator.encode_text(text_buf);
single_value->field_clir__Suppression.encode_text(text_buf);
single_value->field_clir__Invocation.encode_text(text_buf);
single_value->field_cC__Capabilities.encode_text(text_buf);
single_value->field_facility__ccbs1.encode_text(text_buf);
single_value->field_facility__ccbs2.encode_text(text_buf);
single_value->field_streamIdentifier.encode_text(text_buf);
single_value->field_supportedCodecs.encode_text(text_buf);
single_value->field_redial.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_CC_Types.PDU_ML3_Setup_MS_NW.");
}
}

void PDU__ML3__Setup__MS__NW_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_bcRepeatIndicator.decode_text(text_buf);
single_value->field_bearerCapability1.decode_text(text_buf);
single_value->field_bearerCapability2.decode_text(text_buf);
single_value->field_facility.decode_text(text_buf);
single_value->field_callingPartySubAddress.decode_text(text_buf);
single_value->field_calledPartyBCD__Number.decode_text(text_buf);
single_value->field_calledPartySubAddress.decode_text(text_buf);
single_value->field_llc__RepeatIndicator.decode_text(text_buf);
single_value->field_lowLayerCompatibility1.decode_text(text_buf);
single_value->field_lowLayerCompatibility2.decode_text(text_buf);
single_value->field_hlc__RepeatIndicator.decode_text(text_buf);
single_value->field_highLayerCompatibility1.decode_text(text_buf);
single_value->field_highLayerCompatibility2.decode_text(text_buf);
single_value->field_user__user.decode_text(text_buf);
single_value->field_ss__VersionIndicator.decode_text(text_buf);
single_value->field_clir__Suppression.decode_text(text_buf);
single_value->field_clir__Invocation.decode_text(text_buf);
single_value->field_cC__Capabilities.decode_text(text_buf);
single_value->field_facility__ccbs1.decode_text(text_buf);
single_value->field_facility__ccbs2.decode_text(text_buf);
single_value->field_streamIdentifier.decode_text(text_buf);
single_value->field_supportedCodecs.decode_text(text_buf);
single_value->field_redial.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__Setup__MS__NW_template[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_CC_Types.PDU_ML3_Setup_MS_NW.");
}
}

void PDU__ML3__Setup__MS__NW_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__Setup__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (25<param.get_size()) {
      param.error("record template of type @MobileL3_CC_Types.PDU_ML3_Setup_MS_NW has 25 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nsd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bcRepeatIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bearerCapability1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) bearerCapability2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) facility().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) callingPartySubAddress().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) calledPartyBCD__Number().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) calledPartySubAddress().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) llc__RepeatIndicator().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility1().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) lowLayerCompatibility2().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) hlc__RepeatIndicator().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility1().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) highLayerCompatibility2().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) user__user().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) ss__VersionIndicator().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) clir__Suppression().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) clir__Invocation().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) cC__Capabilities().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) facility__ccbs1().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) facility__ccbs2().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) streamIdentifier().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) redial().set_param(*param.get_elem(24));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bcRepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bcRepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bearerCapability2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bearerCapability2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPartySubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPartySubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPartyBCD_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPartyBCD__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPartySubAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPartySubAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "llc_RepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          llc__RepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lowLayerCompatibility2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lowLayerCompatibility2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hlc_RepeatIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hlc__RepeatIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highLayerCompatibility2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highLayerCompatibility2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ss_VersionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ss__VersionIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "clir_Suppression")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          clir__Suppression().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "clir_Invocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          clir__Invocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cC_Capabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cC__Capabilities().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility_ccbs1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility__ccbs1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facility_ccbs2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facility__ccbs2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "streamIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          streamIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redial")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redial().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_CC_Types.PDU_ML3_Setup_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__Setup__MS__NW_template* precondition = new PDU__ML3__Setup__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__Setup__MS__NW_template* implied_template = new PDU__ML3__Setup__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__Setup__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__Setup__MS__NW_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_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_bcRepeatIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_bearerCapability1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_bearerCapability2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_facility.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_callingPartySubAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_calledPartyBCD__Number.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_calledPartySubAddress.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_llc__RepeatIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_lowLayerCompatibility1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_lowLayerCompatibility2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_hlc__RepeatIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_highLayerCompatibility1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_highLayerCompatibility2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_user__user.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_ss__VersionIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_clir__Suppression.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_clir__Invocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_cC__Capabilities.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_facility__ccbs1.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_facility__ccbs2.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_streamIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_supportedCodecs.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
single_value->field_redial.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_Setup_MS_NW");
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_CC_Types.PDU_ML3_Setup_MS_NW");
}

boolean PDU__ML3__Setup__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__ML3__Setup__MS__NW_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__StartCC::PDU__ML3__StartCC()
{
}

PDU__ML3__StartCC::PDU__ML3__StartCC(const BITSTRING& par_messageType,
    const BITSTRING& par_nsd,
    const OPTIONAL< CallControlCapabilities >& par_cC__Capabilities)
  :   field_messageType(par_messageType),
  field_nsd(par_nsd),
  field_cC__Capabilities(par_cC__Capabilities)
{
}

PDU__ML3__StartCC::PDU__ML3__StartCC(const PDU__ML3__StartCC& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_CC_Types.PDU_ML3_StartCC.");
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.cC__Capabilities().is_bound()) field_cC__Capabilities = other_value.cC__Capabilities();
else field_cC__Capabilities.clean_up();
}

void PDU__ML3__StartCC::clean_up()
{
field_messageType.clean_up();
field_nsd.clean_up();
field_cC__Capabilities.clean_up();
}

const TTCN_Typedescriptor_t* PDU__ML3__StartCC::get_descriptor() const { return &PDU__ML3__StartCC_descr_; }
PDU__ML3__StartCC& PDU__ML3__StartCC::operator=(const PDU__ML3__StartCC& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_CC_Types.PDU_ML3_StartCC.");
  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.cC__Capabilities().is_bound()) field_cC__Capabilities = other_value.cC__Capabilities();
  else field_cC__Capabilities.clean_up();
}
return *this;
}

boolean PDU__ML3__StartCC::operator==(const PDU__ML3__StartCC& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_nsd==other_value.field_nsd
  && field_cC__Capabilities==other_value.field_cC__Capabilities;
}

boolean PDU__ML3__StartCC::is_bound() const
{
return (field_messageType.is_bound())
  || (field_nsd.is_bound())
  || (OPTIONAL_OMIT == field_cC__Capabilities.get_selection() || field_cC__Capabilities.is_bound());
}
boolean PDU__ML3__StartCC::is_value() const
{
return field_messageType.is_value()
  && field_nsd.is_value()
  && (OPTIONAL_OMIT == field_cC__Capabilities.get_selection() || field_cC__Capabilities.is_value());
}
int PDU__ML3__StartCC::size_of() const
{
  int ret_val = 2;
  if (field_cC__Capabilities.ispresent()) ret_val++;
  return ret_val;
}

void PDU__ML3__StartCC::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(", cC_Capabilities := ");
field_cC__Capabilities.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__ML3__StartCC::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (nsd().is_bound()) nsd().set_implicit_omit();
if (!cC__Capabilities().is_bound()) cC__Capabilities() = OMIT_VALUE;
else cC__Capabilities().set_implicit_omit();
}

void PDU__ML3__StartCC::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_CC_Types.PDU_ML3_StartCC 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) cC__Capabilities().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(), "cC_Capabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cC__Capabilities().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_CC_Types.PDU_ML3_StartCC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_CC_Types.PDU_ML3_StartCC");
  }
}

void PDU__ML3__StartCC::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_nsd.encode_text(text_buf);
field_cC__Capabilities.encode_text(text_buf);
}

void PDU__ML3__StartCC::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_nsd.decode_text(text_buf);
field_cC__Capabilities.decode_text(text_buf);
}

void PDU__ML3__StartCC::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__StartCC::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__StartCC::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_cC__Capabilities = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, CallControlCapabilities_descr_.raw->forceomit);
  decoded_field_length = field_cC__Capabilities().RAW_decode(CallControlCapabilities_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_cC__Capabilities = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cC__Capabilities.ispresent() || field_cC__Capabilities().elementIdentifier() !=  os_6){
  field_cC__Capabilities=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_cC__Capabilities=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__StartCC::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);
  if (field_cC__Capabilities.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, CallControlCapabilities_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = 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_cC__Capabilities.ispresent()) {
  encoded_length += field_cC__Capabilities().RAW_encode(CallControlCapabilities_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_cC__Capabilities.ispresent() && (!field_cC__Capabilities.ispresent() || field_cC__Capabilities().elementIdentifier() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__ML3__StartCC_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_nsd;
CallControlCapabilities_template field_cC__Capabilities;
};

void PDU__ML3__StartCC_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_cC__Capabilities = ANY_OR_OMIT;
}
}
}

void PDU__ML3__StartCC_template::copy_value(const PDU__ML3__StartCC& 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.cC__Capabilities().is_bound()) {
  if (other_value.cC__Capabilities().ispresent()) single_value->field_cC__Capabilities = other_value.cC__Capabilities()();
  else single_value->field_cC__Capabilities = OMIT_VALUE;
} else {
  single_value->field_cC__Capabilities.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__ML3__StartCC_template::copy_template(const PDU__ML3__StartCC_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.cC__Capabilities().get_selection()) {
single_value->field_cC__Capabilities = other_value.cC__Capabilities();
} else {
single_value->field_cC__Capabilities.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__StartCC_template[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__StartCC_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__ML3__StartCC_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_CC_Types.PDU_ML3_StartCC.");
break;
}
set_selection(other_value);
}

PDU__ML3__StartCC_template::PDU__ML3__StartCC_template()
{
}

PDU__ML3__StartCC_template::PDU__ML3__StartCC_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__ML3__StartCC_template::PDU__ML3__StartCC_template(const PDU__ML3__StartCC& other_value)
{
copy_value(other_value);
}

PDU__ML3__StartCC_template::PDU__ML3__StartCC_template(const OPTIONAL<PDU__ML3__StartCC>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__StartCC&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_CC_Types.PDU_ML3_StartCC from an unbound optional field.");
}
}

PDU__ML3__StartCC_template::PDU__ML3__StartCC_template(PDU__ML3__StartCC_template* p_precondition, PDU__ML3__StartCC_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__ML3__StartCC_template::PDU__ML3__StartCC_template(Dynamic_Match_Interface<PDU__ML3__StartCC>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__ML3__StartCC>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__ML3__StartCC_template::PDU__ML3__StartCC_template(const PDU__ML3__StartCC_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__ML3__StartCC_template::~PDU__ML3__StartCC_template()
{
clean_up();
}

PDU__ML3__StartCC_template& PDU__ML3__StartCC_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__ML3__StartCC_template& PDU__ML3__StartCC_template::operator=(const PDU__ML3__StartCC& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__ML3__StartCC_template& PDU__ML3__StartCC_template::operator=(const OPTIONAL<PDU__ML3__StartCC>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__ML3__StartCC&)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_CC_Types.PDU_ML3_StartCC.");
}
return *this;
}

PDU__ML3__StartCC_template& PDU__ML3__StartCC_template::operator=(const PDU__ML3__StartCC_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__ML3__StartCC_template::match(const PDU__ML3__StartCC& 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.cC__Capabilities().is_bound()) return FALSE;
if((other_value.cC__Capabilities().ispresent() ? !single_value->field_cC__Capabilities.match((const CallControlCapabilities&)other_value.cC__Capabilities(), legacy) : !single_value->field_cC__Capabilities.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_CC_Types.PDU_ML3_StartCC.");
}
return FALSE;
}

boolean PDU__ML3__StartCC_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_cC__Capabilities.is_omit() || single_value->field_cC__Capabilities.is_bound());
}

boolean PDU__ML3__StartCC_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_cC__Capabilities.is_omit() || single_value->field_cC__Capabilities.is_value());
}

void PDU__ML3__StartCC_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__StartCC PDU__ML3__StartCC_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_CC_Types.PDU_ML3_StartCC.");
PDU__ML3__StartCC 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_cC__Capabilities.is_omit()) ret_val.cC__Capabilities() = OMIT_VALUE;
else if (single_value->field_cC__Capabilities.is_bound()) {
ret_val.cC__Capabilities() = single_value->field_cC__Capabilities.valueof();
}
return ret_val;
}

void PDU__ML3__StartCC_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_CC_Types.PDU_ML3_StartCC.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__ML3__StartCC_template[list_length];
}

PDU__ML3__StartCC_template& PDU__ML3__StartCC_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_CC_Types.PDU_ML3_StartCC.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_CC_Types.PDU_ML3_StartCC.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__ML3__StartCC_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__ML3__StartCC_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_StartCC.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__ML3__StartCC_template::nsd()
{
set_specific();
return single_value->field_nsd;
}

const BITSTRING_template& PDU__ML3__StartCC_template::nsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nsd of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_StartCC.");
return single_value->field_nsd;
}

CallControlCapabilities_template& PDU__ML3__StartCC_template::cC__Capabilities()
{
set_specific();
return single_value->field_cC__Capabilities;
}

const CallControlCapabilities_template& PDU__ML3__StartCC_template::cC__Capabilities() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cC_Capabilities of a non-specific template of type @MobileL3_CC_Types.PDU_ML3_StartCC.");
return single_value->field_cC__Capabilities;
}

int PDU__ML3__StartCC_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_StartCC which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_cC__Capabilities.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_CC_Types.PDU_ML3_StartCC 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_CC_Types.PDU_ML3_StartCC containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_StartCC containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_StartCC containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_StartCC containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_StartCC containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_StartCC containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_CC_Types.PDU_ML3_StartCC containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_CC_Types.PDU_ML3_StartCC.");
  }
  return 0;
}

void PDU__ML3__StartCC_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(", cC_Capabilities := ");
single_value->field_cC__Capabilities.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__StartCC_template::log_match(const PDU__ML3__StartCC& 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.cC__Capabilities().ispresent()){
if(!single_value->field_cC__Capabilities.match(match_value.cC__Capabilities(), legacy)){
TTCN_Logger::log_logmatch_info(".cC_Capabilities");
single_value->field_cC__Capabilities.log_match(match_value.cC__Capabilities(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cC__Capabilities.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cC_Capabilities := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cC__Capabilities.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(", cC_Capabilities := ");
if (match_value.cC__Capabilities().ispresent()) {
single_value->field_cC__Capabilities.log_match(match_value.cC__Capabilities(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cC__Capabilities.log();
if (single_value->field_cC__Capabilities.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__StartCC_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 (!cC__Capabilities().is_bound()) cC__Capabilities() = OMIT_VALUE;
else cC__Capabilities().set_implicit_omit();
}

void PDU__ML3__StartCC_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_cC__Capabilities.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_CC_Types.PDU_ML3_StartCC.");
}
}

void PDU__ML3__StartCC_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_cC__Capabilities.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__StartCC_template[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_CC_Types.PDU_ML3_StartCC.");
}
}

void PDU__ML3__StartCC_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__StartCC_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_CC_Types.PDU_ML3_StartCC 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) cC__Capabilities().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(), "cC_Capabilities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cC__Capabilities().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_CC_Types.PDU_ML3_StartCC: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__ML3__StartCC_template* precondition = new PDU__ML3__StartCC_template;
    precondition->set_param(*param.get_elem(0));
    PDU__ML3__StartCC_template* implied_template = new PDU__ML3__StartCC_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__ML3__StartCC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_CC_Types.PDU_ML3_StartCC");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__ML3__StartCC_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_CC_Types.PDU_ML3_StartCC");
single_value->field_nsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_StartCC");
single_value->field_cC__Capabilities.check_restriction(t_res, t_name ? t_name : "@MobileL3_CC_Types.PDU_ML3_StartCC");
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_CC_Types.PDU_ML3_StartCC");
}

boolean PDU__ML3__StartCC_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__ML3__StartCC_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


} /* end of namespace */
