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

namespace MobileL3__RRM__Types {

/* Member functions of C++ classes */

PDU__RRM__ClassmarkEnquiry__NW__MS::PDU__RRM__ClassmarkEnquiry__NW__MS()
{
}

PDU__RRM__ClassmarkEnquiry__NW__MS::PDU__RRM__ClassmarkEnquiry__NW__MS(const BITSTRING& par_messageType,
    const OPTIONAL< ClassmarkEnquiryMask__TLV >& par_classmarkEnquiryMask)
  :   field_messageType(par_messageType),
  field_classmarkEnquiryMask(par_classmarkEnquiryMask)
{
}

PDU__RRM__ClassmarkEnquiry__NW__MS::PDU__RRM__ClassmarkEnquiry__NW__MS(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.classmarkEnquiryMask().is_bound()) field_classmarkEnquiryMask = other_value.classmarkEnquiryMask();
else field_classmarkEnquiryMask.clean_up();
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::clean_up()
{
field_messageType.clean_up();
field_classmarkEnquiryMask.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ClassmarkEnquiry__NW__MS::get_descriptor() const { return &PDU__RRM__ClassmarkEnquiry__NW__MS_descr_; }
PDU__RRM__ClassmarkEnquiry__NW__MS& PDU__RRM__ClassmarkEnquiry__NW__MS::operator=(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.classmarkEnquiryMask().is_bound()) field_classmarkEnquiryMask = other_value.classmarkEnquiryMask();
  else field_classmarkEnquiryMask.clean_up();
}
return *this;
}

boolean PDU__RRM__ClassmarkEnquiry__NW__MS::operator==(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_classmarkEnquiryMask==other_value.field_classmarkEnquiryMask;
}

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

void PDU__RRM__ClassmarkEnquiry__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(", classmarkEnquiryMask := ");
field_classmarkEnquiryMask.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!classmarkEnquiryMask().is_bound()) classmarkEnquiryMask() = OMIT_VALUE;
else classmarkEnquiryMask().set_implicit_omit();
}

void PDU__RRM__ClassmarkEnquiry__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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS 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) classmarkEnquiryMask().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(), "classmarkEnquiryMask")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          classmarkEnquiryMask().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS");
  }
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_classmarkEnquiryMask.encode_text(text_buf);
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_classmarkEnquiryMask.decode_text(text_buf);
}

void PDU__RRM__ClassmarkEnquiry__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__RRM__ClassmarkEnquiry__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__RRM__ClassmarkEnquiry__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_classmarkEnquiryMask = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, ClassmarkEnquiryMask__TLV_descr_.raw->forceomit);
  decoded_field_length = field_classmarkEnquiryMask().RAW_decode(ClassmarkEnquiryMask__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_classmarkEnquiryMask = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_classmarkEnquiryMask.ispresent() || field_classmarkEnquiryMask().elementIdentifier() !=  os_5){
  field_classmarkEnquiryMask=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_classmarkEnquiryMask=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__RRM__ClassmarkEnquiry__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 = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  if (field_classmarkEnquiryMask.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ClassmarkEnquiryMask__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_classmarkEnquiryMask.ispresent()) {
  encoded_length += field_classmarkEnquiryMask().RAW_encode(ClassmarkEnquiryMask__TLV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_classmarkEnquiryMask.ispresent() && (!field_classmarkEnquiryMask.ispresent() || field_classmarkEnquiryMask().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[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   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__RRM__ClassmarkEnquiry__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
ClassmarkEnquiryMask__TLV_template field_classmarkEnquiryMask;
};

void PDU__RRM__ClassmarkEnquiry__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_classmarkEnquiryMask = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::copy_value(const PDU__RRM__ClassmarkEnquiry__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.classmarkEnquiryMask().is_bound()) {
  if (other_value.classmarkEnquiryMask().ispresent()) single_value->field_classmarkEnquiryMask = other_value.classmarkEnquiryMask()();
  else single_value->field_classmarkEnquiryMask = OMIT_VALUE;
} else {
  single_value->field_classmarkEnquiryMask.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::copy_template(const PDU__RRM__ClassmarkEnquiry__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.classmarkEnquiryMask().get_selection()) {
single_value->field_classmarkEnquiryMask = other_value.classmarkEnquiryMask();
} else {
single_value->field_classmarkEnquiryMask.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__RRM__ClassmarkEnquiry__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__RRM__ClassmarkEnquiry__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ClassmarkEnquiry__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_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template::PDU__RRM__ClassmarkEnquiry__NW__MS_template()
{
}

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

PDU__RRM__ClassmarkEnquiry__NW__MS_template::PDU__RRM__ClassmarkEnquiry__NW__MS_template(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__ClassmarkEnquiry__NW__MS_template::match(const PDU__RRM__ClassmarkEnquiry__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.classmarkEnquiryMask().is_bound()) return FALSE;
if((other_value.classmarkEnquiryMask().ispresent() ? !single_value->field_classmarkEnquiryMask.match((const ClassmarkEnquiryMask__TLV&)other_value.classmarkEnquiryMask(), legacy) : !single_value->field_classmarkEnquiryMask.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_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ClassmarkEnquiry__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_classmarkEnquiryMask.is_omit() || single_value->field_classmarkEnquiryMask.is_bound());
}

boolean PDU__RRM__ClassmarkEnquiry__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_classmarkEnquiryMask.is_omit() || single_value->field_classmarkEnquiryMask.is_value());
}

void PDU__RRM__ClassmarkEnquiry__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__RRM__ClassmarkEnquiry__NW__MS PDU__RRM__ClassmarkEnquiry__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_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
PDU__RRM__ClassmarkEnquiry__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_classmarkEnquiryMask.is_omit()) ret_val.classmarkEnquiryMask() = OMIT_VALUE;
else if (single_value->field_classmarkEnquiryMask.is_bound()) {
ret_val.classmarkEnquiryMask() = single_value->field_classmarkEnquiryMask.valueof();
}
return ret_val;
}

void PDU__RRM__ClassmarkEnquiry__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_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ClassmarkEnquiry__NW__MS_template[list_length];
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template& PDU__RRM__ClassmarkEnquiry__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_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
return value_list.list_value[list_index];
}

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

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

ClassmarkEnquiryMask__TLV_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::classmarkEnquiryMask()
{
set_specific();
return single_value->field_classmarkEnquiryMask;
}

const ClassmarkEnquiryMask__TLV_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::classmarkEnquiryMask() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field classmarkEnquiryMask of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
return single_value->field_classmarkEnquiryMask;
}

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

void PDU__RRM__ClassmarkEnquiry__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(", classmarkEnquiryMask := ");
single_value->field_classmarkEnquiryMask.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__RRM__ClassmarkEnquiry__NW__MS_template::log_match(const PDU__RRM__ClassmarkEnquiry__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 (match_value.classmarkEnquiryMask().ispresent()){
if(!single_value->field_classmarkEnquiryMask.match(match_value.classmarkEnquiryMask(), legacy)){
TTCN_Logger::log_logmatch_info(".classmarkEnquiryMask");
single_value->field_classmarkEnquiryMask.log_match(match_value.classmarkEnquiryMask(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_classmarkEnquiryMask.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".classmarkEnquiryMask := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_classmarkEnquiryMask.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(", classmarkEnquiryMask := ");
if (match_value.classmarkEnquiryMask().ispresent()) {
single_value->field_classmarkEnquiryMask.log_match(match_value.classmarkEnquiryMask(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_classmarkEnquiryMask.log();
if (single_value->field_classmarkEnquiryMask.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__RRM__ClassmarkEnquiry__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!classmarkEnquiryMask().is_bound()) classmarkEnquiryMask() = OMIT_VALUE;
else classmarkEnquiryMask().set_implicit_omit();
}

void PDU__RRM__ClassmarkEnquiry__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_classmarkEnquiryMask.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_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
}
}

void PDU__RRM__ClassmarkEnquiry__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_classmarkEnquiryMask.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__RRM__ClassmarkEnquiry__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_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
}
}

void PDU__RRM__ClassmarkEnquiry__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__RRM__ClassmarkEnquiry__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 (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS 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) classmarkEnquiryMask().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(), "classmarkEnquiryMask")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          classmarkEnquiryMask().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ClassmarkEnquiry__NW__MS_template* precondition = new PDU__RRM__ClassmarkEnquiry__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ClassmarkEnquiry__NW__MS_template* implied_template = new PDU__RRM__ClassmarkEnquiry__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ClassmarkEnquiry__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ClassmarkEnquiry__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_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS");
single_value->field_classmarkEnquiryMask.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_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_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS");
}

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

boolean PDU__RRM__ClassmarkEnquiry__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__RRM__ConfigurationChangeCommand__NW__MS::PDU__RRM__ConfigurationChangeCommand__NW__MS()
{
}

PDU__RRM__ConfigurationChangeCommand__NW__MS::PDU__RRM__ConfigurationChangeCommand__NW__MS(const BITSTRING& par_messageType,
    const MultislotAllocation__LV& par_multislotAllocation,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet1,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet2,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet3,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet4,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet5,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet6,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet7,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet8)
  :   field_messageType(par_messageType),
  field_multislotAllocation(par_multislotAllocation),
  field_modeOfChannelSet1(par_modeOfChannelSet1),
  field_modeOfChannelSet2(par_modeOfChannelSet2),
  field_modeOfChannelSet3(par_modeOfChannelSet3),
  field_modeOfChannelSet4(par_modeOfChannelSet4),
  field_modeOfChannelSet5(par_modeOfChannelSet5),
  field_modeOfChannelSet6(par_modeOfChannelSet6),
  field_modeOfChannelSet7(par_modeOfChannelSet7),
  field_modeOfChannelSet8(par_modeOfChannelSet8)
{
}

PDU__RRM__ConfigurationChangeCommand__NW__MS::PDU__RRM__ConfigurationChangeCommand__NW__MS(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.multislotAllocation().is_bound()) field_multislotAllocation = other_value.multislotAllocation();
else field_multislotAllocation.clean_up();
if (other_value.modeOfChannelSet1().is_bound()) field_modeOfChannelSet1 = other_value.modeOfChannelSet1();
else field_modeOfChannelSet1.clean_up();
if (other_value.modeOfChannelSet2().is_bound()) field_modeOfChannelSet2 = other_value.modeOfChannelSet2();
else field_modeOfChannelSet2.clean_up();
if (other_value.modeOfChannelSet3().is_bound()) field_modeOfChannelSet3 = other_value.modeOfChannelSet3();
else field_modeOfChannelSet3.clean_up();
if (other_value.modeOfChannelSet4().is_bound()) field_modeOfChannelSet4 = other_value.modeOfChannelSet4();
else field_modeOfChannelSet4.clean_up();
if (other_value.modeOfChannelSet5().is_bound()) field_modeOfChannelSet5 = other_value.modeOfChannelSet5();
else field_modeOfChannelSet5.clean_up();
if (other_value.modeOfChannelSet6().is_bound()) field_modeOfChannelSet6 = other_value.modeOfChannelSet6();
else field_modeOfChannelSet6.clean_up();
if (other_value.modeOfChannelSet7().is_bound()) field_modeOfChannelSet7 = other_value.modeOfChannelSet7();
else field_modeOfChannelSet7.clean_up();
if (other_value.modeOfChannelSet8().is_bound()) field_modeOfChannelSet8 = other_value.modeOfChannelSet8();
else field_modeOfChannelSet8.clean_up();
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_multislotAllocation.clean_up();
field_modeOfChannelSet1.clean_up();
field_modeOfChannelSet2.clean_up();
field_modeOfChannelSet3.clean_up();
field_modeOfChannelSet4.clean_up();
field_modeOfChannelSet5.clean_up();
field_modeOfChannelSet6.clean_up();
field_modeOfChannelSet7.clean_up();
field_modeOfChannelSet8.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ConfigurationChangeCommand__NW__MS::get_descriptor() const { return &PDU__RRM__ConfigurationChangeCommand__NW__MS_descr_; }
PDU__RRM__ConfigurationChangeCommand__NW__MS& PDU__RRM__ConfigurationChangeCommand__NW__MS::operator=(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.multislotAllocation().is_bound()) field_multislotAllocation = other_value.multislotAllocation();
  else field_multislotAllocation.clean_up();
  if (other_value.modeOfChannelSet1().is_bound()) field_modeOfChannelSet1 = other_value.modeOfChannelSet1();
  else field_modeOfChannelSet1.clean_up();
  if (other_value.modeOfChannelSet2().is_bound()) field_modeOfChannelSet2 = other_value.modeOfChannelSet2();
  else field_modeOfChannelSet2.clean_up();
  if (other_value.modeOfChannelSet3().is_bound()) field_modeOfChannelSet3 = other_value.modeOfChannelSet3();
  else field_modeOfChannelSet3.clean_up();
  if (other_value.modeOfChannelSet4().is_bound()) field_modeOfChannelSet4 = other_value.modeOfChannelSet4();
  else field_modeOfChannelSet4.clean_up();
  if (other_value.modeOfChannelSet5().is_bound()) field_modeOfChannelSet5 = other_value.modeOfChannelSet5();
  else field_modeOfChannelSet5.clean_up();
  if (other_value.modeOfChannelSet6().is_bound()) field_modeOfChannelSet6 = other_value.modeOfChannelSet6();
  else field_modeOfChannelSet6.clean_up();
  if (other_value.modeOfChannelSet7().is_bound()) field_modeOfChannelSet7 = other_value.modeOfChannelSet7();
  else field_modeOfChannelSet7.clean_up();
  if (other_value.modeOfChannelSet8().is_bound()) field_modeOfChannelSet8 = other_value.modeOfChannelSet8();
  else field_modeOfChannelSet8.clean_up();
}
return *this;
}

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS::operator==(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_multislotAllocation==other_value.field_multislotAllocation
  && field_modeOfChannelSet1==other_value.field_modeOfChannelSet1
  && field_modeOfChannelSet2==other_value.field_modeOfChannelSet2
  && field_modeOfChannelSet3==other_value.field_modeOfChannelSet3
  && field_modeOfChannelSet4==other_value.field_modeOfChannelSet4
  && field_modeOfChannelSet5==other_value.field_modeOfChannelSet5
  && field_modeOfChannelSet6==other_value.field_modeOfChannelSet6
  && field_modeOfChannelSet7==other_value.field_modeOfChannelSet7
  && field_modeOfChannelSet8==other_value.field_modeOfChannelSet8;
}

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_multislotAllocation.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet1.get_selection() || field_modeOfChannelSet1.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet2.get_selection() || field_modeOfChannelSet2.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet3.get_selection() || field_modeOfChannelSet3.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet4.get_selection() || field_modeOfChannelSet4.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet5.get_selection() || field_modeOfChannelSet5.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet6.get_selection() || field_modeOfChannelSet6.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet7.get_selection() || field_modeOfChannelSet7.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet8.get_selection() || field_modeOfChannelSet8.is_bound());
}
boolean PDU__RRM__ConfigurationChangeCommand__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_multislotAllocation.is_value()
  && (OPTIONAL_OMIT == field_modeOfChannelSet1.get_selection() || field_modeOfChannelSet1.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet2.get_selection() || field_modeOfChannelSet2.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet3.get_selection() || field_modeOfChannelSet3.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet4.get_selection() || field_modeOfChannelSet4.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet5.get_selection() || field_modeOfChannelSet5.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet6.get_selection() || field_modeOfChannelSet6.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet7.get_selection() || field_modeOfChannelSet7.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet8.get_selection() || field_modeOfChannelSet8.is_value());
}
int PDU__RRM__ConfigurationChangeCommand__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_modeOfChannelSet1.ispresent()) ret_val++;
  if (field_modeOfChannelSet2.ispresent()) ret_val++;
  if (field_modeOfChannelSet3.ispresent()) ret_val++;
  if (field_modeOfChannelSet4.ispresent()) ret_val++;
  if (field_modeOfChannelSet5.ispresent()) ret_val++;
  if (field_modeOfChannelSet6.ispresent()) ret_val++;
  if (field_modeOfChannelSet7.ispresent()) ret_val++;
  if (field_modeOfChannelSet8.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__ConfigurationChangeCommand__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(", multislotAllocation := ");
field_multislotAllocation.log();
TTCN_Logger::log_event_str(", modeOfChannelSet1 := ");
field_modeOfChannelSet1.log();
TTCN_Logger::log_event_str(", modeOfChannelSet2 := ");
field_modeOfChannelSet2.log();
TTCN_Logger::log_event_str(", modeOfChannelSet3 := ");
field_modeOfChannelSet3.log();
TTCN_Logger::log_event_str(", modeOfChannelSet4 := ");
field_modeOfChannelSet4.log();
TTCN_Logger::log_event_str(", modeOfChannelSet5 := ");
field_modeOfChannelSet5.log();
TTCN_Logger::log_event_str(", modeOfChannelSet6 := ");
field_modeOfChannelSet6.log();
TTCN_Logger::log_event_str(", modeOfChannelSet7 := ");
field_modeOfChannelSet7.log();
TTCN_Logger::log_event_str(", modeOfChannelSet8 := ");
field_modeOfChannelSet8.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (multislotAllocation().is_bound()) multislotAllocation().set_implicit_omit();
if (!modeOfChannelSet1().is_bound()) modeOfChannelSet1() = OMIT_VALUE;
else modeOfChannelSet1().set_implicit_omit();
if (!modeOfChannelSet2().is_bound()) modeOfChannelSet2() = OMIT_VALUE;
else modeOfChannelSet2().set_implicit_omit();
if (!modeOfChannelSet3().is_bound()) modeOfChannelSet3() = OMIT_VALUE;
else modeOfChannelSet3().set_implicit_omit();
if (!modeOfChannelSet4().is_bound()) modeOfChannelSet4() = OMIT_VALUE;
else modeOfChannelSet4().set_implicit_omit();
if (!modeOfChannelSet5().is_bound()) modeOfChannelSet5() = OMIT_VALUE;
else modeOfChannelSet5().set_implicit_omit();
if (!modeOfChannelSet6().is_bound()) modeOfChannelSet6() = OMIT_VALUE;
else modeOfChannelSet6().set_implicit_omit();
if (!modeOfChannelSet7().is_bound()) modeOfChannelSet7() = OMIT_VALUE;
else modeOfChannelSet7().set_implicit_omit();
if (!modeOfChannelSet8().is_bound()) modeOfChannelSet8() = OMIT_VALUE;
else modeOfChannelSet8().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeCommand__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 (10<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS has 10 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) multislotAllocation().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet4().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet5().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet6().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet7().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet8().set_param(*param.get_elem(9));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet6().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
  }
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_multislotAllocation.encode_text(text_buf);
field_modeOfChannelSet1.encode_text(text_buf);
field_modeOfChannelSet2.encode_text(text_buf);
field_modeOfChannelSet3.encode_text(text_buf);
field_modeOfChannelSet4.encode_text(text_buf);
field_modeOfChannelSet5.encode_text(text_buf);
field_modeOfChannelSet6.encode_text(text_buf);
field_modeOfChannelSet7.encode_text(text_buf);
field_modeOfChannelSet8.encode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_multislotAllocation.decode_text(text_buf);
field_modeOfChannelSet1.decode_text(text_buf);
field_modeOfChannelSet2.decode_text(text_buf);
field_modeOfChannelSet3.decode_text(text_buf);
field_modeOfChannelSet4.decode_text(text_buf);
field_modeOfChannelSet5.decode_text(text_buf);
field_modeOfChannelSet6.decode_text(text_buf);
field_modeOfChannelSet7.decode_text(text_buf);
field_modeOfChannelSet8.decode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeCommand__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__RRM__ConfigurationChangeCommand__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__RRM__ConfigurationChangeCommand__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotAllocation__LV_descr_.raw->forceomit);
  decoded_field_length = field_multislotAllocation.RAW_decode(MultislotAllocation__LV_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_modeOfChannelSet1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet1().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet1.ispresent() || field_modeOfChannelSet1().elementIdentifier() !=  os_6){
  field_modeOfChannelSet1=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_modeOfChannelSet2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet2().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet2.ispresent() || field_modeOfChannelSet2().elementIdentifier() !=  os_7){
  field_modeOfChannelSet2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_modeOfChannelSet3 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet3().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet3 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet3.ispresent() || field_modeOfChannelSet3().elementIdentifier() !=  os_8){
  field_modeOfChannelSet3=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet3=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_modeOfChannelSet4 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet4().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet4 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet4.ispresent() || field_modeOfChannelSet4().elementIdentifier() !=  os_9){
  field_modeOfChannelSet4=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet4=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_modeOfChannelSet5 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet5().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet5 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet5.ispresent() || field_modeOfChannelSet5().elementIdentifier() !=  os_10){
  field_modeOfChannelSet5=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet5=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_modeOfChannelSet6 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet6().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet6 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet6.ispresent() || field_modeOfChannelSet6().elementIdentifier() !=  os_11){
  field_modeOfChannelSet6=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet6=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_modeOfChannelSet7 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet7().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet7 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet7.ispresent() || field_modeOfChannelSet7().elementIdentifier() !=  os_12){
  field_modeOfChannelSet7=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet7=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_modeOfChannelSet8 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet8().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet8 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet8.ispresent() || field_modeOfChannelSet8().elementIdentifier() !=  os_13){
  field_modeOfChannelSet8=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet8=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__RRM__ConfigurationChangeCommand__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 = 10;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(10);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotAllocation__LV_descr_.raw);
  if (field_modeOfChannelSet1.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_modeOfChannelSet2.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_modeOfChannelSet3.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_modeOfChannelSet4.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_modeOfChannelSet5.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_modeOfChannelSet6.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_modeOfChannelSet7.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_modeOfChannelSet8.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_multislotAllocation.RAW_encode(MultislotAllocation__LV_descr_, *myleaf.body.node.nodes[1]);
  if (field_modeOfChannelSet1.ispresent()) {
  encoded_length += field_modeOfChannelSet1().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_modeOfChannelSet2.ispresent()) {
  encoded_length += field_modeOfChannelSet2().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_modeOfChannelSet3.ispresent()) {
  encoded_length += field_modeOfChannelSet3().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_modeOfChannelSet4.ispresent()) {
  encoded_length += field_modeOfChannelSet4().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_modeOfChannelSet5.ispresent()) {
  encoded_length += field_modeOfChannelSet5().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_modeOfChannelSet6.ispresent()) {
  encoded_length += field_modeOfChannelSet6().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_modeOfChannelSet7.ispresent()) {
  encoded_length += field_modeOfChannelSet7().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_modeOfChannelSet8.ispresent()) {
  encoded_length += field_modeOfChannelSet8().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_modeOfChannelSet1.ispresent() && (!field_modeOfChannelSet1.ispresent() || field_modeOfChannelSet1().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);
  }
  }
  if (field_modeOfChannelSet2.ispresent() && (!field_modeOfChannelSet2.ispresent() || field_modeOfChannelSet2().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_modeOfChannelSet3.ispresent() && (!field_modeOfChannelSet3.ispresent() || field_modeOfChannelSet3().elementIdentifier() !=  os_8)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_8.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOfChannelSet4.ispresent() && (!field_modeOfChannelSet4.ispresent() || field_modeOfChannelSet4().elementIdentifier() !=  os_9)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_9.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOfChannelSet5.ispresent() && (!field_modeOfChannelSet5.ispresent() || field_modeOfChannelSet5().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[]={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_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_modeOfChannelSet6.ispresent() && (!field_modeOfChannelSet6.ispresent() || field_modeOfChannelSet6().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[]={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_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);
  }
  }
  if (field_modeOfChannelSet7.ispresent() && (!field_modeOfChannelSet7.ispresent() || field_modeOfChannelSet7().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[]={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_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);
  }
  }
  if (field_modeOfChannelSet8.ispresent() && (!field_modeOfChannelSet8.ispresent() || field_modeOfChannelSet8().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[]={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_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ConfigurationChangeCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
MultislotAllocation__LV_template field_multislotAllocation;
ChannelMode__TV_template field_modeOfChannelSet1;
ChannelMode__TV_template field_modeOfChannelSet2;
ChannelMode__TV_template field_modeOfChannelSet3;
ChannelMode__TV_template field_modeOfChannelSet4;
ChannelMode__TV_template field_modeOfChannelSet5;
ChannelMode__TV_template field_modeOfChannelSet6;
ChannelMode__TV_template field_modeOfChannelSet7;
ChannelMode__TV_template field_modeOfChannelSet8;
};

void PDU__RRM__ConfigurationChangeCommand__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_multislotAllocation = ANY_VALUE;
single_value->field_modeOfChannelSet1 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet2 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet3 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet4 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet5 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet6 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet7 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet8 = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::copy_value(const PDU__RRM__ConfigurationChangeCommand__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.multislotAllocation().is_bound()) {
  single_value->field_multislotAllocation = other_value.multislotAllocation();
} else {
  single_value->field_multislotAllocation.clean_up();
}
if (other_value.modeOfChannelSet1().is_bound()) {
  if (other_value.modeOfChannelSet1().ispresent()) single_value->field_modeOfChannelSet1 = other_value.modeOfChannelSet1()();
  else single_value->field_modeOfChannelSet1 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet1.clean_up();
}
if (other_value.modeOfChannelSet2().is_bound()) {
  if (other_value.modeOfChannelSet2().ispresent()) single_value->field_modeOfChannelSet2 = other_value.modeOfChannelSet2()();
  else single_value->field_modeOfChannelSet2 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet2.clean_up();
}
if (other_value.modeOfChannelSet3().is_bound()) {
  if (other_value.modeOfChannelSet3().ispresent()) single_value->field_modeOfChannelSet3 = other_value.modeOfChannelSet3()();
  else single_value->field_modeOfChannelSet3 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet3.clean_up();
}
if (other_value.modeOfChannelSet4().is_bound()) {
  if (other_value.modeOfChannelSet4().ispresent()) single_value->field_modeOfChannelSet4 = other_value.modeOfChannelSet4()();
  else single_value->field_modeOfChannelSet4 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet4.clean_up();
}
if (other_value.modeOfChannelSet5().is_bound()) {
  if (other_value.modeOfChannelSet5().ispresent()) single_value->field_modeOfChannelSet5 = other_value.modeOfChannelSet5()();
  else single_value->field_modeOfChannelSet5 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet5.clean_up();
}
if (other_value.modeOfChannelSet6().is_bound()) {
  if (other_value.modeOfChannelSet6().ispresent()) single_value->field_modeOfChannelSet6 = other_value.modeOfChannelSet6()();
  else single_value->field_modeOfChannelSet6 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet6.clean_up();
}
if (other_value.modeOfChannelSet7().is_bound()) {
  if (other_value.modeOfChannelSet7().ispresent()) single_value->field_modeOfChannelSet7 = other_value.modeOfChannelSet7()();
  else single_value->field_modeOfChannelSet7 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet7.clean_up();
}
if (other_value.modeOfChannelSet8().is_bound()) {
  if (other_value.modeOfChannelSet8().ispresent()) single_value->field_modeOfChannelSet8 = other_value.modeOfChannelSet8()();
  else single_value->field_modeOfChannelSet8 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet8.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::copy_template(const PDU__RRM__ConfigurationChangeCommand__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.multislotAllocation().get_selection()) {
single_value->field_multislotAllocation = other_value.multislotAllocation();
} else {
single_value->field_multislotAllocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet1().get_selection()) {
single_value->field_modeOfChannelSet1 = other_value.modeOfChannelSet1();
} else {
single_value->field_modeOfChannelSet1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet2().get_selection()) {
single_value->field_modeOfChannelSet2 = other_value.modeOfChannelSet2();
} else {
single_value->field_modeOfChannelSet2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet3().get_selection()) {
single_value->field_modeOfChannelSet3 = other_value.modeOfChannelSet3();
} else {
single_value->field_modeOfChannelSet3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet4().get_selection()) {
single_value->field_modeOfChannelSet4 = other_value.modeOfChannelSet4();
} else {
single_value->field_modeOfChannelSet4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet5().get_selection()) {
single_value->field_modeOfChannelSet5 = other_value.modeOfChannelSet5();
} else {
single_value->field_modeOfChannelSet5.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet6().get_selection()) {
single_value->field_modeOfChannelSet6 = other_value.modeOfChannelSet6();
} else {
single_value->field_modeOfChannelSet6.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet7().get_selection()) {
single_value->field_modeOfChannelSet7 = other_value.modeOfChannelSet7();
} else {
single_value->field_modeOfChannelSet7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet8().get_selection()) {
single_value->field_modeOfChannelSet8 = other_value.modeOfChannelSet8();
} else {
single_value->field_modeOfChannelSet8.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__RRM__ConfigurationChangeCommand__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__RRM__ConfigurationChangeCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ConfigurationChangeCommand__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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::PDU__RRM__ConfigurationChangeCommand__NW__MS_template()
{
}

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

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::PDU__RRM__ConfigurationChangeCommand__NW__MS_template(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS_template::match(const PDU__RRM__ConfigurationChangeCommand__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.multislotAllocation().is_bound()) return FALSE;
if(!single_value->field_multislotAllocation.match(other_value.multislotAllocation(), legacy))return FALSE;
if(!other_value.modeOfChannelSet1().is_bound()) return FALSE;
if((other_value.modeOfChannelSet1().ispresent() ? !single_value->field_modeOfChannelSet1.match((const ChannelMode__TV&)other_value.modeOfChannelSet1(), legacy) : !single_value->field_modeOfChannelSet1.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet2().is_bound()) return FALSE;
if((other_value.modeOfChannelSet2().ispresent() ? !single_value->field_modeOfChannelSet2.match((const ChannelMode__TV&)other_value.modeOfChannelSet2(), legacy) : !single_value->field_modeOfChannelSet2.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet3().is_bound()) return FALSE;
if((other_value.modeOfChannelSet3().ispresent() ? !single_value->field_modeOfChannelSet3.match((const ChannelMode__TV&)other_value.modeOfChannelSet3(), legacy) : !single_value->field_modeOfChannelSet3.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet4().is_bound()) return FALSE;
if((other_value.modeOfChannelSet4().ispresent() ? !single_value->field_modeOfChannelSet4.match((const ChannelMode__TV&)other_value.modeOfChannelSet4(), legacy) : !single_value->field_modeOfChannelSet4.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet5().is_bound()) return FALSE;
if((other_value.modeOfChannelSet5().ispresent() ? !single_value->field_modeOfChannelSet5.match((const ChannelMode__TV&)other_value.modeOfChannelSet5(), legacy) : !single_value->field_modeOfChannelSet5.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet6().is_bound()) return FALSE;
if((other_value.modeOfChannelSet6().ispresent() ? !single_value->field_modeOfChannelSet6.match((const ChannelMode__TV&)other_value.modeOfChannelSet6(), legacy) : !single_value->field_modeOfChannelSet6.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet7().is_bound()) return FALSE;
if((other_value.modeOfChannelSet7().ispresent() ? !single_value->field_modeOfChannelSet7.match((const ChannelMode__TV&)other_value.modeOfChannelSet7(), legacy) : !single_value->field_modeOfChannelSet7.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet8().is_bound()) return FALSE;
if((other_value.modeOfChannelSet8().ispresent() ? !single_value->field_modeOfChannelSet8.match((const ChannelMode__TV&)other_value.modeOfChannelSet8(), legacy) : !single_value->field_modeOfChannelSet8.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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ConfigurationChangeCommand__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_multislotAllocation.is_bound()
 || (single_value->field_modeOfChannelSet1.is_omit() || single_value->field_modeOfChannelSet1.is_bound())
 || (single_value->field_modeOfChannelSet2.is_omit() || single_value->field_modeOfChannelSet2.is_bound())
 || (single_value->field_modeOfChannelSet3.is_omit() || single_value->field_modeOfChannelSet3.is_bound())
 || (single_value->field_modeOfChannelSet4.is_omit() || single_value->field_modeOfChannelSet4.is_bound())
 || (single_value->field_modeOfChannelSet5.is_omit() || single_value->field_modeOfChannelSet5.is_bound())
 || (single_value->field_modeOfChannelSet6.is_omit() || single_value->field_modeOfChannelSet6.is_bound())
 || (single_value->field_modeOfChannelSet7.is_omit() || single_value->field_modeOfChannelSet7.is_bound())
 || (single_value->field_modeOfChannelSet8.is_omit() || single_value->field_modeOfChannelSet8.is_bound());
}

boolean PDU__RRM__ConfigurationChangeCommand__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_multislotAllocation.is_value()
 && (single_value->field_modeOfChannelSet1.is_omit() || single_value->field_modeOfChannelSet1.is_value())
 && (single_value->field_modeOfChannelSet2.is_omit() || single_value->field_modeOfChannelSet2.is_value())
 && (single_value->field_modeOfChannelSet3.is_omit() || single_value->field_modeOfChannelSet3.is_value())
 && (single_value->field_modeOfChannelSet4.is_omit() || single_value->field_modeOfChannelSet4.is_value())
 && (single_value->field_modeOfChannelSet5.is_omit() || single_value->field_modeOfChannelSet5.is_value())
 && (single_value->field_modeOfChannelSet6.is_omit() || single_value->field_modeOfChannelSet6.is_value())
 && (single_value->field_modeOfChannelSet7.is_omit() || single_value->field_modeOfChannelSet7.is_value())
 && (single_value->field_modeOfChannelSet8.is_omit() || single_value->field_modeOfChannelSet8.is_value());
}

void PDU__RRM__ConfigurationChangeCommand__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__RRM__ConfigurationChangeCommand__NW__MS PDU__RRM__ConfigurationChangeCommand__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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
PDU__RRM__ConfigurationChangeCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_multislotAllocation.is_bound()) {
ret_val.multislotAllocation() = single_value->field_multislotAllocation.valueof();
}
if (single_value->field_modeOfChannelSet1.is_omit()) ret_val.modeOfChannelSet1() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet1.is_bound()) {
ret_val.modeOfChannelSet1() = single_value->field_modeOfChannelSet1.valueof();
}
if (single_value->field_modeOfChannelSet2.is_omit()) ret_val.modeOfChannelSet2() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet2.is_bound()) {
ret_val.modeOfChannelSet2() = single_value->field_modeOfChannelSet2.valueof();
}
if (single_value->field_modeOfChannelSet3.is_omit()) ret_val.modeOfChannelSet3() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet3.is_bound()) {
ret_val.modeOfChannelSet3() = single_value->field_modeOfChannelSet3.valueof();
}
if (single_value->field_modeOfChannelSet4.is_omit()) ret_val.modeOfChannelSet4() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet4.is_bound()) {
ret_val.modeOfChannelSet4() = single_value->field_modeOfChannelSet4.valueof();
}
if (single_value->field_modeOfChannelSet5.is_omit()) ret_val.modeOfChannelSet5() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet5.is_bound()) {
ret_val.modeOfChannelSet5() = single_value->field_modeOfChannelSet5.valueof();
}
if (single_value->field_modeOfChannelSet6.is_omit()) ret_val.modeOfChannelSet6() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet6.is_bound()) {
ret_val.modeOfChannelSet6() = single_value->field_modeOfChannelSet6.valueof();
}
if (single_value->field_modeOfChannelSet7.is_omit()) ret_val.modeOfChannelSet7() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet7.is_bound()) {
ret_val.modeOfChannelSet7() = single_value->field_modeOfChannelSet7.valueof();
}
if (single_value->field_modeOfChannelSet8.is_omit()) ret_val.modeOfChannelSet8() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet8.is_bound()) {
ret_val.modeOfChannelSet8() = single_value->field_modeOfChannelSet8.valueof();
}
return ret_val;
}

void PDU__RRM__ConfigurationChangeCommand__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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template[list_length];
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template& PDU__RRM__ConfigurationChangeCommand__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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return value_list.list_value[list_index];
}

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

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

MultislotAllocation__LV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::multislotAllocation()
{
set_specific();
return single_value->field_multislotAllocation;
}

const MultislotAllocation__LV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::multislotAllocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotAllocation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_multislotAllocation;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet1()
{
set_specific();
return single_value->field_modeOfChannelSet1;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet1;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet2()
{
set_specific();
return single_value->field_modeOfChannelSet2;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet2;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet3()
{
set_specific();
return single_value->field_modeOfChannelSet3;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet3 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet3;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet4()
{
set_specific();
return single_value->field_modeOfChannelSet4;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet4 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet4;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet5()
{
set_specific();
return single_value->field_modeOfChannelSet5;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet5 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet5;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet6()
{
set_specific();
return single_value->field_modeOfChannelSet6;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet6() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet6 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet6;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet7()
{
set_specific();
return single_value->field_modeOfChannelSet7;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet7 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet7;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet8()
{
set_specific();
return single_value->field_modeOfChannelSet8;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet8() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet8 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet8;
}

int PDU__RRM__ConfigurationChangeCommand__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_modeOfChannelSet1.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet2.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet3.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet4.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet5.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet6.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet7.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet8.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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
  }
  return 0;
}

void PDU__RRM__ConfigurationChangeCommand__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(", multislotAllocation := ");
single_value->field_multislotAllocation.log();
TTCN_Logger::log_event_str(", modeOfChannelSet1 := ");
single_value->field_modeOfChannelSet1.log();
TTCN_Logger::log_event_str(", modeOfChannelSet2 := ");
single_value->field_modeOfChannelSet2.log();
TTCN_Logger::log_event_str(", modeOfChannelSet3 := ");
single_value->field_modeOfChannelSet3.log();
TTCN_Logger::log_event_str(", modeOfChannelSet4 := ");
single_value->field_modeOfChannelSet4.log();
TTCN_Logger::log_event_str(", modeOfChannelSet5 := ");
single_value->field_modeOfChannelSet5.log();
TTCN_Logger::log_event_str(", modeOfChannelSet6 := ");
single_value->field_modeOfChannelSet6.log();
TTCN_Logger::log_event_str(", modeOfChannelSet7 := ");
single_value->field_modeOfChannelSet7.log();
TTCN_Logger::log_event_str(", modeOfChannelSet8 := ");
single_value->field_modeOfChannelSet8.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__RRM__ConfigurationChangeCommand__NW__MS_template::log_match(const PDU__RRM__ConfigurationChangeCommand__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_multislotAllocation.match(match_value.multislotAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotAllocation");
single_value->field_multislotAllocation.log_match(match_value.multislotAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.modeOfChannelSet1().ispresent()){
if(!single_value->field_modeOfChannelSet1.match(match_value.modeOfChannelSet1(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet1");
single_value->field_modeOfChannelSet1.log_match(match_value.modeOfChannelSet1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet2().ispresent()){
if(!single_value->field_modeOfChannelSet2.match(match_value.modeOfChannelSet2(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet2");
single_value->field_modeOfChannelSet2.log_match(match_value.modeOfChannelSet2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet3().ispresent()){
if(!single_value->field_modeOfChannelSet3.match(match_value.modeOfChannelSet3(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet3");
single_value->field_modeOfChannelSet3.log_match(match_value.modeOfChannelSet3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet4().ispresent()){
if(!single_value->field_modeOfChannelSet4.match(match_value.modeOfChannelSet4(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet4");
single_value->field_modeOfChannelSet4.log_match(match_value.modeOfChannelSet4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet4.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet4 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet4.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet5().ispresent()){
if(!single_value->field_modeOfChannelSet5.match(match_value.modeOfChannelSet5(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet5");
single_value->field_modeOfChannelSet5.log_match(match_value.modeOfChannelSet5(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet5.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet5 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet5.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet6().ispresent()){
if(!single_value->field_modeOfChannelSet6.match(match_value.modeOfChannelSet6(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet6");
single_value->field_modeOfChannelSet6.log_match(match_value.modeOfChannelSet6(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet6.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet6 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet6.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet7().ispresent()){
if(!single_value->field_modeOfChannelSet7.match(match_value.modeOfChannelSet7(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet7");
single_value->field_modeOfChannelSet7.log_match(match_value.modeOfChannelSet7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet7.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet7 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet7.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet8().ispresent()){
if(!single_value->field_modeOfChannelSet8.match(match_value.modeOfChannelSet8(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet8");
single_value->field_modeOfChannelSet8.log_match(match_value.modeOfChannelSet8(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet8.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet8 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet8.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(", multislotAllocation := ");
single_value->field_multislotAllocation.log_match(match_value.multislotAllocation(), legacy);
TTCN_Logger::log_event_str(", modeOfChannelSet1 := ");
if (match_value.modeOfChannelSet1().ispresent()) {
single_value->field_modeOfChannelSet1.log_match(match_value.modeOfChannelSet1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet1.log();
if (single_value->field_modeOfChannelSet1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet2 := ");
if (match_value.modeOfChannelSet2().ispresent()) {
single_value->field_modeOfChannelSet2.log_match(match_value.modeOfChannelSet2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet2.log();
if (single_value->field_modeOfChannelSet2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet3 := ");
if (match_value.modeOfChannelSet3().ispresent()) {
single_value->field_modeOfChannelSet3.log_match(match_value.modeOfChannelSet3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet3.log();
if (single_value->field_modeOfChannelSet3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet4 := ");
if (match_value.modeOfChannelSet4().ispresent()) {
single_value->field_modeOfChannelSet4.log_match(match_value.modeOfChannelSet4(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet4.log();
if (single_value->field_modeOfChannelSet4.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet5 := ");
if (match_value.modeOfChannelSet5().ispresent()) {
single_value->field_modeOfChannelSet5.log_match(match_value.modeOfChannelSet5(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet5.log();
if (single_value->field_modeOfChannelSet5.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet6 := ");
if (match_value.modeOfChannelSet6().ispresent()) {
single_value->field_modeOfChannelSet6.log_match(match_value.modeOfChannelSet6(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet6.log();
if (single_value->field_modeOfChannelSet6.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet7 := ");
if (match_value.modeOfChannelSet7().ispresent()) {
single_value->field_modeOfChannelSet7.log_match(match_value.modeOfChannelSet7(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet7.log();
if (single_value->field_modeOfChannelSet7.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet8 := ");
if (match_value.modeOfChannelSet8().ispresent()) {
single_value->field_modeOfChannelSet8.log_match(match_value.modeOfChannelSet8(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet8.log();
if (single_value->field_modeOfChannelSet8.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__RRM__ConfigurationChangeCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (multislotAllocation().is_bound()) multislotAllocation().set_implicit_omit();
if (!modeOfChannelSet1().is_bound()) modeOfChannelSet1() = OMIT_VALUE;
else modeOfChannelSet1().set_implicit_omit();
if (!modeOfChannelSet2().is_bound()) modeOfChannelSet2() = OMIT_VALUE;
else modeOfChannelSet2().set_implicit_omit();
if (!modeOfChannelSet3().is_bound()) modeOfChannelSet3() = OMIT_VALUE;
else modeOfChannelSet3().set_implicit_omit();
if (!modeOfChannelSet4().is_bound()) modeOfChannelSet4() = OMIT_VALUE;
else modeOfChannelSet4().set_implicit_omit();
if (!modeOfChannelSet5().is_bound()) modeOfChannelSet5() = OMIT_VALUE;
else modeOfChannelSet5().set_implicit_omit();
if (!modeOfChannelSet6().is_bound()) modeOfChannelSet6() = OMIT_VALUE;
else modeOfChannelSet6().set_implicit_omit();
if (!modeOfChannelSet7().is_bound()) modeOfChannelSet7() = OMIT_VALUE;
else modeOfChannelSet7().set_implicit_omit();
if (!modeOfChannelSet8().is_bound()) modeOfChannelSet8() = OMIT_VALUE;
else modeOfChannelSet8().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeCommand__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_multislotAllocation.encode_text(text_buf);
single_value->field_modeOfChannelSet1.encode_text(text_buf);
single_value->field_modeOfChannelSet2.encode_text(text_buf);
single_value->field_modeOfChannelSet3.encode_text(text_buf);
single_value->field_modeOfChannelSet4.encode_text(text_buf);
single_value->field_modeOfChannelSet5.encode_text(text_buf);
single_value->field_modeOfChannelSet6.encode_text(text_buf);
single_value->field_modeOfChannelSet7.encode_text(text_buf);
single_value->field_modeOfChannelSet8.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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
}
}

void PDU__RRM__ConfigurationChangeCommand__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_multislotAllocation.decode_text(text_buf);
single_value->field_modeOfChannelSet1.decode_text(text_buf);
single_value->field_modeOfChannelSet2.decode_text(text_buf);
single_value->field_modeOfChannelSet3.decode_text(text_buf);
single_value->field_modeOfChannelSet4.decode_text(text_buf);
single_value->field_modeOfChannelSet5.decode_text(text_buf);
single_value->field_modeOfChannelSet6.decode_text(text_buf);
single_value->field_modeOfChannelSet7.decode_text(text_buf);
single_value->field_modeOfChannelSet8.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__RRM__ConfigurationChangeCommand__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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
}
}

void PDU__RRM__ConfigurationChangeCommand__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__RRM__ConfigurationChangeCommand__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 (10<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS has 10 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) multislotAllocation().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet4().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet5().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet6().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet7().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet8().set_param(*param.get_elem(9));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet6().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ConfigurationChangeCommand__NW__MS_template* precondition = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ConfigurationChangeCommand__NW__MS_template* implied_template = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ConfigurationChangeCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ConfigurationChangeCommand__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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_multislotAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet4.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet5.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet6.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet7.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet8.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_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_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
}

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

boolean PDU__RRM__ConfigurationChangeCommand__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__RRM__ConfigurationChangeAck__MS__NW::PDU__RRM__ConfigurationChangeAck__MS__NW()
{
}

PDU__RRM__ConfigurationChangeAck__MS__NW::PDU__RRM__ConfigurationChangeAck__MS__NW(const BITSTRING& par_messageType)
  :   field_messageType(par_messageType)
{
}

PDU__RRM__ConfigurationChangeAck__MS__NW::PDU__RRM__ConfigurationChangeAck__MS__NW(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
}

void PDU__RRM__ConfigurationChangeAck__MS__NW::clean_up()
{
field_messageType.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ConfigurationChangeAck__MS__NW::get_descriptor() const { return &PDU__RRM__ConfigurationChangeAck__MS__NW_descr_; }
PDU__RRM__ConfigurationChangeAck__MS__NW& PDU__RRM__ConfigurationChangeAck__MS__NW::operator=(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
}
return *this;
}

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

boolean PDU__RRM__ConfigurationChangeAck__MS__NW::is_bound() const
{
return (field_messageType.is_bound());
}
boolean PDU__RRM__ConfigurationChangeAck__MS__NW::is_value() const
{
return field_messageType.is_value();
}
void PDU__RRM__ConfigurationChangeAck__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(" }");
}

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

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

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

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

void PDU__RRM__ConfigurationChangeAck__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__RRM__ConfigurationChangeAck__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__RRM__ConfigurationChangeAck__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct PDU__RRM__ConfigurationChangeAck__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
};

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

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::copy_value(const PDU__RRM__ConfigurationChangeAck__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();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::copy_template(const PDU__RRM__ConfigurationChangeAck__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();
}
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__RRM__ConfigurationChangeAck__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__RRM__ConfigurationChangeAck__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ConfigurationChangeAck__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_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template::PDU__RRM__ConfigurationChangeAck__MS__NW_template()
{
}

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

PDU__RRM__ConfigurationChangeAck__MS__NW_template::PDU__RRM__ConfigurationChangeAck__MS__NW_template(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__ConfigurationChangeAck__MS__NW_template::match(const PDU__RRM__ConfigurationChangeAck__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;
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_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__ConfigurationChangeAck__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();
}

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

void PDU__RRM__ConfigurationChangeAck__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__RRM__ConfigurationChangeAck__MS__NW PDU__RRM__ConfigurationChangeAck__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_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
PDU__RRM__ConfigurationChangeAck__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
return ret_val;
}

void PDU__RRM__ConfigurationChangeAck__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_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ConfigurationChangeAck__MS__NW_template[list_length];
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template& PDU__RRM__ConfigurationChangeAck__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_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
return value_list.list_value[list_index];
}

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

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

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

void PDU__RRM__ConfigurationChangeAck__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(" }");
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__RRM__ConfigurationChangeAck__MS__NW_template::log_match(const PDU__RRM__ConfigurationChangeAck__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);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void PDU__RRM__ConfigurationChangeAck__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);
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_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
}
}

void PDU__RRM__ConfigurationChangeAck__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);
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__RRM__ConfigurationChangeAck__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_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
}
}

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

void PDU__RRM__ConfigurationChangeAck__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_RRM_Types.PDU_RRM_ConfigurationChangeAck_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_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW");
}

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

boolean PDU__RRM__ConfigurationChangeAck__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__RRM__ConfigurationChangeRej__MS__NW::PDU__RRM__ConfigurationChangeRej__MS__NW()
{
}

PDU__RRM__ConfigurationChangeRej__MS__NW::PDU__RRM__ConfigurationChangeRej__MS__NW(const BITSTRING& par_messageType,
    const RR__Cause__V& par_rR__Cause)
  :   field_messageType(par_messageType),
  field_rR__Cause(par_rR__Cause)
{
}

PDU__RRM__ConfigurationChangeRej__MS__NW::PDU__RRM__ConfigurationChangeRej__MS__NW(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.rR__Cause().is_bound()) field_rR__Cause = other_value.rR__Cause();
else field_rR__Cause.clean_up();
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::clean_up()
{
field_messageType.clean_up();
field_rR__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ConfigurationChangeRej__MS__NW::get_descriptor() const { return &PDU__RRM__ConfigurationChangeRej__MS__NW_descr_; }
PDU__RRM__ConfigurationChangeRej__MS__NW& PDU__RRM__ConfigurationChangeRej__MS__NW::operator=(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.rR__Cause().is_bound()) field_rR__Cause = other_value.rR__Cause();
  else field_rR__Cause.clean_up();
}
return *this;
}

boolean PDU__RRM__ConfigurationChangeRej__MS__NW::operator==(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rR__Cause==other_value.field_rR__Cause;
}

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

void PDU__RRM__ConfigurationChangeRej__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rR__Cause().is_bound()) rR__Cause().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeRej__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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW 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) rR__Cause().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(), "rR_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rR__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW");
  }
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_rR__Cause.encode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_rR__Cause.decode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeRej__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__RRM__ConfigurationChangeRej__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__RRM__ConfigurationChangeRej__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, RR__Cause__V_descr_.raw->forceomit);
  decoded_field_length = field_rR__Cause.RAW_decode(RR__Cause__V_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__RRM__ConfigurationChangeRej__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 = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RR__Cause__V_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rR__Cause.RAW_encode(RR__Cause__V_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ConfigurationChangeRej__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
RR__Cause__V_template field_rR__Cause;
};

void PDU__RRM__ConfigurationChangeRej__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_rR__Cause = ANY_VALUE;
}
}
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::copy_value(const PDU__RRM__ConfigurationChangeRej__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.rR__Cause().is_bound()) {
  single_value->field_rR__Cause = other_value.rR__Cause();
} else {
  single_value->field_rR__Cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::copy_template(const PDU__RRM__ConfigurationChangeRej__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.rR__Cause().get_selection()) {
single_value->field_rR__Cause = other_value.rR__Cause();
} else {
single_value->field_rR__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__RRM__ConfigurationChangeRej__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__RRM__ConfigurationChangeRej__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ConfigurationChangeRej__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template::PDU__RRM__ConfigurationChangeRej__MS__NW_template()
{
}

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

PDU__RRM__ConfigurationChangeRej__MS__NW_template::PDU__RRM__ConfigurationChangeRej__MS__NW_template(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__ConfigurationChangeRej__MS__NW_template::match(const PDU__RRM__ConfigurationChangeRej__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.rR__Cause().is_bound()) return FALSE;
if(!single_value->field_rR__Cause.match(other_value.rR__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__ConfigurationChangeRej__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_rR__Cause.is_bound();
}

boolean PDU__RRM__ConfigurationChangeRej__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_rR__Cause.is_value();
}

void PDU__RRM__ConfigurationChangeRej__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__RRM__ConfigurationChangeRej__MS__NW PDU__RRM__ConfigurationChangeRej__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
PDU__RRM__ConfigurationChangeRej__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_rR__Cause.is_bound()) {
ret_val.rR__Cause() = single_value->field_rR__Cause.valueof();
}
return ret_val;
}

void PDU__RRM__ConfigurationChangeRej__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ConfigurationChangeRej__MS__NW_template[list_length];
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template& PDU__RRM__ConfigurationChangeRej__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
return value_list.list_value[list_index];
}

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

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

RR__Cause__V_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::rR__Cause()
{
set_specific();
return single_value->field_rR__Cause;
}

const RR__Cause__V_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::rR__Cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rR_Cause of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
return single_value->field_rR__Cause;
}

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

void PDU__RRM__ConfigurationChangeRej__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(", rR_Cause := ");
single_value->field_rR__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__RRM__ConfigurationChangeRej__MS__NW_template::log_match(const PDU__RRM__ConfigurationChangeRej__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_rR__Cause.match(match_value.rR__Cause(), legacy)){
TTCN_Logger::log_logmatch_info(".rR_Cause");
single_value->field_rR__Cause.log_match(match_value.rR__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(", rR_Cause := ");
single_value->field_rR__Cause.log_match(match_value.rR__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__RRM__ConfigurationChangeRej__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rR__Cause().is_bound()) rR__Cause().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeRej__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_rR__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
}
}

void PDU__RRM__ConfigurationChangeRej__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_rR__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__RRM__ConfigurationChangeRej__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
}
}

void PDU__RRM__ConfigurationChangeRej__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__RRM__ConfigurationChangeRej__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 (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW 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) rR__Cause().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(), "rR_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rR__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ConfigurationChangeRej__MS__NW_template* precondition = new PDU__RRM__ConfigurationChangeRej__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ConfigurationChangeRej__MS__NW_template* implied_template = new PDU__RRM__ConfigurationChangeRej__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ConfigurationChangeRej__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ConfigurationChangeRej__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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW");
single_value->field_rR__Cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_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_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW");
}

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

boolean PDU__RRM__ConfigurationChangeRej__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__RRM__DTM__AssignmentCommand__NW__MS::PDU__RRM__DTM__AssignmentCommand__NW__MS()
{
}

PDU__RRM__DTM__AssignmentCommand__NW__MS::PDU__RRM__DTM__AssignmentCommand__NW__MS(const BITSTRING& par_messageType,
    const PowerCommand__V& par_cS__PowerCommand,
    const ChannelDescription__V& par_description__CS__Channel,
    const GPRS__BroadcastInformation__LV& par_gPRS__BroadcastInformation,
    const OPTIONAL< CellChannelDescription__TV >& par_cellChannelDescr,
    const OPTIONAL< ChannelMode__TV >& par_channelMode,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_frequencyList,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_mobileAllocation,
    const OPTIONAL< RR__PacketUplinkAssignment__TLV >& par_descrUplinkPacketChannelAssignment,
    const OPTIONAL< RR__PacketDownlinkAssignment__TLV >& par_descrDownlinkPacketChannelAssignment,
    const OPTIONAL< MultiRateConfiguration__TLV >& par_multiRateConfiguration,
    const OPTIONAL< CipherModeSetting__TV >& par_cipherModeSetting,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_mobileAllocationC2,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_frequencyListC2,
    const OPTIONAL< RR__DualCarrierPacketDownlinkAssignment__TLV >& par_descriptionDualCarrierPacketDownlinkAssignment,
    const OPTIONAL< ChannelDescription3__TV >& par_channelDescriptionC2,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet)
  :   field_messageType(par_messageType),
  field_cS__PowerCommand(par_cS__PowerCommand),
  field_description__CS__Channel(par_description__CS__Channel),
  field_gPRS__BroadcastInformation(par_gPRS__BroadcastInformation),
  field_cellChannelDescr(par_cellChannelDescr),
  field_channelMode(par_channelMode),
  field_frequencyList(par_frequencyList),
  field_mobileAllocation(par_mobileAllocation),
  field_descrUplinkPacketChannelAssignment(par_descrUplinkPacketChannelAssignment),
  field_descrDownlinkPacketChannelAssignment(par_descrDownlinkPacketChannelAssignment),
  field_multiRateConfiguration(par_multiRateConfiguration),
  field_cipherModeSetting(par_cipherModeSetting),
  field_mobileAllocationC2(par_mobileAllocationC2),
  field_frequencyListC2(par_frequencyListC2),
  field_descriptionDualCarrierPacketDownlinkAssignment(par_descriptionDualCarrierPacketDownlinkAssignment),
  field_channelDescriptionC2(par_channelDescriptionC2),
  field_extendedTSCSet(par_extendedTSCSet)
{
}

PDU__RRM__DTM__AssignmentCommand__NW__MS::PDU__RRM__DTM__AssignmentCommand__NW__MS(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.cS__PowerCommand().is_bound()) field_cS__PowerCommand = other_value.cS__PowerCommand();
else field_cS__PowerCommand.clean_up();
if (other_value.description__CS__Channel().is_bound()) field_description__CS__Channel = other_value.description__CS__Channel();
else field_description__CS__Channel.clean_up();
if (other_value.gPRS__BroadcastInformation().is_bound()) field_gPRS__BroadcastInformation = other_value.gPRS__BroadcastInformation();
else field_gPRS__BroadcastInformation.clean_up();
if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
else field_cellChannelDescr.clean_up();
if (other_value.channelMode().is_bound()) field_channelMode = other_value.channelMode();
else field_channelMode.clean_up();
if (other_value.frequencyList().is_bound()) field_frequencyList = other_value.frequencyList();
else field_frequencyList.clean_up();
if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
else field_mobileAllocation.clean_up();
if (other_value.descrUplinkPacketChannelAssignment().is_bound()) field_descrUplinkPacketChannelAssignment = other_value.descrUplinkPacketChannelAssignment();
else field_descrUplinkPacketChannelAssignment.clean_up();
if (other_value.descrDownlinkPacketChannelAssignment().is_bound()) field_descrDownlinkPacketChannelAssignment = other_value.descrDownlinkPacketChannelAssignment();
else field_descrDownlinkPacketChannelAssignment.clean_up();
if (other_value.multiRateConfiguration().is_bound()) field_multiRateConfiguration = other_value.multiRateConfiguration();
else field_multiRateConfiguration.clean_up();
if (other_value.cipherModeSetting().is_bound()) field_cipherModeSetting = other_value.cipherModeSetting();
else field_cipherModeSetting.clean_up();
if (other_value.mobileAllocationC2().is_bound()) field_mobileAllocationC2 = other_value.mobileAllocationC2();
else field_mobileAllocationC2.clean_up();
if (other_value.frequencyListC2().is_bound()) field_frequencyListC2 = other_value.frequencyListC2();
else field_frequencyListC2.clean_up();
if (other_value.descriptionDualCarrierPacketDownlinkAssignment().is_bound()) field_descriptionDualCarrierPacketDownlinkAssignment = other_value.descriptionDualCarrierPacketDownlinkAssignment();
else field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
if (other_value.channelDescriptionC2().is_bound()) field_channelDescriptionC2 = other_value.channelDescriptionC2();
else field_channelDescriptionC2.clean_up();
if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
else field_extendedTSCSet.clean_up();
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_cS__PowerCommand.clean_up();
field_description__CS__Channel.clean_up();
field_gPRS__BroadcastInformation.clean_up();
field_cellChannelDescr.clean_up();
field_channelMode.clean_up();
field_frequencyList.clean_up();
field_mobileAllocation.clean_up();
field_descrUplinkPacketChannelAssignment.clean_up();
field_descrDownlinkPacketChannelAssignment.clean_up();
field_multiRateConfiguration.clean_up();
field_cipherModeSetting.clean_up();
field_mobileAllocationC2.clean_up();
field_frequencyListC2.clean_up();
field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
field_channelDescriptionC2.clean_up();
field_extendedTSCSet.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__DTM__AssignmentCommand__NW__MS::get_descriptor() const { return &PDU__RRM__DTM__AssignmentCommand__NW__MS_descr_; }
PDU__RRM__DTM__AssignmentCommand__NW__MS& PDU__RRM__DTM__AssignmentCommand__NW__MS::operator=(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.cS__PowerCommand().is_bound()) field_cS__PowerCommand = other_value.cS__PowerCommand();
  else field_cS__PowerCommand.clean_up();
  if (other_value.description__CS__Channel().is_bound()) field_description__CS__Channel = other_value.description__CS__Channel();
  else field_description__CS__Channel.clean_up();
  if (other_value.gPRS__BroadcastInformation().is_bound()) field_gPRS__BroadcastInformation = other_value.gPRS__BroadcastInformation();
  else field_gPRS__BroadcastInformation.clean_up();
  if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
  else field_cellChannelDescr.clean_up();
  if (other_value.channelMode().is_bound()) field_channelMode = other_value.channelMode();
  else field_channelMode.clean_up();
  if (other_value.frequencyList().is_bound()) field_frequencyList = other_value.frequencyList();
  else field_frequencyList.clean_up();
  if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
  else field_mobileAllocation.clean_up();
  if (other_value.descrUplinkPacketChannelAssignment().is_bound()) field_descrUplinkPacketChannelAssignment = other_value.descrUplinkPacketChannelAssignment();
  else field_descrUplinkPacketChannelAssignment.clean_up();
  if (other_value.descrDownlinkPacketChannelAssignment().is_bound()) field_descrDownlinkPacketChannelAssignment = other_value.descrDownlinkPacketChannelAssignment();
  else field_descrDownlinkPacketChannelAssignment.clean_up();
  if (other_value.multiRateConfiguration().is_bound()) field_multiRateConfiguration = other_value.multiRateConfiguration();
  else field_multiRateConfiguration.clean_up();
  if (other_value.cipherModeSetting().is_bound()) field_cipherModeSetting = other_value.cipherModeSetting();
  else field_cipherModeSetting.clean_up();
  if (other_value.mobileAllocationC2().is_bound()) field_mobileAllocationC2 = other_value.mobileAllocationC2();
  else field_mobileAllocationC2.clean_up();
  if (other_value.frequencyListC2().is_bound()) field_frequencyListC2 = other_value.frequencyListC2();
  else field_frequencyListC2.clean_up();
  if (other_value.descriptionDualCarrierPacketDownlinkAssignment().is_bound()) field_descriptionDualCarrierPacketDownlinkAssignment = other_value.descriptionDualCarrierPacketDownlinkAssignment();
  else field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
  if (other_value.channelDescriptionC2().is_bound()) field_channelDescriptionC2 = other_value.channelDescriptionC2();
  else field_channelDescriptionC2.clean_up();
  if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
  else field_extendedTSCSet.clean_up();
}
return *this;
}

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS::operator==(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_cS__PowerCommand==other_value.field_cS__PowerCommand
  && field_description__CS__Channel==other_value.field_description__CS__Channel
  && field_gPRS__BroadcastInformation==other_value.field_gPRS__BroadcastInformation
  && field_cellChannelDescr==other_value.field_cellChannelDescr
  && field_channelMode==other_value.field_channelMode
  && field_frequencyList==other_value.field_frequencyList
  && field_mobileAllocation==other_value.field_mobileAllocation
  && field_descrUplinkPacketChannelAssignment==other_value.field_descrUplinkPacketChannelAssignment
  && field_descrDownlinkPacketChannelAssignment==other_value.field_descrDownlinkPacketChannelAssignment
  && field_multiRateConfiguration==other_value.field_multiRateConfiguration
  && field_cipherModeSetting==other_value.field_cipherModeSetting
  && field_mobileAllocationC2==other_value.field_mobileAllocationC2
  && field_frequencyListC2==other_value.field_frequencyListC2
  && field_descriptionDualCarrierPacketDownlinkAssignment==other_value.field_descriptionDualCarrierPacketDownlinkAssignment
  && field_channelDescriptionC2==other_value.field_channelDescriptionC2
  && field_extendedTSCSet==other_value.field_extendedTSCSet;
}

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_cS__PowerCommand.is_bound())
  || (field_description__CS__Channel.is_bound())
  || (field_gPRS__BroadcastInformation.is_bound())
  || (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_bound())
  || (OPTIONAL_OMIT == field_channelMode.get_selection() || field_channelMode.is_bound())
  || (OPTIONAL_OMIT == field_frequencyList.get_selection() || field_frequencyList.is_bound())
  || (OPTIONAL_OMIT == field_mobileAllocation.get_selection() || field_mobileAllocation.is_bound())
  || (OPTIONAL_OMIT == field_descrUplinkPacketChannelAssignment.get_selection() || field_descrUplinkPacketChannelAssignment.is_bound())
  || (OPTIONAL_OMIT == field_descrDownlinkPacketChannelAssignment.get_selection() || field_descrDownlinkPacketChannelAssignment.is_bound())
  || (OPTIONAL_OMIT == field_multiRateConfiguration.get_selection() || field_multiRateConfiguration.is_bound())
  || (OPTIONAL_OMIT == field_cipherModeSetting.get_selection() || field_cipherModeSetting.is_bound())
  || (OPTIONAL_OMIT == field_mobileAllocationC2.get_selection() || field_mobileAllocationC2.is_bound())
  || (OPTIONAL_OMIT == field_frequencyListC2.get_selection() || field_frequencyListC2.is_bound())
  || (OPTIONAL_OMIT == field_descriptionDualCarrierPacketDownlinkAssignment.get_selection() || field_descriptionDualCarrierPacketDownlinkAssignment.is_bound())
  || (OPTIONAL_OMIT == field_channelDescriptionC2.get_selection() || field_channelDescriptionC2.is_bound())
  || (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_bound());
}
boolean PDU__RRM__DTM__AssignmentCommand__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_cS__PowerCommand.is_value()
  && field_description__CS__Channel.is_value()
  && field_gPRS__BroadcastInformation.is_value()
  && (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_value())
  && (OPTIONAL_OMIT == field_channelMode.get_selection() || field_channelMode.is_value())
  && (OPTIONAL_OMIT == field_frequencyList.get_selection() || field_frequencyList.is_value())
  && (OPTIONAL_OMIT == field_mobileAllocation.get_selection() || field_mobileAllocation.is_value())
  && (OPTIONAL_OMIT == field_descrUplinkPacketChannelAssignment.get_selection() || field_descrUplinkPacketChannelAssignment.is_value())
  && (OPTIONAL_OMIT == field_descrDownlinkPacketChannelAssignment.get_selection() || field_descrDownlinkPacketChannelAssignment.is_value())
  && (OPTIONAL_OMIT == field_multiRateConfiguration.get_selection() || field_multiRateConfiguration.is_value())
  && (OPTIONAL_OMIT == field_cipherModeSetting.get_selection() || field_cipherModeSetting.is_value())
  && (OPTIONAL_OMIT == field_mobileAllocationC2.get_selection() || field_mobileAllocationC2.is_value())
  && (OPTIONAL_OMIT == field_frequencyListC2.get_selection() || field_frequencyListC2.is_value())
  && (OPTIONAL_OMIT == field_descriptionDualCarrierPacketDownlinkAssignment.get_selection() || field_descriptionDualCarrierPacketDownlinkAssignment.is_value())
  && (OPTIONAL_OMIT == field_channelDescriptionC2.get_selection() || field_channelDescriptionC2.is_value())
  && (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_value());
}
int PDU__RRM__DTM__AssignmentCommand__NW__MS::size_of() const
{
  int ret_val = 4;
  if (field_cellChannelDescr.ispresent()) ret_val++;
  if (field_channelMode.ispresent()) ret_val++;
  if (field_frequencyList.ispresent()) ret_val++;
  if (field_mobileAllocation.ispresent()) ret_val++;
  if (field_descrUplinkPacketChannelAssignment.ispresent()) ret_val++;
  if (field_descrDownlinkPacketChannelAssignment.ispresent()) ret_val++;
  if (field_multiRateConfiguration.ispresent()) ret_val++;
  if (field_cipherModeSetting.ispresent()) ret_val++;
  if (field_mobileAllocationC2.ispresent()) ret_val++;
  if (field_frequencyListC2.ispresent()) ret_val++;
  if (field_descriptionDualCarrierPacketDownlinkAssignment.ispresent()) ret_val++;
  if (field_channelDescriptionC2.ispresent()) ret_val++;
  if (field_extendedTSCSet.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__DTM__AssignmentCommand__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(", cS_PowerCommand := ");
field_cS__PowerCommand.log();
TTCN_Logger::log_event_str(", description_CS_Channel := ");
field_description__CS__Channel.log();
TTCN_Logger::log_event_str(", gPRS_BroadcastInformation := ");
field_gPRS__BroadcastInformation.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", channelMode := ");
field_channelMode.log();
TTCN_Logger::log_event_str(", frequencyList := ");
field_frequencyList.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
field_mobileAllocation.log();
TTCN_Logger::log_event_str(", descrUplinkPacketChannelAssignment := ");
field_descrUplinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(", descrDownlinkPacketChannelAssignment := ");
field_descrDownlinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(", multiRateConfiguration := ");
field_multiRateConfiguration.log();
TTCN_Logger::log_event_str(", cipherModeSetting := ");
field_cipherModeSetting.log();
TTCN_Logger::log_event_str(", mobileAllocationC2 := ");
field_mobileAllocationC2.log();
TTCN_Logger::log_event_str(", frequencyListC2 := ");
field_frequencyListC2.log();
TTCN_Logger::log_event_str(", descriptionDualCarrierPacketDownlinkAssignment := ");
field_descriptionDualCarrierPacketDownlinkAssignment.log();
TTCN_Logger::log_event_str(", channelDescriptionC2 := ");
field_channelDescriptionC2.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
field_extendedTSCSet.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cS__PowerCommand().is_bound()) cS__PowerCommand().set_implicit_omit();
if (description__CS__Channel().is_bound()) description__CS__Channel().set_implicit_omit();
if (gPRS__BroadcastInformation().is_bound()) gPRS__BroadcastInformation().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!channelMode().is_bound()) channelMode() = OMIT_VALUE;
else channelMode().set_implicit_omit();
if (!frequencyList().is_bound()) frequencyList() = OMIT_VALUE;
else frequencyList().set_implicit_omit();
if (!mobileAllocation().is_bound()) mobileAllocation() = OMIT_VALUE;
else mobileAllocation().set_implicit_omit();
if (!descrUplinkPacketChannelAssignment().is_bound()) descrUplinkPacketChannelAssignment() = OMIT_VALUE;
else descrUplinkPacketChannelAssignment().set_implicit_omit();
if (!descrDownlinkPacketChannelAssignment().is_bound()) descrDownlinkPacketChannelAssignment() = OMIT_VALUE;
else descrDownlinkPacketChannelAssignment().set_implicit_omit();
if (!multiRateConfiguration().is_bound()) multiRateConfiguration() = OMIT_VALUE;
else multiRateConfiguration().set_implicit_omit();
if (!cipherModeSetting().is_bound()) cipherModeSetting() = OMIT_VALUE;
else cipherModeSetting().set_implicit_omit();
if (!mobileAllocationC2().is_bound()) mobileAllocationC2() = OMIT_VALUE;
else mobileAllocationC2().set_implicit_omit();
if (!frequencyListC2().is_bound()) frequencyListC2() = OMIT_VALUE;
else frequencyListC2().set_implicit_omit();
if (!descriptionDualCarrierPacketDownlinkAssignment().is_bound()) descriptionDualCarrierPacketDownlinkAssignment() = OMIT_VALUE;
else descriptionDualCarrierPacketDownlinkAssignment().set_implicit_omit();
if (!channelDescriptionC2().is_bound()) channelDescriptionC2() = OMIT_VALUE;
else channelDescriptionC2().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__DTM__AssignmentCommand__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 (17<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS has 17 fields but 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) cS__PowerCommand().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) description__CS__Channel().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gPRS__BroadcastInformation().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescr().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) channelMode().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) frequencyList().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) descrUplinkPacketChannelAssignment().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) descrDownlinkPacketChannelAssignment().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) cipherModeSetting().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) mobileAllocationC2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) frequencyListC2().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) descriptionDualCarrierPacketDownlinkAssignment().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) channelDescriptionC2().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().set_param(*param.get_elem(16));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "cS_PowerCommand")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__PowerCommand().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "description_CS_Channel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          description__CS__Channel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gPRS_BroadcastInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPRS__BroadcastInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellChannelDescr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellChannelDescr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrUplinkPacketChannelAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrUplinkPacketChannelAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrDownlinkPacketChannelAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrDownlinkPacketChannelAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multiRateConfiguration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multiRateConfiguration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipherModeSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipherModeSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocationC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocationC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyListC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyListC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descriptionDualCarrierPacketDownlinkAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descriptionDualCarrierPacketDownlinkAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescriptionC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescriptionC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
  }
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_cS__PowerCommand.encode_text(text_buf);
field_description__CS__Channel.encode_text(text_buf);
field_gPRS__BroadcastInformation.encode_text(text_buf);
field_cellChannelDescr.encode_text(text_buf);
field_channelMode.encode_text(text_buf);
field_frequencyList.encode_text(text_buf);
field_mobileAllocation.encode_text(text_buf);
field_descrUplinkPacketChannelAssignment.encode_text(text_buf);
field_descrDownlinkPacketChannelAssignment.encode_text(text_buf);
field_multiRateConfiguration.encode_text(text_buf);
field_cipherModeSetting.encode_text(text_buf);
field_mobileAllocationC2.encode_text(text_buf);
field_frequencyListC2.encode_text(text_buf);
field_descriptionDualCarrierPacketDownlinkAssignment.encode_text(text_buf);
field_channelDescriptionC2.encode_text(text_buf);
field_extendedTSCSet.encode_text(text_buf);
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_cS__PowerCommand.decode_text(text_buf);
field_description__CS__Channel.decode_text(text_buf);
field_gPRS__BroadcastInformation.decode_text(text_buf);
field_cellChannelDescr.decode_text(text_buf);
field_channelMode.decode_text(text_buf);
field_frequencyList.decode_text(text_buf);
field_mobileAllocation.decode_text(text_buf);
field_descrUplinkPacketChannelAssignment.decode_text(text_buf);
field_descrDownlinkPacketChannelAssignment.decode_text(text_buf);
field_multiRateConfiguration.decode_text(text_buf);
field_cipherModeSetting.decode_text(text_buf);
field_mobileAllocationC2.decode_text(text_buf);
field_frequencyListC2.decode_text(text_buf);
field_descriptionDualCarrierPacketDownlinkAssignment.decode_text(text_buf);
field_channelDescriptionC2.decode_text(text_buf);
field_extendedTSCSet.decode_text(text_buf);
}

void PDU__RRM__DTM__AssignmentCommand__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__RRM__DTM__AssignmentCommand__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__RRM__DTM__AssignmentCommand__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, PowerCommand__V_descr_.raw->forceomit);
  decoded_field_length = field_cS__PowerCommand.RAW_decode(PowerCommand__V_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, ChannelDescription__V_descr_.raw->forceomit);
  decoded_field_length = field_description__CS__Channel.RAW_decode(ChannelDescription__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, GPRS__BroadcastInformation__LV_descr_.raw->forceomit);
  decoded_field_length = field_gPRS__BroadcastInformation.RAW_decode(GPRS__BroadcastInformation__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_cellChannelDescr = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, CellChannelDescription__TV_descr_.raw->forceomit);
  decoded_field_length = field_cellChannelDescr().RAW_decode(CellChannelDescription__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_cellChannelDescr = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cellChannelDescr.ispresent() || field_cellChannelDescr().elementIdentifier() !=  os_5){
  field_cellChannelDescr=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cellChannelDescr=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_channelMode = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_channelMode().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_channelMode = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelMode.ispresent() || field_channelMode().elementIdentifier() !=  os_7){
  field_channelMode=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelMode=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_frequencyList = 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::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyList().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyList = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyList.ispresent() || field_frequencyList().elementIdentifier() !=  os_35){
  field_frequencyList=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyList=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_mobileAllocation = 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::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocation().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_mobileAllocation = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileAllocation.ispresent() || field_mobileAllocation().elementIdentifier() !=  os_8){
  field_mobileAllocation=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileAllocation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_descrUplinkPacketChannelAssignment = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, RR__PacketUplinkAssignment__TLV_descr_.raw->forceomit);
  decoded_field_length = field_descrUplinkPacketChannelAssignment().RAW_decode(RR__PacketUplinkAssignment__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_descrUplinkPacketChannelAssignment = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descrUplinkPacketChannelAssignment.ispresent() || field_descrUplinkPacketChannelAssignment().elementIdentifier() !=  os_10){
  field_descrUplinkPacketChannelAssignment=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descrUplinkPacketChannelAssignment=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_descrDownlinkPacketChannelAssignment = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, RR__PacketDownlinkAssignment__TLV_descr_.raw->forceomit);
  decoded_field_length = field_descrDownlinkPacketChannelAssignment().RAW_decode(RR__PacketDownlinkAssignment__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_descrDownlinkPacketChannelAssignment = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descrDownlinkPacketChannelAssignment.ispresent() || field_descrDownlinkPacketChannelAssignment().elementIdentifier() !=  os_11){
  field_descrDownlinkPacketChannelAssignment=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descrDownlinkPacketChannelAssignment=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_multiRateConfiguration = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, MultiRateConfiguration__TLV_descr_.raw->forceomit);
  decoded_field_length = field_multiRateConfiguration().RAW_decode(MultiRateConfiguration__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_multiRateConfiguration = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_multiRateConfiguration.ispresent() || field_multiRateConfiguration().elementIdentifier() !=  os_12){
  field_multiRateConfiguration=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_multiRateConfiguration=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_cipherModeSetting = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, CipherModeSetting__TV_descr_.raw->forceomit);
  decoded_field_length = field_cipherModeSetting().RAW_decode(CipherModeSetting__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_cipherModeSetting = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cipherModeSetting.ispresent() || field_cipherModeSetting().elementIdentifier() !=  bs_1){
  field_cipherModeSetting=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cipherModeSetting=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_mobileAllocationC2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocationC2().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_mobileAllocationC2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileAllocationC2.ispresent() || field_mobileAllocationC2().elementIdentifier() !=  os_13){
  field_mobileAllocationC2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileAllocationC2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_frequencyListC2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyListC2().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyListC2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyListC2.ispresent() || field_frequencyListC2().elementIdentifier() !=  os_16){
  field_frequencyListC2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyListC2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_descriptionDualCarrierPacketDownlinkAssignment = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, RR__DualCarrierPacketDownlinkAssignment__TLV_descr_.raw->forceomit);
  decoded_field_length = field_descriptionDualCarrierPacketDownlinkAssignment().RAW_decode(RR__DualCarrierPacketDownlinkAssignment__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_descriptionDualCarrierPacketDownlinkAssignment = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descriptionDualCarrierPacketDownlinkAssignment.ispresent() || field_descriptionDualCarrierPacketDownlinkAssignment().elementIdentifier() !=  os_34){
  field_descriptionDualCarrierPacketDownlinkAssignment=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descriptionDualCarrierPacketDownlinkAssignment=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_channelDescriptionC2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, ChannelDescription3__TV_descr_.raw->forceomit);
  decoded_field_length = field_channelDescriptionC2().RAW_decode(ChannelDescription3__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_channelDescriptionC2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelDescriptionC2.ispresent() || field_channelDescriptionC2().elementIdentifier() !=  os_20){
  field_channelDescriptionC2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelDescriptionC2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_extendedTSCSet = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, ExtendedTSCSet__TV_descr_.raw->forceomit);
  decoded_field_length = field_extendedTSCSet().RAW_decode(ExtendedTSCSet__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_extendedTSCSet = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_extendedTSCSet.ispresent() || field_extendedTSCSet().elementIdentifier() !=  os_2){
  field_extendedTSCSet=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_extendedTSCSet=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__RRM__DTM__AssignmentCommand__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 = 17;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(17);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PowerCommand__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ChannelDescription__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GPRS__BroadcastInformation__LV_descr_.raw);
  if (field_cellChannelDescr.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, CellChannelDescription__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_channelMode.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_frequencyList.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_mobileAllocation.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_descrUplinkPacketChannelAssignment.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, RR__PacketUplinkAssignment__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_descrDownlinkPacketChannelAssignment.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, RR__PacketDownlinkAssignment__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_multiRateConfiguration.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, MultiRateConfiguration__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_cipherModeSetting.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, CipherModeSetting__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_mobileAllocationC2.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_frequencyListC2.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_descriptionDualCarrierPacketDownlinkAssignment.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, RR__DualCarrierPacketDownlinkAssignment__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_channelDescriptionC2.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, ChannelDescription3__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_extendedTSCSet.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, ExtendedTSCSet__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cS__PowerCommand.RAW_encode(PowerCommand__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_description__CS__Channel.RAW_encode(ChannelDescription__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_gPRS__BroadcastInformation.RAW_encode(GPRS__BroadcastInformation__LV_descr_, *myleaf.body.node.nodes[3]);
  if (field_cellChannelDescr.ispresent()) {
  encoded_length += field_cellChannelDescr().RAW_encode(CellChannelDescription__TV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_channelMode.ispresent()) {
  encoded_length += field_channelMode().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_frequencyList.ispresent()) {
  encoded_length += field_frequencyList().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_mobileAllocation.ispresent()) {
  encoded_length += field_mobileAllocation().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_descrUplinkPacketChannelAssignment.ispresent()) {
  encoded_length += field_descrUplinkPacketChannelAssignment().RAW_encode(RR__PacketUplinkAssignment__TLV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_descrDownlinkPacketChannelAssignment.ispresent()) {
  encoded_length += field_descrDownlinkPacketChannelAssignment().RAW_encode(RR__PacketDownlinkAssignment__TLV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_multiRateConfiguration.ispresent()) {
  encoded_length += field_multiRateConfiguration().RAW_encode(MultiRateConfiguration__TLV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_cipherModeSetting.ispresent()) {
  encoded_length += field_cipherModeSetting().RAW_encode(CipherModeSetting__TV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_mobileAllocationC2.ispresent()) {
  encoded_length += field_mobileAllocationC2().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_frequencyListC2.ispresent()) {
  encoded_length += field_frequencyListC2().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_descriptionDualCarrierPacketDownlinkAssignment.ispresent()) {
  encoded_length += field_descriptionDualCarrierPacketDownlinkAssignment().RAW_encode(RR__DualCarrierPacketDownlinkAssignment__TLV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_channelDescriptionC2.ispresent()) {
  encoded_length += field_channelDescriptionC2().RAW_encode(ChannelDescription3__TV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_extendedTSCSet.ispresent()) {
  encoded_length += field_extendedTSCSet().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_cellChannelDescr.ispresent() && (!field_cellChannelDescr.ispresent() || field_cellChannelDescr().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);
  }
  }
  if (field_channelMode.ispresent() && (!field_channelMode.ispresent() || field_channelMode().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[]={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_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_frequencyList.ispresent() && (!field_frequencyList.ispresent() || field_frequencyList().elementIdentifier() !=  os_35)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_35.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_mobileAllocation.ispresent() && (!field_mobileAllocation.ispresent() || field_mobileAllocation().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[]={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_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_descrUplinkPacketChannelAssignment.ispresent() && (!field_descrUplinkPacketChannelAssignment.ispresent() || field_descrUplinkPacketChannelAssignment().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[]={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_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_descrDownlinkPacketChannelAssignment.ispresent() && (!field_descrDownlinkPacketChannelAssignment.ispresent() || field_descrDownlinkPacketChannelAssignment().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[]={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_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);
  }
  }
  if (field_multiRateConfiguration.ispresent() && (!field_multiRateConfiguration.ispresent() || field_multiRateConfiguration().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[]={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_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);
  }
  }
  if (field_cipherModeSetting.ispresent() && (!field_cipherModeSetting.ispresent() || field_cipherModeSetting().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[]={11,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_mobileAllocationC2.ispresent() && (!field_mobileAllocationC2.ispresent() || field_mobileAllocationC2().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[]={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_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_frequencyListC2.ispresent() && (!field_frequencyListC2.ispresent() || field_frequencyListC2().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[]={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_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);
  }
  }
  if (field_descriptionDualCarrierPacketDownlinkAssignment.ispresent() && (!field_descriptionDualCarrierPacketDownlinkAssignment.ispresent() || field_descriptionDualCarrierPacketDownlinkAssignment().elementIdentifier() !=  os_34)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_34.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_channelDescriptionC2.ispresent() && (!field_channelDescriptionC2.ispresent() || field_channelDescriptionC2().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[]={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_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_extendedTSCSet.ispresent() && (!field_extendedTSCSet.ispresent() || field_extendedTSCSet().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[]={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_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__RRM__DTM__AssignmentCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
PowerCommand__V_template field_cS__PowerCommand;
ChannelDescription__V_template field_description__CS__Channel;
GPRS__BroadcastInformation__LV_template field_gPRS__BroadcastInformation;
CellChannelDescription__TV_template field_cellChannelDescr;
ChannelMode__TV_template field_channelMode;
MobileL3__CommonIE__Types::Type4__TLV_template field_frequencyList;
MobileL3__CommonIE__Types::Type4__TLV_template field_mobileAllocation;
RR__PacketUplinkAssignment__TLV_template field_descrUplinkPacketChannelAssignment;
RR__PacketDownlinkAssignment__TLV_template field_descrDownlinkPacketChannelAssignment;
MultiRateConfiguration__TLV_template field_multiRateConfiguration;
CipherModeSetting__TV_template field_cipherModeSetting;
MobileL3__CommonIE__Types::Type4__TLV_template field_mobileAllocationC2;
MobileL3__CommonIE__Types::Type4__TLV_template field_frequencyListC2;
RR__DualCarrierPacketDownlinkAssignment__TLV_template field_descriptionDualCarrierPacketDownlinkAssignment;
ChannelDescription3__TV_template field_channelDescriptionC2;
ExtendedTSCSet__TV_template field_extendedTSCSet;
};

void PDU__RRM__DTM__AssignmentCommand__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_cS__PowerCommand = ANY_VALUE;
single_value->field_description__CS__Channel = ANY_VALUE;
single_value->field_gPRS__BroadcastInformation = ANY_VALUE;
single_value->field_cellChannelDescr = ANY_OR_OMIT;
single_value->field_channelMode = ANY_OR_OMIT;
single_value->field_frequencyList = ANY_OR_OMIT;
single_value->field_mobileAllocation = ANY_OR_OMIT;
single_value->field_descrUplinkPacketChannelAssignment = ANY_OR_OMIT;
single_value->field_descrDownlinkPacketChannelAssignment = ANY_OR_OMIT;
single_value->field_multiRateConfiguration = ANY_OR_OMIT;
single_value->field_cipherModeSetting = ANY_OR_OMIT;
single_value->field_mobileAllocationC2 = ANY_OR_OMIT;
single_value->field_frequencyListC2 = ANY_OR_OMIT;
single_value->field_descriptionDualCarrierPacketDownlinkAssignment = ANY_OR_OMIT;
single_value->field_channelDescriptionC2 = ANY_OR_OMIT;
single_value->field_extendedTSCSet = ANY_OR_OMIT;
}
}
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::copy_value(const PDU__RRM__DTM__AssignmentCommand__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.cS__PowerCommand().is_bound()) {
  single_value->field_cS__PowerCommand = other_value.cS__PowerCommand();
} else {
  single_value->field_cS__PowerCommand.clean_up();
}
if (other_value.description__CS__Channel().is_bound()) {
  single_value->field_description__CS__Channel = other_value.description__CS__Channel();
} else {
  single_value->field_description__CS__Channel.clean_up();
}
if (other_value.gPRS__BroadcastInformation().is_bound()) {
  single_value->field_gPRS__BroadcastInformation = other_value.gPRS__BroadcastInformation();
} else {
  single_value->field_gPRS__BroadcastInformation.clean_up();
}
if (other_value.cellChannelDescr().is_bound()) {
  if (other_value.cellChannelDescr().ispresent()) single_value->field_cellChannelDescr = other_value.cellChannelDescr()();
  else single_value->field_cellChannelDescr = OMIT_VALUE;
} else {
  single_value->field_cellChannelDescr.clean_up();
}
if (other_value.channelMode().is_bound()) {
  if (other_value.channelMode().ispresent()) single_value->field_channelMode = other_value.channelMode()();
  else single_value->field_channelMode = OMIT_VALUE;
} else {
  single_value->field_channelMode.clean_up();
}
if (other_value.frequencyList().is_bound()) {
  if (other_value.frequencyList().ispresent()) single_value->field_frequencyList = other_value.frequencyList()();
  else single_value->field_frequencyList = OMIT_VALUE;
} else {
  single_value->field_frequencyList.clean_up();
}
if (other_value.mobileAllocation().is_bound()) {
  if (other_value.mobileAllocation().ispresent()) single_value->field_mobileAllocation = other_value.mobileAllocation()();
  else single_value->field_mobileAllocation = OMIT_VALUE;
} else {
  single_value->field_mobileAllocation.clean_up();
}
if (other_value.descrUplinkPacketChannelAssignment().is_bound()) {
  if (other_value.descrUplinkPacketChannelAssignment().ispresent()) single_value->field_descrUplinkPacketChannelAssignment = other_value.descrUplinkPacketChannelAssignment()();
  else single_value->field_descrUplinkPacketChannelAssignment = OMIT_VALUE;
} else {
  single_value->field_descrUplinkPacketChannelAssignment.clean_up();
}
if (other_value.descrDownlinkPacketChannelAssignment().is_bound()) {
  if (other_value.descrDownlinkPacketChannelAssignment().ispresent()) single_value->field_descrDownlinkPacketChannelAssignment = other_value.descrDownlinkPacketChannelAssignment()();
  else single_value->field_descrDownlinkPacketChannelAssignment = OMIT_VALUE;
} else {
  single_value->field_descrDownlinkPacketChannelAssignment.clean_up();
}
if (other_value.multiRateConfiguration().is_bound()) {
  if (other_value.multiRateConfiguration().ispresent()) single_value->field_multiRateConfiguration = other_value.multiRateConfiguration()();
  else single_value->field_multiRateConfiguration = OMIT_VALUE;
} else {
  single_value->field_multiRateConfiguration.clean_up();
}
if (other_value.cipherModeSetting().is_bound()) {
  if (other_value.cipherModeSetting().ispresent()) single_value->field_cipherModeSetting = other_value.cipherModeSetting()();
  else single_value->field_cipherModeSetting = OMIT_VALUE;
} else {
  single_value->field_cipherModeSetting.clean_up();
}
if (other_value.mobileAllocationC2().is_bound()) {
  if (other_value.mobileAllocationC2().ispresent()) single_value->field_mobileAllocationC2 = other_value.mobileAllocationC2()();
  else single_value->field_mobileAllocationC2 = OMIT_VALUE;
} else {
  single_value->field_mobileAllocationC2.clean_up();
}
if (other_value.frequencyListC2().is_bound()) {
  if (other_value.frequencyListC2().ispresent()) single_value->field_frequencyListC2 = other_value.frequencyListC2()();
  else single_value->field_frequencyListC2 = OMIT_VALUE;
} else {
  single_value->field_frequencyListC2.clean_up();
}
if (other_value.descriptionDualCarrierPacketDownlinkAssignment().is_bound()) {
  if (other_value.descriptionDualCarrierPacketDownlinkAssignment().ispresent()) single_value->field_descriptionDualCarrierPacketDownlinkAssignment = other_value.descriptionDualCarrierPacketDownlinkAssignment()();
  else single_value->field_descriptionDualCarrierPacketDownlinkAssignment = OMIT_VALUE;
} else {
  single_value->field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
}
if (other_value.channelDescriptionC2().is_bound()) {
  if (other_value.channelDescriptionC2().ispresent()) single_value->field_channelDescriptionC2 = other_value.channelDescriptionC2()();
  else single_value->field_channelDescriptionC2 = OMIT_VALUE;
} else {
  single_value->field_channelDescriptionC2.clean_up();
}
if (other_value.extendedTSCSet().is_bound()) {
  if (other_value.extendedTSCSet().ispresent()) single_value->field_extendedTSCSet = other_value.extendedTSCSet()();
  else single_value->field_extendedTSCSet = OMIT_VALUE;
} else {
  single_value->field_extendedTSCSet.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::copy_template(const PDU__RRM__DTM__AssignmentCommand__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.cS__PowerCommand().get_selection()) {
single_value->field_cS__PowerCommand = other_value.cS__PowerCommand();
} else {
single_value->field_cS__PowerCommand.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.description__CS__Channel().get_selection()) {
single_value->field_description__CS__Channel = other_value.description__CS__Channel();
} else {
single_value->field_description__CS__Channel.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gPRS__BroadcastInformation().get_selection()) {
single_value->field_gPRS__BroadcastInformation = other_value.gPRS__BroadcastInformation();
} else {
single_value->field_gPRS__BroadcastInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellChannelDescr().get_selection()) {
single_value->field_cellChannelDescr = other_value.cellChannelDescr();
} else {
single_value->field_cellChannelDescr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelMode().get_selection()) {
single_value->field_channelMode = other_value.channelMode();
} else {
single_value->field_channelMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyList().get_selection()) {
single_value->field_frequencyList = other_value.frequencyList();
} else {
single_value->field_frequencyList.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocation().get_selection()) {
single_value->field_mobileAllocation = other_value.mobileAllocation();
} else {
single_value->field_mobileAllocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descrUplinkPacketChannelAssignment().get_selection()) {
single_value->field_descrUplinkPacketChannelAssignment = other_value.descrUplinkPacketChannelAssignment();
} else {
single_value->field_descrUplinkPacketChannelAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descrDownlinkPacketChannelAssignment().get_selection()) {
single_value->field_descrDownlinkPacketChannelAssignment = other_value.descrDownlinkPacketChannelAssignment();
} else {
single_value->field_descrDownlinkPacketChannelAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multiRateConfiguration().get_selection()) {
single_value->field_multiRateConfiguration = other_value.multiRateConfiguration();
} else {
single_value->field_multiRateConfiguration.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipherModeSetting().get_selection()) {
single_value->field_cipherModeSetting = other_value.cipherModeSetting();
} else {
single_value->field_cipherModeSetting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocationC2().get_selection()) {
single_value->field_mobileAllocationC2 = other_value.mobileAllocationC2();
} else {
single_value->field_mobileAllocationC2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyListC2().get_selection()) {
single_value->field_frequencyListC2 = other_value.frequencyListC2();
} else {
single_value->field_frequencyListC2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descriptionDualCarrierPacketDownlinkAssignment().get_selection()) {
single_value->field_descriptionDualCarrierPacketDownlinkAssignment = other_value.descriptionDualCarrierPacketDownlinkAssignment();
} else {
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelDescriptionC2().get_selection()) {
single_value->field_channelDescriptionC2 = other_value.channelDescriptionC2();
} else {
single_value->field_channelDescriptionC2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedTSCSet().get_selection()) {
single_value->field_extendedTSCSet = other_value.extendedTSCSet();
} else {
single_value->field_extendedTSCSet.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__RRM__DTM__AssignmentCommand__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__RRM__DTM__AssignmentCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__DTM__AssignmentCommand__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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::PDU__RRM__DTM__AssignmentCommand__NW__MS_template()
{
}

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

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::PDU__RRM__DTM__AssignmentCommand__NW__MS_template(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS_template::match(const PDU__RRM__DTM__AssignmentCommand__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.cS__PowerCommand().is_bound()) return FALSE;
if(!single_value->field_cS__PowerCommand.match(other_value.cS__PowerCommand(), legacy))return FALSE;
if(!other_value.description__CS__Channel().is_bound()) return FALSE;
if(!single_value->field_description__CS__Channel.match(other_value.description__CS__Channel(), legacy))return FALSE;
if(!other_value.gPRS__BroadcastInformation().is_bound()) return FALSE;
if(!single_value->field_gPRS__BroadcastInformation.match(other_value.gPRS__BroadcastInformation(), legacy))return FALSE;
if(!other_value.cellChannelDescr().is_bound()) return FALSE;
if((other_value.cellChannelDescr().ispresent() ? !single_value->field_cellChannelDescr.match((const CellChannelDescription__TV&)other_value.cellChannelDescr(), legacy) : !single_value->field_cellChannelDescr.match_omit(legacy)))return FALSE;
if(!other_value.channelMode().is_bound()) return FALSE;
if((other_value.channelMode().ispresent() ? !single_value->field_channelMode.match((const ChannelMode__TV&)other_value.channelMode(), legacy) : !single_value->field_channelMode.match_omit(legacy)))return FALSE;
if(!other_value.frequencyList().is_bound()) return FALSE;
if((other_value.frequencyList().ispresent() ? !single_value->field_frequencyList.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.frequencyList(), legacy) : !single_value->field_frequencyList.match_omit(legacy)))return FALSE;
if(!other_value.mobileAllocation().is_bound()) return FALSE;
if((other_value.mobileAllocation().ispresent() ? !single_value->field_mobileAllocation.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.mobileAllocation(), legacy) : !single_value->field_mobileAllocation.match_omit(legacy)))return FALSE;
if(!other_value.descrUplinkPacketChannelAssignment().is_bound()) return FALSE;
if((other_value.descrUplinkPacketChannelAssignment().ispresent() ? !single_value->field_descrUplinkPacketChannelAssignment.match((const RR__PacketUplinkAssignment__TLV&)other_value.descrUplinkPacketChannelAssignment(), legacy) : !single_value->field_descrUplinkPacketChannelAssignment.match_omit(legacy)))return FALSE;
if(!other_value.descrDownlinkPacketChannelAssignment().is_bound()) return FALSE;
if((other_value.descrDownlinkPacketChannelAssignment().ispresent() ? !single_value->field_descrDownlinkPacketChannelAssignment.match((const RR__PacketDownlinkAssignment__TLV&)other_value.descrDownlinkPacketChannelAssignment(), legacy) : !single_value->field_descrDownlinkPacketChannelAssignment.match_omit(legacy)))return FALSE;
if(!other_value.multiRateConfiguration().is_bound()) return FALSE;
if((other_value.multiRateConfiguration().ispresent() ? !single_value->field_multiRateConfiguration.match((const MultiRateConfiguration__TLV&)other_value.multiRateConfiguration(), legacy) : !single_value->field_multiRateConfiguration.match_omit(legacy)))return FALSE;
if(!other_value.cipherModeSetting().is_bound()) return FALSE;
if((other_value.cipherModeSetting().ispresent() ? !single_value->field_cipherModeSetting.match((const CipherModeSetting__TV&)other_value.cipherModeSetting(), legacy) : !single_value->field_cipherModeSetting.match_omit(legacy)))return FALSE;
if(!other_value.mobileAllocationC2().is_bound()) return FALSE;
if((other_value.mobileAllocationC2().ispresent() ? !single_value->field_mobileAllocationC2.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.mobileAllocationC2(), legacy) : !single_value->field_mobileAllocationC2.match_omit(legacy)))return FALSE;
if(!other_value.frequencyListC2().is_bound()) return FALSE;
if((other_value.frequencyListC2().ispresent() ? !single_value->field_frequencyListC2.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.frequencyListC2(), legacy) : !single_value->field_frequencyListC2.match_omit(legacy)))return FALSE;
if(!other_value.descriptionDualCarrierPacketDownlinkAssignment().is_bound()) return FALSE;
if((other_value.descriptionDualCarrierPacketDownlinkAssignment().ispresent() ? !single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match((const RR__DualCarrierPacketDownlinkAssignment__TLV&)other_value.descriptionDualCarrierPacketDownlinkAssignment(), legacy) : !single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match_omit(legacy)))return FALSE;
if(!other_value.channelDescriptionC2().is_bound()) return FALSE;
if((other_value.channelDescriptionC2().ispresent() ? !single_value->field_channelDescriptionC2.match((const ChannelDescription3__TV&)other_value.channelDescriptionC2(), legacy) : !single_value->field_channelDescriptionC2.match_omit(legacy)))return FALSE;
if(!other_value.extendedTSCSet().is_bound()) return FALSE;
if((other_value.extendedTSCSet().ispresent() ? !single_value->field_extendedTSCSet.match((const ExtendedTSCSet__TV&)other_value.extendedTSCSet(), legacy) : !single_value->field_extendedTSCSet.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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__DTM__AssignmentCommand__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_cS__PowerCommand.is_bound()
 || single_value->field_description__CS__Channel.is_bound()
 || single_value->field_gPRS__BroadcastInformation.is_bound()
 || (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_bound())
 || (single_value->field_channelMode.is_omit() || single_value->field_channelMode.is_bound())
 || (single_value->field_frequencyList.is_omit() || single_value->field_frequencyList.is_bound())
 || (single_value->field_mobileAllocation.is_omit() || single_value->field_mobileAllocation.is_bound())
 || (single_value->field_descrUplinkPacketChannelAssignment.is_omit() || single_value->field_descrUplinkPacketChannelAssignment.is_bound())
 || (single_value->field_descrDownlinkPacketChannelAssignment.is_omit() || single_value->field_descrDownlinkPacketChannelAssignment.is_bound())
 || (single_value->field_multiRateConfiguration.is_omit() || single_value->field_multiRateConfiguration.is_bound())
 || (single_value->field_cipherModeSetting.is_omit() || single_value->field_cipherModeSetting.is_bound())
 || (single_value->field_mobileAllocationC2.is_omit() || single_value->field_mobileAllocationC2.is_bound())
 || (single_value->field_frequencyListC2.is_omit() || single_value->field_frequencyListC2.is_bound())
 || (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_omit() || single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_bound())
 || (single_value->field_channelDescriptionC2.is_omit() || single_value->field_channelDescriptionC2.is_bound())
 || (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_bound());
}

boolean PDU__RRM__DTM__AssignmentCommand__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_cS__PowerCommand.is_value()
 && single_value->field_description__CS__Channel.is_value()
 && single_value->field_gPRS__BroadcastInformation.is_value()
 && (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_value())
 && (single_value->field_channelMode.is_omit() || single_value->field_channelMode.is_value())
 && (single_value->field_frequencyList.is_omit() || single_value->field_frequencyList.is_value())
 && (single_value->field_mobileAllocation.is_omit() || single_value->field_mobileAllocation.is_value())
 && (single_value->field_descrUplinkPacketChannelAssignment.is_omit() || single_value->field_descrUplinkPacketChannelAssignment.is_value())
 && (single_value->field_descrDownlinkPacketChannelAssignment.is_omit() || single_value->field_descrDownlinkPacketChannelAssignment.is_value())
 && (single_value->field_multiRateConfiguration.is_omit() || single_value->field_multiRateConfiguration.is_value())
 && (single_value->field_cipherModeSetting.is_omit() || single_value->field_cipherModeSetting.is_value())
 && (single_value->field_mobileAllocationC2.is_omit() || single_value->field_mobileAllocationC2.is_value())
 && (single_value->field_frequencyListC2.is_omit() || single_value->field_frequencyListC2.is_value())
 && (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_omit() || single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_value())
 && (single_value->field_channelDescriptionC2.is_omit() || single_value->field_channelDescriptionC2.is_value())
 && (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_value());
}

void PDU__RRM__DTM__AssignmentCommand__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__RRM__DTM__AssignmentCommand__NW__MS PDU__RRM__DTM__AssignmentCommand__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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
PDU__RRM__DTM__AssignmentCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_cS__PowerCommand.is_bound()) {
ret_val.cS__PowerCommand() = single_value->field_cS__PowerCommand.valueof();
}
if (single_value->field_description__CS__Channel.is_bound()) {
ret_val.description__CS__Channel() = single_value->field_description__CS__Channel.valueof();
}
if (single_value->field_gPRS__BroadcastInformation.is_bound()) {
ret_val.gPRS__BroadcastInformation() = single_value->field_gPRS__BroadcastInformation.valueof();
}
if (single_value->field_cellChannelDescr.is_omit()) ret_val.cellChannelDescr() = OMIT_VALUE;
else if (single_value->field_cellChannelDescr.is_bound()) {
ret_val.cellChannelDescr() = single_value->field_cellChannelDescr.valueof();
}
if (single_value->field_channelMode.is_omit()) ret_val.channelMode() = OMIT_VALUE;
else if (single_value->field_channelMode.is_bound()) {
ret_val.channelMode() = single_value->field_channelMode.valueof();
}
if (single_value->field_frequencyList.is_omit()) ret_val.frequencyList() = OMIT_VALUE;
else if (single_value->field_frequencyList.is_bound()) {
ret_val.frequencyList() = single_value->field_frequencyList.valueof();
}
if (single_value->field_mobileAllocation.is_omit()) ret_val.mobileAllocation() = OMIT_VALUE;
else if (single_value->field_mobileAllocation.is_bound()) {
ret_val.mobileAllocation() = single_value->field_mobileAllocation.valueof();
}
if (single_value->field_descrUplinkPacketChannelAssignment.is_omit()) ret_val.descrUplinkPacketChannelAssignment() = OMIT_VALUE;
else if (single_value->field_descrUplinkPacketChannelAssignment.is_bound()) {
ret_val.descrUplinkPacketChannelAssignment() = single_value->field_descrUplinkPacketChannelAssignment.valueof();
}
if (single_value->field_descrDownlinkPacketChannelAssignment.is_omit()) ret_val.descrDownlinkPacketChannelAssignment() = OMIT_VALUE;
else if (single_value->field_descrDownlinkPacketChannelAssignment.is_bound()) {
ret_val.descrDownlinkPacketChannelAssignment() = single_value->field_descrDownlinkPacketChannelAssignment.valueof();
}
if (single_value->field_multiRateConfiguration.is_omit()) ret_val.multiRateConfiguration() = OMIT_VALUE;
else if (single_value->field_multiRateConfiguration.is_bound()) {
ret_val.multiRateConfiguration() = single_value->field_multiRateConfiguration.valueof();
}
if (single_value->field_cipherModeSetting.is_omit()) ret_val.cipherModeSetting() = OMIT_VALUE;
else if (single_value->field_cipherModeSetting.is_bound()) {
ret_val.cipherModeSetting() = single_value->field_cipherModeSetting.valueof();
}
if (single_value->field_mobileAllocationC2.is_omit()) ret_val.mobileAllocationC2() = OMIT_VALUE;
else if (single_value->field_mobileAllocationC2.is_bound()) {
ret_val.mobileAllocationC2() = single_value->field_mobileAllocationC2.valueof();
}
if (single_value->field_frequencyListC2.is_omit()) ret_val.frequencyListC2() = OMIT_VALUE;
else if (single_value->field_frequencyListC2.is_bound()) {
ret_val.frequencyListC2() = single_value->field_frequencyListC2.valueof();
}
if (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_omit()) ret_val.descriptionDualCarrierPacketDownlinkAssignment() = OMIT_VALUE;
else if (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_bound()) {
ret_val.descriptionDualCarrierPacketDownlinkAssignment() = single_value->field_descriptionDualCarrierPacketDownlinkAssignment.valueof();
}
if (single_value->field_channelDescriptionC2.is_omit()) ret_val.channelDescriptionC2() = OMIT_VALUE;
else if (single_value->field_channelDescriptionC2.is_bound()) {
ret_val.channelDescriptionC2() = single_value->field_channelDescriptionC2.valueof();
}
if (single_value->field_extendedTSCSet.is_omit()) ret_val.extendedTSCSet() = OMIT_VALUE;
else if (single_value->field_extendedTSCSet.is_bound()) {
ret_val.extendedTSCSet() = single_value->field_extendedTSCSet.valueof();
}
return ret_val;
}

void PDU__RRM__DTM__AssignmentCommand__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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template[list_length];
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template& PDU__RRM__DTM__AssignmentCommand__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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return value_list.list_value[list_index];
}

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

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

PowerCommand__V_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cS__PowerCommand()
{
set_specific();
return single_value->field_cS__PowerCommand;
}

const PowerCommand__V_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cS__PowerCommand() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cS_PowerCommand of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_cS__PowerCommand;
}

ChannelDescription__V_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::description__CS__Channel()
{
set_specific();
return single_value->field_description__CS__Channel;
}

const ChannelDescription__V_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::description__CS__Channel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field description_CS_Channel of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_description__CS__Channel;
}

GPRS__BroadcastInformation__LV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::gPRS__BroadcastInformation()
{
set_specific();
return single_value->field_gPRS__BroadcastInformation;
}

const GPRS__BroadcastInformation__LV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::gPRS__BroadcastInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gPRS_BroadcastInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_gPRS__BroadcastInformation;
}

CellChannelDescription__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cellChannelDescr()
{
set_specific();
return single_value->field_cellChannelDescr;
}

const CellChannelDescription__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cellChannelDescr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellChannelDescr of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_cellChannelDescr;
}

ChannelMode__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::channelMode()
{
set_specific();
return single_value->field_channelMode;
}

const ChannelMode__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::channelMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelMode of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_channelMode;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::frequencyList()
{
set_specific();
return single_value->field_frequencyList;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::frequencyList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyList of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_frequencyList;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::mobileAllocation()
{
set_specific();
return single_value->field_mobileAllocation;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::mobileAllocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_mobileAllocation;
}

RR__PacketUplinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descrUplinkPacketChannelAssignment()
{
set_specific();
return single_value->field_descrUplinkPacketChannelAssignment;
}

const RR__PacketUplinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descrUplinkPacketChannelAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrUplinkPacketChannelAssignment of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_descrUplinkPacketChannelAssignment;
}

RR__PacketDownlinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descrDownlinkPacketChannelAssignment()
{
set_specific();
return single_value->field_descrDownlinkPacketChannelAssignment;
}

const RR__PacketDownlinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descrDownlinkPacketChannelAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrDownlinkPacketChannelAssignment of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_descrDownlinkPacketChannelAssignment;
}

MultiRateConfiguration__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::multiRateConfiguration()
{
set_specific();
return single_value->field_multiRateConfiguration;
}

const MultiRateConfiguration__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::multiRateConfiguration() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multiRateConfiguration of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_multiRateConfiguration;
}

CipherModeSetting__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cipherModeSetting()
{
set_specific();
return single_value->field_cipherModeSetting;
}

const CipherModeSetting__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cipherModeSetting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipherModeSetting of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_cipherModeSetting;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::mobileAllocationC2()
{
set_specific();
return single_value->field_mobileAllocationC2;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::mobileAllocationC2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocationC2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_mobileAllocationC2;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::frequencyListC2()
{
set_specific();
return single_value->field_frequencyListC2;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::frequencyListC2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyListC2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_frequencyListC2;
}

RR__DualCarrierPacketDownlinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descriptionDualCarrierPacketDownlinkAssignment()
{
set_specific();
return single_value->field_descriptionDualCarrierPacketDownlinkAssignment;
}

const RR__DualCarrierPacketDownlinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descriptionDualCarrierPacketDownlinkAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descriptionDualCarrierPacketDownlinkAssignment of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_descriptionDualCarrierPacketDownlinkAssignment;
}

ChannelDescription3__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::channelDescriptionC2()
{
set_specific();
return single_value->field_channelDescriptionC2;
}

const ChannelDescription3__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::channelDescriptionC2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelDescriptionC2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_channelDescriptionC2;
}

ExtendedTSCSet__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::extendedTSCSet()
{
set_specific();
return single_value->field_extendedTSCSet;
}

const ExtendedTSCSet__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::extendedTSCSet() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedTSCSet of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_extendedTSCSet;
}

int PDU__RRM__DTM__AssignmentCommand__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 4;
      if (single_value->field_cellChannelDescr.is_present()) ret_val++;
      if (single_value->field_channelMode.is_present()) ret_val++;
      if (single_value->field_frequencyList.is_present()) ret_val++;
      if (single_value->field_mobileAllocation.is_present()) ret_val++;
      if (single_value->field_descrUplinkPacketChannelAssignment.is_present()) ret_val++;
      if (single_value->field_descrDownlinkPacketChannelAssignment.is_present()) ret_val++;
      if (single_value->field_multiRateConfiguration.is_present()) ret_val++;
      if (single_value->field_cipherModeSetting.is_present()) ret_val++;
      if (single_value->field_mobileAllocationC2.is_present()) ret_val++;
      if (single_value->field_frequencyListC2.is_present()) ret_val++;
      if (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_present()) ret_val++;
      if (single_value->field_channelDescriptionC2.is_present()) ret_val++;
      if (single_value->field_extendedTSCSet.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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
  }
  return 0;
}

void PDU__RRM__DTM__AssignmentCommand__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(", cS_PowerCommand := ");
single_value->field_cS__PowerCommand.log();
TTCN_Logger::log_event_str(", description_CS_Channel := ");
single_value->field_description__CS__Channel.log();
TTCN_Logger::log_event_str(", gPRS_BroadcastInformation := ");
single_value->field_gPRS__BroadcastInformation.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
single_value->field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", channelMode := ");
single_value->field_channelMode.log();
TTCN_Logger::log_event_str(", frequencyList := ");
single_value->field_frequencyList.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
single_value->field_mobileAllocation.log();
TTCN_Logger::log_event_str(", descrUplinkPacketChannelAssignment := ");
single_value->field_descrUplinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(", descrDownlinkPacketChannelAssignment := ");
single_value->field_descrDownlinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(", multiRateConfiguration := ");
single_value->field_multiRateConfiguration.log();
TTCN_Logger::log_event_str(", cipherModeSetting := ");
single_value->field_cipherModeSetting.log();
TTCN_Logger::log_event_str(", mobileAllocationC2 := ");
single_value->field_mobileAllocationC2.log();
TTCN_Logger::log_event_str(", frequencyListC2 := ");
single_value->field_frequencyListC2.log();
TTCN_Logger::log_event_str(", descriptionDualCarrierPacketDownlinkAssignment := ");
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log();
TTCN_Logger::log_event_str(", channelDescriptionC2 := ");
single_value->field_channelDescriptionC2.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
single_value->field_extendedTSCSet.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__RRM__DTM__AssignmentCommand__NW__MS_template::log_match(const PDU__RRM__DTM__AssignmentCommand__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_cS__PowerCommand.match(match_value.cS__PowerCommand(), legacy)){
TTCN_Logger::log_logmatch_info(".cS_PowerCommand");
single_value->field_cS__PowerCommand.log_match(match_value.cS__PowerCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_description__CS__Channel.match(match_value.description__CS__Channel(), legacy)){
TTCN_Logger::log_logmatch_info(".description_CS_Channel");
single_value->field_description__CS__Channel.log_match(match_value.description__CS__Channel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gPRS__BroadcastInformation.match(match_value.gPRS__BroadcastInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".gPRS_BroadcastInformation");
single_value->field_gPRS__BroadcastInformation.log_match(match_value.gPRS__BroadcastInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cellChannelDescr().ispresent()){
if(!single_value->field_cellChannelDescr.match(match_value.cellChannelDescr(), legacy)){
TTCN_Logger::log_logmatch_info(".cellChannelDescr");
single_value->field_cellChannelDescr.log_match(match_value.cellChannelDescr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellChannelDescr.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellChannelDescr := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellChannelDescr.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelMode().ispresent()){
if(!single_value->field_channelMode.match(match_value.channelMode(), legacy)){
TTCN_Logger::log_logmatch_info(".channelMode");
single_value->field_channelMode.log_match(match_value.channelMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelMode.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelMode := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelMode.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyList().ispresent()){
if(!single_value->field_frequencyList.match(match_value.frequencyList(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyList");
single_value->field_frequencyList.log_match(match_value.frequencyList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyList.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileAllocation().ispresent()){
if(!single_value->field_mobileAllocation.match(match_value.mobileAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocation");
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileAllocation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileAllocation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileAllocation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descrUplinkPacketChannelAssignment().ispresent()){
if(!single_value->field_descrUplinkPacketChannelAssignment.match(match_value.descrUplinkPacketChannelAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".descrUplinkPacketChannelAssignment");
single_value->field_descrUplinkPacketChannelAssignment.log_match(match_value.descrUplinkPacketChannelAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descrUplinkPacketChannelAssignment.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descrUplinkPacketChannelAssignment := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descrUplinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descrDownlinkPacketChannelAssignment().ispresent()){
if(!single_value->field_descrDownlinkPacketChannelAssignment.match(match_value.descrDownlinkPacketChannelAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".descrDownlinkPacketChannelAssignment");
single_value->field_descrDownlinkPacketChannelAssignment.log_match(match_value.descrDownlinkPacketChannelAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descrDownlinkPacketChannelAssignment.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descrDownlinkPacketChannelAssignment := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descrDownlinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.multiRateConfiguration().ispresent()){
if(!single_value->field_multiRateConfiguration.match(match_value.multiRateConfiguration(), legacy)){
TTCN_Logger::log_logmatch_info(".multiRateConfiguration");
single_value->field_multiRateConfiguration.log_match(match_value.multiRateConfiguration(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_multiRateConfiguration.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".multiRateConfiguration := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_multiRateConfiguration.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cipherModeSetting().ispresent()){
if(!single_value->field_cipherModeSetting.match(match_value.cipherModeSetting(), legacy)){
TTCN_Logger::log_logmatch_info(".cipherModeSetting");
single_value->field_cipherModeSetting.log_match(match_value.cipherModeSetting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cipherModeSetting.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cipherModeSetting := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cipherModeSetting.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileAllocationC2().ispresent()){
if(!single_value->field_mobileAllocationC2.match(match_value.mobileAllocationC2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocationC2");
single_value->field_mobileAllocationC2.log_match(match_value.mobileAllocationC2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileAllocationC2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileAllocationC2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileAllocationC2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyListC2().ispresent()){
if(!single_value->field_frequencyListC2.match(match_value.frequencyListC2(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyListC2");
single_value->field_frequencyListC2.log_match(match_value.frequencyListC2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyListC2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyListC2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyListC2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descriptionDualCarrierPacketDownlinkAssignment().ispresent()){
if(!single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match(match_value.descriptionDualCarrierPacketDownlinkAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".descriptionDualCarrierPacketDownlinkAssignment");
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log_match(match_value.descriptionDualCarrierPacketDownlinkAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descriptionDualCarrierPacketDownlinkAssignment := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelDescriptionC2().ispresent()){
if(!single_value->field_channelDescriptionC2.match(match_value.channelDescriptionC2(), legacy)){
TTCN_Logger::log_logmatch_info(".channelDescriptionC2");
single_value->field_channelDescriptionC2.log_match(match_value.channelDescriptionC2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelDescriptionC2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelDescriptionC2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelDescriptionC2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedTSCSet().ispresent()){
if(!single_value->field_extendedTSCSet.match(match_value.extendedTSCSet(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedTSCSet");
single_value->field_extendedTSCSet.log_match(match_value.extendedTSCSet(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedTSCSet.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedTSCSet := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedTSCSet.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(", cS_PowerCommand := ");
single_value->field_cS__PowerCommand.log_match(match_value.cS__PowerCommand(), legacy);
TTCN_Logger::log_event_str(", description_CS_Channel := ");
single_value->field_description__CS__Channel.log_match(match_value.description__CS__Channel(), legacy);
TTCN_Logger::log_event_str(", gPRS_BroadcastInformation := ");
single_value->field_gPRS__BroadcastInformation.log_match(match_value.gPRS__BroadcastInformation(), legacy);
TTCN_Logger::log_event_str(", cellChannelDescr := ");
if (match_value.cellChannelDescr().ispresent()) {
single_value->field_cellChannelDescr.log_match(match_value.cellChannelDescr(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellChannelDescr.log();
if (single_value->field_cellChannelDescr.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelMode := ");
if (match_value.channelMode().ispresent()) {
single_value->field_channelMode.log_match(match_value.channelMode(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelMode.log();
if (single_value->field_channelMode.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyList := ");
if (match_value.frequencyList().ispresent()) {
single_value->field_frequencyList.log_match(match_value.frequencyList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyList.log();
if (single_value->field_frequencyList.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileAllocation := ");
if (match_value.mobileAllocation().ispresent()) {
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileAllocation.log();
if (single_value->field_mobileAllocation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descrUplinkPacketChannelAssignment := ");
if (match_value.descrUplinkPacketChannelAssignment().ispresent()) {
single_value->field_descrUplinkPacketChannelAssignment.log_match(match_value.descrUplinkPacketChannelAssignment(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descrUplinkPacketChannelAssignment.log();
if (single_value->field_descrUplinkPacketChannelAssignment.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descrDownlinkPacketChannelAssignment := ");
if (match_value.descrDownlinkPacketChannelAssignment().ispresent()) {
single_value->field_descrDownlinkPacketChannelAssignment.log_match(match_value.descrDownlinkPacketChannelAssignment(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descrDownlinkPacketChannelAssignment.log();
if (single_value->field_descrDownlinkPacketChannelAssignment.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", multiRateConfiguration := ");
if (match_value.multiRateConfiguration().ispresent()) {
single_value->field_multiRateConfiguration.log_match(match_value.multiRateConfiguration(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_multiRateConfiguration.log();
if (single_value->field_multiRateConfiguration.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cipherModeSetting := ");
if (match_value.cipherModeSetting().ispresent()) {
single_value->field_cipherModeSetting.log_match(match_value.cipherModeSetting(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cipherModeSetting.log();
if (single_value->field_cipherModeSetting.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileAllocationC2 := ");
if (match_value.mobileAllocationC2().ispresent()) {
single_value->field_mobileAllocationC2.log_match(match_value.mobileAllocationC2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileAllocationC2.log();
if (single_value->field_mobileAllocationC2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyListC2 := ");
if (match_value.frequencyListC2().ispresent()) {
single_value->field_frequencyListC2.log_match(match_value.frequencyListC2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyListC2.log();
if (single_value->field_frequencyListC2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descriptionDualCarrierPacketDownlinkAssignment := ");
if (match_value.descriptionDualCarrierPacketDownlinkAssignment().ispresent()) {
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log_match(match_value.descriptionDualCarrierPacketDownlinkAssignment(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log();
if (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelDescriptionC2 := ");
if (match_value.channelDescriptionC2().ispresent()) {
single_value->field_channelDescriptionC2.log_match(match_value.channelDescriptionC2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelDescriptionC2.log();
if (single_value->field_channelDescriptionC2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedTSCSet := ");
if (match_value.extendedTSCSet().ispresent()) {
single_value->field_extendedTSCSet.log_match(match_value.extendedTSCSet(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedTSCSet.log();
if (single_value->field_extendedTSCSet.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__RRM__DTM__AssignmentCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cS__PowerCommand().is_bound()) cS__PowerCommand().set_implicit_omit();
if (description__CS__Channel().is_bound()) description__CS__Channel().set_implicit_omit();
if (gPRS__BroadcastInformation().is_bound()) gPRS__BroadcastInformation().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!channelMode().is_bound()) channelMode() = OMIT_VALUE;
else channelMode().set_implicit_omit();
if (!frequencyList().is_bound()) frequencyList() = OMIT_VALUE;
else frequencyList().set_implicit_omit();
if (!mobileAllocation().is_bound()) mobileAllocation() = OMIT_VALUE;
else mobileAllocation().set_implicit_omit();
if (!descrUplinkPacketChannelAssignment().is_bound()) descrUplinkPacketChannelAssignment() = OMIT_VALUE;
else descrUplinkPacketChannelAssignment().set_implicit_omit();
if (!descrDownlinkPacketChannelAssignment().is_bound()) descrDownlinkPacketChannelAssignment() = OMIT_VALUE;
else descrDownlinkPacketChannelAssignment().set_implicit_omit();
if (!multiRateConfiguration().is_bound()) multiRateConfiguration() = OMIT_VALUE;
else multiRateConfiguration().set_implicit_omit();
if (!cipherModeSetting().is_bound()) cipherModeSetting() = OMIT_VALUE;
else cipherModeSetting().set_implicit_omit();
if (!mobileAllocationC2().is_bound()) mobileAllocationC2() = OMIT_VALUE;
else mobileAllocationC2().set_implicit_omit();
if (!frequencyListC2().is_bound()) frequencyListC2() = OMIT_VALUE;
else frequencyListC2().set_implicit_omit();
if (!descriptionDualCarrierPacketDownlinkAssignment().is_bound()) descriptionDualCarrierPacketDownlinkAssignment() = OMIT_VALUE;
else descriptionDualCarrierPacketDownlinkAssignment().set_implicit_omit();
if (!channelDescriptionC2().is_bound()) channelDescriptionC2() = OMIT_VALUE;
else channelDescriptionC2().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__DTM__AssignmentCommand__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_cS__PowerCommand.encode_text(text_buf);
single_value->field_description__CS__Channel.encode_text(text_buf);
single_value->field_gPRS__BroadcastInformation.encode_text(text_buf);
single_value->field_cellChannelDescr.encode_text(text_buf);
single_value->field_channelMode.encode_text(text_buf);
single_value->field_frequencyList.encode_text(text_buf);
single_value->field_mobileAllocation.encode_text(text_buf);
single_value->field_descrUplinkPacketChannelAssignment.encode_text(text_buf);
single_value->field_descrDownlinkPacketChannelAssignment.encode_text(text_buf);
single_value->field_multiRateConfiguration.encode_text(text_buf);
single_value->field_cipherModeSetting.encode_text(text_buf);
single_value->field_mobileAllocationC2.encode_text(text_buf);
single_value->field_frequencyListC2.encode_text(text_buf);
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.encode_text(text_buf);
single_value->field_channelDescriptionC2.encode_text(text_buf);
single_value->field_extendedTSCSet.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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
}
}

void PDU__RRM__DTM__AssignmentCommand__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_cS__PowerCommand.decode_text(text_buf);
single_value->field_description__CS__Channel.decode_text(text_buf);
single_value->field_gPRS__BroadcastInformation.decode_text(text_buf);
single_value->field_cellChannelDescr.decode_text(text_buf);
single_value->field_channelMode.decode_text(text_buf);
single_value->field_frequencyList.decode_text(text_buf);
single_value->field_mobileAllocation.decode_text(text_buf);
single_value->field_descrUplinkPacketChannelAssignment.decode_text(text_buf);
single_value->field_descrDownlinkPacketChannelAssignment.decode_text(text_buf);
single_value->field_multiRateConfiguration.decode_text(text_buf);
single_value->field_cipherModeSetting.decode_text(text_buf);
single_value->field_mobileAllocationC2.decode_text(text_buf);
single_value->field_frequencyListC2.decode_text(text_buf);
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.decode_text(text_buf);
single_value->field_channelDescriptionC2.decode_text(text_buf);
single_value->field_extendedTSCSet.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__RRM__DTM__AssignmentCommand__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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
}
}

void PDU__RRM__DTM__AssignmentCommand__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__RRM__DTM__AssignmentCommand__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 (17<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS has 17 fields but 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) cS__PowerCommand().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) description__CS__Channel().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gPRS__BroadcastInformation().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescr().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) channelMode().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) frequencyList().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) descrUplinkPacketChannelAssignment().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) descrDownlinkPacketChannelAssignment().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) cipherModeSetting().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) mobileAllocationC2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) frequencyListC2().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) descriptionDualCarrierPacketDownlinkAssignment().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) channelDescriptionC2().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().set_param(*param.get_elem(16));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "cS_PowerCommand")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__PowerCommand().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "description_CS_Channel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          description__CS__Channel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gPRS_BroadcastInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPRS__BroadcastInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellChannelDescr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellChannelDescr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrUplinkPacketChannelAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrUplinkPacketChannelAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrDownlinkPacketChannelAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrDownlinkPacketChannelAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multiRateConfiguration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multiRateConfiguration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipherModeSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipherModeSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocationC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocationC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyListC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyListC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descriptionDualCarrierPacketDownlinkAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descriptionDualCarrierPacketDownlinkAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescriptionC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescriptionC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__DTM__AssignmentCommand__NW__MS_template* precondition = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__DTM__AssignmentCommand__NW__MS_template* implied_template = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__DTM__AssignmentCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__DTM__AssignmentCommand__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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_cS__PowerCommand.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_description__CS__Channel.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_gPRS__BroadcastInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_cellChannelDescr.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_channelMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_frequencyList.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_mobileAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_descrUplinkPacketChannelAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_descrDownlinkPacketChannelAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_multiRateConfiguration.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_cipherModeSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_mobileAllocationC2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_frequencyListC2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_channelDescriptionC2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_extendedTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_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_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
}

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

boolean PDU__RRM__DTM__AssignmentCommand__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__RRM__DTM__AssignmentFailure__MS__NW::PDU__RRM__DTM__AssignmentFailure__MS__NW()
{
}

PDU__RRM__DTM__AssignmentFailure__MS__NW::PDU__RRM__DTM__AssignmentFailure__MS__NW(const BITSTRING& par_messageType,
    const RR__Cause__V& par_rR__Cause)
  :   field_messageType(par_messageType),
  field_rR__Cause(par_rR__Cause)
{
}

PDU__RRM__DTM__AssignmentFailure__MS__NW::PDU__RRM__DTM__AssignmentFailure__MS__NW(const PDU__RRM__DTM__AssignmentFailure__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.rR__Cause().is_bound()) field_rR__Cause = other_value.rR__Cause();
else field_rR__Cause.clean_up();
}

void PDU__RRM__DTM__AssignmentFailure__MS__NW::clean_up()
{
field_messageType.clean_up();
field_rR__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__DTM__AssignmentFailure__MS__NW::get_descriptor() const { return &PDU__RRM__DTM__AssignmentFailure__MS__NW_descr_; }
PDU__RRM__DTM__AssignmentFailure__MS__NW& PDU__RRM__DTM__AssignmentFailure__MS__NW::operator=(const PDU__RRM__DTM__AssignmentFailure__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.rR__Cause().is_bound()) field_rR__Cause = other_value.rR__Cause();
  else field_rR__Cause.clean_up();
}
return *this;
}

boolean PDU__RRM__DTM__AssignmentFailure__MS__NW::operator==(const PDU__RRM__DTM__AssignmentFailure__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rR__Cause==other_value.field_rR__Cause;
}

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

void PDU__RRM__DTM__AssignmentFailure__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rR__Cause().is_bound()) rR__Cause().set_implicit_omit();
}

void PDU__RRM__DTM__AssignmentFailure__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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW 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) rR__Cause().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(), "rR_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rR__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW");
  }
}

void PDU__RRM__DTM__AssignmentFailure__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_rR__Cause.encode_text(text_buf);
}

void PDU__RRM__DTM__AssignmentFailure__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_rR__Cause.decode_text(text_buf);
}

void PDU__RRM__DTM__AssignmentFailure__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__RRM__DTM__AssignmentFailure__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__RRM__DTM__AssignmentFailure__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, RR__Cause__V_descr_.raw->forceomit);
  decoded_field_length = field_rR__Cause.RAW_decode(RR__Cause__V_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__RRM__DTM__AssignmentFailure__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 = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RR__Cause__V_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rR__Cause.RAW_encode(RR__Cause__V_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__DTM__AssignmentFailure__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
RR__Cause__V_template field_rR__Cause;
};

void PDU__RRM__DTM__AssignmentFailure__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_rR__Cause = ANY_VALUE;
}
}
}

void PDU__RRM__DTM__AssignmentFailure__MS__NW_template::copy_value(const PDU__RRM__DTM__AssignmentFailure__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.rR__Cause().is_bound()) {
  single_value->field_rR__Cause = other_value.rR__Cause();
} else {
  single_value->field_rR__Cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__DTM__AssignmentFailure__MS__NW_template::copy_template(const PDU__RRM__DTM__AssignmentFailure__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.rR__Cause().get_selection()) {
single_value->field_rR__Cause = other_value.rR__Cause();
} else {
single_value->field_rR__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__RRM__DTM__AssignmentFailure__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__RRM__DTM__AssignmentFailure__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__DTM__AssignmentFailure__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__DTM__AssignmentFailure__MS__NW_template::PDU__RRM__DTM__AssignmentFailure__MS__NW_template()
{
}

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

PDU__RRM__DTM__AssignmentFailure__MS__NW_template::PDU__RRM__DTM__AssignmentFailure__MS__NW_template(const PDU__RRM__DTM__AssignmentFailure__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__DTM__AssignmentFailure__MS__NW_template::match(const PDU__RRM__DTM__AssignmentFailure__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.rR__Cause().is_bound()) return FALSE;
if(!single_value->field_rR__Cause.match(other_value.rR__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__DTM__AssignmentFailure__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_rR__Cause.is_bound();
}

boolean PDU__RRM__DTM__AssignmentFailure__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_rR__Cause.is_value();
}

void PDU__RRM__DTM__AssignmentFailure__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__RRM__DTM__AssignmentFailure__MS__NW PDU__RRM__DTM__AssignmentFailure__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
PDU__RRM__DTM__AssignmentFailure__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_rR__Cause.is_bound()) {
ret_val.rR__Cause() = single_value->field_rR__Cause.valueof();
}
return ret_val;
}

void PDU__RRM__DTM__AssignmentFailure__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__DTM__AssignmentFailure__MS__NW_template[list_length];
}

PDU__RRM__DTM__AssignmentFailure__MS__NW_template& PDU__RRM__DTM__AssignmentFailure__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
return value_list.list_value[list_index];
}

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

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

RR__Cause__V_template& PDU__RRM__DTM__AssignmentFailure__MS__NW_template::rR__Cause()
{
set_specific();
return single_value->field_rR__Cause;
}

const RR__Cause__V_template& PDU__RRM__DTM__AssignmentFailure__MS__NW_template::rR__Cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rR_Cause of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
return single_value->field_rR__Cause;
}

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

void PDU__RRM__DTM__AssignmentFailure__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(", rR_Cause := ");
single_value->field_rR__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__RRM__DTM__AssignmentFailure__MS__NW_template::log_match(const PDU__RRM__DTM__AssignmentFailure__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_rR__Cause.match(match_value.rR__Cause(), legacy)){
TTCN_Logger::log_logmatch_info(".rR_Cause");
single_value->field_rR__Cause.log_match(match_value.rR__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(", rR_Cause := ");
single_value->field_rR__Cause.log_match(match_value.rR__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__RRM__DTM__AssignmentFailure__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rR__Cause().is_bound()) rR__Cause().set_implicit_omit();
}

void PDU__RRM__DTM__AssignmentFailure__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_rR__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
}
}

void PDU__RRM__DTM__AssignmentFailure__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_rR__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__RRM__DTM__AssignmentFailure__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW.");
}
}

void PDU__RRM__DTM__AssignmentFailure__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__RRM__DTM__AssignmentFailure__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 (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW 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) rR__Cause().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(), "rR_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rR__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__DTM__AssignmentFailure__MS__NW_template* precondition = new PDU__RRM__DTM__AssignmentFailure__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__DTM__AssignmentFailure__MS__NW_template* implied_template = new PDU__RRM__DTM__AssignmentFailure__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__DTM__AssignmentFailure__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__DTM__AssignmentFailure__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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW");
single_value->field_rR__Cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentFailure_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_RRM_Types.PDU_RRM_DTM_AssignmentFailure_MS_NW");
}

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

boolean PDU__RRM__DTM__AssignmentFailure__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__RRM__DTM__Information__NW__MS::PDU__RRM__DTM__Information__NW__MS()
{
}

PDU__RRM__DTM__Information__NW__MS::PDU__RRM__DTM__Information__NW__MS(const BITSTRING& par_messageType,
    const MobileL3__GMM__SM__Types::RoutingAreaIdentificationV& par_routingAreaIdentification,
    const DTM__InformationDetails__LV& par_dTM__InformationDetails)
  :   field_messageType(par_messageType),
  field_routingAreaIdentification(par_routingAreaIdentification),
  field_dTM__InformationDetails(par_dTM__InformationDetails)
{
}

PDU__RRM__DTM__Information__NW__MS::PDU__RRM__DTM__Information__NW__MS(const PDU__RRM__DTM__Information__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
else field_routingAreaIdentification.clean_up();
if (other_value.dTM__InformationDetails().is_bound()) field_dTM__InformationDetails = other_value.dTM__InformationDetails();
else field_dTM__InformationDetails.clean_up();
}

void PDU__RRM__DTM__Information__NW__MS::clean_up()
{
field_messageType.clean_up();
field_routingAreaIdentification.clean_up();
field_dTM__InformationDetails.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__DTM__Information__NW__MS::get_descriptor() const { return &PDU__RRM__DTM__Information__NW__MS_descr_; }
PDU__RRM__DTM__Information__NW__MS& PDU__RRM__DTM__Information__NW__MS::operator=(const PDU__RRM__DTM__Information__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
  else field_routingAreaIdentification.clean_up();
  if (other_value.dTM__InformationDetails().is_bound()) field_dTM__InformationDetails = other_value.dTM__InformationDetails();
  else field_dTM__InformationDetails.clean_up();
}
return *this;
}

boolean PDU__RRM__DTM__Information__NW__MS::operator==(const PDU__RRM__DTM__Information__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_routingAreaIdentification==other_value.field_routingAreaIdentification
  && field_dTM__InformationDetails==other_value.field_dTM__InformationDetails;
}

boolean PDU__RRM__DTM__Information__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_routingAreaIdentification.is_bound())
  || (field_dTM__InformationDetails.is_bound());
}
boolean PDU__RRM__DTM__Information__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_routingAreaIdentification.is_value()
  && field_dTM__InformationDetails.is_value();
}
void PDU__RRM__DTM__Information__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(", routingAreaIdentification := ");
field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", dTM_InformationDetails := ");
field_dTM__InformationDetails.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__DTM__Information__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (dTM__InformationDetails().is_bound()) dTM__InformationDetails().set_implicit_omit();
}

void PDU__RRM__DTM__Information__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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dTM__InformationDetails().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(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTM_InformationDetails")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTM__InformationDetails().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS");
  }
}

void PDU__RRM__DTM__Information__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_routingAreaIdentification.encode_text(text_buf);
field_dTM__InformationDetails.encode_text(text_buf);
}

void PDU__RRM__DTM__Information__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_routingAreaIdentification.decode_text(text_buf);
field_dTM__InformationDetails.decode_text(text_buf);
}

void PDU__RRM__DTM__Information__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__RRM__DTM__Information__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__RRM__DTM__Information__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaIdentification.RAW_decode(MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_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, DTM__InformationDetails__LV_descr_.raw->forceomit);
  decoded_field_length = field_dTM__InformationDetails.RAW_decode(DTM__InformationDetails__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__RRM__DTM__Information__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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DTM__InformationDetails__LV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_routingAreaIdentification.RAW_encode(MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_dTM__InformationDetails.RAW_encode(DTM__InformationDetails__LV_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__DTM__Information__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_template field_routingAreaIdentification;
DTM__InformationDetails__LV_template field_dTM__InformationDetails;
};

void PDU__RRM__DTM__Information__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_routingAreaIdentification = ANY_VALUE;
single_value->field_dTM__InformationDetails = ANY_VALUE;
}
}
}

void PDU__RRM__DTM__Information__NW__MS_template::copy_value(const PDU__RRM__DTM__Information__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.routingAreaIdentification().is_bound()) {
  single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
  single_value->field_routingAreaIdentification.clean_up();
}
if (other_value.dTM__InformationDetails().is_bound()) {
  single_value->field_dTM__InformationDetails = other_value.dTM__InformationDetails();
} else {
  single_value->field_dTM__InformationDetails.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__DTM__Information__NW__MS_template::copy_template(const PDU__RRM__DTM__Information__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.routingAreaIdentification().get_selection()) {
single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
single_value->field_routingAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dTM__InformationDetails().get_selection()) {
single_value->field_dTM__InformationDetails = other_value.dTM__InformationDetails();
} else {
single_value->field_dTM__InformationDetails.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__RRM__DTM__Information__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__RRM__DTM__Information__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__DTM__Information__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_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__DTM__Information__NW__MS_template::PDU__RRM__DTM__Information__NW__MS_template()
{
}

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

PDU__RRM__DTM__Information__NW__MS_template::PDU__RRM__DTM__Information__NW__MS_template(const PDU__RRM__DTM__Information__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__DTM__Information__NW__MS_template::match(const PDU__RRM__DTM__Information__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.routingAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_routingAreaIdentification.match(other_value.routingAreaIdentification(), legacy))return FALSE;
if(!other_value.dTM__InformationDetails().is_bound()) return FALSE;
if(!single_value->field_dTM__InformationDetails.match(other_value.dTM__InformationDetails(), 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_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__DTM__Information__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_routingAreaIdentification.is_bound()
 || single_value->field_dTM__InformationDetails.is_bound();
}

boolean PDU__RRM__DTM__Information__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_routingAreaIdentification.is_value()
 && single_value->field_dTM__InformationDetails.is_value();
}

void PDU__RRM__DTM__Information__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__RRM__DTM__Information__NW__MS PDU__RRM__DTM__Information__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_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
PDU__RRM__DTM__Information__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_routingAreaIdentification.is_bound()) {
ret_val.routingAreaIdentification() = single_value->field_routingAreaIdentification.valueof();
}
if (single_value->field_dTM__InformationDetails.is_bound()) {
ret_val.dTM__InformationDetails() = single_value->field_dTM__InformationDetails.valueof();
}
return ret_val;
}

void PDU__RRM__DTM__Information__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_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__DTM__Information__NW__MS_template[list_length];
}

PDU__RRM__DTM__Information__NW__MS_template& PDU__RRM__DTM__Information__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_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
return value_list.list_value[list_index];
}

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

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

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

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

DTM__InformationDetails__LV_template& PDU__RRM__DTM__Information__NW__MS_template::dTM__InformationDetails()
{
set_specific();
return single_value->field_dTM__InformationDetails;
}

const DTM__InformationDetails__LV_template& PDU__RRM__DTM__Information__NW__MS_template::dTM__InformationDetails() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTM_InformationDetails of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
return single_value->field_dTM__InformationDetails;
}

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

void PDU__RRM__DTM__Information__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(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", dTM_InformationDetails := ");
single_value->field_dTM__InformationDetails.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__RRM__DTM__Information__NW__MS_template::log_match(const PDU__RRM__DTM__Information__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_routingAreaIdentification.match(match_value.routingAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaIdentification");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dTM__InformationDetails.match(match_value.dTM__InformationDetails(), legacy)){
TTCN_Logger::log_logmatch_info(".dTM_InformationDetails");
single_value->field_dTM__InformationDetails.log_match(match_value.dTM__InformationDetails(), 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(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", dTM_InformationDetails := ");
single_value->field_dTM__InformationDetails.log_match(match_value.dTM__InformationDetails(), 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__RRM__DTM__Information__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (dTM__InformationDetails().is_bound()) dTM__InformationDetails().set_implicit_omit();
}

void PDU__RRM__DTM__Information__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_routingAreaIdentification.encode_text(text_buf);
single_value->field_dTM__InformationDetails.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_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
}
}

void PDU__RRM__DTM__Information__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_routingAreaIdentification.decode_text(text_buf);
single_value->field_dTM__InformationDetails.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__RRM__DTM__Information__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_RRM_Types.PDU_RRM_DTM_Information_NW_MS.");
}
}

void PDU__RRM__DTM__Information__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__RRM__DTM__Information__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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dTM__InformationDetails().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(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTM_InformationDetails")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTM__InformationDetails().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__DTM__Information__NW__MS_template* precondition = new PDU__RRM__DTM__Information__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__DTM__Information__NW__MS_template* implied_template = new PDU__RRM__DTM__Information__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__DTM__Information__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__DTM__Information__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_RRM_Types.PDU_RRM_DTM_Information_NW_MS");
single_value->field_routingAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_Information_NW_MS");
single_value->field_dTM__InformationDetails.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_Information_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_RRM_Types.PDU_RRM_DTM_Information_NW_MS");
}

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

boolean PDU__RRM__DTM__Information__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__RRM__DTM__Reject__NW__MS::PDU__RRM__DTM__Reject__NW__MS()
{
}

PDU__RRM__DTM__Reject__NW__MS::PDU__RRM__DTM__Reject__NW__MS(const BITSTRING& par_messageType,
    const WaitIndication__V& par_waitIndication)
  :   field_messageType(par_messageType),
  field_waitIndication(par_waitIndication)
{
}

PDU__RRM__DTM__Reject__NW__MS::PDU__RRM__DTM__Reject__NW__MS(const PDU__RRM__DTM__Reject__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.waitIndication().is_bound()) field_waitIndication = other_value.waitIndication();
else field_waitIndication.clean_up();
}

void PDU__RRM__DTM__Reject__NW__MS::clean_up()
{
field_messageType.clean_up();
field_waitIndication.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__DTM__Reject__NW__MS::get_descriptor() const { return &PDU__RRM__DTM__Reject__NW__MS_descr_; }
PDU__RRM__DTM__Reject__NW__MS& PDU__RRM__DTM__Reject__NW__MS::operator=(const PDU__RRM__DTM__Reject__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.waitIndication().is_bound()) field_waitIndication = other_value.waitIndication();
  else field_waitIndication.clean_up();
}
return *this;
}

boolean PDU__RRM__DTM__Reject__NW__MS::operator==(const PDU__RRM__DTM__Reject__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_waitIndication==other_value.field_waitIndication;
}

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

void PDU__RRM__DTM__Reject__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (waitIndication().is_bound()) waitIndication().set_implicit_omit();
}

void PDU__RRM__DTM__Reject__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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS 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) waitIndication().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(), "waitIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS");
  }
}

void PDU__RRM__DTM__Reject__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_waitIndication.encode_text(text_buf);
}

void PDU__RRM__DTM__Reject__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_waitIndication.decode_text(text_buf);
}

void PDU__RRM__DTM__Reject__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__RRM__DTM__Reject__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__RRM__DTM__Reject__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, WaitIndication__V_descr_.raw->forceomit);
  decoded_field_length = field_waitIndication.RAW_decode(WaitIndication__V_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__RRM__DTM__Reject__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 = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, WaitIndication__V_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_waitIndication.RAW_encode(WaitIndication__V_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__DTM__Reject__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
WaitIndication__V_template field_waitIndication;
};

void PDU__RRM__DTM__Reject__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_waitIndication = ANY_VALUE;
}
}
}

void PDU__RRM__DTM__Reject__NW__MS_template::copy_value(const PDU__RRM__DTM__Reject__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.waitIndication().is_bound()) {
  single_value->field_waitIndication = other_value.waitIndication();
} else {
  single_value->field_waitIndication.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__DTM__Reject__NW__MS_template::copy_template(const PDU__RRM__DTM__Reject__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.waitIndication().get_selection()) {
single_value->field_waitIndication = other_value.waitIndication();
} else {
single_value->field_waitIndication.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__RRM__DTM__Reject__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__RRM__DTM__Reject__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__DTM__Reject__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_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__DTM__Reject__NW__MS_template::PDU__RRM__DTM__Reject__NW__MS_template()
{
}

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

PDU__RRM__DTM__Reject__NW__MS_template::PDU__RRM__DTM__Reject__NW__MS_template(const PDU__RRM__DTM__Reject__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__DTM__Reject__NW__MS_template::match(const PDU__RRM__DTM__Reject__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.waitIndication().is_bound()) return FALSE;
if(!single_value->field_waitIndication.match(other_value.waitIndication(), 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_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__DTM__Reject__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_waitIndication.is_bound();
}

boolean PDU__RRM__DTM__Reject__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_waitIndication.is_value();
}

void PDU__RRM__DTM__Reject__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__RRM__DTM__Reject__NW__MS PDU__RRM__DTM__Reject__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_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
PDU__RRM__DTM__Reject__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_waitIndication.is_bound()) {
ret_val.waitIndication() = single_value->field_waitIndication.valueof();
}
return ret_val;
}

void PDU__RRM__DTM__Reject__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_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__DTM__Reject__NW__MS_template[list_length];
}

PDU__RRM__DTM__Reject__NW__MS_template& PDU__RRM__DTM__Reject__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_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
return value_list.list_value[list_index];
}

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

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

WaitIndication__V_template& PDU__RRM__DTM__Reject__NW__MS_template::waitIndication()
{
set_specific();
return single_value->field_waitIndication;
}

const WaitIndication__V_template& PDU__RRM__DTM__Reject__NW__MS_template::waitIndication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field waitIndication of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
return single_value->field_waitIndication;
}

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

void PDU__RRM__DTM__Reject__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(", waitIndication := ");
single_value->field_waitIndication.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__RRM__DTM__Reject__NW__MS_template::log_match(const PDU__RRM__DTM__Reject__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_waitIndication.match(match_value.waitIndication(), legacy)){
TTCN_Logger::log_logmatch_info(".waitIndication");
single_value->field_waitIndication.log_match(match_value.waitIndication(), 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(", waitIndication := ");
single_value->field_waitIndication.log_match(match_value.waitIndication(), 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__RRM__DTM__Reject__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (waitIndication().is_bound()) waitIndication().set_implicit_omit();
}

void PDU__RRM__DTM__Reject__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_waitIndication.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_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
}
}

void PDU__RRM__DTM__Reject__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_waitIndication.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__RRM__DTM__Reject__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_RRM_Types.PDU_RRM_DTM_Reject_NW_MS.");
}
}

void PDU__RRM__DTM__Reject__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__RRM__DTM__Reject__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 (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS 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) waitIndication().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(), "waitIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__DTM__Reject__NW__MS_template* precondition = new PDU__RRM__DTM__Reject__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__DTM__Reject__NW__MS_template* implied_template = new PDU__RRM__DTM__Reject__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__DTM__Reject__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_DTM_Reject_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__DTM__Reject__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_RRM_Types.PDU_RRM_DTM_Reject_NW_MS");
single_value->field_waitIndication.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_Reject_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_RRM_Types.PDU_RRM_DTM_Reject_NW_MS");
}

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

boolean PDU__RRM__DTM__Reject__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__RRM__DTM__Request__MS__NW::PDU__RRM__DTM__Request__MS__NW()
{
}

PDU__RRM__DTM__Request__MS__NW::PDU__RRM__DTM__Request__MS__NW(const BITSTRING& par_messageType,
    const OCTETSTRING& par_tLLI,
    const ChannelRequestDescription2__LV& par_channelRequestDescription2)
  :   field_messageType(par_messageType),
  field_tLLI(par_tLLI),
  field_channelRequestDescription2(par_channelRequestDescription2)
{
}

PDU__RRM__DTM__Request__MS__NW::PDU__RRM__DTM__Request__MS__NW(const PDU__RRM__DTM__Request__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.channelRequestDescription2().is_bound()) field_channelRequestDescription2 = other_value.channelRequestDescription2();
else field_channelRequestDescription2.clean_up();
}

void PDU__RRM__DTM__Request__MS__NW::clean_up()
{
field_messageType.clean_up();
field_tLLI.clean_up();
field_channelRequestDescription2.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__DTM__Request__MS__NW::get_descriptor() const { return &PDU__RRM__DTM__Request__MS__NW_descr_; }
PDU__RRM__DTM__Request__MS__NW& PDU__RRM__DTM__Request__MS__NW::operator=(const PDU__RRM__DTM__Request__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.channelRequestDescription2().is_bound()) field_channelRequestDescription2 = other_value.channelRequestDescription2();
  else field_channelRequestDescription2.clean_up();
}
return *this;
}

boolean PDU__RRM__DTM__Request__MS__NW::operator==(const PDU__RRM__DTM__Request__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_tLLI==other_value.field_tLLI
  && field_channelRequestDescription2==other_value.field_channelRequestDescription2;
}

boolean PDU__RRM__DTM__Request__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_tLLI.is_bound())
  || (field_channelRequestDescription2.is_bound());
}
boolean PDU__RRM__DTM__Request__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_tLLI.is_value()
  && field_channelRequestDescription2.is_value();
}
void PDU__RRM__DTM__Request__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(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", channelRequestDescription2 := ");
field_channelRequestDescription2.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__DTM__Request__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (channelRequestDescription2().is_bound()) channelRequestDescription2().set_implicit_omit();
}

void PDU__RRM__DTM__Request__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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW 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) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelRequestDescription2().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(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelRequestDescription2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelRequestDescription2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW");
  }
}

void PDU__RRM__DTM__Request__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_channelRequestDescription2.encode_text(text_buf);
}

void PDU__RRM__DTM__Request__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_channelRequestDescription2.decode_text(text_buf);
}

void PDU__RRM__DTM__Request__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__RRM__DTM__Request__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__RRM__DTM__Request__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(General__Types::OCT4_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, ChannelRequestDescription2__LV_descr_.raw->forceomit);
  decoded_field_length = field_channelRequestDescription2.RAW_decode(ChannelRequestDescription2__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__RRM__DTM__Request__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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ChannelRequestDescription2__LV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_channelRequestDescription2.RAW_encode(ChannelRequestDescription2__LV_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__DTM__Request__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
OCTETSTRING_template field_tLLI;
ChannelRequestDescription2__LV_template field_channelRequestDescription2;
};

void PDU__RRM__DTM__Request__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_tLLI = ANY_VALUE;
single_value->field_channelRequestDescription2 = ANY_VALUE;
}
}
}

void PDU__RRM__DTM__Request__MS__NW_template::copy_value(const PDU__RRM__DTM__Request__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.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.channelRequestDescription2().is_bound()) {
  single_value->field_channelRequestDescription2 = other_value.channelRequestDescription2();
} else {
  single_value->field_channelRequestDescription2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__DTM__Request__MS__NW_template::copy_template(const PDU__RRM__DTM__Request__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.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelRequestDescription2().get_selection()) {
single_value->field_channelRequestDescription2 = other_value.channelRequestDescription2();
} else {
single_value->field_channelRequestDescription2.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__RRM__DTM__Request__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__RRM__DTM__Request__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__DTM__Request__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_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__DTM__Request__MS__NW_template::PDU__RRM__DTM__Request__MS__NW_template()
{
}

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

PDU__RRM__DTM__Request__MS__NW_template::PDU__RRM__DTM__Request__MS__NW_template(const PDU__RRM__DTM__Request__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__DTM__Request__MS__NW_template::match(const PDU__RRM__DTM__Request__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.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.channelRequestDescription2().is_bound()) return FALSE;
if(!single_value->field_channelRequestDescription2.match(other_value.channelRequestDescription2(), 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_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__DTM__Request__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_tLLI.is_bound()
 || single_value->field_channelRequestDescription2.is_bound();
}

boolean PDU__RRM__DTM__Request__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_tLLI.is_value()
 && single_value->field_channelRequestDescription2.is_value();
}

void PDU__RRM__DTM__Request__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__RRM__DTM__Request__MS__NW PDU__RRM__DTM__Request__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_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
PDU__RRM__DTM__Request__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_channelRequestDescription2.is_bound()) {
ret_val.channelRequestDescription2() = single_value->field_channelRequestDescription2.valueof();
}
return ret_val;
}

void PDU__RRM__DTM__Request__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_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__DTM__Request__MS__NW_template[list_length];
}

PDU__RRM__DTM__Request__MS__NW_template& PDU__RRM__DTM__Request__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_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& PDU__RRM__DTM__Request__MS__NW_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const OCTETSTRING_template& PDU__RRM__DTM__Request__MS__NW_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
return single_value->field_tLLI;
}

ChannelRequestDescription2__LV_template& PDU__RRM__DTM__Request__MS__NW_template::channelRequestDescription2()
{
set_specific();
return single_value->field_channelRequestDescription2;
}

const ChannelRequestDescription2__LV_template& PDU__RRM__DTM__Request__MS__NW_template::channelRequestDescription2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelRequestDescription2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
return single_value->field_channelRequestDescription2;
}

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

void PDU__RRM__DTM__Request__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(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", channelRequestDescription2 := ");
single_value->field_channelRequestDescription2.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__RRM__DTM__Request__MS__NW_template::log_match(const PDU__RRM__DTM__Request__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_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_channelRequestDescription2.match(match_value.channelRequestDescription2(), legacy)){
TTCN_Logger::log_logmatch_info(".channelRequestDescription2");
single_value->field_channelRequestDescription2.log_match(match_value.channelRequestDescription2(), 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(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", channelRequestDescription2 := ");
single_value->field_channelRequestDescription2.log_match(match_value.channelRequestDescription2(), 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__RRM__DTM__Request__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (channelRequestDescription2().is_bound()) channelRequestDescription2().set_implicit_omit();
}

void PDU__RRM__DTM__Request__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_tLLI.encode_text(text_buf);
single_value->field_channelRequestDescription2.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_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
}
}

void PDU__RRM__DTM__Request__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_tLLI.decode_text(text_buf);
single_value->field_channelRequestDescription2.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__RRM__DTM__Request__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_RRM_Types.PDU_RRM_DTM_Request_MS_NW.");
}
}

void PDU__RRM__DTM__Request__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__RRM__DTM__Request__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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW 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) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelRequestDescription2().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(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelRequestDescription2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelRequestDescription2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__DTM__Request__MS__NW_template* precondition = new PDU__RRM__DTM__Request__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__DTM__Request__MS__NW_template* implied_template = new PDU__RRM__DTM__Request__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__DTM__Request__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__DTM__Request__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_RRM_Types.PDU_RRM_DTM_Request_MS_NW");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_Request_MS_NW");
single_value->field_channelRequestDescription2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_Request_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_RRM_Types.PDU_RRM_DTM_Request_MS_NW");
}

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

boolean PDU__RRM__DTM__Request__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__RRM__Frequency__Redefinition__NW__MS::PDU__RRM__Frequency__Redefinition__NW__MS()
{
}

PDU__RRM__Frequency__Redefinition__NW__MS::PDU__RRM__Frequency__Redefinition__NW__MS(const BITSTRING& par_messageType,
    const ChannelDescription__V& par_channelDescription,
    const MobileL3__CommonIE__Types::Type4__LV& par_mobileAllocation,
    const StartingTime__V& par_startingTime,
    const OPTIONAL< CellChannelDescription__TV >& par_cellChannelDescr,
    const OPTIONAL< CarrierIndication__TV >& par_carrierIndication,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_mobileAllocationC2,
    const OPTIONAL< ChannelDescription3__TV >& par_channelDescriptionC2,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet)
  :   field_messageType(par_messageType),
  field_channelDescription(par_channelDescription),
  field_mobileAllocation(par_mobileAllocation),
  field_startingTime(par_startingTime),
  field_cellChannelDescr(par_cellChannelDescr),
  field_carrierIndication(par_carrierIndication),
  field_mobileAllocationC2(par_mobileAllocationC2),
  field_channelDescriptionC2(par_channelDescriptionC2),
  field_extendedTSCSet(par_extendedTSCSet)
{
}

PDU__RRM__Frequency__Redefinition__NW__MS::PDU__RRM__Frequency__Redefinition__NW__MS(const PDU__RRM__Frequency__Redefinition__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.channelDescription().is_bound()) field_channelDescription = other_value.channelDescription();
else field_channelDescription.clean_up();
if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
else field_mobileAllocation.clean_up();
if (other_value.startingTime().is_bound()) field_startingTime = other_value.startingTime();
else field_startingTime.clean_up();
if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
else field_cellChannelDescr.clean_up();
if (other_value.carrierIndication().is_bound()) field_carrierIndication = other_value.carrierIndication();
else field_carrierIndication.clean_up();
if (other_value.mobileAllocationC2().is_bound()) field_mobileAllocationC2 = other_value.mobileAllocationC2();
else field_mobileAllocationC2.clean_up();
if (other_value.channelDescriptionC2().is_bound()) field_channelDescriptionC2 = other_value.channelDescriptionC2();
else field_channelDescriptionC2.clean_up();
if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
else field_extendedTSCSet.clean_up();
}

void PDU__RRM__Frequency__Redefinition__NW__MS::clean_up()
{
field_messageType.clean_up();
field_channelDescription.clean_up();
field_mobileAllocation.clean_up();
field_startingTime.clean_up();
field_cellChannelDescr.clean_up();
field_carrierIndication.clean_up();
field_mobileAllocationC2.clean_up();
field_channelDescriptionC2.clean_up();
field_extendedTSCSet.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__Frequency__Redefinition__NW__MS::get_descriptor() const { return &PDU__RRM__Frequency__Redefinition__NW__MS_descr_; }
PDU__RRM__Frequency__Redefinition__NW__MS& PDU__RRM__Frequency__Redefinition__NW__MS::operator=(const PDU__RRM__Frequency__Redefinition__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.channelDescription().is_bound()) field_channelDescription = other_value.channelDescription();
  else field_channelDescription.clean_up();
  if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
  else field_mobileAllocation.clean_up();
  if (other_value.startingTime().is_bound()) field_startingTime = other_value.startingTime();
  else field_startingTime.clean_up();
  if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
  else field_cellChannelDescr.clean_up();
  if (other_value.carrierIndication().is_bound()) field_carrierIndication = other_value.carrierIndication();
  else field_carrierIndication.clean_up();
  if (other_value.mobileAllocationC2().is_bound()) field_mobileAllocationC2 = other_value.mobileAllocationC2();
  else field_mobileAllocationC2.clean_up();
  if (other_value.channelDescriptionC2().is_bound()) field_channelDescriptionC2 = other_value.channelDescriptionC2();
  else field_channelDescriptionC2.clean_up();
  if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
  else field_extendedTSCSet.clean_up();
}
return *this;
}

boolean PDU__RRM__Frequency__Redefinition__NW__MS::operator==(const PDU__RRM__Frequency__Redefinition__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_channelDescription==other_value.field_channelDescription
  && field_mobileAllocation==other_value.field_mobileAllocation
  && field_startingTime==other_value.field_startingTime
  && field_cellChannelDescr==other_value.field_cellChannelDescr
  && field_carrierIndication==other_value.field_carrierIndication
  && field_mobileAllocationC2==other_value.field_mobileAllocationC2
  && field_channelDescriptionC2==other_value.field_channelDescriptionC2
  && field_extendedTSCSet==other_value.field_extendedTSCSet;
}

boolean PDU__RRM__Frequency__Redefinition__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_channelDescription.is_bound())
  || (field_mobileAllocation.is_bound())
  || (field_startingTime.is_bound())
  || (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_bound())
  || (OPTIONAL_OMIT == field_carrierIndication.get_selection() || field_carrierIndication.is_bound())
  || (OPTIONAL_OMIT == field_mobileAllocationC2.get_selection() || field_mobileAllocationC2.is_bound())
  || (OPTIONAL_OMIT == field_channelDescriptionC2.get_selection() || field_channelDescriptionC2.is_bound())
  || (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_bound());
}
boolean PDU__RRM__Frequency__Redefinition__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_channelDescription.is_value()
  && field_mobileAllocation.is_value()
  && field_startingTime.is_value()
  && (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_value())
  && (OPTIONAL_OMIT == field_carrierIndication.get_selection() || field_carrierIndication.is_value())
  && (OPTIONAL_OMIT == field_mobileAllocationC2.get_selection() || field_mobileAllocationC2.is_value())
  && (OPTIONAL_OMIT == field_channelDescriptionC2.get_selection() || field_channelDescriptionC2.is_value())
  && (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_value());
}
int PDU__RRM__Frequency__Redefinition__NW__MS::size_of() const
{
  int ret_val = 4;
  if (field_cellChannelDescr.ispresent()) ret_val++;
  if (field_carrierIndication.ispresent()) ret_val++;
  if (field_mobileAllocationC2.ispresent()) ret_val++;
  if (field_channelDescriptionC2.ispresent()) ret_val++;
  if (field_extendedTSCSet.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__Frequency__Redefinition__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(", channelDescription := ");
field_channelDescription.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
field_mobileAllocation.log();
TTCN_Logger::log_event_str(", startingTime := ");
field_startingTime.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", carrierIndication := ");
field_carrierIndication.log();
TTCN_Logger::log_event_str(", mobileAllocationC2 := ");
field_mobileAllocationC2.log();
TTCN_Logger::log_event_str(", channelDescriptionC2 := ");
field_channelDescriptionC2.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
field_extendedTSCSet.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__Frequency__Redefinition__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (channelDescription().is_bound()) channelDescription().set_implicit_omit();
if (mobileAllocation().is_bound()) mobileAllocation().set_implicit_omit();
if (startingTime().is_bound()) startingTime().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!carrierIndication().is_bound()) carrierIndication() = OMIT_VALUE;
else carrierIndication().set_implicit_omit();
if (!mobileAllocationC2().is_bound()) mobileAllocationC2() = OMIT_VALUE;
else mobileAllocationC2().set_implicit_omit();
if (!channelDescriptionC2().is_bound()) channelDescriptionC2() = OMIT_VALUE;
else channelDescriptionC2().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__Frequency__Redefinition__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 (9<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS 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) channelDescription().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescr().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) carrierIndication().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mobileAllocationC2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) channelDescriptionC2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().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(), "channelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startingTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellChannelDescr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellChannelDescr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "carrierIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          carrierIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocationC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocationC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescriptionC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescriptionC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
  }
}

void PDU__RRM__Frequency__Redefinition__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_channelDescription.encode_text(text_buf);
field_mobileAllocation.encode_text(text_buf);
field_startingTime.encode_text(text_buf);
field_cellChannelDescr.encode_text(text_buf);
field_carrierIndication.encode_text(text_buf);
field_mobileAllocationC2.encode_text(text_buf);
field_channelDescriptionC2.encode_text(text_buf);
field_extendedTSCSet.encode_text(text_buf);
}

void PDU__RRM__Frequency__Redefinition__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_channelDescription.decode_text(text_buf);
field_mobileAllocation.decode_text(text_buf);
field_startingTime.decode_text(text_buf);
field_cellChannelDescr.decode_text(text_buf);
field_carrierIndication.decode_text(text_buf);
field_mobileAllocationC2.decode_text(text_buf);
field_channelDescriptionC2.decode_text(text_buf);
field_extendedTSCSet.decode_text(text_buf);
}

void PDU__RRM__Frequency__Redefinition__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__RRM__Frequency__Redefinition__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__RRM__Frequency__Redefinition__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, ChannelDescription__V_descr_.raw->forceomit);
  decoded_field_length = field_channelDescription.RAW_decode(ChannelDescription__V_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::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocation.RAW_decode(MobileL3__CommonIE__Types::Type4__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, StartingTime__V_descr_.raw->forceomit);
  decoded_field_length = field_startingTime.RAW_decode(StartingTime__V_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_cellChannelDescr = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, CellChannelDescription__TV_descr_.raw->forceomit);
  decoded_field_length = field_cellChannelDescr().RAW_decode(CellChannelDescription__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_cellChannelDescr = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cellChannelDescr.ispresent() || field_cellChannelDescr().elementIdentifier() !=  os_4){
  field_cellChannelDescr=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cellChannelDescr=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_carrierIndication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, CarrierIndication__TV_descr_.raw->forceomit);
  decoded_field_length = field_carrierIndication().RAW_decode(CarrierIndication__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_carrierIndication = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_carrierIndication.ispresent() || field_carrierIndication().elementIdentifier() !=  bs_1){
  field_carrierIndication=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_carrierIndication=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_mobileAllocationC2 = 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::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocationC2().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_mobileAllocationC2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileAllocationC2.ispresent() || field_mobileAllocationC2().elementIdentifier() !=  os_7){
  field_mobileAllocationC2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileAllocationC2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_channelDescriptionC2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, ChannelDescription3__TV_descr_.raw->forceomit);
  decoded_field_length = field_channelDescriptionC2().RAW_decode(ChannelDescription3__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_channelDescriptionC2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelDescriptionC2.ispresent() || field_channelDescriptionC2().elementIdentifier() !=  os_35){
  field_channelDescriptionC2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelDescriptionC2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_extendedTSCSet = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, ExtendedTSCSet__TV_descr_.raw->forceomit);
  decoded_field_length = field_extendedTSCSet().RAW_decode(ExtendedTSCSet__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_extendedTSCSet = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_extendedTSCSet.ispresent() || field_extendedTSCSet().elementIdentifier() !=  os_2){
  field_extendedTSCSet=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_extendedTSCSet=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__RRM__Frequency__Redefinition__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 = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ChannelDescription__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, StartingTime__V_descr_.raw);
  if (field_cellChannelDescr.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, CellChannelDescription__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_carrierIndication.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, CarrierIndication__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_mobileAllocationC2.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_channelDescriptionC2.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, ChannelDescription3__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_extendedTSCSet.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, ExtendedTSCSet__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_channelDescription.RAW_encode(ChannelDescription__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mobileAllocation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_startingTime.RAW_encode(StartingTime__V_descr_, *myleaf.body.node.nodes[3]);
  if (field_cellChannelDescr.ispresent()) {
  encoded_length += field_cellChannelDescr().RAW_encode(CellChannelDescription__TV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_carrierIndication.ispresent()) {
  encoded_length += field_carrierIndication().RAW_encode(CarrierIndication__TV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_mobileAllocationC2.ispresent()) {
  encoded_length += field_mobileAllocationC2().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_channelDescriptionC2.ispresent()) {
  encoded_length += field_channelDescriptionC2().RAW_encode(ChannelDescription3__TV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_extendedTSCSet.ispresent()) {
  encoded_length += field_extendedTSCSet().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_cellChannelDescr.ispresent() && (!field_cellChannelDescr.ispresent() || field_cellChannelDescr().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_carrierIndication.ispresent() && (!field_carrierIndication.ispresent() || field_carrierIndication().elementIdentifier() !=  bs_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,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_mobileAllocationC2.ispresent() && (!field_mobileAllocationC2.ispresent() || field_mobileAllocationC2().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);
  }
  }
  if (field_channelDescriptionC2.ispresent() && (!field_channelDescriptionC2.ispresent() || field_channelDescriptionC2().elementIdentifier() !=  os_35)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_35.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_extendedTSCSet.ispresent() && (!field_extendedTSCSet.ispresent() || field_extendedTSCSet().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[]={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_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__RRM__Frequency__Redefinition__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
ChannelDescription__V_template field_channelDescription;
MobileL3__CommonIE__Types::Type4__LV_template field_mobileAllocation;
StartingTime__V_template field_startingTime;
CellChannelDescription__TV_template field_cellChannelDescr;
CarrierIndication__TV_template field_carrierIndication;
MobileL3__CommonIE__Types::Type4__TLV_template field_mobileAllocationC2;
ChannelDescription3__TV_template field_channelDescriptionC2;
ExtendedTSCSet__TV_template field_extendedTSCSet;
};

void PDU__RRM__Frequency__Redefinition__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_channelDescription = ANY_VALUE;
single_value->field_mobileAllocation = ANY_VALUE;
single_value->field_startingTime = ANY_VALUE;
single_value->field_cellChannelDescr = ANY_OR_OMIT;
single_value->field_carrierIndication = ANY_OR_OMIT;
single_value->field_mobileAllocationC2 = ANY_OR_OMIT;
single_value->field_channelDescriptionC2 = ANY_OR_OMIT;
single_value->field_extendedTSCSet = ANY_OR_OMIT;
}
}
}

void PDU__RRM__Frequency__Redefinition__NW__MS_template::copy_value(const PDU__RRM__Frequency__Redefinition__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.channelDescription().is_bound()) {
  single_value->field_channelDescription = other_value.channelDescription();
} else {
  single_value->field_channelDescription.clean_up();
}
if (other_value.mobileAllocation().is_bound()) {
  single_value->field_mobileAllocation = other_value.mobileAllocation();
} else {
  single_value->field_mobileAllocation.clean_up();
}
if (other_value.startingTime().is_bound()) {
  single_value->field_startingTime = other_value.startingTime();
} else {
  single_value->field_startingTime.clean_up();
}
if (other_value.cellChannelDescr().is_bound()) {
  if (other_value.cellChannelDescr().ispresent()) single_value->field_cellChannelDescr = other_value.cellChannelDescr()();
  else single_value->field_cellChannelDescr = OMIT_VALUE;
} else {
  single_value->field_cellChannelDescr.clean_up();
}
if (other_value.carrierIndication().is_bound()) {
  if (other_value.carrierIndication().ispresent()) single_value->field_carrierIndication = other_value.carrierIndication()();
  else single_value->field_carrierIndication = OMIT_VALUE;
} else {
  single_value->field_carrierIndication.clean_up();
}
if (other_value.mobileAllocationC2().is_bound()) {
  if (other_value.mobileAllocationC2().ispresent()) single_value->field_mobileAllocationC2 = other_value.mobileAllocationC2()();
  else single_value->field_mobileAllocationC2 = OMIT_VALUE;
} else {
  single_value->field_mobileAllocationC2.clean_up();
}
if (other_value.channelDescriptionC2().is_bound()) {
  if (other_value.channelDescriptionC2().ispresent()) single_value->field_channelDescriptionC2 = other_value.channelDescriptionC2()();
  else single_value->field_channelDescriptionC2 = OMIT_VALUE;
} else {
  single_value->field_channelDescriptionC2.clean_up();
}
if (other_value.extendedTSCSet().is_bound()) {
  if (other_value.extendedTSCSet().ispresent()) single_value->field_extendedTSCSet = other_value.extendedTSCSet()();
  else single_value->field_extendedTSCSet = OMIT_VALUE;
} else {
  single_value->field_extendedTSCSet.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__Frequency__Redefinition__NW__MS_template::copy_template(const PDU__RRM__Frequency__Redefinition__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.channelDescription().get_selection()) {
single_value->field_channelDescription = other_value.channelDescription();
} else {
single_value->field_channelDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocation().get_selection()) {
single_value->field_mobileAllocation = other_value.mobileAllocation();
} else {
single_value->field_mobileAllocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.startingTime().get_selection()) {
single_value->field_startingTime = other_value.startingTime();
} else {
single_value->field_startingTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellChannelDescr().get_selection()) {
single_value->field_cellChannelDescr = other_value.cellChannelDescr();
} else {
single_value->field_cellChannelDescr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.carrierIndication().get_selection()) {
single_value->field_carrierIndication = other_value.carrierIndication();
} else {
single_value->field_carrierIndication.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocationC2().get_selection()) {
single_value->field_mobileAllocationC2 = other_value.mobileAllocationC2();
} else {
single_value->field_mobileAllocationC2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelDescriptionC2().get_selection()) {
single_value->field_channelDescriptionC2 = other_value.channelDescriptionC2();
} else {
single_value->field_channelDescriptionC2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedTSCSet().get_selection()) {
single_value->field_extendedTSCSet = other_value.extendedTSCSet();
} else {
single_value->field_extendedTSCSet.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__RRM__Frequency__Redefinition__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__RRM__Frequency__Redefinition__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__Frequency__Redefinition__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_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__Frequency__Redefinition__NW__MS_template::PDU__RRM__Frequency__Redefinition__NW__MS_template()
{
}

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

PDU__RRM__Frequency__Redefinition__NW__MS_template::PDU__RRM__Frequency__Redefinition__NW__MS_template(const PDU__RRM__Frequency__Redefinition__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__Frequency__Redefinition__NW__MS_template::match(const PDU__RRM__Frequency__Redefinition__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.channelDescription().is_bound()) return FALSE;
if(!single_value->field_channelDescription.match(other_value.channelDescription(), legacy))return FALSE;
if(!other_value.mobileAllocation().is_bound()) return FALSE;
if(!single_value->field_mobileAllocation.match(other_value.mobileAllocation(), legacy))return FALSE;
if(!other_value.startingTime().is_bound()) return FALSE;
if(!single_value->field_startingTime.match(other_value.startingTime(), legacy))return FALSE;
if(!other_value.cellChannelDescr().is_bound()) return FALSE;
if((other_value.cellChannelDescr().ispresent() ? !single_value->field_cellChannelDescr.match((const CellChannelDescription__TV&)other_value.cellChannelDescr(), legacy) : !single_value->field_cellChannelDescr.match_omit(legacy)))return FALSE;
if(!other_value.carrierIndication().is_bound()) return FALSE;
if((other_value.carrierIndication().ispresent() ? !single_value->field_carrierIndication.match((const CarrierIndication__TV&)other_value.carrierIndication(), legacy) : !single_value->field_carrierIndication.match_omit(legacy)))return FALSE;
if(!other_value.mobileAllocationC2().is_bound()) return FALSE;
if((other_value.mobileAllocationC2().ispresent() ? !single_value->field_mobileAllocationC2.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.mobileAllocationC2(), legacy) : !single_value->field_mobileAllocationC2.match_omit(legacy)))return FALSE;
if(!other_value.channelDescriptionC2().is_bound()) return FALSE;
if((other_value.channelDescriptionC2().ispresent() ? !single_value->field_channelDescriptionC2.match((const ChannelDescription3__TV&)other_value.channelDescriptionC2(), legacy) : !single_value->field_channelDescriptionC2.match_omit(legacy)))return FALSE;
if(!other_value.extendedTSCSet().is_bound()) return FALSE;
if((other_value.extendedTSCSet().ispresent() ? !single_value->field_extendedTSCSet.match((const ExtendedTSCSet__TV&)other_value.extendedTSCSet(), legacy) : !single_value->field_extendedTSCSet.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_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__Frequency__Redefinition__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_channelDescription.is_bound()
 || single_value->field_mobileAllocation.is_bound()
 || single_value->field_startingTime.is_bound()
 || (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_bound())
 || (single_value->field_carrierIndication.is_omit() || single_value->field_carrierIndication.is_bound())
 || (single_value->field_mobileAllocationC2.is_omit() || single_value->field_mobileAllocationC2.is_bound())
 || (single_value->field_channelDescriptionC2.is_omit() || single_value->field_channelDescriptionC2.is_bound())
 || (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_bound());
}

boolean PDU__RRM__Frequency__Redefinition__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_channelDescription.is_value()
 && single_value->field_mobileAllocation.is_value()
 && single_value->field_startingTime.is_value()
 && (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_value())
 && (single_value->field_carrierIndication.is_omit() || single_value->field_carrierIndication.is_value())
 && (single_value->field_mobileAllocationC2.is_omit() || single_value->field_mobileAllocationC2.is_value())
 && (single_value->field_channelDescriptionC2.is_omit() || single_value->field_channelDescriptionC2.is_value())
 && (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_value());
}

void PDU__RRM__Frequency__Redefinition__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__RRM__Frequency__Redefinition__NW__MS PDU__RRM__Frequency__Redefinition__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_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
PDU__RRM__Frequency__Redefinition__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_channelDescription.is_bound()) {
ret_val.channelDescription() = single_value->field_channelDescription.valueof();
}
if (single_value->field_mobileAllocation.is_bound()) {
ret_val.mobileAllocation() = single_value->field_mobileAllocation.valueof();
}
if (single_value->field_startingTime.is_bound()) {
ret_val.startingTime() = single_value->field_startingTime.valueof();
}
if (single_value->field_cellChannelDescr.is_omit()) ret_val.cellChannelDescr() = OMIT_VALUE;
else if (single_value->field_cellChannelDescr.is_bound()) {
ret_val.cellChannelDescr() = single_value->field_cellChannelDescr.valueof();
}
if (single_value->field_carrierIndication.is_omit()) ret_val.carrierIndication() = OMIT_VALUE;
else if (single_value->field_carrierIndication.is_bound()) {
ret_val.carrierIndication() = single_value->field_carrierIndication.valueof();
}
if (single_value->field_mobileAllocationC2.is_omit()) ret_val.mobileAllocationC2() = OMIT_VALUE;
else if (single_value->field_mobileAllocationC2.is_bound()) {
ret_val.mobileAllocationC2() = single_value->field_mobileAllocationC2.valueof();
}
if (single_value->field_channelDescriptionC2.is_omit()) ret_val.channelDescriptionC2() = OMIT_VALUE;
else if (single_value->field_channelDescriptionC2.is_bound()) {
ret_val.channelDescriptionC2() = single_value->field_channelDescriptionC2.valueof();
}
if (single_value->field_extendedTSCSet.is_omit()) ret_val.extendedTSCSet() = OMIT_VALUE;
else if (single_value->field_extendedTSCSet.is_bound()) {
ret_val.extendedTSCSet() = single_value->field_extendedTSCSet.valueof();
}
return ret_val;
}

void PDU__RRM__Frequency__Redefinition__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_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__Frequency__Redefinition__NW__MS_template[list_length];
}

PDU__RRM__Frequency__Redefinition__NW__MS_template& PDU__RRM__Frequency__Redefinition__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_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
return value_list.list_value[list_index];
}

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

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

ChannelDescription__V_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::channelDescription()
{
set_specific();
return single_value->field_channelDescription;
}

const ChannelDescription__V_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::channelDescription() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelDescription of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
return single_value->field_channelDescription;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::mobileAllocation()
{
set_specific();
return single_value->field_mobileAllocation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::mobileAllocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
return single_value->field_mobileAllocation;
}

StartingTime__V_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::startingTime()
{
set_specific();
return single_value->field_startingTime;
}

const StartingTime__V_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::startingTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field startingTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
return single_value->field_startingTime;
}

CellChannelDescription__TV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::cellChannelDescr()
{
set_specific();
return single_value->field_cellChannelDescr;
}

const CellChannelDescription__TV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::cellChannelDescr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellChannelDescr of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
return single_value->field_cellChannelDescr;
}

CarrierIndication__TV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::carrierIndication()
{
set_specific();
return single_value->field_carrierIndication;
}

const CarrierIndication__TV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::carrierIndication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field carrierIndication of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
return single_value->field_carrierIndication;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::mobileAllocationC2()
{
set_specific();
return single_value->field_mobileAllocationC2;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::mobileAllocationC2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocationC2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
return single_value->field_mobileAllocationC2;
}

ChannelDescription3__TV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::channelDescriptionC2()
{
set_specific();
return single_value->field_channelDescriptionC2;
}

const ChannelDescription3__TV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::channelDescriptionC2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelDescriptionC2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
return single_value->field_channelDescriptionC2;
}

ExtendedTSCSet__TV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::extendedTSCSet()
{
set_specific();
return single_value->field_extendedTSCSet;
}

const ExtendedTSCSet__TV_template& PDU__RRM__Frequency__Redefinition__NW__MS_template::extendedTSCSet() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedTSCSet of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
return single_value->field_extendedTSCSet;
}

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

void PDU__RRM__Frequency__Redefinition__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(", channelDescription := ");
single_value->field_channelDescription.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
single_value->field_mobileAllocation.log();
TTCN_Logger::log_event_str(", startingTime := ");
single_value->field_startingTime.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
single_value->field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", carrierIndication := ");
single_value->field_carrierIndication.log();
TTCN_Logger::log_event_str(", mobileAllocationC2 := ");
single_value->field_mobileAllocationC2.log();
TTCN_Logger::log_event_str(", channelDescriptionC2 := ");
single_value->field_channelDescriptionC2.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
single_value->field_extendedTSCSet.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__RRM__Frequency__Redefinition__NW__MS_template::log_match(const PDU__RRM__Frequency__Redefinition__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_channelDescription.match(match_value.channelDescription(), legacy)){
TTCN_Logger::log_logmatch_info(".channelDescription");
single_value->field_channelDescription.log_match(match_value.channelDescription(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileAllocation.match(match_value.mobileAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocation");
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_startingTime.match(match_value.startingTime(), legacy)){
TTCN_Logger::log_logmatch_info(".startingTime");
single_value->field_startingTime.log_match(match_value.startingTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cellChannelDescr().ispresent()){
if(!single_value->field_cellChannelDescr.match(match_value.cellChannelDescr(), legacy)){
TTCN_Logger::log_logmatch_info(".cellChannelDescr");
single_value->field_cellChannelDescr.log_match(match_value.cellChannelDescr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellChannelDescr.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellChannelDescr := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellChannelDescr.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.carrierIndication().ispresent()){
if(!single_value->field_carrierIndication.match(match_value.carrierIndication(), legacy)){
TTCN_Logger::log_logmatch_info(".carrierIndication");
single_value->field_carrierIndication.log_match(match_value.carrierIndication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_carrierIndication.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".carrierIndication := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_carrierIndication.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileAllocationC2().ispresent()){
if(!single_value->field_mobileAllocationC2.match(match_value.mobileAllocationC2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocationC2");
single_value->field_mobileAllocationC2.log_match(match_value.mobileAllocationC2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileAllocationC2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileAllocationC2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileAllocationC2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelDescriptionC2().ispresent()){
if(!single_value->field_channelDescriptionC2.match(match_value.channelDescriptionC2(), legacy)){
TTCN_Logger::log_logmatch_info(".channelDescriptionC2");
single_value->field_channelDescriptionC2.log_match(match_value.channelDescriptionC2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelDescriptionC2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelDescriptionC2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelDescriptionC2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedTSCSet().ispresent()){
if(!single_value->field_extendedTSCSet.match(match_value.extendedTSCSet(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedTSCSet");
single_value->field_extendedTSCSet.log_match(match_value.extendedTSCSet(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedTSCSet.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedTSCSet := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedTSCSet.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(", channelDescription := ");
single_value->field_channelDescription.log_match(match_value.channelDescription(), legacy);
TTCN_Logger::log_event_str(", mobileAllocation := ");
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
TTCN_Logger::log_event_str(", startingTime := ");
single_value->field_startingTime.log_match(match_value.startingTime(), legacy);
TTCN_Logger::log_event_str(", cellChannelDescr := ");
if (match_value.cellChannelDescr().ispresent()) {
single_value->field_cellChannelDescr.log_match(match_value.cellChannelDescr(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellChannelDescr.log();
if (single_value->field_cellChannelDescr.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", carrierIndication := ");
if (match_value.carrierIndication().ispresent()) {
single_value->field_carrierIndication.log_match(match_value.carrierIndication(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_carrierIndication.log();
if (single_value->field_carrierIndication.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileAllocationC2 := ");
if (match_value.mobileAllocationC2().ispresent()) {
single_value->field_mobileAllocationC2.log_match(match_value.mobileAllocationC2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileAllocationC2.log();
if (single_value->field_mobileAllocationC2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelDescriptionC2 := ");
if (match_value.channelDescriptionC2().ispresent()) {
single_value->field_channelDescriptionC2.log_match(match_value.channelDescriptionC2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelDescriptionC2.log();
if (single_value->field_channelDescriptionC2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedTSCSet := ");
if (match_value.extendedTSCSet().ispresent()) {
single_value->field_extendedTSCSet.log_match(match_value.extendedTSCSet(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedTSCSet.log();
if (single_value->field_extendedTSCSet.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__RRM__Frequency__Redefinition__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (channelDescription().is_bound()) channelDescription().set_implicit_omit();
if (mobileAllocation().is_bound()) mobileAllocation().set_implicit_omit();
if (startingTime().is_bound()) startingTime().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!carrierIndication().is_bound()) carrierIndication() = OMIT_VALUE;
else carrierIndication().set_implicit_omit();
if (!mobileAllocationC2().is_bound()) mobileAllocationC2() = OMIT_VALUE;
else mobileAllocationC2().set_implicit_omit();
if (!channelDescriptionC2().is_bound()) channelDescriptionC2() = OMIT_VALUE;
else channelDescriptionC2().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__Frequency__Redefinition__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_channelDescription.encode_text(text_buf);
single_value->field_mobileAllocation.encode_text(text_buf);
single_value->field_startingTime.encode_text(text_buf);
single_value->field_cellChannelDescr.encode_text(text_buf);
single_value->field_carrierIndication.encode_text(text_buf);
single_value->field_mobileAllocationC2.encode_text(text_buf);
single_value->field_channelDescriptionC2.encode_text(text_buf);
single_value->field_extendedTSCSet.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_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
}
}

void PDU__RRM__Frequency__Redefinition__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_channelDescription.decode_text(text_buf);
single_value->field_mobileAllocation.decode_text(text_buf);
single_value->field_startingTime.decode_text(text_buf);
single_value->field_cellChannelDescr.decode_text(text_buf);
single_value->field_carrierIndication.decode_text(text_buf);
single_value->field_mobileAllocationC2.decode_text(text_buf);
single_value->field_channelDescriptionC2.decode_text(text_buf);
single_value->field_extendedTSCSet.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__RRM__Frequency__Redefinition__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_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS.");
}
}

void PDU__RRM__Frequency__Redefinition__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__RRM__Frequency__Redefinition__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 (9<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS 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) channelDescription().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescr().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) carrierIndication().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mobileAllocationC2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) channelDescriptionC2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().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(), "channelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startingTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellChannelDescr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellChannelDescr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "carrierIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          carrierIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocationC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocationC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescriptionC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescriptionC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__Frequency__Redefinition__NW__MS_template* precondition = new PDU__RRM__Frequency__Redefinition__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__Frequency__Redefinition__NW__MS_template* implied_template = new PDU__RRM__Frequency__Redefinition__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__Frequency__Redefinition__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__Frequency__Redefinition__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_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
single_value->field_channelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
single_value->field_mobileAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
single_value->field_startingTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
single_value->field_cellChannelDescr.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
single_value->field_carrierIndication.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
single_value->field_mobileAllocationC2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
single_value->field_channelDescriptionC2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
single_value->field_extendedTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_Frequency_Redefinition_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_RRM_Types.PDU_RRM_Frequency_Redefinition_NW_MS");
}

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

boolean PDU__RRM__Frequency__Redefinition__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__RRM__GPRS__SuspensionRequest__MS__NW::PDU__RRM__GPRS__SuspensionRequest__MS__NW()
{
}

PDU__RRM__GPRS__SuspensionRequest__MS__NW::PDU__RRM__GPRS__SuspensionRequest__MS__NW(const BITSTRING& par_messageType,
    const OCTETSTRING& par_tLLI,
    const MobileL3__GMM__SM__Types::RoutingAreaIdentificationV& par_routingAreaIdentification,
    const OCTETSTRING& par_suspensionCause,
    const OPTIONAL< ServiceSupport__TV >& par_service__Support)
  :   field_messageType(par_messageType),
  field_tLLI(par_tLLI),
  field_routingAreaIdentification(par_routingAreaIdentification),
  field_suspensionCause(par_suspensionCause),
  field_service__Support(par_service__Support)
{
}

PDU__RRM__GPRS__SuspensionRequest__MS__NW::PDU__RRM__GPRS__SuspensionRequest__MS__NW(const PDU__RRM__GPRS__SuspensionRequest__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
else field_routingAreaIdentification.clean_up();
if (other_value.suspensionCause().is_bound()) field_suspensionCause = other_value.suspensionCause();
else field_suspensionCause.clean_up();
if (other_value.service__Support().is_bound()) field_service__Support = other_value.service__Support();
else field_service__Support.clean_up();
}

void PDU__RRM__GPRS__SuspensionRequest__MS__NW::clean_up()
{
field_messageType.clean_up();
field_tLLI.clean_up();
field_routingAreaIdentification.clean_up();
field_suspensionCause.clean_up();
field_service__Support.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__GPRS__SuspensionRequest__MS__NW::get_descriptor() const { return &PDU__RRM__GPRS__SuspensionRequest__MS__NW_descr_; }
PDU__RRM__GPRS__SuspensionRequest__MS__NW& PDU__RRM__GPRS__SuspensionRequest__MS__NW::operator=(const PDU__RRM__GPRS__SuspensionRequest__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
  else field_routingAreaIdentification.clean_up();
  if (other_value.suspensionCause().is_bound()) field_suspensionCause = other_value.suspensionCause();
  else field_suspensionCause.clean_up();
  if (other_value.service__Support().is_bound()) field_service__Support = other_value.service__Support();
  else field_service__Support.clean_up();
}
return *this;
}

boolean PDU__RRM__GPRS__SuspensionRequest__MS__NW::operator==(const PDU__RRM__GPRS__SuspensionRequest__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_tLLI==other_value.field_tLLI
  && field_routingAreaIdentification==other_value.field_routingAreaIdentification
  && field_suspensionCause==other_value.field_suspensionCause
  && field_service__Support==other_value.field_service__Support;
}

boolean PDU__RRM__GPRS__SuspensionRequest__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_tLLI.is_bound())
  || (field_routingAreaIdentification.is_bound())
  || (field_suspensionCause.is_bound())
  || (OPTIONAL_OMIT == field_service__Support.get_selection() || field_service__Support.is_bound());
}
boolean PDU__RRM__GPRS__SuspensionRequest__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_tLLI.is_value()
  && field_routingAreaIdentification.is_value()
  && field_suspensionCause.is_value()
  && (OPTIONAL_OMIT == field_service__Support.get_selection() || field_service__Support.is_value());
}
int PDU__RRM__GPRS__SuspensionRequest__MS__NW::size_of() const
{
  int ret_val = 4;
  if (field_service__Support.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__GPRS__SuspensionRequest__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(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", suspensionCause := ");
field_suspensionCause.log();
TTCN_Logger::log_event_str(", service_Support := ");
field_service__Support.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__GPRS__SuspensionRequest__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (suspensionCause().is_bound()) suspensionCause().set_implicit_omit();
if (!service__Support().is_bound()) service__Support() = OMIT_VALUE;
else service__Support().set_implicit_omit();
}

void PDU__RRM__GPRS__SuspensionRequest__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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_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) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) suspensionCause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) service__Support().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(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "suspensionCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          suspensionCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_Support")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__Support().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW");
  }
}

void PDU__RRM__GPRS__SuspensionRequest__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_routingAreaIdentification.encode_text(text_buf);
field_suspensionCause.encode_text(text_buf);
field_service__Support.encode_text(text_buf);
}

void PDU__RRM__GPRS__SuspensionRequest__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_routingAreaIdentification.decode_text(text_buf);
field_suspensionCause.decode_text(text_buf);
field_service__Support.decode_text(text_buf);
}

void PDU__RRM__GPRS__SuspensionRequest__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__RRM__GPRS__SuspensionRequest__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__RRM__GPRS__SuspensionRequest__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(General__Types::OCT4_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__GMM__SM__Types::RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaIdentification.RAW_decode(MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_suspensionCause.RAW_decode(General__Types::OCT1_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_service__Support = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, ServiceSupport__TV_descr_.raw->forceomit);
  decoded_field_length = field_service__Support().RAW_decode(ServiceSupport__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_service__Support = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_service__Support.ispresent() || field_service__Support().elementIdentifier() !=  os_21){
  field_service__Support=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_service__Support=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__RRM__GPRS__SuspensionRequest__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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  if (field_service__Support.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ServiceSupport__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routingAreaIdentification.RAW_encode(MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_suspensionCause.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  if (field_service__Support.ispresent()) {
  encoded_length += field_service__Support().RAW_encode(ServiceSupport__TV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_service__Support.ispresent() && (!field_service__Support.ispresent() || field_service__Support().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[]={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_21.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
OCTETSTRING_template field_tLLI;
MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_template field_routingAreaIdentification;
OCTETSTRING_template field_suspensionCause;
ServiceSupport__TV_template field_service__Support;
};

void PDU__RRM__GPRS__SuspensionRequest__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_tLLI = ANY_VALUE;
single_value->field_routingAreaIdentification = ANY_VALUE;
single_value->field_suspensionCause = ANY_VALUE;
single_value->field_service__Support = ANY_OR_OMIT;
}
}
}

void PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::copy_value(const PDU__RRM__GPRS__SuspensionRequest__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.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.routingAreaIdentification().is_bound()) {
  single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
  single_value->field_routingAreaIdentification.clean_up();
}
if (other_value.suspensionCause().is_bound()) {
  single_value->field_suspensionCause = other_value.suspensionCause();
} else {
  single_value->field_suspensionCause.clean_up();
}
if (other_value.service__Support().is_bound()) {
  if (other_value.service__Support().ispresent()) single_value->field_service__Support = other_value.service__Support()();
  else single_value->field_service__Support = OMIT_VALUE;
} else {
  single_value->field_service__Support.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::copy_template(const PDU__RRM__GPRS__SuspensionRequest__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.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaIdentification().get_selection()) {
single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
single_value->field_routingAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.suspensionCause().get_selection()) {
single_value->field_suspensionCause = other_value.suspensionCause();
} else {
single_value->field_suspensionCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.service__Support().get_selection()) {
single_value->field_service__Support = other_value.service__Support();
} else {
single_value->field_service__Support.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__RRM__GPRS__SuspensionRequest__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__RRM__GPRS__SuspensionRequest__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__GPRS__SuspensionRequest__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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::PDU__RRM__GPRS__SuspensionRequest__MS__NW_template()
{
}

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

PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::PDU__RRM__GPRS__SuspensionRequest__MS__NW_template(const PDU__RRM__GPRS__SuspensionRequest__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::match(const PDU__RRM__GPRS__SuspensionRequest__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.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.routingAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_routingAreaIdentification.match(other_value.routingAreaIdentification(), legacy))return FALSE;
if(!other_value.suspensionCause().is_bound()) return FALSE;
if(!single_value->field_suspensionCause.match(other_value.suspensionCause(), legacy))return FALSE;
if(!other_value.service__Support().is_bound()) return FALSE;
if((other_value.service__Support().ispresent() ? !single_value->field_service__Support.match((const ServiceSupport__TV&)other_value.service__Support(), legacy) : !single_value->field_service__Support.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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__GPRS__SuspensionRequest__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_tLLI.is_bound()
 || single_value->field_routingAreaIdentification.is_bound()
 || single_value->field_suspensionCause.is_bound()
 || (single_value->field_service__Support.is_omit() || single_value->field_service__Support.is_bound());
}

boolean PDU__RRM__GPRS__SuspensionRequest__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_tLLI.is_value()
 && single_value->field_routingAreaIdentification.is_value()
 && single_value->field_suspensionCause.is_value()
 && (single_value->field_service__Support.is_omit() || single_value->field_service__Support.is_value());
}

void PDU__RRM__GPRS__SuspensionRequest__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__RRM__GPRS__SuspensionRequest__MS__NW PDU__RRM__GPRS__SuspensionRequest__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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
PDU__RRM__GPRS__SuspensionRequest__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_routingAreaIdentification.is_bound()) {
ret_val.routingAreaIdentification() = single_value->field_routingAreaIdentification.valueof();
}
if (single_value->field_suspensionCause.is_bound()) {
ret_val.suspensionCause() = single_value->field_suspensionCause.valueof();
}
if (single_value->field_service__Support.is_omit()) ret_val.service__Support() = OMIT_VALUE;
else if (single_value->field_service__Support.is_bound()) {
ret_val.service__Support() = single_value->field_service__Support.valueof();
}
return ret_val;
}

void PDU__RRM__GPRS__SuspensionRequest__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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__GPRS__SuspensionRequest__MS__NW_template[list_length];
}

PDU__RRM__GPRS__SuspensionRequest__MS__NW_template& PDU__RRM__GPRS__SuspensionRequest__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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
return value_list.list_value[list_index];
}

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

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

OCTETSTRING_template& PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const OCTETSTRING_template& PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
return single_value->field_tLLI;
}

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

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

OCTETSTRING_template& PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::suspensionCause()
{
set_specific();
return single_value->field_suspensionCause;
}

const OCTETSTRING_template& PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::suspensionCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field suspensionCause of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
return single_value->field_suspensionCause;
}

ServiceSupport__TV_template& PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::service__Support()
{
set_specific();
return single_value->field_service__Support;
}

const ServiceSupport__TV_template& PDU__RRM__GPRS__SuspensionRequest__MS__NW_template::service__Support() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field service_Support of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
return single_value->field_service__Support;
}

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

void PDU__RRM__GPRS__SuspensionRequest__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(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", suspensionCause := ");
single_value->field_suspensionCause.log();
TTCN_Logger::log_event_str(", service_Support := ");
single_value->field_service__Support.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__RRM__GPRS__SuspensionRequest__MS__NW_template::log_match(const PDU__RRM__GPRS__SuspensionRequest__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_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingAreaIdentification.match(match_value.routingAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaIdentification");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_suspensionCause.match(match_value.suspensionCause(), legacy)){
TTCN_Logger::log_logmatch_info(".suspensionCause");
single_value->field_suspensionCause.log_match(match_value.suspensionCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.service__Support().ispresent()){
if(!single_value->field_service__Support.match(match_value.service__Support(), legacy)){
TTCN_Logger::log_logmatch_info(".service_Support");
single_value->field_service__Support.log_match(match_value.service__Support(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_service__Support.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".service_Support := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_service__Support.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(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", suspensionCause := ");
single_value->field_suspensionCause.log_match(match_value.suspensionCause(), legacy);
TTCN_Logger::log_event_str(", service_Support := ");
if (match_value.service__Support().ispresent()) {
single_value->field_service__Support.log_match(match_value.service__Support(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_service__Support.log();
if (single_value->field_service__Support.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__RRM__GPRS__SuspensionRequest__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (suspensionCause().is_bound()) suspensionCause().set_implicit_omit();
if (!service__Support().is_bound()) service__Support() = OMIT_VALUE;
else service__Support().set_implicit_omit();
}

void PDU__RRM__GPRS__SuspensionRequest__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_tLLI.encode_text(text_buf);
single_value->field_routingAreaIdentification.encode_text(text_buf);
single_value->field_suspensionCause.encode_text(text_buf);
single_value->field_service__Support.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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
}
}

void PDU__RRM__GPRS__SuspensionRequest__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_tLLI.decode_text(text_buf);
single_value->field_routingAreaIdentification.decode_text(text_buf);
single_value->field_suspensionCause.decode_text(text_buf);
single_value->field_service__Support.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__RRM__GPRS__SuspensionRequest__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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW.");
}
}

void PDU__RRM__GPRS__SuspensionRequest__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__RRM__GPRS__SuspensionRequest__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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_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) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) suspensionCause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) service__Support().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(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "suspensionCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          suspensionCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_Support")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__Support().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__GPRS__SuspensionRequest__MS__NW_template* precondition = new PDU__RRM__GPRS__SuspensionRequest__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__GPRS__SuspensionRequest__MS__NW_template* implied_template = new PDU__RRM__GPRS__SuspensionRequest__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__GPRS__SuspensionRequest__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__GPRS__SuspensionRequest__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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW");
single_value->field_routingAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW");
single_value->field_suspensionCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW");
single_value->field_service__Support.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_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_RRM_Types.PDU_RRM_GPRS_SuspensionRequest_MS_NW");
}

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

boolean PDU__RRM__GPRS__SuspensionRequest__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__RRM__HandoverAccess__NW__MS::PDU__RRM__HandoverAccess__NW__MS()
{
}

PDU__RRM__HandoverAccess__NW__MS::PDU__RRM__HandoverAccess__NW__MS(const BITSTRING& par_handoverReference)
  :   field_handoverReference(par_handoverReference)
{
}

PDU__RRM__HandoverAccess__NW__MS::PDU__RRM__HandoverAccess__NW__MS(const PDU__RRM__HandoverAccess__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
if (other_value.handoverReference().is_bound()) field_handoverReference = other_value.handoverReference();
else field_handoverReference.clean_up();
}

void PDU__RRM__HandoverAccess__NW__MS::clean_up()
{
field_handoverReference.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__HandoverAccess__NW__MS::get_descriptor() const { return &PDU__RRM__HandoverAccess__NW__MS_descr_; }
PDU__RRM__HandoverAccess__NW__MS& PDU__RRM__HandoverAccess__NW__MS::operator=(const PDU__RRM__HandoverAccess__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
  if (other_value.handoverReference().is_bound()) field_handoverReference = other_value.handoverReference();
  else field_handoverReference.clean_up();
}
return *this;
}

boolean PDU__RRM__HandoverAccess__NW__MS::operator==(const PDU__RRM__HandoverAccess__NW__MS& other_value) const
{
return field_handoverReference==other_value.field_handoverReference;
}

boolean PDU__RRM__HandoverAccess__NW__MS::is_bound() const
{
return (field_handoverReference.is_bound());
}
boolean PDU__RRM__HandoverAccess__NW__MS::is_value() const
{
return field_handoverReference.is_value();
}
void PDU__RRM__HandoverAccess__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ handoverReference := ");
field_handoverReference.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__HandoverAccess__NW__MS::set_implicit_omit()
{
if (handoverReference().is_bound()) handoverReference().set_implicit_omit();
}

void PDU__RRM__HandoverAccess__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 (1<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS 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) handoverReference().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(), "handoverReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handoverReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS");
  }
}

void PDU__RRM__HandoverAccess__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_handoverReference.encode_text(text_buf);
}

void PDU__RRM__HandoverAccess__NW__MS::decode_text(Text_Buf& text_buf)
{
field_handoverReference.decode_text(text_buf);
}

void PDU__RRM__HandoverAccess__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__RRM__HandoverAccess__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__RRM__HandoverAccess__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_handoverReference.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct PDU__RRM__HandoverAccess__NW__MS_template::single_value_struct {
BITSTRING_template field_handoverReference;
};

void PDU__RRM__HandoverAccess__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_handoverReference = ANY_VALUE;
}
}
}

void PDU__RRM__HandoverAccess__NW__MS_template::copy_value(const PDU__RRM__HandoverAccess__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.handoverReference().is_bound()) {
  single_value->field_handoverReference = other_value.handoverReference();
} else {
  single_value->field_handoverReference.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__HandoverAccess__NW__MS_template::copy_template(const PDU__RRM__HandoverAccess__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.handoverReference().get_selection()) {
single_value->field_handoverReference = other_value.handoverReference();
} else {
single_value->field_handoverReference.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__RRM__HandoverAccess__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__RRM__HandoverAccess__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__HandoverAccess__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_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__HandoverAccess__NW__MS_template::PDU__RRM__HandoverAccess__NW__MS_template()
{
}

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

PDU__RRM__HandoverAccess__NW__MS_template::PDU__RRM__HandoverAccess__NW__MS_template(const PDU__RRM__HandoverAccess__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__HandoverAccess__NW__MS_template::match(const PDU__RRM__HandoverAccess__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.handoverReference().is_bound()) return FALSE;
if(!single_value->field_handoverReference.match(other_value.handoverReference(), 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_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__HandoverAccess__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_handoverReference.is_bound();
}

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

void PDU__RRM__HandoverAccess__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__RRM__HandoverAccess__NW__MS PDU__RRM__HandoverAccess__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_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
PDU__RRM__HandoverAccess__NW__MS ret_val;
if (single_value->field_handoverReference.is_bound()) {
ret_val.handoverReference() = single_value->field_handoverReference.valueof();
}
return ret_val;
}

void PDU__RRM__HandoverAccess__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_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__HandoverAccess__NW__MS_template[list_length];
}

PDU__RRM__HandoverAccess__NW__MS_template& PDU__RRM__HandoverAccess__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_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__HandoverAccess__NW__MS_template::handoverReference()
{
set_specific();
return single_value->field_handoverReference;
}

const BITSTRING_template& PDU__RRM__HandoverAccess__NW__MS_template::handoverReference() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field handoverReference of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
return single_value->field_handoverReference;
}

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

void PDU__RRM__HandoverAccess__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ handoverReference := ");
single_value->field_handoverReference.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__RRM__HandoverAccess__NW__MS_template::log_match(const PDU__RRM__HandoverAccess__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_handoverReference.match(match_value.handoverReference(), legacy)){
TTCN_Logger::log_logmatch_info(".handoverReference");
single_value->field_handoverReference.log_match(match_value.handoverReference(), 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("{ handoverReference := ");
single_value->field_handoverReference.log_match(match_value.handoverReference(), 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__RRM__HandoverAccess__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (handoverReference().is_bound()) handoverReference().set_implicit_omit();
}

void PDU__RRM__HandoverAccess__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_handoverReference.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_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
}
}

void PDU__RRM__HandoverAccess__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_handoverReference.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__RRM__HandoverAccess__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_RRM_Types.PDU_RRM_HandoverAccess_NW_MS.");
}
}

void PDU__RRM__HandoverAccess__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__RRM__HandoverAccess__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 (1<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS 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) handoverReference().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(), "handoverReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handoverReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__HandoverAccess__NW__MS_template* precondition = new PDU__RRM__HandoverAccess__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__HandoverAccess__NW__MS_template* implied_template = new PDU__RRM__HandoverAccess__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__HandoverAccess__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_HandoverAccess_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__HandoverAccess__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_handoverReference.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverAccess_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_RRM_Types.PDU_RRM_HandoverAccess_NW_MS");
}

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

boolean PDU__RRM__HandoverAccess__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__RRM__HandoverCommand__NW__MS::PDU__RRM__HandoverCommand__NW__MS()
{
}

PDU__RRM__HandoverCommand__NW__MS::PDU__RRM__HandoverCommand__NW__MS(const BITSTRING& par_messageType,
    const CellDescription__V& par_cellDescription,
    const ChannelDescription2__V& par_channelDescription2,
    const HandoverReference__V& par_handoverReference,
    const PowerCommandAndAccesstype__V& par_powerCommandAndAccesstype,
    const OPTIONAL< SynchronizationIndication__TV >& par_synchronizationIndication,
    const OPTIONAL< FrequencyShortList__TV >& par_frequencyShortListAfterTime,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_frequencyListAfterTime,
    const OPTIONAL< CellChannelDescription__TV >& par_cellChannelDescription,
    const OPTIONAL< MultislotAllocation__TLV >& par_multislotAllocation,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet1,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet2,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet3,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet4,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet5,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet6,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet7,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet8,
    const OPTIONAL< ChannelDescription__TV >& par_descrOf2ndCh__at,
    const OPTIONAL< ChannelMode2__TV >& par_modeOf2ndChannel,
    const OPTIONAL< FrequencyChannelSequence__TV >& par_frequencyChannelSequence__at,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_mobileAllocation__at,
    const OPTIONAL< StartingTime__TV >& par_startingTime,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_timeDifference,
    const OPTIONAL< TimingAdvance__TV >& par_timingAdvance,
    const OPTIONAL< FrequencyShortList__TV >& par_frequencyShortListBeforeTime,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_frequencyListBeforeTime,
    const OPTIONAL< ChannelDescription2__TV >& par_descrOf1stCh__bt,
    const OPTIONAL< ChannelDescription__TV >& par_descrOf2ndCh__bt,
    const OPTIONAL< FrequencyChannelSequence__TV >& par_frequencyChannelSequence__bt,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_mobileAllocation__bt,
    const OPTIONAL< CipherModeSetting__TV >& par_cipherModeSetting,
    const OPTIONAL< VGCS__TargetModeIndication__TLV >& par_vGCS__TargetModeIndication,
    const OPTIONAL< MultiRateConfiguration__TLV >& par_multiRateConfiguration,
    const OPTIONAL< DynamicARFCN__Mapping__TLV >& par_dynamicARFCN__Mapping,
    const OPTIONAL< VGCS__Ciphering__Parameters__TLV >& par_vGCS__Ciphering__Parameters,
    const OPTIONAL< DedicatedServiceInformation__TV >& par_dedicatedServiceInformation,
    const OPTIONAL< PLMNIndex__TV >& par_pLMNIndex,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet__afterTime,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet__beforeTime)
  :   field_messageType(par_messageType),
  field_cellDescription(par_cellDescription),
  field_channelDescription2(par_channelDescription2),
  field_handoverReference(par_handoverReference),
  field_powerCommandAndAccesstype(par_powerCommandAndAccesstype),
  field_synchronizationIndication(par_synchronizationIndication),
  field_frequencyShortListAfterTime(par_frequencyShortListAfterTime),
  field_frequencyListAfterTime(par_frequencyListAfterTime),
  field_cellChannelDescription(par_cellChannelDescription),
  field_multislotAllocation(par_multislotAllocation),
  field_modeOfChannelSet1(par_modeOfChannelSet1),
  field_modeOfChannelSet2(par_modeOfChannelSet2),
  field_modeOfChannelSet3(par_modeOfChannelSet3),
  field_modeOfChannelSet4(par_modeOfChannelSet4),
  field_modeOfChannelSet5(par_modeOfChannelSet5),
  field_modeOfChannelSet6(par_modeOfChannelSet6),
  field_modeOfChannelSet7(par_modeOfChannelSet7),
  field_modeOfChannelSet8(par_modeOfChannelSet8),
  field_descrOf2ndCh__at(par_descrOf2ndCh__at),
  field_modeOf2ndChannel(par_modeOf2ndChannel),
  field_frequencyChannelSequence__at(par_frequencyChannelSequence__at),
  field_mobileAllocation__at(par_mobileAllocation__at),
  field_startingTime(par_startingTime),
  field_timeDifference(par_timeDifference),
  field_timingAdvance(par_timingAdvance),
  field_frequencyShortListBeforeTime(par_frequencyShortListBeforeTime),
  field_frequencyListBeforeTime(par_frequencyListBeforeTime),
  field_descrOf1stCh__bt(par_descrOf1stCh__bt),
  field_descrOf2ndCh__bt(par_descrOf2ndCh__bt),
  field_frequencyChannelSequence__bt(par_frequencyChannelSequence__bt),
  field_mobileAllocation__bt(par_mobileAllocation__bt),
  field_cipherModeSetting(par_cipherModeSetting),
  field_vGCS__TargetModeIndication(par_vGCS__TargetModeIndication),
  field_multiRateConfiguration(par_multiRateConfiguration),
  field_dynamicARFCN__Mapping(par_dynamicARFCN__Mapping),
  field_vGCS__Ciphering__Parameters(par_vGCS__Ciphering__Parameters),
  field_dedicatedServiceInformation(par_dedicatedServiceInformation),
  field_pLMNIndex(par_pLMNIndex),
  field_extendedTSCSet__afterTime(par_extendedTSCSet__afterTime),
  field_extendedTSCSet__beforeTime(par_extendedTSCSet__beforeTime)
{
}

PDU__RRM__HandoverCommand__NW__MS::PDU__RRM__HandoverCommand__NW__MS(const PDU__RRM__HandoverCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.cellDescription().is_bound()) field_cellDescription = other_value.cellDescription();
else field_cellDescription.clean_up();
if (other_value.channelDescription2().is_bound()) field_channelDescription2 = other_value.channelDescription2();
else field_channelDescription2.clean_up();
if (other_value.handoverReference().is_bound()) field_handoverReference = other_value.handoverReference();
else field_handoverReference.clean_up();
if (other_value.powerCommandAndAccesstype().is_bound()) field_powerCommandAndAccesstype = other_value.powerCommandAndAccesstype();
else field_powerCommandAndAccesstype.clean_up();
if (other_value.synchronizationIndication().is_bound()) field_synchronizationIndication = other_value.synchronizationIndication();
else field_synchronizationIndication.clean_up();
if (other_value.frequencyShortListAfterTime().is_bound()) field_frequencyShortListAfterTime = other_value.frequencyShortListAfterTime();
else field_frequencyShortListAfterTime.clean_up();
if (other_value.frequencyListAfterTime().is_bound()) field_frequencyListAfterTime = other_value.frequencyListAfterTime();
else field_frequencyListAfterTime.clean_up();
if (other_value.cellChannelDescription().is_bound()) field_cellChannelDescription = other_value.cellChannelDescription();
else field_cellChannelDescription.clean_up();
if (other_value.multislotAllocation().is_bound()) field_multislotAllocation = other_value.multislotAllocation();
else field_multislotAllocation.clean_up();
if (other_value.modeOfChannelSet1().is_bound()) field_modeOfChannelSet1 = other_value.modeOfChannelSet1();
else field_modeOfChannelSet1.clean_up();
if (other_value.modeOfChannelSet2().is_bound()) field_modeOfChannelSet2 = other_value.modeOfChannelSet2();
else field_modeOfChannelSet2.clean_up();
if (other_value.modeOfChannelSet3().is_bound()) field_modeOfChannelSet3 = other_value.modeOfChannelSet3();
else field_modeOfChannelSet3.clean_up();
if (other_value.modeOfChannelSet4().is_bound()) field_modeOfChannelSet4 = other_value.modeOfChannelSet4();
else field_modeOfChannelSet4.clean_up();
if (other_value.modeOfChannelSet5().is_bound()) field_modeOfChannelSet5 = other_value.modeOfChannelSet5();
else field_modeOfChannelSet5.clean_up();
if (other_value.modeOfChannelSet6().is_bound()) field_modeOfChannelSet6 = other_value.modeOfChannelSet6();
else field_modeOfChannelSet6.clean_up();
if (other_value.modeOfChannelSet7().is_bound()) field_modeOfChannelSet7 = other_value.modeOfChannelSet7();
else field_modeOfChannelSet7.clean_up();
if (other_value.modeOfChannelSet8().is_bound()) field_modeOfChannelSet8 = other_value.modeOfChannelSet8();
else field_modeOfChannelSet8.clean_up();
if (other_value.descrOf2ndCh__at().is_bound()) field_descrOf2ndCh__at = other_value.descrOf2ndCh__at();
else field_descrOf2ndCh__at.clean_up();
if (other_value.modeOf2ndChannel().is_bound()) field_modeOf2ndChannel = other_value.modeOf2ndChannel();
else field_modeOf2ndChannel.clean_up();
if (other_value.frequencyChannelSequence__at().is_bound()) field_frequencyChannelSequence__at = other_value.frequencyChannelSequence__at();
else field_frequencyChannelSequence__at.clean_up();
if (other_value.mobileAllocation__at().is_bound()) field_mobileAllocation__at = other_value.mobileAllocation__at();
else field_mobileAllocation__at.clean_up();
if (other_value.startingTime().is_bound()) field_startingTime = other_value.startingTime();
else field_startingTime.clean_up();
if (other_value.timeDifference().is_bound()) field_timeDifference = other_value.timeDifference();
else field_timeDifference.clean_up();
if (other_value.timingAdvance().is_bound()) field_timingAdvance = other_value.timingAdvance();
else field_timingAdvance.clean_up();
if (other_value.frequencyShortListBeforeTime().is_bound()) field_frequencyShortListBeforeTime = other_value.frequencyShortListBeforeTime();
else field_frequencyShortListBeforeTime.clean_up();
if (other_value.frequencyListBeforeTime().is_bound()) field_frequencyListBeforeTime = other_value.frequencyListBeforeTime();
else field_frequencyListBeforeTime.clean_up();
if (other_value.descrOf1stCh__bt().is_bound()) field_descrOf1stCh__bt = other_value.descrOf1stCh__bt();
else field_descrOf1stCh__bt.clean_up();
if (other_value.descrOf2ndCh__bt().is_bound()) field_descrOf2ndCh__bt = other_value.descrOf2ndCh__bt();
else field_descrOf2ndCh__bt.clean_up();
if (other_value.frequencyChannelSequence__bt().is_bound()) field_frequencyChannelSequence__bt = other_value.frequencyChannelSequence__bt();
else field_frequencyChannelSequence__bt.clean_up();
if (other_value.mobileAllocation__bt().is_bound()) field_mobileAllocation__bt = other_value.mobileAllocation__bt();
else field_mobileAllocation__bt.clean_up();
if (other_value.cipherModeSetting().is_bound()) field_cipherModeSetting = other_value.cipherModeSetting();
else field_cipherModeSetting.clean_up();
if (other_value.vGCS__TargetModeIndication().is_bound()) field_vGCS__TargetModeIndication = other_value.vGCS__TargetModeIndication();
else field_vGCS__TargetModeIndication.clean_up();
if (other_value.multiRateConfiguration().is_bound()) field_multiRateConfiguration = other_value.multiRateConfiguration();
else field_multiRateConfiguration.clean_up();
if (other_value.dynamicARFCN__Mapping().is_bound()) field_dynamicARFCN__Mapping = other_value.dynamicARFCN__Mapping();
else field_dynamicARFCN__Mapping.clean_up();
if (other_value.vGCS__Ciphering__Parameters().is_bound()) field_vGCS__Ciphering__Parameters = other_value.vGCS__Ciphering__Parameters();
else field_vGCS__Ciphering__Parameters.clean_up();
if (other_value.dedicatedServiceInformation().is_bound()) field_dedicatedServiceInformation = other_value.dedicatedServiceInformation();
else field_dedicatedServiceInformation.clean_up();
if (other_value.pLMNIndex().is_bound()) field_pLMNIndex = other_value.pLMNIndex();
else field_pLMNIndex.clean_up();
if (other_value.extendedTSCSet__afterTime().is_bound()) field_extendedTSCSet__afterTime = other_value.extendedTSCSet__afterTime();
else field_extendedTSCSet__afterTime.clean_up();
if (other_value.extendedTSCSet__beforeTime().is_bound()) field_extendedTSCSet__beforeTime = other_value.extendedTSCSet__beforeTime();
else field_extendedTSCSet__beforeTime.clean_up();
}

void PDU__RRM__HandoverCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_cellDescription.clean_up();
field_channelDescription2.clean_up();
field_handoverReference.clean_up();
field_powerCommandAndAccesstype.clean_up();
field_synchronizationIndication.clean_up();
field_frequencyShortListAfterTime.clean_up();
field_frequencyListAfterTime.clean_up();
field_cellChannelDescription.clean_up();
field_multislotAllocation.clean_up();
field_modeOfChannelSet1.clean_up();
field_modeOfChannelSet2.clean_up();
field_modeOfChannelSet3.clean_up();
field_modeOfChannelSet4.clean_up();
field_modeOfChannelSet5.clean_up();
field_modeOfChannelSet6.clean_up();
field_modeOfChannelSet7.clean_up();
field_modeOfChannelSet8.clean_up();
field_descrOf2ndCh__at.clean_up();
field_modeOf2ndChannel.clean_up();
field_frequencyChannelSequence__at.clean_up();
field_mobileAllocation__at.clean_up();
field_startingTime.clean_up();
field_timeDifference.clean_up();
field_timingAdvance.clean_up();
field_frequencyShortListBeforeTime.clean_up();
field_frequencyListBeforeTime.clean_up();
field_descrOf1stCh__bt.clean_up();
field_descrOf2ndCh__bt.clean_up();
field_frequencyChannelSequence__bt.clean_up();
field_mobileAllocation__bt.clean_up();
field_cipherModeSetting.clean_up();
field_vGCS__TargetModeIndication.clean_up();
field_multiRateConfiguration.clean_up();
field_dynamicARFCN__Mapping.clean_up();
field_vGCS__Ciphering__Parameters.clean_up();
field_dedicatedServiceInformation.clean_up();
field_pLMNIndex.clean_up();
field_extendedTSCSet__afterTime.clean_up();
field_extendedTSCSet__beforeTime.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__HandoverCommand__NW__MS::get_descriptor() const { return &PDU__RRM__HandoverCommand__NW__MS_descr_; }
PDU__RRM__HandoverCommand__NW__MS& PDU__RRM__HandoverCommand__NW__MS::operator=(const PDU__RRM__HandoverCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.cellDescription().is_bound()) field_cellDescription = other_value.cellDescription();
  else field_cellDescription.clean_up();
  if (other_value.channelDescription2().is_bound()) field_channelDescription2 = other_value.channelDescription2();
  else field_channelDescription2.clean_up();
  if (other_value.handoverReference().is_bound()) field_handoverReference = other_value.handoverReference();
  else field_handoverReference.clean_up();
  if (other_value.powerCommandAndAccesstype().is_bound()) field_powerCommandAndAccesstype = other_value.powerCommandAndAccesstype();
  else field_powerCommandAndAccesstype.clean_up();
  if (other_value.synchronizationIndication().is_bound()) field_synchronizationIndication = other_value.synchronizationIndication();
  else field_synchronizationIndication.clean_up();
  if (other_value.frequencyShortListAfterTime().is_bound()) field_frequencyShortListAfterTime = other_value.frequencyShortListAfterTime();
  else field_frequencyShortListAfterTime.clean_up();
  if (other_value.frequencyListAfterTime().is_bound()) field_frequencyListAfterTime = other_value.frequencyListAfterTime();
  else field_frequencyListAfterTime.clean_up();
  if (other_value.cellChannelDescription().is_bound()) field_cellChannelDescription = other_value.cellChannelDescription();
  else field_cellChannelDescription.clean_up();
  if (other_value.multislotAllocation().is_bound()) field_multislotAllocation = other_value.multislotAllocation();
  else field_multislotAllocation.clean_up();
  if (other_value.modeOfChannelSet1().is_bound()) field_modeOfChannelSet1 = other_value.modeOfChannelSet1();
  else field_modeOfChannelSet1.clean_up();
  if (other_value.modeOfChannelSet2().is_bound()) field_modeOfChannelSet2 = other_value.modeOfChannelSet2();
  else field_modeOfChannelSet2.clean_up();
  if (other_value.modeOfChannelSet3().is_bound()) field_modeOfChannelSet3 = other_value.modeOfChannelSet3();
  else field_modeOfChannelSet3.clean_up();
  if (other_value.modeOfChannelSet4().is_bound()) field_modeOfChannelSet4 = other_value.modeOfChannelSet4();
  else field_modeOfChannelSet4.clean_up();
  if (other_value.modeOfChannelSet5().is_bound()) field_modeOfChannelSet5 = other_value.modeOfChannelSet5();
  else field_modeOfChannelSet5.clean_up();
  if (other_value.modeOfChannelSet6().is_bound()) field_modeOfChannelSet6 = other_value.modeOfChannelSet6();
  else field_modeOfChannelSet6.clean_up();
  if (other_value.modeOfChannelSet7().is_bound()) field_modeOfChannelSet7 = other_value.modeOfChannelSet7();
  else field_modeOfChannelSet7.clean_up();
  if (other_value.modeOfChannelSet8().is_bound()) field_modeOfChannelSet8 = other_value.modeOfChannelSet8();
  else field_modeOfChannelSet8.clean_up();
  if (other_value.descrOf2ndCh__at().is_bound()) field_descrOf2ndCh__at = other_value.descrOf2ndCh__at();
  else field_descrOf2ndCh__at.clean_up();
  if (other_value.modeOf2ndChannel().is_bound()) field_modeOf2ndChannel = other_value.modeOf2ndChannel();
  else field_modeOf2ndChannel.clean_up();
  if (other_value.frequencyChannelSequence__at().is_bound()) field_frequencyChannelSequence__at = other_value.frequencyChannelSequence__at();
  else field_frequencyChannelSequence__at.clean_up();
  if (other_value.mobileAllocation__at().is_bound()) field_mobileAllocation__at = other_value.mobileAllocation__at();
  else field_mobileAllocation__at.clean_up();
  if (other_value.startingTime().is_bound()) field_startingTime = other_value.startingTime();
  else field_startingTime.clean_up();
  if (other_value.timeDifference().is_bound()) field_timeDifference = other_value.timeDifference();
  else field_timeDifference.clean_up();
  if (other_value.timingAdvance().is_bound()) field_timingAdvance = other_value.timingAdvance();
  else field_timingAdvance.clean_up();
  if (other_value.frequencyShortListBeforeTime().is_bound()) field_frequencyShortListBeforeTime = other_value.frequencyShortListBeforeTime();
  else field_frequencyShortListBeforeTime.clean_up();
  if (other_value.frequencyListBeforeTime().is_bound()) field_frequencyListBeforeTime = other_value.frequencyListBeforeTime();
  else field_frequencyListBeforeTime.clean_up();
  if (other_value.descrOf1stCh__bt().is_bound()) field_descrOf1stCh__bt = other_value.descrOf1stCh__bt();
  else field_descrOf1stCh__bt.clean_up();
  if (other_value.descrOf2ndCh__bt().is_bound()) field_descrOf2ndCh__bt = other_value.descrOf2ndCh__bt();
  else field_descrOf2ndCh__bt.clean_up();
  if (other_value.frequencyChannelSequence__bt().is_bound()) field_frequencyChannelSequence__bt = other_value.frequencyChannelSequence__bt();
  else field_frequencyChannelSequence__bt.clean_up();
  if (other_value.mobileAllocation__bt().is_bound()) field_mobileAllocation__bt = other_value.mobileAllocation__bt();
  else field_mobileAllocation__bt.clean_up();
  if (other_value.cipherModeSetting().is_bound()) field_cipherModeSetting = other_value.cipherModeSetting();
  else field_cipherModeSetting.clean_up();
  if (other_value.vGCS__TargetModeIndication().is_bound()) field_vGCS__TargetModeIndication = other_value.vGCS__TargetModeIndication();
  else field_vGCS__TargetModeIndication.clean_up();
  if (other_value.multiRateConfiguration().is_bound()) field_multiRateConfiguration = other_value.multiRateConfiguration();
  else field_multiRateConfiguration.clean_up();
  if (other_value.dynamicARFCN__Mapping().is_bound()) field_dynamicARFCN__Mapping = other_value.dynamicARFCN__Mapping();
  else field_dynamicARFCN__Mapping.clean_up();
  if (other_value.vGCS__Ciphering__Parameters().is_bound()) field_vGCS__Ciphering__Parameters = other_value.vGCS__Ciphering__Parameters();
  else field_vGCS__Ciphering__Parameters.clean_up();
  if (other_value.dedicatedServiceInformation().is_bound()) field_dedicatedServiceInformation = other_value.dedicatedServiceInformation();
  else field_dedicatedServiceInformation.clean_up();
  if (other_value.pLMNIndex().is_bound()) field_pLMNIndex = other_value.pLMNIndex();
  else field_pLMNIndex.clean_up();
  if (other_value.extendedTSCSet__afterTime().is_bound()) field_extendedTSCSet__afterTime = other_value.extendedTSCSet__afterTime();
  else field_extendedTSCSet__afterTime.clean_up();
  if (other_value.extendedTSCSet__beforeTime().is_bound()) field_extendedTSCSet__beforeTime = other_value.extendedTSCSet__beforeTime();
  else field_extendedTSCSet__beforeTime.clean_up();
}
return *this;
}

boolean PDU__RRM__HandoverCommand__NW__MS::operator==(const PDU__RRM__HandoverCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_cellDescription==other_value.field_cellDescription
  && field_channelDescription2==other_value.field_channelDescription2
  && field_handoverReference==other_value.field_handoverReference
  && field_powerCommandAndAccesstype==other_value.field_powerCommandAndAccesstype
  && field_synchronizationIndication==other_value.field_synchronizationIndication
  && field_frequencyShortListAfterTime==other_value.field_frequencyShortListAfterTime
  && field_frequencyListAfterTime==other_value.field_frequencyListAfterTime
  && field_cellChannelDescription==other_value.field_cellChannelDescription
  && field_multislotAllocation==other_value.field_multislotAllocation
  && field_modeOfChannelSet1==other_value.field_modeOfChannelSet1
  && field_modeOfChannelSet2==other_value.field_modeOfChannelSet2
  && field_modeOfChannelSet3==other_value.field_modeOfChannelSet3
  && field_modeOfChannelSet4==other_value.field_modeOfChannelSet4
  && field_modeOfChannelSet5==other_value.field_modeOfChannelSet5
  && field_modeOfChannelSet6==other_value.field_modeOfChannelSet6
  && field_modeOfChannelSet7==other_value.field_modeOfChannelSet7
  && field_modeOfChannelSet8==other_value.field_modeOfChannelSet8
  && field_descrOf2ndCh__at==other_value.field_descrOf2ndCh__at
  && field_modeOf2ndChannel==other_value.field_modeOf2ndChannel
  && field_frequencyChannelSequence__at==other_value.field_frequencyChannelSequence__at
  && field_mobileAllocation__at==other_value.field_mobileAllocation__at
  && field_startingTime==other_value.field_startingTime
  && field_timeDifference==other_value.field_timeDifference
  && field_timingAdvance==other_value.field_timingAdvance
  && field_frequencyShortListBeforeTime==other_value.field_frequencyShortListBeforeTime
  && field_frequencyListBeforeTime==other_value.field_frequencyListBeforeTime
  && field_descrOf1stCh__bt==other_value.field_descrOf1stCh__bt
  && field_descrOf2ndCh__bt==other_value.field_descrOf2ndCh__bt
  && field_frequencyChannelSequence__bt==other_value.field_frequencyChannelSequence__bt
  && field_mobileAllocation__bt==other_value.field_mobileAllocation__bt
  && field_cipherModeSetting==other_value.field_cipherModeSetting
  && field_vGCS__TargetModeIndication==other_value.field_vGCS__TargetModeIndication
  && field_multiRateConfiguration==other_value.field_multiRateConfiguration
  && field_dynamicARFCN__Mapping==other_value.field_dynamicARFCN__Mapping
  && field_vGCS__Ciphering__Parameters==other_value.field_vGCS__Ciphering__Parameters
  && field_dedicatedServiceInformation==other_value.field_dedicatedServiceInformation
  && field_pLMNIndex==other_value.field_pLMNIndex
  && field_extendedTSCSet__afterTime==other_value.field_extendedTSCSet__afterTime
  && field_extendedTSCSet__beforeTime==other_value.field_extendedTSCSet__beforeTime;
}

boolean PDU__RRM__HandoverCommand__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_cellDescription.is_bound())
  || (field_channelDescription2.is_bound())
  || (field_handoverReference.is_bound())
  || (field_powerCommandAndAccesstype.is_bound())
  || (OPTIONAL_OMIT == field_synchronizationIndication.get_selection() || field_synchronizationIndication.is_bound())
  || (OPTIONAL_OMIT == field_frequencyShortListAfterTime.get_selection() || field_frequencyShortListAfterTime.is_bound())
  || (OPTIONAL_OMIT == field_frequencyListAfterTime.get_selection() || field_frequencyListAfterTime.is_bound())
  || (OPTIONAL_OMIT == field_cellChannelDescription.get_selection() || field_cellChannelDescription.is_bound())
  || (OPTIONAL_OMIT == field_multislotAllocation.get_selection() || field_multislotAllocation.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet1.get_selection() || field_modeOfChannelSet1.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet2.get_selection() || field_modeOfChannelSet2.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet3.get_selection() || field_modeOfChannelSet3.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet4.get_selection() || field_modeOfChannelSet4.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet5.get_selection() || field_modeOfChannelSet5.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet6.get_selection() || field_modeOfChannelSet6.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet7.get_selection() || field_modeOfChannelSet7.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet8.get_selection() || field_modeOfChannelSet8.is_bound())
  || (OPTIONAL_OMIT == field_descrOf2ndCh__at.get_selection() || field_descrOf2ndCh__at.is_bound())
  || (OPTIONAL_OMIT == field_modeOf2ndChannel.get_selection() || field_modeOf2ndChannel.is_bound())
  || (OPTIONAL_OMIT == field_frequencyChannelSequence__at.get_selection() || field_frequencyChannelSequence__at.is_bound())
  || (OPTIONAL_OMIT == field_mobileAllocation__at.get_selection() || field_mobileAllocation__at.is_bound())
  || (OPTIONAL_OMIT == field_startingTime.get_selection() || field_startingTime.is_bound())
  || (OPTIONAL_OMIT == field_timeDifference.get_selection() || field_timeDifference.is_bound())
  || (OPTIONAL_OMIT == field_timingAdvance.get_selection() || field_timingAdvance.is_bound())
  || (OPTIONAL_OMIT == field_frequencyShortListBeforeTime.get_selection() || field_frequencyShortListBeforeTime.is_bound())
  || (OPTIONAL_OMIT == field_frequencyListBeforeTime.get_selection() || field_frequencyListBeforeTime.is_bound())
  || (OPTIONAL_OMIT == field_descrOf1stCh__bt.get_selection() || field_descrOf1stCh__bt.is_bound())
  || (OPTIONAL_OMIT == field_descrOf2ndCh__bt.get_selection() || field_descrOf2ndCh__bt.is_bound())
  || (OPTIONAL_OMIT == field_frequencyChannelSequence__bt.get_selection() || field_frequencyChannelSequence__bt.is_bound())
  || (OPTIONAL_OMIT == field_mobileAllocation__bt.get_selection() || field_mobileAllocation__bt.is_bound())
  || (OPTIONAL_OMIT == field_cipherModeSetting.get_selection() || field_cipherModeSetting.is_bound())
  || (OPTIONAL_OMIT == field_vGCS__TargetModeIndication.get_selection() || field_vGCS__TargetModeIndication.is_bound())
  || (OPTIONAL_OMIT == field_multiRateConfiguration.get_selection() || field_multiRateConfiguration.is_bound())
  || (OPTIONAL_OMIT == field_dynamicARFCN__Mapping.get_selection() || field_dynamicARFCN__Mapping.is_bound())
  || (OPTIONAL_OMIT == field_vGCS__Ciphering__Parameters.get_selection() || field_vGCS__Ciphering__Parameters.is_bound())
  || (OPTIONAL_OMIT == field_dedicatedServiceInformation.get_selection() || field_dedicatedServiceInformation.is_bound())
  || (OPTIONAL_OMIT == field_pLMNIndex.get_selection() || field_pLMNIndex.is_bound())
  || (OPTIONAL_OMIT == field_extendedTSCSet__afterTime.get_selection() || field_extendedTSCSet__afterTime.is_bound())
  || (OPTIONAL_OMIT == field_extendedTSCSet__beforeTime.get_selection() || field_extendedTSCSet__beforeTime.is_bound());
}
boolean PDU__RRM__HandoverCommand__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_cellDescription.is_value()
  && field_channelDescription2.is_value()
  && field_handoverReference.is_value()
  && field_powerCommandAndAccesstype.is_value()
  && (OPTIONAL_OMIT == field_synchronizationIndication.get_selection() || field_synchronizationIndication.is_value())
  && (OPTIONAL_OMIT == field_frequencyShortListAfterTime.get_selection() || field_frequencyShortListAfterTime.is_value())
  && (OPTIONAL_OMIT == field_frequencyListAfterTime.get_selection() || field_frequencyListAfterTime.is_value())
  && (OPTIONAL_OMIT == field_cellChannelDescription.get_selection() || field_cellChannelDescription.is_value())
  && (OPTIONAL_OMIT == field_multislotAllocation.get_selection() || field_multislotAllocation.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet1.get_selection() || field_modeOfChannelSet1.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet2.get_selection() || field_modeOfChannelSet2.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet3.get_selection() || field_modeOfChannelSet3.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet4.get_selection() || field_modeOfChannelSet4.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet5.get_selection() || field_modeOfChannelSet5.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet6.get_selection() || field_modeOfChannelSet6.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet7.get_selection() || field_modeOfChannelSet7.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet8.get_selection() || field_modeOfChannelSet8.is_value())
  && (OPTIONAL_OMIT == field_descrOf2ndCh__at.get_selection() || field_descrOf2ndCh__at.is_value())
  && (OPTIONAL_OMIT == field_modeOf2ndChannel.get_selection() || field_modeOf2ndChannel.is_value())
  && (OPTIONAL_OMIT == field_frequencyChannelSequence__at.get_selection() || field_frequencyChannelSequence__at.is_value())
  && (OPTIONAL_OMIT == field_mobileAllocation__at.get_selection() || field_mobileAllocation__at.is_value())
  && (OPTIONAL_OMIT == field_startingTime.get_selection() || field_startingTime.is_value())
  && (OPTIONAL_OMIT == field_timeDifference.get_selection() || field_timeDifference.is_value())
  && (OPTIONAL_OMIT == field_timingAdvance.get_selection() || field_timingAdvance.is_value())
  && (OPTIONAL_OMIT == field_frequencyShortListBeforeTime.get_selection() || field_frequencyShortListBeforeTime.is_value())
  && (OPTIONAL_OMIT == field_frequencyListBeforeTime.get_selection() || field_frequencyListBeforeTime.is_value())
  && (OPTIONAL_OMIT == field_descrOf1stCh__bt.get_selection() || field_descrOf1stCh__bt.is_value())
  && (OPTIONAL_OMIT == field_descrOf2ndCh__bt.get_selection() || field_descrOf2ndCh__bt.is_value())
  && (OPTIONAL_OMIT == field_frequencyChannelSequence__bt.get_selection() || field_frequencyChannelSequence__bt.is_value())
  && (OPTIONAL_OMIT == field_mobileAllocation__bt.get_selection() || field_mobileAllocation__bt.is_value())
  && (OPTIONAL_OMIT == field_cipherModeSetting.get_selection() || field_cipherModeSetting.is_value())
  && (OPTIONAL_OMIT == field_vGCS__TargetModeIndication.get_selection() || field_vGCS__TargetModeIndication.is_value())
  && (OPTIONAL_OMIT == field_multiRateConfiguration.get_selection() || field_multiRateConfiguration.is_value())
  && (OPTIONAL_OMIT == field_dynamicARFCN__Mapping.get_selection() || field_dynamicARFCN__Mapping.is_value())
  && (OPTIONAL_OMIT == field_vGCS__Ciphering__Parameters.get_selection() || field_vGCS__Ciphering__Parameters.is_value())
  && (OPTIONAL_OMIT == field_dedicatedServiceInformation.get_selection() || field_dedicatedServiceInformation.is_value())
  && (OPTIONAL_OMIT == field_pLMNIndex.get_selection() || field_pLMNIndex.is_value())
  && (OPTIONAL_OMIT == field_extendedTSCSet__afterTime.get_selection() || field_extendedTSCSet__afterTime.is_value())
  && (OPTIONAL_OMIT == field_extendedTSCSet__beforeTime.get_selection() || field_extendedTSCSet__beforeTime.is_value());
}
int PDU__RRM__HandoverCommand__NW__MS::size_of() const
{
  int ret_val = 5;
  if (field_synchronizationIndication.ispresent()) ret_val++;
  if (field_frequencyShortListAfterTime.ispresent()) ret_val++;
  if (field_frequencyListAfterTime.ispresent()) ret_val++;
  if (field_cellChannelDescription.ispresent()) ret_val++;
  if (field_multislotAllocation.ispresent()) ret_val++;
  if (field_modeOfChannelSet1.ispresent()) ret_val++;
  if (field_modeOfChannelSet2.ispresent()) ret_val++;
  if (field_modeOfChannelSet3.ispresent()) ret_val++;
  if (field_modeOfChannelSet4.ispresent()) ret_val++;
  if (field_modeOfChannelSet5.ispresent()) ret_val++;
  if (field_modeOfChannelSet6.ispresent()) ret_val++;
  if (field_modeOfChannelSet7.ispresent()) ret_val++;
  if (field_modeOfChannelSet8.ispresent()) ret_val++;
  if (field_descrOf2ndCh__at.ispresent()) ret_val++;
  if (field_modeOf2ndChannel.ispresent()) ret_val++;
  if (field_frequencyChannelSequence__at.ispresent()) ret_val++;
  if (field_mobileAllocation__at.ispresent()) ret_val++;
  if (field_startingTime.ispresent()) ret_val++;
  if (field_timeDifference.ispresent()) ret_val++;
  if (field_timingAdvance.ispresent()) ret_val++;
  if (field_frequencyShortListBeforeTime.ispresent()) ret_val++;
  if (field_frequencyListBeforeTime.ispresent()) ret_val++;
  if (field_descrOf1stCh__bt.ispresent()) ret_val++;
  if (field_descrOf2ndCh__bt.ispresent()) ret_val++;
  if (field_frequencyChannelSequence__bt.ispresent()) ret_val++;
  if (field_mobileAllocation__bt.ispresent()) ret_val++;
  if (field_cipherModeSetting.ispresent()) ret_val++;
  if (field_vGCS__TargetModeIndication.ispresent()) ret_val++;
  if (field_multiRateConfiguration.ispresent()) ret_val++;
  if (field_dynamicARFCN__Mapping.ispresent()) ret_val++;
  if (field_vGCS__Ciphering__Parameters.ispresent()) ret_val++;
  if (field_dedicatedServiceInformation.ispresent()) ret_val++;
  if (field_pLMNIndex.ispresent()) ret_val++;
  if (field_extendedTSCSet__afterTime.ispresent()) ret_val++;
  if (field_extendedTSCSet__beforeTime.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__HandoverCommand__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(", cellDescription := ");
field_cellDescription.log();
TTCN_Logger::log_event_str(", channelDescription2 := ");
field_channelDescription2.log();
TTCN_Logger::log_event_str(", handoverReference := ");
field_handoverReference.log();
TTCN_Logger::log_event_str(", powerCommandAndAccesstype := ");
field_powerCommandAndAccesstype.log();
TTCN_Logger::log_event_str(", synchronizationIndication := ");
field_synchronizationIndication.log();
TTCN_Logger::log_event_str(", frequencyShortListAfterTime := ");
field_frequencyShortListAfterTime.log();
TTCN_Logger::log_event_str(", frequencyListAfterTime := ");
field_frequencyListAfterTime.log();
TTCN_Logger::log_event_str(", cellChannelDescription := ");
field_cellChannelDescription.log();
TTCN_Logger::log_event_str(", multislotAllocation := ");
field_multislotAllocation.log();
TTCN_Logger::log_event_str(", modeOfChannelSet1 := ");
field_modeOfChannelSet1.log();
TTCN_Logger::log_event_str(", modeOfChannelSet2 := ");
field_modeOfChannelSet2.log();
TTCN_Logger::log_event_str(", modeOfChannelSet3 := ");
field_modeOfChannelSet3.log();
TTCN_Logger::log_event_str(", modeOfChannelSet4 := ");
field_modeOfChannelSet4.log();
TTCN_Logger::log_event_str(", modeOfChannelSet5 := ");
field_modeOfChannelSet5.log();
TTCN_Logger::log_event_str(", modeOfChannelSet6 := ");
field_modeOfChannelSet6.log();
TTCN_Logger::log_event_str(", modeOfChannelSet7 := ");
field_modeOfChannelSet7.log();
TTCN_Logger::log_event_str(", modeOfChannelSet8 := ");
field_modeOfChannelSet8.log();
TTCN_Logger::log_event_str(", descrOf2ndCh_at := ");
field_descrOf2ndCh__at.log();
TTCN_Logger::log_event_str(", modeOf2ndChannel := ");
field_modeOf2ndChannel.log();
TTCN_Logger::log_event_str(", frequencyChannelSequence_at := ");
field_frequencyChannelSequence__at.log();
TTCN_Logger::log_event_str(", mobileAllocation_at := ");
field_mobileAllocation__at.log();
TTCN_Logger::log_event_str(", startingTime := ");
field_startingTime.log();
TTCN_Logger::log_event_str(", timeDifference := ");
field_timeDifference.log();
TTCN_Logger::log_event_str(", timingAdvance := ");
field_timingAdvance.log();
TTCN_Logger::log_event_str(", frequencyShortListBeforeTime := ");
field_frequencyShortListBeforeTime.log();
TTCN_Logger::log_event_str(", frequencyListBeforeTime := ");
field_frequencyListBeforeTime.log();
TTCN_Logger::log_event_str(", descrOf1stCh_bt := ");
field_descrOf1stCh__bt.log();
TTCN_Logger::log_event_str(", descrOf2ndCh_bt := ");
field_descrOf2ndCh__bt.log();
TTCN_Logger::log_event_str(", frequencyChannelSequence_bt := ");
field_frequencyChannelSequence__bt.log();
TTCN_Logger::log_event_str(", mobileAllocation_bt := ");
field_mobileAllocation__bt.log();
TTCN_Logger::log_event_str(", cipherModeSetting := ");
field_cipherModeSetting.log();
TTCN_Logger::log_event_str(", vGCS_TargetModeIndication := ");
field_vGCS__TargetModeIndication.log();
TTCN_Logger::log_event_str(", multiRateConfiguration := ");
field_multiRateConfiguration.log();
TTCN_Logger::log_event_str(", dynamicARFCN_Mapping := ");
field_dynamicARFCN__Mapping.log();
TTCN_Logger::log_event_str(", vGCS_Ciphering_Parameters := ");
field_vGCS__Ciphering__Parameters.log();
TTCN_Logger::log_event_str(", dedicatedServiceInformation := ");
field_dedicatedServiceInformation.log();
TTCN_Logger::log_event_str(", pLMNIndex := ");
field_pLMNIndex.log();
TTCN_Logger::log_event_str(", extendedTSCSet_afterTime := ");
field_extendedTSCSet__afterTime.log();
TTCN_Logger::log_event_str(", extendedTSCSet_beforeTime := ");
field_extendedTSCSet__beforeTime.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__HandoverCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cellDescription().is_bound()) cellDescription().set_implicit_omit();
if (channelDescription2().is_bound()) channelDescription2().set_implicit_omit();
if (handoverReference().is_bound()) handoverReference().set_implicit_omit();
if (powerCommandAndAccesstype().is_bound()) powerCommandAndAccesstype().set_implicit_omit();
if (!synchronizationIndication().is_bound()) synchronizationIndication() = OMIT_VALUE;
else synchronizationIndication().set_implicit_omit();
if (!frequencyShortListAfterTime().is_bound()) frequencyShortListAfterTime() = OMIT_VALUE;
else frequencyShortListAfterTime().set_implicit_omit();
if (!frequencyListAfterTime().is_bound()) frequencyListAfterTime() = OMIT_VALUE;
else frequencyListAfterTime().set_implicit_omit();
if (!cellChannelDescription().is_bound()) cellChannelDescription() = OMIT_VALUE;
else cellChannelDescription().set_implicit_omit();
if (!multislotAllocation().is_bound()) multislotAllocation() = OMIT_VALUE;
else multislotAllocation().set_implicit_omit();
if (!modeOfChannelSet1().is_bound()) modeOfChannelSet1() = OMIT_VALUE;
else modeOfChannelSet1().set_implicit_omit();
if (!modeOfChannelSet2().is_bound()) modeOfChannelSet2() = OMIT_VALUE;
else modeOfChannelSet2().set_implicit_omit();
if (!modeOfChannelSet3().is_bound()) modeOfChannelSet3() = OMIT_VALUE;
else modeOfChannelSet3().set_implicit_omit();
if (!modeOfChannelSet4().is_bound()) modeOfChannelSet4() = OMIT_VALUE;
else modeOfChannelSet4().set_implicit_omit();
if (!modeOfChannelSet5().is_bound()) modeOfChannelSet5() = OMIT_VALUE;
else modeOfChannelSet5().set_implicit_omit();
if (!modeOfChannelSet6().is_bound()) modeOfChannelSet6() = OMIT_VALUE;
else modeOfChannelSet6().set_implicit_omit();
if (!modeOfChannelSet7().is_bound()) modeOfChannelSet7() = OMIT_VALUE;
else modeOfChannelSet7().set_implicit_omit();
if (!modeOfChannelSet8().is_bound()) modeOfChannelSet8() = OMIT_VALUE;
else modeOfChannelSet8().set_implicit_omit();
if (!descrOf2ndCh__at().is_bound()) descrOf2ndCh__at() = OMIT_VALUE;
else descrOf2ndCh__at().set_implicit_omit();
if (!modeOf2ndChannel().is_bound()) modeOf2ndChannel() = OMIT_VALUE;
else modeOf2ndChannel().set_implicit_omit();
if (!frequencyChannelSequence__at().is_bound()) frequencyChannelSequence__at() = OMIT_VALUE;
else frequencyChannelSequence__at().set_implicit_omit();
if (!mobileAllocation__at().is_bound()) mobileAllocation__at() = OMIT_VALUE;
else mobileAllocation__at().set_implicit_omit();
if (!startingTime().is_bound()) startingTime() = OMIT_VALUE;
else startingTime().set_implicit_omit();
if (!timeDifference().is_bound()) timeDifference() = OMIT_VALUE;
else timeDifference().set_implicit_omit();
if (!timingAdvance().is_bound()) timingAdvance() = OMIT_VALUE;
else timingAdvance().set_implicit_omit();
if (!frequencyShortListBeforeTime().is_bound()) frequencyShortListBeforeTime() = OMIT_VALUE;
else frequencyShortListBeforeTime().set_implicit_omit();
if (!frequencyListBeforeTime().is_bound()) frequencyListBeforeTime() = OMIT_VALUE;
else frequencyListBeforeTime().set_implicit_omit();
if (!descrOf1stCh__bt().is_bound()) descrOf1stCh__bt() = OMIT_VALUE;
else descrOf1stCh__bt().set_implicit_omit();
if (!descrOf2ndCh__bt().is_bound()) descrOf2ndCh__bt() = OMIT_VALUE;
else descrOf2ndCh__bt().set_implicit_omit();
if (!frequencyChannelSequence__bt().is_bound()) frequencyChannelSequence__bt() = OMIT_VALUE;
else frequencyChannelSequence__bt().set_implicit_omit();
if (!mobileAllocation__bt().is_bound()) mobileAllocation__bt() = OMIT_VALUE;
else mobileAllocation__bt().set_implicit_omit();
if (!cipherModeSetting().is_bound()) cipherModeSetting() = OMIT_VALUE;
else cipherModeSetting().set_implicit_omit();
if (!vGCS__TargetModeIndication().is_bound()) vGCS__TargetModeIndication() = OMIT_VALUE;
else vGCS__TargetModeIndication().set_implicit_omit();
if (!multiRateConfiguration().is_bound()) multiRateConfiguration() = OMIT_VALUE;
else multiRateConfiguration().set_implicit_omit();
if (!dynamicARFCN__Mapping().is_bound()) dynamicARFCN__Mapping() = OMIT_VALUE;
else dynamicARFCN__Mapping().set_implicit_omit();
if (!vGCS__Ciphering__Parameters().is_bound()) vGCS__Ciphering__Parameters() = OMIT_VALUE;
else vGCS__Ciphering__Parameters().set_implicit_omit();
if (!dedicatedServiceInformation().is_bound()) dedicatedServiceInformation() = OMIT_VALUE;
else dedicatedServiceInformation().set_implicit_omit();
if (!pLMNIndex().is_bound()) pLMNIndex() = OMIT_VALUE;
else pLMNIndex().set_implicit_omit();
if (!extendedTSCSet__afterTime().is_bound()) extendedTSCSet__afterTime() = OMIT_VALUE;
else extendedTSCSet__afterTime().set_implicit_omit();
if (!extendedTSCSet__beforeTime().is_bound()) extendedTSCSet__beforeTime() = OMIT_VALUE;
else extendedTSCSet__beforeTime().set_implicit_omit();
}

void PDU__RRM__HandoverCommand__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 (40<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS has 40 fields but 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) cellDescription().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelDescription2().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) handoverReference().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) powerCommandAndAccesstype().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) synchronizationIndication().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) frequencyShortListAfterTime().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) frequencyListAfterTime().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescription().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) multislotAllocation().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet1().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet2().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet3().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet4().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet5().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet6().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet7().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet8().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) descrOf2ndCh__at().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) modeOf2ndChannel().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) frequencyChannelSequence__at().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation__at().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) timeDifference().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) timingAdvance().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) frequencyShortListBeforeTime().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) frequencyListBeforeTime().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) descrOf1stCh__bt().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) descrOf2ndCh__bt().set_param(*param.get_elem(28));
    if (param.get_size()>29 && param.get_elem(29)->get_type()!=Module_Param::MP_NotUsed) frequencyChannelSequence__bt().set_param(*param.get_elem(29));
    if (param.get_size()>30 && param.get_elem(30)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation__bt().set_param(*param.get_elem(30));
    if (param.get_size()>31 && param.get_elem(31)->get_type()!=Module_Param::MP_NotUsed) cipherModeSetting().set_param(*param.get_elem(31));
    if (param.get_size()>32 && param.get_elem(32)->get_type()!=Module_Param::MP_NotUsed) vGCS__TargetModeIndication().set_param(*param.get_elem(32));
    if (param.get_size()>33 && param.get_elem(33)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(33));
    if (param.get_size()>34 && param.get_elem(34)->get_type()!=Module_Param::MP_NotUsed) dynamicARFCN__Mapping().set_param(*param.get_elem(34));
    if (param.get_size()>35 && param.get_elem(35)->get_type()!=Module_Param::MP_NotUsed) vGCS__Ciphering__Parameters().set_param(*param.get_elem(35));
    if (param.get_size()>36 && param.get_elem(36)->get_type()!=Module_Param::MP_NotUsed) dedicatedServiceInformation().set_param(*param.get_elem(36));
    if (param.get_size()>37 && param.get_elem(37)->get_type()!=Module_Param::MP_NotUsed) pLMNIndex().set_param(*param.get_elem(37));
    if (param.get_size()>38 && param.get_elem(38)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet__afterTime().set_param(*param.get_elem(38));
    if (param.get_size()>39 && param.get_elem(39)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet__beforeTime().set_param(*param.get_elem(39));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "cellDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescription2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "handoverReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handoverReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "powerCommandAndAccesstype")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          powerCommandAndAccesstype().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "synchronizationIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          synchronizationIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyShortListAfterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyShortListAfterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyListAfterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyListAfterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet6().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrOf2ndCh_at")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf2ndCh__at().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOf2ndChannel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOf2ndChannel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyChannelSequence_at")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyChannelSequence__at().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation_at")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation__at().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startingTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timeDifference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timeDifference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timingAdvance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timingAdvance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyShortListBeforeTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyShortListBeforeTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyListBeforeTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyListBeforeTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrOf1stCh_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf1stCh__bt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrOf2ndCh_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf2ndCh__bt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyChannelSequence_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyChannelSequence__bt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation__bt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipherModeSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipherModeSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vGCS_TargetModeIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vGCS__TargetModeIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multiRateConfiguration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multiRateConfiguration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dynamicARFCN_Mapping")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dynamicARFCN__Mapping().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vGCS_Ciphering_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vGCS__Ciphering__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dedicatedServiceInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dedicatedServiceInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pLMNIndex")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pLMNIndex().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet_afterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet__afterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet_beforeTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet__beforeTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
  }
}

void PDU__RRM__HandoverCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_cellDescription.encode_text(text_buf);
field_channelDescription2.encode_text(text_buf);
field_handoverReference.encode_text(text_buf);
field_powerCommandAndAccesstype.encode_text(text_buf);
field_synchronizationIndication.encode_text(text_buf);
field_frequencyShortListAfterTime.encode_text(text_buf);
field_frequencyListAfterTime.encode_text(text_buf);
field_cellChannelDescription.encode_text(text_buf);
field_multislotAllocation.encode_text(text_buf);
field_modeOfChannelSet1.encode_text(text_buf);
field_modeOfChannelSet2.encode_text(text_buf);
field_modeOfChannelSet3.encode_text(text_buf);
field_modeOfChannelSet4.encode_text(text_buf);
field_modeOfChannelSet5.encode_text(text_buf);
field_modeOfChannelSet6.encode_text(text_buf);
field_modeOfChannelSet7.encode_text(text_buf);
field_modeOfChannelSet8.encode_text(text_buf);
field_descrOf2ndCh__at.encode_text(text_buf);
field_modeOf2ndChannel.encode_text(text_buf);
field_frequencyChannelSequence__at.encode_text(text_buf);
field_mobileAllocation__at.encode_text(text_buf);
field_startingTime.encode_text(text_buf);
field_timeDifference.encode_text(text_buf);
field_timingAdvance.encode_text(text_buf);
field_frequencyShortListBeforeTime.encode_text(text_buf);
field_frequencyListBeforeTime.encode_text(text_buf);
field_descrOf1stCh__bt.encode_text(text_buf);
field_descrOf2ndCh__bt.encode_text(text_buf);
field_frequencyChannelSequence__bt.encode_text(text_buf);
field_mobileAllocation__bt.encode_text(text_buf);
field_cipherModeSetting.encode_text(text_buf);
field_vGCS__TargetModeIndication.encode_text(text_buf);
field_multiRateConfiguration.encode_text(text_buf);
field_dynamicARFCN__Mapping.encode_text(text_buf);
field_vGCS__Ciphering__Parameters.encode_text(text_buf);
field_dedicatedServiceInformation.encode_text(text_buf);
field_pLMNIndex.encode_text(text_buf);
field_extendedTSCSet__afterTime.encode_text(text_buf);
field_extendedTSCSet__beforeTime.encode_text(text_buf);
}

void PDU__RRM__HandoverCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_cellDescription.decode_text(text_buf);
field_channelDescription2.decode_text(text_buf);
field_handoverReference.decode_text(text_buf);
field_powerCommandAndAccesstype.decode_text(text_buf);
field_synchronizationIndication.decode_text(text_buf);
field_frequencyShortListAfterTime.decode_text(text_buf);
field_frequencyListAfterTime.decode_text(text_buf);
field_cellChannelDescription.decode_text(text_buf);
field_multislotAllocation.decode_text(text_buf);
field_modeOfChannelSet1.decode_text(text_buf);
field_modeOfChannelSet2.decode_text(text_buf);
field_modeOfChannelSet3.decode_text(text_buf);
field_modeOfChannelSet4.decode_text(text_buf);
field_modeOfChannelSet5.decode_text(text_buf);
field_modeOfChannelSet6.decode_text(text_buf);
field_modeOfChannelSet7.decode_text(text_buf);
field_modeOfChannelSet8.decode_text(text_buf);
field_descrOf2ndCh__at.decode_text(text_buf);
field_modeOf2ndChannel.decode_text(text_buf);
field_frequencyChannelSequence__at.decode_text(text_buf);
field_mobileAllocation__at.decode_text(text_buf);
field_startingTime.decode_text(text_buf);
field_timeDifference.decode_text(text_buf);
field_timingAdvance.decode_text(text_buf);
field_frequencyShortListBeforeTime.decode_text(text_buf);
field_frequencyListBeforeTime.decode_text(text_buf);
field_descrOf1stCh__bt.decode_text(text_buf);
field_descrOf2ndCh__bt.decode_text(text_buf);
field_frequencyChannelSequence__bt.decode_text(text_buf);
field_mobileAllocation__bt.decode_text(text_buf);
field_cipherModeSetting.decode_text(text_buf);
field_vGCS__TargetModeIndication.decode_text(text_buf);
field_multiRateConfiguration.decode_text(text_buf);
field_dynamicARFCN__Mapping.decode_text(text_buf);
field_vGCS__Ciphering__Parameters.decode_text(text_buf);
field_dedicatedServiceInformation.decode_text(text_buf);
field_pLMNIndex.decode_text(text_buf);
field_extendedTSCSet__afterTime.decode_text(text_buf);
field_extendedTSCSet__beforeTime.decode_text(text_buf);
}

void PDU__RRM__HandoverCommand__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__RRM__HandoverCommand__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__RRM__HandoverCommand__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, CellDescription__V_descr_.raw->forceomit);
  decoded_field_length = field_cellDescription.RAW_decode(CellDescription__V_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, ChannelDescription2__V_descr_.raw->forceomit);
  decoded_field_length = field_channelDescription2.RAW_decode(ChannelDescription2__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, HandoverReference__V_descr_.raw->forceomit);
  decoded_field_length = field_handoverReference.RAW_decode(HandoverReference__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, PowerCommandAndAccesstype__V_descr_.raw->forceomit);
  decoded_field_length = field_powerCommandAndAccesstype.RAW_decode(PowerCommandAndAccesstype__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_synchronizationIndication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, SynchronizationIndication__TV_descr_.raw->forceomit);
  decoded_field_length = field_synchronizationIndication().RAW_decode(SynchronizationIndication__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_synchronizationIndication = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_synchronizationIndication.ispresent() || field_synchronizationIndication().elementIdentifier() !=  bs_6){
  field_synchronizationIndication=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_synchronizationIndication=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_frequencyShortListAfterTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, FrequencyShortList__TV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyShortListAfterTime().RAW_decode(FrequencyShortList__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyShortListAfterTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyShortListAfterTime.ispresent() || field_frequencyShortListAfterTime().elementIdentifier() !=  os_36){
  field_frequencyShortListAfterTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyShortListAfterTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_frequencyListAfterTime = 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::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyListAfterTime().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyListAfterTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyListAfterTime.ispresent() || field_frequencyListAfterTime().elementIdentifier() !=  os_3){
  field_frequencyListAfterTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyListAfterTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_cellChannelDescription = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, CellChannelDescription__TV_descr_.raw->forceomit);
  decoded_field_length = field_cellChannelDescription().RAW_decode(CellChannelDescription__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_cellChannelDescription = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cellChannelDescription.ispresent() || field_cellChannelDescription().elementIdentifier() !=  os_4){
  field_cellChannelDescription=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cellChannelDescription=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_multislotAllocation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, MultislotAllocation__TLV_descr_.raw->forceomit);
  decoded_field_length = field_multislotAllocation().RAW_decode(MultislotAllocation__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_multislotAllocation = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_multislotAllocation.ispresent() || field_multislotAllocation().elementIdentifier() !=  os_5){
  field_multislotAllocation=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_multislotAllocation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_modeOfChannelSet1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet1().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet1.ispresent() || field_modeOfChannelSet1().elementIdentifier() !=  os_6){
  field_modeOfChannelSet1=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_modeOfChannelSet2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet2().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet2.ispresent() || field_modeOfChannelSet2().elementIdentifier() !=  os_7){
  field_modeOfChannelSet2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_modeOfChannelSet3 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet3().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet3 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet3.ispresent() || field_modeOfChannelSet3().elementIdentifier() !=  os_8){
  field_modeOfChannelSet3=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet3=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_modeOfChannelSet4 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet4().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet4 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet4.ispresent() || field_modeOfChannelSet4().elementIdentifier() !=  os_9){
  field_modeOfChannelSet4=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet4=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_modeOfChannelSet5 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet5().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet5 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet5.ispresent() || field_modeOfChannelSet5().elementIdentifier() !=  os_10){
  field_modeOfChannelSet5=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet5=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_modeOfChannelSet6 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet6().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet6 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet6.ispresent() || field_modeOfChannelSet6().elementIdentifier() !=  os_11){
  field_modeOfChannelSet6=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet6=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_modeOfChannelSet7 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet7().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet7 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet7.ispresent() || field_modeOfChannelSet7().elementIdentifier() !=  os_12){
  field_modeOfChannelSet7=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet7=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_modeOfChannelSet8 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet8().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet8 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet8.ispresent() || field_modeOfChannelSet8().elementIdentifier() !=  os_13){
  field_modeOfChannelSet8=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet8=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_descrOf2ndCh__at = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, ChannelDescription__TV_descr_.raw->forceomit);
  decoded_field_length = field_descrOf2ndCh__at().RAW_decode(ChannelDescription__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_descrOf2ndCh__at = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descrOf2ndCh__at.ispresent() || field_descrOf2ndCh__at().elementIdentifier() !=  os_14){
  field_descrOf2ndCh__at=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descrOf2ndCh__at=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_modeOf2ndChannel = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, ChannelMode2__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOf2ndChannel().RAW_decode(ChannelMode2__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_modeOf2ndChannel = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOf2ndChannel.ispresent() || field_modeOf2ndChannel().elementIdentifier() !=  os_15){
  field_modeOf2ndChannel=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOf2ndChannel=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_frequencyChannelSequence__at = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, FrequencyChannelSequence__TV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyChannelSequence__at().RAW_decode(FrequencyChannelSequence__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyChannelSequence__at = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyChannelSequence__at.ispresent() || field_frequencyChannelSequence__at().elementIdentifier() !=  os_37){
  field_frequencyChannelSequence__at=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyChannelSequence__at=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_mobileAllocation__at = 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::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocation__at().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_mobileAllocation__at = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileAllocation__at.ispresent() || field_mobileAllocation__at().elementIdentifier() !=  os_0){
  field_mobileAllocation__at=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileAllocation__at=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_startingTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, StartingTime__TV_descr_.raw->forceomit);
  decoded_field_length = field_startingTime().RAW_decode(StartingTime__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_startingTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_startingTime.ispresent() || field_startingTime().elementIdentifier() !=  os_1){
  field_startingTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_startingTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_timeDifference = 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::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_timeDifference().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_timeDifference = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_timeDifference.ispresent() || field_timeDifference().elementIdentifier() !=  os_33){
  field_timeDifference=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_timeDifference=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_timingAdvance = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, TimingAdvance__TV_descr_.raw->forceomit);
  decoded_field_length = field_timingAdvance().RAW_decode(TimingAdvance__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_timingAdvance = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_timingAdvance.ispresent() || field_timingAdvance().elementIdentifier() !=  os_38){
  field_timingAdvance=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_timingAdvance=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(25)) {
    field_frequencyShortListBeforeTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_25_force_omit(25, force_omit, FrequencyShortList__TV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyShortListBeforeTime().RAW_decode(FrequencyShortList__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_25_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyShortListBeforeTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyShortListBeforeTime.ispresent() || field_frequencyShortListBeforeTime().elementIdentifier() !=  os_35){
  field_frequencyShortListBeforeTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyShortListBeforeTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(26)) {
    field_frequencyListBeforeTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_26_force_omit(26, force_omit, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyListBeforeTime().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_26_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyListBeforeTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyListBeforeTime.ispresent() || field_frequencyListBeforeTime().elementIdentifier() !=  os_16){
  field_frequencyListBeforeTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyListBeforeTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(27)) {
    field_descrOf1stCh__bt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_27_force_omit(27, force_omit, ChannelDescription2__TV_descr_.raw->forceomit);
  decoded_field_length = field_descrOf1stCh__bt().RAW_decode(ChannelDescription2__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_27_force_omit);
  if (decoded_field_length < 1) {
  field_descrOf1stCh__bt = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descrOf1stCh__bt.ispresent() || field_descrOf1stCh__bt().elementIdentifier() !=  os_18){
  field_descrOf1stCh__bt=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descrOf1stCh__bt=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(28)) {
    field_descrOf2ndCh__bt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_28_force_omit(28, force_omit, ChannelDescription__TV_descr_.raw->forceomit);
  decoded_field_length = field_descrOf2ndCh__bt().RAW_decode(ChannelDescription__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_28_force_omit);
  if (decoded_field_length < 1) {
  field_descrOf2ndCh__bt = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descrOf2ndCh__bt.ispresent() || field_descrOf2ndCh__bt().elementIdentifier() !=  os_17){
  field_descrOf2ndCh__bt=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descrOf2ndCh__bt=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(29)) {
    field_frequencyChannelSequence__bt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_29_force_omit(29, force_omit, FrequencyChannelSequence__TV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyChannelSequence__bt().RAW_decode(FrequencyChannelSequence__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_29_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyChannelSequence__bt = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyChannelSequence__bt.ispresent() || field_frequencyChannelSequence__bt().elementIdentifier() !=  os_19){
  field_frequencyChannelSequence__bt=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyChannelSequence__bt=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(30)) {
    field_mobileAllocation__bt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_30_force_omit(30, force_omit, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocation__bt().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_30_force_omit);
  if (decoded_field_length < 1) {
  field_mobileAllocation__bt = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileAllocation__bt.ispresent() || field_mobileAllocation__bt().elementIdentifier() !=  os_20){
  field_mobileAllocation__bt=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileAllocation__bt=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(31)) {
    field_cipherModeSetting = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_31_force_omit(31, force_omit, CipherModeSetting__TV_descr_.raw->forceomit);
  decoded_field_length = field_cipherModeSetting().RAW_decode(CipherModeSetting__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_31_force_omit);
  if (decoded_field_length < 1) {
  field_cipherModeSetting = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cipherModeSetting.ispresent() || field_cipherModeSetting().elementIdentifier() !=  bs_1){
  field_cipherModeSetting=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cipherModeSetting=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(32)) {
    field_vGCS__TargetModeIndication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_32_force_omit(32, force_omit, VGCS__TargetModeIndication__TLV_descr_.raw->forceomit);
  decoded_field_length = field_vGCS__TargetModeIndication().RAW_decode(VGCS__TargetModeIndication__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_32_force_omit);
  if (decoded_field_length < 1) {
  field_vGCS__TargetModeIndication = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_vGCS__TargetModeIndication.ispresent() || field_vGCS__TargetModeIndication().elementIdentifier() !=  os_21){
  field_vGCS__TargetModeIndication=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_vGCS__TargetModeIndication=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(33)) {
    field_multiRateConfiguration = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_33_force_omit(33, force_omit, MultiRateConfiguration__TLV_descr_.raw->forceomit);
  decoded_field_length = field_multiRateConfiguration().RAW_decode(MultiRateConfiguration__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_33_force_omit);
  if (decoded_field_length < 1) {
  field_multiRateConfiguration = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_multiRateConfiguration.ispresent() || field_multiRateConfiguration().elementIdentifier() !=  os_22){
  field_multiRateConfiguration=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_multiRateConfiguration=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(34)) {
    field_dynamicARFCN__Mapping = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_34_force_omit(34, force_omit, DynamicARFCN__Mapping__TLV_descr_.raw->forceomit);
  decoded_field_length = field_dynamicARFCN__Mapping().RAW_decode(DynamicARFCN__Mapping__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_34_force_omit);
  if (decoded_field_length < 1) {
  field_dynamicARFCN__Mapping = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_dynamicARFCN__Mapping.ispresent() || field_dynamicARFCN__Mapping().elementIdentifier() !=  os_28){
  field_dynamicARFCN__Mapping=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_dynamicARFCN__Mapping=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(35)) {
    field_vGCS__Ciphering__Parameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_35_force_omit(35, force_omit, VGCS__Ciphering__Parameters__TLV_descr_.raw->forceomit);
  decoded_field_length = field_vGCS__Ciphering__Parameters().RAW_decode(VGCS__Ciphering__Parameters__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_35_force_omit);
  if (decoded_field_length < 1) {
  field_vGCS__Ciphering__Parameters = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_vGCS__Ciphering__Parameters.ispresent() || field_vGCS__Ciphering__Parameters().elementIdentifier() !=  os_23){
  field_vGCS__Ciphering__Parameters=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_vGCS__Ciphering__Parameters=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(36)) {
    field_dedicatedServiceInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_36_force_omit(36, force_omit, DedicatedServiceInformation__TV_descr_.raw->forceomit);
  decoded_field_length = field_dedicatedServiceInformation().RAW_decode(DedicatedServiceInformation__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_36_force_omit);
  if (decoded_field_length < 1) {
  field_dedicatedServiceInformation = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_dedicatedServiceInformation.ispresent() || field_dedicatedServiceInformation().elementIdentifier() !=  os_39){
  field_dedicatedServiceInformation=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_dedicatedServiceInformation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(37)) {
    field_pLMNIndex = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_37_force_omit(37, force_omit, PLMNIndex__TV_descr_.raw->forceomit);
  decoded_field_length = field_pLMNIndex().RAW_decode(PLMNIndex__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_37_force_omit);
  if (decoded_field_length < 1) {
  field_pLMNIndex = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_pLMNIndex.ispresent() || field_pLMNIndex().elementIdentifier() !=  bs_4){
  field_pLMNIndex=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_pLMNIndex=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(38)) {
    field_extendedTSCSet__afterTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_38_force_omit(38, force_omit, ExtendedTSCSet__TV_descr_.raw->forceomit);
  decoded_field_length = field_extendedTSCSet__afterTime().RAW_decode(ExtendedTSCSet__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_38_force_omit);
  if (decoded_field_length < 1) {
  field_extendedTSCSet__afterTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_extendedTSCSet__afterTime.ispresent() || field_extendedTSCSet__afterTime().elementIdentifier() !=  os_2){
  field_extendedTSCSet__afterTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_extendedTSCSet__afterTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(39)) {
    field_extendedTSCSet__beforeTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_39_force_omit(39, force_omit, ExtendedTSCSet__TV_descr_.raw->forceomit);
  decoded_field_length = field_extendedTSCSet__beforeTime().RAW_decode(ExtendedTSCSet__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_39_force_omit);
  if (decoded_field_length < 1) {
  field_extendedTSCSet__beforeTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_extendedTSCSet__beforeTime.ispresent() || field_extendedTSCSet__beforeTime().elementIdentifier() !=  os_24){
  field_extendedTSCSet__beforeTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_extendedTSCSet__beforeTime=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__RRM__HandoverCommand__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 = 40;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(40);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CellDescription__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ChannelDescription2__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, HandoverReference__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PowerCommandAndAccesstype__V_descr_.raw);
  if (field_synchronizationIndication.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SynchronizationIndication__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_frequencyShortListAfterTime.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, FrequencyShortList__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_frequencyListAfterTime.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_cellChannelDescription.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, CellChannelDescription__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_multislotAllocation.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, MultislotAllocation__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_modeOfChannelSet1.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_modeOfChannelSet2.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_modeOfChannelSet3.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_modeOfChannelSet4.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_modeOfChannelSet5.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_modeOfChannelSet6.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_modeOfChannelSet7.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_modeOfChannelSet8.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_descrOf2ndCh__at.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, ChannelDescription__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_modeOf2ndChannel.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, ChannelMode2__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_frequencyChannelSequence__at.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, FrequencyChannelSequence__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_mobileAllocation__at.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_startingTime.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, StartingTime__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_timeDifference.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_timingAdvance.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, TimingAdvance__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  if (field_frequencyShortListBeforeTime.ispresent()) {
  myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 25, FrequencyShortList__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[25] = NULL;
  if (field_frequencyListBeforeTime.ispresent()) {
  myleaf.body.node.nodes[26] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 26, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[26] = NULL;
  if (field_descrOf1stCh__bt.ispresent()) {
  myleaf.body.node.nodes[27] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 27, ChannelDescription2__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[27] = NULL;
  if (field_descrOf2ndCh__bt.ispresent()) {
  myleaf.body.node.nodes[28] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 28, ChannelDescription__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[28] = NULL;
  if (field_frequencyChannelSequence__bt.ispresent()) {
  myleaf.body.node.nodes[29] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 29, FrequencyChannelSequence__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[29] = NULL;
  if (field_mobileAllocation__bt.ispresent()) {
  myleaf.body.node.nodes[30] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 30, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[30] = NULL;
  if (field_cipherModeSetting.ispresent()) {
  myleaf.body.node.nodes[31] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 31, CipherModeSetting__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[31] = NULL;
  if (field_vGCS__TargetModeIndication.ispresent()) {
  myleaf.body.node.nodes[32] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 32, VGCS__TargetModeIndication__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[32] = NULL;
  if (field_multiRateConfiguration.ispresent()) {
  myleaf.body.node.nodes[33] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 33, MultiRateConfiguration__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[33] = NULL;
  if (field_dynamicARFCN__Mapping.ispresent()) {
  myleaf.body.node.nodes[34] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 34, DynamicARFCN__Mapping__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[34] = NULL;
  if (field_vGCS__Ciphering__Parameters.ispresent()) {
  myleaf.body.node.nodes[35] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 35, VGCS__Ciphering__Parameters__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[35] = NULL;
  if (field_dedicatedServiceInformation.ispresent()) {
  myleaf.body.node.nodes[36] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 36, DedicatedServiceInformation__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[36] = NULL;
  if (field_pLMNIndex.ispresent()) {
  myleaf.body.node.nodes[37] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 37, PLMNIndex__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[37] = NULL;
  if (field_extendedTSCSet__afterTime.ispresent()) {
  myleaf.body.node.nodes[38] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 38, ExtendedTSCSet__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[38] = NULL;
  if (field_extendedTSCSet__beforeTime.ispresent()) {
  myleaf.body.node.nodes[39] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 39, ExtendedTSCSet__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[39] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cellDescription.RAW_encode(CellDescription__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_channelDescription2.RAW_encode(ChannelDescription2__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_handoverReference.RAW_encode(HandoverReference__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_powerCommandAndAccesstype.RAW_encode(PowerCommandAndAccesstype__V_descr_, *myleaf.body.node.nodes[4]);
  if (field_synchronizationIndication.ispresent()) {
  encoded_length += field_synchronizationIndication().RAW_encode(SynchronizationIndication__TV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_frequencyShortListAfterTime.ispresent()) {
  encoded_length += field_frequencyShortListAfterTime().RAW_encode(FrequencyShortList__TV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_frequencyListAfterTime.ispresent()) {
  encoded_length += field_frequencyListAfterTime().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_cellChannelDescription.ispresent()) {
  encoded_length += field_cellChannelDescription().RAW_encode(CellChannelDescription__TV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_multislotAllocation.ispresent()) {
  encoded_length += field_multislotAllocation().RAW_encode(MultislotAllocation__TLV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_modeOfChannelSet1.ispresent()) {
  encoded_length += field_modeOfChannelSet1().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_modeOfChannelSet2.ispresent()) {
  encoded_length += field_modeOfChannelSet2().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_modeOfChannelSet3.ispresent()) {
  encoded_length += field_modeOfChannelSet3().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_modeOfChannelSet4.ispresent()) {
  encoded_length += field_modeOfChannelSet4().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_modeOfChannelSet5.ispresent()) {
  encoded_length += field_modeOfChannelSet5().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_modeOfChannelSet6.ispresent()) {
  encoded_length += field_modeOfChannelSet6().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_modeOfChannelSet7.ispresent()) {
  encoded_length += field_modeOfChannelSet7().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_modeOfChannelSet8.ispresent()) {
  encoded_length += field_modeOfChannelSet8().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_descrOf2ndCh__at.ispresent()) {
  encoded_length += field_descrOf2ndCh__at().RAW_encode(ChannelDescription__TV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_modeOf2ndChannel.ispresent()) {
  encoded_length += field_modeOf2ndChannel().RAW_encode(ChannelMode2__TV_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_frequencyChannelSequence__at.ispresent()) {
  encoded_length += field_frequencyChannelSequence__at().RAW_encode(FrequencyChannelSequence__TV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_mobileAllocation__at.ispresent()) {
  encoded_length += field_mobileAllocation__at().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_startingTime.ispresent()) {
  encoded_length += field_startingTime().RAW_encode(StartingTime__TV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_timeDifference.ispresent()) {
  encoded_length += field_timeDifference().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_timingAdvance.ispresent()) {
  encoded_length += field_timingAdvance().RAW_encode(TimingAdvance__TV_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_frequencyShortListBeforeTime.ispresent()) {
  encoded_length += field_frequencyShortListBeforeTime().RAW_encode(FrequencyShortList__TV_descr_, *myleaf.body.node.nodes[25]);
  }
  if (field_frequencyListBeforeTime.ispresent()) {
  encoded_length += field_frequencyListBeforeTime().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[26]);
  }
  if (field_descrOf1stCh__bt.ispresent()) {
  encoded_length += field_descrOf1stCh__bt().RAW_encode(ChannelDescription2__TV_descr_, *myleaf.body.node.nodes[27]);
  }
  if (field_descrOf2ndCh__bt.ispresent()) {
  encoded_length += field_descrOf2ndCh__bt().RAW_encode(ChannelDescription__TV_descr_, *myleaf.body.node.nodes[28]);
  }
  if (field_frequencyChannelSequence__bt.ispresent()) {
  encoded_length += field_frequencyChannelSequence__bt().RAW_encode(FrequencyChannelSequence__TV_descr_, *myleaf.body.node.nodes[29]);
  }
  if (field_mobileAllocation__bt.ispresent()) {
  encoded_length += field_mobileAllocation__bt().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[30]);
  }
  if (field_cipherModeSetting.ispresent()) {
  encoded_length += field_cipherModeSetting().RAW_encode(CipherModeSetting__TV_descr_, *myleaf.body.node.nodes[31]);
  }
  if (field_vGCS__TargetModeIndication.ispresent()) {
  encoded_length += field_vGCS__TargetModeIndication().RAW_encode(VGCS__TargetModeIndication__TLV_descr_, *myleaf.body.node.nodes[32]);
  }
  if (field_multiRateConfiguration.ispresent()) {
  encoded_length += field_multiRateConfiguration().RAW_encode(MultiRateConfiguration__TLV_descr_, *myleaf.body.node.nodes[33]);
  }
  if (field_dynamicARFCN__Mapping.ispresent()) {
  encoded_length += field_dynamicARFCN__Mapping().RAW_encode(DynamicARFCN__Mapping__TLV_descr_, *myleaf.body.node.nodes[34]);
  }
  if (field_vGCS__Ciphering__Parameters.ispresent()) {
  encoded_length += field_vGCS__Ciphering__Parameters().RAW_encode(VGCS__Ciphering__Parameters__TLV_descr_, *myleaf.body.node.nodes[35]);
  }
  if (field_dedicatedServiceInformation.ispresent()) {
  encoded_length += field_dedicatedServiceInformation().RAW_encode(DedicatedServiceInformation__TV_descr_, *myleaf.body.node.nodes[36]);
  }
  if (field_pLMNIndex.ispresent()) {
  encoded_length += field_pLMNIndex().RAW_encode(PLMNIndex__TV_descr_, *myleaf.body.node.nodes[37]);
  }
  if (field_extendedTSCSet__afterTime.ispresent()) {
  encoded_length += field_extendedTSCSet__afterTime().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[38]);
  }
  if (field_extendedTSCSet__beforeTime.ispresent()) {
  encoded_length += field_extendedTSCSet__beforeTime().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[39]);
  }
  if (field_synchronizationIndication.ispresent() && (!field_synchronizationIndication.ispresent() || field_synchronizationIndication().elementIdentifier() !=  bs_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,3};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_6.RAW_encode(General__Types::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_frequencyShortListAfterTime.ispresent() && (!field_frequencyShortListAfterTime.ispresent() || field_frequencyShortListAfterTime().elementIdentifier() !=  os_36)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_36.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_frequencyListAfterTime.ispresent() && (!field_frequencyListAfterTime.ispresent() || field_frequencyListAfterTime().elementIdentifier() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_cellChannelDescription.ispresent() && (!field_cellChannelDescription.ispresent() || field_cellChannelDescription().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[]={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_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_multislotAllocation.ispresent() && (!field_multislotAllocation.ispresent() || field_multislotAllocation().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[]={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_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_modeOfChannelSet1.ispresent() && (!field_modeOfChannelSet1.ispresent() || field_modeOfChannelSet1().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[]={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_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_modeOfChannelSet2.ispresent() && (!field_modeOfChannelSet2.ispresent() || field_modeOfChannelSet2().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[]={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_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_modeOfChannelSet3.ispresent() && (!field_modeOfChannelSet3.ispresent() || field_modeOfChannelSet3().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[]={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_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_modeOfChannelSet4.ispresent() && (!field_modeOfChannelSet4.ispresent() || field_modeOfChannelSet4().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[]={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_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_modeOfChannelSet5.ispresent() && (!field_modeOfChannelSet5.ispresent() || field_modeOfChannelSet5().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[]={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_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_modeOfChannelSet6.ispresent() && (!field_modeOfChannelSet6.ispresent() || field_modeOfChannelSet6().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[]={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_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);
  }
  }
  if (field_modeOfChannelSet7.ispresent() && (!field_modeOfChannelSet7.ispresent() || field_modeOfChannelSet7().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[]={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_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);
  }
  }
  if (field_modeOfChannelSet8.ispresent() && (!field_modeOfChannelSet8.ispresent() || field_modeOfChannelSet8().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[]={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_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_descrOf2ndCh__at.ispresent() && (!field_descrOf2ndCh__at.ispresent() || field_descrOf2ndCh__at().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_modeOf2ndChannel.ispresent() && (!field_modeOf2ndChannel.ispresent() || field_modeOf2ndChannel().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[]={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_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_frequencyChannelSequence__at.ispresent() && (!field_frequencyChannelSequence__at.ispresent() || field_frequencyChannelSequence__at().elementIdentifier() !=  os_37)) {
  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_37.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_mobileAllocation__at.ispresent() && (!field_mobileAllocation__at.ispresent() || field_mobileAllocation__at().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[]={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_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_startingTime.ispresent() && (!field_startingTime.ispresent() || field_startingTime().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[]={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_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_timeDifference.ispresent() && (!field_timeDifference.ispresent() || field_timeDifference().elementIdentifier() !=  os_33)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_33.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_timingAdvance.ispresent() && (!field_timingAdvance.ispresent() || field_timingAdvance().elementIdentifier() !=  os_38)) {
  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_38.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_frequencyShortListBeforeTime.ispresent() && (!field_frequencyShortListBeforeTime.ispresent() || field_frequencyShortListBeforeTime().elementIdentifier() !=  os_35)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_35.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_frequencyListBeforeTime.ispresent() && (!field_frequencyListBeforeTime.ispresent() || field_frequencyListBeforeTime().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[]={26,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_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);
  }
  }
  if (field_descrOf1stCh__bt.ispresent() && (!field_descrOf1stCh__bt.ispresent() || field_descrOf1stCh__bt().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[]={27,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_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_descrOf2ndCh__bt.ispresent() && (!field_descrOf2ndCh__bt.ispresent() || field_descrOf2ndCh__bt().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={28,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_frequencyChannelSequence__bt.ispresent() && (!field_frequencyChannelSequence__bt.ispresent() || field_frequencyChannelSequence__bt().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[]={29,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_mobileAllocation__bt.ispresent() && (!field_mobileAllocation__bt.ispresent() || field_mobileAllocation__bt().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[]={30,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_cipherModeSetting.ispresent() && (!field_cipherModeSetting.ispresent() || field_cipherModeSetting().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[]={31,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_vGCS__TargetModeIndication.ispresent() && (!field_vGCS__TargetModeIndication.ispresent() || field_vGCS__TargetModeIndication().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[]={32,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_multiRateConfiguration.ispresent() && (!field_multiRateConfiguration.ispresent() || field_multiRateConfiguration().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[]={33,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_dynamicARFCN__Mapping.ispresent() && (!field_dynamicARFCN__Mapping.ispresent() || field_dynamicARFCN__Mapping().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[]={34,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_vGCS__Ciphering__Parameters.ispresent() && (!field_vGCS__Ciphering__Parameters.ispresent() || field_vGCS__Ciphering__Parameters().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[]={35,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_dedicatedServiceInformation.ispresent() && (!field_dedicatedServiceInformation.ispresent() || field_dedicatedServiceInformation().elementIdentifier() !=  os_39)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={36,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_39.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_pLMNIndex.ispresent() && (!field_pLMNIndex.ispresent() || field_pLMNIndex().elementIdentifier() !=  bs_4)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={37,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_4.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_extendedTSCSet__afterTime.ispresent() && (!field_extendedTSCSet__afterTime.ispresent() || field_extendedTSCSet__afterTime().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[]={38,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_extendedTSCSet__beforeTime.ispresent() && (!field_extendedTSCSet__beforeTime.ispresent() || field_extendedTSCSet__beforeTime().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[]={39,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);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__HandoverCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
CellDescription__V_template field_cellDescription;
ChannelDescription2__V_template field_channelDescription2;
HandoverReference__V_template field_handoverReference;
PowerCommandAndAccesstype__V_template field_powerCommandAndAccesstype;
SynchronizationIndication__TV_template field_synchronizationIndication;
FrequencyShortList__TV_template field_frequencyShortListAfterTime;
MobileL3__CommonIE__Types::Type4__TLV_template field_frequencyListAfterTime;
CellChannelDescription__TV_template field_cellChannelDescription;
MultislotAllocation__TLV_template field_multislotAllocation;
ChannelMode__TV_template field_modeOfChannelSet1;
ChannelMode__TV_template field_modeOfChannelSet2;
ChannelMode__TV_template field_modeOfChannelSet3;
ChannelMode__TV_template field_modeOfChannelSet4;
ChannelMode__TV_template field_modeOfChannelSet5;
ChannelMode__TV_template field_modeOfChannelSet6;
ChannelMode__TV_template field_modeOfChannelSet7;
ChannelMode__TV_template field_modeOfChannelSet8;
ChannelDescription__TV_template field_descrOf2ndCh__at;
ChannelMode2__TV_template field_modeOf2ndChannel;
FrequencyChannelSequence__TV_template field_frequencyChannelSequence__at;
MobileL3__CommonIE__Types::Type4__TLV_template field_mobileAllocation__at;
StartingTime__TV_template field_startingTime;
MobileL3__CommonIE__Types::Type4__TLV_template field_timeDifference;
TimingAdvance__TV_template field_timingAdvance;
FrequencyShortList__TV_template field_frequencyShortListBeforeTime;
MobileL3__CommonIE__Types::Type4__TLV_template field_frequencyListBeforeTime;
ChannelDescription2__TV_template field_descrOf1stCh__bt;
ChannelDescription__TV_template field_descrOf2ndCh__bt;
FrequencyChannelSequence__TV_template field_frequencyChannelSequence__bt;
MobileL3__CommonIE__Types::Type4__TLV_template field_mobileAllocation__bt;
CipherModeSetting__TV_template field_cipherModeSetting;
VGCS__TargetModeIndication__TLV_template field_vGCS__TargetModeIndication;
MultiRateConfiguration__TLV_template field_multiRateConfiguration;
DynamicARFCN__Mapping__TLV_template field_dynamicARFCN__Mapping;
VGCS__Ciphering__Parameters__TLV_template field_vGCS__Ciphering__Parameters;
DedicatedServiceInformation__TV_template field_dedicatedServiceInformation;
PLMNIndex__TV_template field_pLMNIndex;
ExtendedTSCSet__TV_template field_extendedTSCSet__afterTime;
ExtendedTSCSet__TV_template field_extendedTSCSet__beforeTime;
};

void PDU__RRM__HandoverCommand__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_cellDescription = ANY_VALUE;
single_value->field_channelDescription2 = ANY_VALUE;
single_value->field_handoverReference = ANY_VALUE;
single_value->field_powerCommandAndAccesstype = ANY_VALUE;
single_value->field_synchronizationIndication = ANY_OR_OMIT;
single_value->field_frequencyShortListAfterTime = ANY_OR_OMIT;
single_value->field_frequencyListAfterTime = ANY_OR_OMIT;
single_value->field_cellChannelDescription = ANY_OR_OMIT;
single_value->field_multislotAllocation = ANY_OR_OMIT;
single_value->field_modeOfChannelSet1 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet2 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet3 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet4 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet5 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet6 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet7 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet8 = ANY_OR_OMIT;
single_value->field_descrOf2ndCh__at = ANY_OR_OMIT;
single_value->field_modeOf2ndChannel = ANY_OR_OMIT;
single_value->field_frequencyChannelSequence__at = ANY_OR_OMIT;
single_value->field_mobileAllocation__at = ANY_OR_OMIT;
single_value->field_startingTime = ANY_OR_OMIT;
single_value->field_timeDifference = ANY_OR_OMIT;
single_value->field_timingAdvance = ANY_OR_OMIT;
single_value->field_frequencyShortListBeforeTime = ANY_OR_OMIT;
single_value->field_frequencyListBeforeTime = ANY_OR_OMIT;
single_value->field_descrOf1stCh__bt = ANY_OR_OMIT;
single_value->field_descrOf2ndCh__bt = ANY_OR_OMIT;
single_value->field_frequencyChannelSequence__bt = ANY_OR_OMIT;
single_value->field_mobileAllocation__bt = ANY_OR_OMIT;
single_value->field_cipherModeSetting = ANY_OR_OMIT;
single_value->field_vGCS__TargetModeIndication = ANY_OR_OMIT;
single_value->field_multiRateConfiguration = ANY_OR_OMIT;
single_value->field_dynamicARFCN__Mapping = ANY_OR_OMIT;
single_value->field_vGCS__Ciphering__Parameters = ANY_OR_OMIT;
single_value->field_dedicatedServiceInformation = ANY_OR_OMIT;
single_value->field_pLMNIndex = ANY_OR_OMIT;
single_value->field_extendedTSCSet__afterTime = ANY_OR_OMIT;
single_value->field_extendedTSCSet__beforeTime = ANY_OR_OMIT;
}
}
}

void PDU__RRM__HandoverCommand__NW__MS_template::copy_value(const PDU__RRM__HandoverCommand__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.cellDescription().is_bound()) {
  single_value->field_cellDescription = other_value.cellDescription();
} else {
  single_value->field_cellDescription.clean_up();
}
if (other_value.channelDescription2().is_bound()) {
  single_value->field_channelDescription2 = other_value.channelDescription2();
} else {
  single_value->field_channelDescription2.clean_up();
}
if (other_value.handoverReference().is_bound()) {
  single_value->field_handoverReference = other_value.handoverReference();
} else {
  single_value->field_handoverReference.clean_up();
}
if (other_value.powerCommandAndAccesstype().is_bound()) {
  single_value->field_powerCommandAndAccesstype = other_value.powerCommandAndAccesstype();
} else {
  single_value->field_powerCommandAndAccesstype.clean_up();
}
if (other_value.synchronizationIndication().is_bound()) {
  if (other_value.synchronizationIndication().ispresent()) single_value->field_synchronizationIndication = other_value.synchronizationIndication()();
  else single_value->field_synchronizationIndication = OMIT_VALUE;
} else {
  single_value->field_synchronizationIndication.clean_up();
}
if (other_value.frequencyShortListAfterTime().is_bound()) {
  if (other_value.frequencyShortListAfterTime().ispresent()) single_value->field_frequencyShortListAfterTime = other_value.frequencyShortListAfterTime()();
  else single_value->field_frequencyShortListAfterTime = OMIT_VALUE;
} else {
  single_value->field_frequencyShortListAfterTime.clean_up();
}
if (other_value.frequencyListAfterTime().is_bound()) {
  if (other_value.frequencyListAfterTime().ispresent()) single_value->field_frequencyListAfterTime = other_value.frequencyListAfterTime()();
  else single_value->field_frequencyListAfterTime = OMIT_VALUE;
} else {
  single_value->field_frequencyListAfterTime.clean_up();
}
if (other_value.cellChannelDescription().is_bound()) {
  if (other_value.cellChannelDescription().ispresent()) single_value->field_cellChannelDescription = other_value.cellChannelDescription()();
  else single_value->field_cellChannelDescription = OMIT_VALUE;
} else {
  single_value->field_cellChannelDescription.clean_up();
}
if (other_value.multislotAllocation().is_bound()) {
  if (other_value.multislotAllocation().ispresent()) single_value->field_multislotAllocation = other_value.multislotAllocation()();
  else single_value->field_multislotAllocation = OMIT_VALUE;
} else {
  single_value->field_multislotAllocation.clean_up();
}
if (other_value.modeOfChannelSet1().is_bound()) {
  if (other_value.modeOfChannelSet1().ispresent()) single_value->field_modeOfChannelSet1 = other_value.modeOfChannelSet1()();
  else single_value->field_modeOfChannelSet1 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet1.clean_up();
}
if (other_value.modeOfChannelSet2().is_bound()) {
  if (other_value.modeOfChannelSet2().ispresent()) single_value->field_modeOfChannelSet2 = other_value.modeOfChannelSet2()();
  else single_value->field_modeOfChannelSet2 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet2.clean_up();
}
if (other_value.modeOfChannelSet3().is_bound()) {
  if (other_value.modeOfChannelSet3().ispresent()) single_value->field_modeOfChannelSet3 = other_value.modeOfChannelSet3()();
  else single_value->field_modeOfChannelSet3 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet3.clean_up();
}
if (other_value.modeOfChannelSet4().is_bound()) {
  if (other_value.modeOfChannelSet4().ispresent()) single_value->field_modeOfChannelSet4 = other_value.modeOfChannelSet4()();
  else single_value->field_modeOfChannelSet4 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet4.clean_up();
}
if (other_value.modeOfChannelSet5().is_bound()) {
  if (other_value.modeOfChannelSet5().ispresent()) single_value->field_modeOfChannelSet5 = other_value.modeOfChannelSet5()();
  else single_value->field_modeOfChannelSet5 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet5.clean_up();
}
if (other_value.modeOfChannelSet6().is_bound()) {
  if (other_value.modeOfChannelSet6().ispresent()) single_value->field_modeOfChannelSet6 = other_value.modeOfChannelSet6()();
  else single_value->field_modeOfChannelSet6 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet6.clean_up();
}
if (other_value.modeOfChannelSet7().is_bound()) {
  if (other_value.modeOfChannelSet7().ispresent()) single_value->field_modeOfChannelSet7 = other_value.modeOfChannelSet7()();
  else single_value->field_modeOfChannelSet7 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet7.clean_up();
}
if (other_value.modeOfChannelSet8().is_bound()) {
  if (other_value.modeOfChannelSet8().ispresent()) single_value->field_modeOfChannelSet8 = other_value.modeOfChannelSet8()();
  else single_value->field_modeOfChannelSet8 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet8.clean_up();
}
if (other_value.descrOf2ndCh__at().is_bound()) {
  if (other_value.descrOf2ndCh__at().ispresent()) single_value->field_descrOf2ndCh__at = other_value.descrOf2ndCh__at()();
  else single_value->field_descrOf2ndCh__at = OMIT_VALUE;
} else {
  single_value->field_descrOf2ndCh__at.clean_up();
}
if (other_value.modeOf2ndChannel().is_bound()) {
  if (other_value.modeOf2ndChannel().ispresent()) single_value->field_modeOf2ndChannel = other_value.modeOf2ndChannel()();
  else single_value->field_modeOf2ndChannel = OMIT_VALUE;
} else {
  single_value->field_modeOf2ndChannel.clean_up();
}
if (other_value.frequencyChannelSequence__at().is_bound()) {
  if (other_value.frequencyChannelSequence__at().ispresent()) single_value->field_frequencyChannelSequence__at = other_value.frequencyChannelSequence__at()();
  else single_value->field_frequencyChannelSequence__at = OMIT_VALUE;
} else {
  single_value->field_frequencyChannelSequence__at.clean_up();
}
if (other_value.mobileAllocation__at().is_bound()) {
  if (other_value.mobileAllocation__at().ispresent()) single_value->field_mobileAllocation__at = other_value.mobileAllocation__at()();
  else single_value->field_mobileAllocation__at = OMIT_VALUE;
} else {
  single_value->field_mobileAllocation__at.clean_up();
}
if (other_value.startingTime().is_bound()) {
  if (other_value.startingTime().ispresent()) single_value->field_startingTime = other_value.startingTime()();
  else single_value->field_startingTime = OMIT_VALUE;
} else {
  single_value->field_startingTime.clean_up();
}
if (other_value.timeDifference().is_bound()) {
  if (other_value.timeDifference().ispresent()) single_value->field_timeDifference = other_value.timeDifference()();
  else single_value->field_timeDifference = OMIT_VALUE;
} else {
  single_value->field_timeDifference.clean_up();
}
if (other_value.timingAdvance().is_bound()) {
  if (other_value.timingAdvance().ispresent()) single_value->field_timingAdvance = other_value.timingAdvance()();
  else single_value->field_timingAdvance = OMIT_VALUE;
} else {
  single_value->field_timingAdvance.clean_up();
}
if (other_value.frequencyShortListBeforeTime().is_bound()) {
  if (other_value.frequencyShortListBeforeTime().ispresent()) single_value->field_frequencyShortListBeforeTime = other_value.frequencyShortListBeforeTime()();
  else single_value->field_frequencyShortListBeforeTime = OMIT_VALUE;
} else {
  single_value->field_frequencyShortListBeforeTime.clean_up();
}
if (other_value.frequencyListBeforeTime().is_bound()) {
  if (other_value.frequencyListBeforeTime().ispresent()) single_value->field_frequencyListBeforeTime = other_value.frequencyListBeforeTime()();
  else single_value->field_frequencyListBeforeTime = OMIT_VALUE;
} else {
  single_value->field_frequencyListBeforeTime.clean_up();
}
if (other_value.descrOf1stCh__bt().is_bound()) {
  if (other_value.descrOf1stCh__bt().ispresent()) single_value->field_descrOf1stCh__bt = other_value.descrOf1stCh__bt()();
  else single_value->field_descrOf1stCh__bt = OMIT_VALUE;
} else {
  single_value->field_descrOf1stCh__bt.clean_up();
}
if (other_value.descrOf2ndCh__bt().is_bound()) {
  if (other_value.descrOf2ndCh__bt().ispresent()) single_value->field_descrOf2ndCh__bt = other_value.descrOf2ndCh__bt()();
  else single_value->field_descrOf2ndCh__bt = OMIT_VALUE;
} else {
  single_value->field_descrOf2ndCh__bt.clean_up();
}
if (other_value.frequencyChannelSequence__bt().is_bound()) {
  if (other_value.frequencyChannelSequence__bt().ispresent()) single_value->field_frequencyChannelSequence__bt = other_value.frequencyChannelSequence__bt()();
  else single_value->field_frequencyChannelSequence__bt = OMIT_VALUE;
} else {
  single_value->field_frequencyChannelSequence__bt.clean_up();
}
if (other_value.mobileAllocation__bt().is_bound()) {
  if (other_value.mobileAllocation__bt().ispresent()) single_value->field_mobileAllocation__bt = other_value.mobileAllocation__bt()();
  else single_value->field_mobileAllocation__bt = OMIT_VALUE;
} else {
  single_value->field_mobileAllocation__bt.clean_up();
}
if (other_value.cipherModeSetting().is_bound()) {
  if (other_value.cipherModeSetting().ispresent()) single_value->field_cipherModeSetting = other_value.cipherModeSetting()();
  else single_value->field_cipherModeSetting = OMIT_VALUE;
} else {
  single_value->field_cipherModeSetting.clean_up();
}
if (other_value.vGCS__TargetModeIndication().is_bound()) {
  if (other_value.vGCS__TargetModeIndication().ispresent()) single_value->field_vGCS__TargetModeIndication = other_value.vGCS__TargetModeIndication()();
  else single_value->field_vGCS__TargetModeIndication = OMIT_VALUE;
} else {
  single_value->field_vGCS__TargetModeIndication.clean_up();
}
if (other_value.multiRateConfiguration().is_bound()) {
  if (other_value.multiRateConfiguration().ispresent()) single_value->field_multiRateConfiguration = other_value.multiRateConfiguration()();
  else single_value->field_multiRateConfiguration = OMIT_VALUE;
} else {
  single_value->field_multiRateConfiguration.clean_up();
}
if (other_value.dynamicARFCN__Mapping().is_bound()) {
  if (other_value.dynamicARFCN__Mapping().ispresent()) single_value->field_dynamicARFCN__Mapping = other_value.dynamicARFCN__Mapping()();
  else single_value->field_dynamicARFCN__Mapping = OMIT_VALUE;
} else {
  single_value->field_dynamicARFCN__Mapping.clean_up();
}
if (other_value.vGCS__Ciphering__Parameters().is_bound()) {
  if (other_value.vGCS__Ciphering__Parameters().ispresent()) single_value->field_vGCS__Ciphering__Parameters = other_value.vGCS__Ciphering__Parameters()();
  else single_value->field_vGCS__Ciphering__Parameters = OMIT_VALUE;
} else {
  single_value->field_vGCS__Ciphering__Parameters.clean_up();
}
if (other_value.dedicatedServiceInformation().is_bound()) {
  if (other_value.dedicatedServiceInformation().ispresent()) single_value->field_dedicatedServiceInformation = other_value.dedicatedServiceInformation()();
  else single_value->field_dedicatedServiceInformation = OMIT_VALUE;
} else {
  single_value->field_dedicatedServiceInformation.clean_up();
}
if (other_value.pLMNIndex().is_bound()) {
  if (other_value.pLMNIndex().ispresent()) single_value->field_pLMNIndex = other_value.pLMNIndex()();
  else single_value->field_pLMNIndex = OMIT_VALUE;
} else {
  single_value->field_pLMNIndex.clean_up();
}
if (other_value.extendedTSCSet__afterTime().is_bound()) {
  if (other_value.extendedTSCSet__afterTime().ispresent()) single_value->field_extendedTSCSet__afterTime = other_value.extendedTSCSet__afterTime()();
  else single_value->field_extendedTSCSet__afterTime = OMIT_VALUE;
} else {
  single_value->field_extendedTSCSet__afterTime.clean_up();
}
if (other_value.extendedTSCSet__beforeTime().is_bound()) {
  if (other_value.extendedTSCSet__beforeTime().ispresent()) single_value->field_extendedTSCSet__beforeTime = other_value.extendedTSCSet__beforeTime()();
  else single_value->field_extendedTSCSet__beforeTime = OMIT_VALUE;
} else {
  single_value->field_extendedTSCSet__beforeTime.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__HandoverCommand__NW__MS_template::copy_template(const PDU__RRM__HandoverCommand__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.cellDescription().get_selection()) {
single_value->field_cellDescription = other_value.cellDescription();
} else {
single_value->field_cellDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelDescription2().get_selection()) {
single_value->field_channelDescription2 = other_value.channelDescription2();
} else {
single_value->field_channelDescription2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.handoverReference().get_selection()) {
single_value->field_handoverReference = other_value.handoverReference();
} else {
single_value->field_handoverReference.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.powerCommandAndAccesstype().get_selection()) {
single_value->field_powerCommandAndAccesstype = other_value.powerCommandAndAccesstype();
} else {
single_value->field_powerCommandAndAccesstype.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.synchronizationIndication().get_selection()) {
single_value->field_synchronizationIndication = other_value.synchronizationIndication();
} else {
single_value->field_synchronizationIndication.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyShortListAfterTime().get_selection()) {
single_value->field_frequencyShortListAfterTime = other_value.frequencyShortListAfterTime();
} else {
single_value->field_frequencyShortListAfterTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyListAfterTime().get_selection()) {
single_value->field_frequencyListAfterTime = other_value.frequencyListAfterTime();
} else {
single_value->field_frequencyListAfterTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellChannelDescription().get_selection()) {
single_value->field_cellChannelDescription = other_value.cellChannelDescription();
} else {
single_value->field_cellChannelDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multislotAllocation().get_selection()) {
single_value->field_multislotAllocation = other_value.multislotAllocation();
} else {
single_value->field_multislotAllocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet1().get_selection()) {
single_value->field_modeOfChannelSet1 = other_value.modeOfChannelSet1();
} else {
single_value->field_modeOfChannelSet1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet2().get_selection()) {
single_value->field_modeOfChannelSet2 = other_value.modeOfChannelSet2();
} else {
single_value->field_modeOfChannelSet2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet3().get_selection()) {
single_value->field_modeOfChannelSet3 = other_value.modeOfChannelSet3();
} else {
single_value->field_modeOfChannelSet3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet4().get_selection()) {
single_value->field_modeOfChannelSet4 = other_value.modeOfChannelSet4();
} else {
single_value->field_modeOfChannelSet4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet5().get_selection()) {
single_value->field_modeOfChannelSet5 = other_value.modeOfChannelSet5();
} else {
single_value->field_modeOfChannelSet5.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet6().get_selection()) {
single_value->field_modeOfChannelSet6 = other_value.modeOfChannelSet6();
} else {
single_value->field_modeOfChannelSet6.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet7().get_selection()) {
single_value->field_modeOfChannelSet7 = other_value.modeOfChannelSet7();
} else {
single_value->field_modeOfChannelSet7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet8().get_selection()) {
single_value->field_modeOfChannelSet8 = other_value.modeOfChannelSet8();
} else {
single_value->field_modeOfChannelSet8.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descrOf2ndCh__at().get_selection()) {
single_value->field_descrOf2ndCh__at = other_value.descrOf2ndCh__at();
} else {
single_value->field_descrOf2ndCh__at.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOf2ndChannel().get_selection()) {
single_value->field_modeOf2ndChannel = other_value.modeOf2ndChannel();
} else {
single_value->field_modeOf2ndChannel.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyChannelSequence__at().get_selection()) {
single_value->field_frequencyChannelSequence__at = other_value.frequencyChannelSequence__at();
} else {
single_value->field_frequencyChannelSequence__at.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocation__at().get_selection()) {
single_value->field_mobileAllocation__at = other_value.mobileAllocation__at();
} else {
single_value->field_mobileAllocation__at.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.startingTime().get_selection()) {
single_value->field_startingTime = other_value.startingTime();
} else {
single_value->field_startingTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.timeDifference().get_selection()) {
single_value->field_timeDifference = other_value.timeDifference();
} else {
single_value->field_timeDifference.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.timingAdvance().get_selection()) {
single_value->field_timingAdvance = other_value.timingAdvance();
} else {
single_value->field_timingAdvance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyShortListBeforeTime().get_selection()) {
single_value->field_frequencyShortListBeforeTime = other_value.frequencyShortListBeforeTime();
} else {
single_value->field_frequencyShortListBeforeTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyListBeforeTime().get_selection()) {
single_value->field_frequencyListBeforeTime = other_value.frequencyListBeforeTime();
} else {
single_value->field_frequencyListBeforeTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descrOf1stCh__bt().get_selection()) {
single_value->field_descrOf1stCh__bt = other_value.descrOf1stCh__bt();
} else {
single_value->field_descrOf1stCh__bt.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descrOf2ndCh__bt().get_selection()) {
single_value->field_descrOf2ndCh__bt = other_value.descrOf2ndCh__bt();
} else {
single_value->field_descrOf2ndCh__bt.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyChannelSequence__bt().get_selection()) {
single_value->field_frequencyChannelSequence__bt = other_value.frequencyChannelSequence__bt();
} else {
single_value->field_frequencyChannelSequence__bt.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocation__bt().get_selection()) {
single_value->field_mobileAllocation__bt = other_value.mobileAllocation__bt();
} else {
single_value->field_mobileAllocation__bt.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipherModeSetting().get_selection()) {
single_value->field_cipherModeSetting = other_value.cipherModeSetting();
} else {
single_value->field_cipherModeSetting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vGCS__TargetModeIndication().get_selection()) {
single_value->field_vGCS__TargetModeIndication = other_value.vGCS__TargetModeIndication();
} else {
single_value->field_vGCS__TargetModeIndication.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multiRateConfiguration().get_selection()) {
single_value->field_multiRateConfiguration = other_value.multiRateConfiguration();
} else {
single_value->field_multiRateConfiguration.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dynamicARFCN__Mapping().get_selection()) {
single_value->field_dynamicARFCN__Mapping = other_value.dynamicARFCN__Mapping();
} else {
single_value->field_dynamicARFCN__Mapping.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vGCS__Ciphering__Parameters().get_selection()) {
single_value->field_vGCS__Ciphering__Parameters = other_value.vGCS__Ciphering__Parameters();
} else {
single_value->field_vGCS__Ciphering__Parameters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dedicatedServiceInformation().get_selection()) {
single_value->field_dedicatedServiceInformation = other_value.dedicatedServiceInformation();
} else {
single_value->field_dedicatedServiceInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pLMNIndex().get_selection()) {
single_value->field_pLMNIndex = other_value.pLMNIndex();
} else {
single_value->field_pLMNIndex.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedTSCSet__afterTime().get_selection()) {
single_value->field_extendedTSCSet__afterTime = other_value.extendedTSCSet__afterTime();
} else {
single_value->field_extendedTSCSet__afterTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedTSCSet__beforeTime().get_selection()) {
single_value->field_extendedTSCSet__beforeTime = other_value.extendedTSCSet__beforeTime();
} else {
single_value->field_extendedTSCSet__beforeTime.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__RRM__HandoverCommand__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__RRM__HandoverCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__HandoverCommand__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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__HandoverCommand__NW__MS_template::PDU__RRM__HandoverCommand__NW__MS_template()
{
}

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

PDU__RRM__HandoverCommand__NW__MS_template::PDU__RRM__HandoverCommand__NW__MS_template(const PDU__RRM__HandoverCommand__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__HandoverCommand__NW__MS_template::match(const PDU__RRM__HandoverCommand__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.cellDescription().is_bound()) return FALSE;
if(!single_value->field_cellDescription.match(other_value.cellDescription(), legacy))return FALSE;
if(!other_value.channelDescription2().is_bound()) return FALSE;
if(!single_value->field_channelDescription2.match(other_value.channelDescription2(), legacy))return FALSE;
if(!other_value.handoverReference().is_bound()) return FALSE;
if(!single_value->field_handoverReference.match(other_value.handoverReference(), legacy))return FALSE;
if(!other_value.powerCommandAndAccesstype().is_bound()) return FALSE;
if(!single_value->field_powerCommandAndAccesstype.match(other_value.powerCommandAndAccesstype(), legacy))return FALSE;
if(!other_value.synchronizationIndication().is_bound()) return FALSE;
if((other_value.synchronizationIndication().ispresent() ? !single_value->field_synchronizationIndication.match((const SynchronizationIndication__TV&)other_value.synchronizationIndication(), legacy) : !single_value->field_synchronizationIndication.match_omit(legacy)))return FALSE;
if(!other_value.frequencyShortListAfterTime().is_bound()) return FALSE;
if((other_value.frequencyShortListAfterTime().ispresent() ? !single_value->field_frequencyShortListAfterTime.match((const FrequencyShortList__TV&)other_value.frequencyShortListAfterTime(), legacy) : !single_value->field_frequencyShortListAfterTime.match_omit(legacy)))return FALSE;
if(!other_value.frequencyListAfterTime().is_bound()) return FALSE;
if((other_value.frequencyListAfterTime().ispresent() ? !single_value->field_frequencyListAfterTime.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.frequencyListAfterTime(), legacy) : !single_value->field_frequencyListAfterTime.match_omit(legacy)))return FALSE;
if(!other_value.cellChannelDescription().is_bound()) return FALSE;
if((other_value.cellChannelDescription().ispresent() ? !single_value->field_cellChannelDescription.match((const CellChannelDescription__TV&)other_value.cellChannelDescription(), legacy) : !single_value->field_cellChannelDescription.match_omit(legacy)))return FALSE;
if(!other_value.multislotAllocation().is_bound()) return FALSE;
if((other_value.multislotAllocation().ispresent() ? !single_value->field_multislotAllocation.match((const MultislotAllocation__TLV&)other_value.multislotAllocation(), legacy) : !single_value->field_multislotAllocation.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet1().is_bound()) return FALSE;
if((other_value.modeOfChannelSet1().ispresent() ? !single_value->field_modeOfChannelSet1.match((const ChannelMode__TV&)other_value.modeOfChannelSet1(), legacy) : !single_value->field_modeOfChannelSet1.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet2().is_bound()) return FALSE;
if((other_value.modeOfChannelSet2().ispresent() ? !single_value->field_modeOfChannelSet2.match((const ChannelMode__TV&)other_value.modeOfChannelSet2(), legacy) : !single_value->field_modeOfChannelSet2.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet3().is_bound()) return FALSE;
if((other_value.modeOfChannelSet3().ispresent() ? !single_value->field_modeOfChannelSet3.match((const ChannelMode__TV&)other_value.modeOfChannelSet3(), legacy) : !single_value->field_modeOfChannelSet3.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet4().is_bound()) return FALSE;
if((other_value.modeOfChannelSet4().ispresent() ? !single_value->field_modeOfChannelSet4.match((const ChannelMode__TV&)other_value.modeOfChannelSet4(), legacy) : !single_value->field_modeOfChannelSet4.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet5().is_bound()) return FALSE;
if((other_value.modeOfChannelSet5().ispresent() ? !single_value->field_modeOfChannelSet5.match((const ChannelMode__TV&)other_value.modeOfChannelSet5(), legacy) : !single_value->field_modeOfChannelSet5.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet6().is_bound()) return FALSE;
if((other_value.modeOfChannelSet6().ispresent() ? !single_value->field_modeOfChannelSet6.match((const ChannelMode__TV&)other_value.modeOfChannelSet6(), legacy) : !single_value->field_modeOfChannelSet6.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet7().is_bound()) return FALSE;
if((other_value.modeOfChannelSet7().ispresent() ? !single_value->field_modeOfChannelSet7.match((const ChannelMode__TV&)other_value.modeOfChannelSet7(), legacy) : !single_value->field_modeOfChannelSet7.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet8().is_bound()) return FALSE;
if((other_value.modeOfChannelSet8().ispresent() ? !single_value->field_modeOfChannelSet8.match((const ChannelMode__TV&)other_value.modeOfChannelSet8(), legacy) : !single_value->field_modeOfChannelSet8.match_omit(legacy)))return FALSE;
if(!other_value.descrOf2ndCh__at().is_bound()) return FALSE;
if((other_value.descrOf2ndCh__at().ispresent() ? !single_value->field_descrOf2ndCh__at.match((const ChannelDescription__TV&)other_value.descrOf2ndCh__at(), legacy) : !single_value->field_descrOf2ndCh__at.match_omit(legacy)))return FALSE;
if(!other_value.modeOf2ndChannel().is_bound()) return FALSE;
if((other_value.modeOf2ndChannel().ispresent() ? !single_value->field_modeOf2ndChannel.match((const ChannelMode2__TV&)other_value.modeOf2ndChannel(), legacy) : !single_value->field_modeOf2ndChannel.match_omit(legacy)))return FALSE;
if(!other_value.frequencyChannelSequence__at().is_bound()) return FALSE;
if((other_value.frequencyChannelSequence__at().ispresent() ? !single_value->field_frequencyChannelSequence__at.match((const FrequencyChannelSequence__TV&)other_value.frequencyChannelSequence__at(), legacy) : !single_value->field_frequencyChannelSequence__at.match_omit(legacy)))return FALSE;
if(!other_value.mobileAllocation__at().is_bound()) return FALSE;
if((other_value.mobileAllocation__at().ispresent() ? !single_value->field_mobileAllocation__at.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.mobileAllocation__at(), legacy) : !single_value->field_mobileAllocation__at.match_omit(legacy)))return FALSE;
if(!other_value.startingTime().is_bound()) return FALSE;
if((other_value.startingTime().ispresent() ? !single_value->field_startingTime.match((const StartingTime__TV&)other_value.startingTime(), legacy) : !single_value->field_startingTime.match_omit(legacy)))return FALSE;
if(!other_value.timeDifference().is_bound()) return FALSE;
if((other_value.timeDifference().ispresent() ? !single_value->field_timeDifference.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.timeDifference(), legacy) : !single_value->field_timeDifference.match_omit(legacy)))return FALSE;
if(!other_value.timingAdvance().is_bound()) return FALSE;
if((other_value.timingAdvance().ispresent() ? !single_value->field_timingAdvance.match((const TimingAdvance__TV&)other_value.timingAdvance(), legacy) : !single_value->field_timingAdvance.match_omit(legacy)))return FALSE;
if(!other_value.frequencyShortListBeforeTime().is_bound()) return FALSE;
if((other_value.frequencyShortListBeforeTime().ispresent() ? !single_value->field_frequencyShortListBeforeTime.match((const FrequencyShortList__TV&)other_value.frequencyShortListBeforeTime(), legacy) : !single_value->field_frequencyShortListBeforeTime.match_omit(legacy)))return FALSE;
if(!other_value.frequencyListBeforeTime().is_bound()) return FALSE;
if((other_value.frequencyListBeforeTime().ispresent() ? !single_value->field_frequencyListBeforeTime.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.frequencyListBeforeTime(), legacy) : !single_value->field_frequencyListBeforeTime.match_omit(legacy)))return FALSE;
if(!other_value.descrOf1stCh__bt().is_bound()) return FALSE;
if((other_value.descrOf1stCh__bt().ispresent() ? !single_value->field_descrOf1stCh__bt.match((const ChannelDescription2__TV&)other_value.descrOf1stCh__bt(), legacy) : !single_value->field_descrOf1stCh__bt.match_omit(legacy)))return FALSE;
if(!other_value.descrOf2ndCh__bt().is_bound()) return FALSE;
if((other_value.descrOf2ndCh__bt().ispresent() ? !single_value->field_descrOf2ndCh__bt.match((const ChannelDescription__TV&)other_value.descrOf2ndCh__bt(), legacy) : !single_value->field_descrOf2ndCh__bt.match_omit(legacy)))return FALSE;
if(!other_value.frequencyChannelSequence__bt().is_bound()) return FALSE;
if((other_value.frequencyChannelSequence__bt().ispresent() ? !single_value->field_frequencyChannelSequence__bt.match((const FrequencyChannelSequence__TV&)other_value.frequencyChannelSequence__bt(), legacy) : !single_value->field_frequencyChannelSequence__bt.match_omit(legacy)))return FALSE;
if(!other_value.mobileAllocation__bt().is_bound()) return FALSE;
if((other_value.mobileAllocation__bt().ispresent() ? !single_value->field_mobileAllocation__bt.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.mobileAllocation__bt(), legacy) : !single_value->field_mobileAllocation__bt.match_omit(legacy)))return FALSE;
if(!other_value.cipherModeSetting().is_bound()) return FALSE;
if((other_value.cipherModeSetting().ispresent() ? !single_value->field_cipherModeSetting.match((const CipherModeSetting__TV&)other_value.cipherModeSetting(), legacy) : !single_value->field_cipherModeSetting.match_omit(legacy)))return FALSE;
if(!other_value.vGCS__TargetModeIndication().is_bound()) return FALSE;
if((other_value.vGCS__TargetModeIndication().ispresent() ? !single_value->field_vGCS__TargetModeIndication.match((const VGCS__TargetModeIndication__TLV&)other_value.vGCS__TargetModeIndication(), legacy) : !single_value->field_vGCS__TargetModeIndication.match_omit(legacy)))return FALSE;
if(!other_value.multiRateConfiguration().is_bound()) return FALSE;
if((other_value.multiRateConfiguration().ispresent() ? !single_value->field_multiRateConfiguration.match((const MultiRateConfiguration__TLV&)other_value.multiRateConfiguration(), legacy) : !single_value->field_multiRateConfiguration.match_omit(legacy)))return FALSE;
if(!other_value.dynamicARFCN__Mapping().is_bound()) return FALSE;
if((other_value.dynamicARFCN__Mapping().ispresent() ? !single_value->field_dynamicARFCN__Mapping.match((const DynamicARFCN__Mapping__TLV&)other_value.dynamicARFCN__Mapping(), legacy) : !single_value->field_dynamicARFCN__Mapping.match_omit(legacy)))return FALSE;
if(!other_value.vGCS__Ciphering__Parameters().is_bound()) return FALSE;
if((other_value.vGCS__Ciphering__Parameters().ispresent() ? !single_value->field_vGCS__Ciphering__Parameters.match((const VGCS__Ciphering__Parameters__TLV&)other_value.vGCS__Ciphering__Parameters(), legacy) : !single_value->field_vGCS__Ciphering__Parameters.match_omit(legacy)))return FALSE;
if(!other_value.dedicatedServiceInformation().is_bound()) return FALSE;
if((other_value.dedicatedServiceInformation().ispresent() ? !single_value->field_dedicatedServiceInformation.match((const DedicatedServiceInformation__TV&)other_value.dedicatedServiceInformation(), legacy) : !single_value->field_dedicatedServiceInformation.match_omit(legacy)))return FALSE;
if(!other_value.pLMNIndex().is_bound()) return FALSE;
if((other_value.pLMNIndex().ispresent() ? !single_value->field_pLMNIndex.match((const PLMNIndex__TV&)other_value.pLMNIndex(), legacy) : !single_value->field_pLMNIndex.match_omit(legacy)))return FALSE;
if(!other_value.extendedTSCSet__afterTime().is_bound()) return FALSE;
if((other_value.extendedTSCSet__afterTime().ispresent() ? !single_value->field_extendedTSCSet__afterTime.match((const ExtendedTSCSet__TV&)other_value.extendedTSCSet__afterTime(), legacy) : !single_value->field_extendedTSCSet__afterTime.match_omit(legacy)))return FALSE;
if(!other_value.extendedTSCSet__beforeTime().is_bound()) return FALSE;
if((other_value.extendedTSCSet__beforeTime().ispresent() ? !single_value->field_extendedTSCSet__beforeTime.match((const ExtendedTSCSet__TV&)other_value.extendedTSCSet__beforeTime(), legacy) : !single_value->field_extendedTSCSet__beforeTime.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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__HandoverCommand__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_cellDescription.is_bound()
 || single_value->field_channelDescription2.is_bound()
 || single_value->field_handoverReference.is_bound()
 || single_value->field_powerCommandAndAccesstype.is_bound()
 || (single_value->field_synchronizationIndication.is_omit() || single_value->field_synchronizationIndication.is_bound())
 || (single_value->field_frequencyShortListAfterTime.is_omit() || single_value->field_frequencyShortListAfterTime.is_bound())
 || (single_value->field_frequencyListAfterTime.is_omit() || single_value->field_frequencyListAfterTime.is_bound())
 || (single_value->field_cellChannelDescription.is_omit() || single_value->field_cellChannelDescription.is_bound())
 || (single_value->field_multislotAllocation.is_omit() || single_value->field_multislotAllocation.is_bound())
 || (single_value->field_modeOfChannelSet1.is_omit() || single_value->field_modeOfChannelSet1.is_bound())
 || (single_value->field_modeOfChannelSet2.is_omit() || single_value->field_modeOfChannelSet2.is_bound())
 || (single_value->field_modeOfChannelSet3.is_omit() || single_value->field_modeOfChannelSet3.is_bound())
 || (single_value->field_modeOfChannelSet4.is_omit() || single_value->field_modeOfChannelSet4.is_bound())
 || (single_value->field_modeOfChannelSet5.is_omit() || single_value->field_modeOfChannelSet5.is_bound())
 || (single_value->field_modeOfChannelSet6.is_omit() || single_value->field_modeOfChannelSet6.is_bound())
 || (single_value->field_modeOfChannelSet7.is_omit() || single_value->field_modeOfChannelSet7.is_bound())
 || (single_value->field_modeOfChannelSet8.is_omit() || single_value->field_modeOfChannelSet8.is_bound())
 || (single_value->field_descrOf2ndCh__at.is_omit() || single_value->field_descrOf2ndCh__at.is_bound())
 || (single_value->field_modeOf2ndChannel.is_omit() || single_value->field_modeOf2ndChannel.is_bound())
 || (single_value->field_frequencyChannelSequence__at.is_omit() || single_value->field_frequencyChannelSequence__at.is_bound())
 || (single_value->field_mobileAllocation__at.is_omit() || single_value->field_mobileAllocation__at.is_bound())
 || (single_value->field_startingTime.is_omit() || single_value->field_startingTime.is_bound())
 || (single_value->field_timeDifference.is_omit() || single_value->field_timeDifference.is_bound())
 || (single_value->field_timingAdvance.is_omit() || single_value->field_timingAdvance.is_bound())
 || (single_value->field_frequencyShortListBeforeTime.is_omit() || single_value->field_frequencyShortListBeforeTime.is_bound())
 || (single_value->field_frequencyListBeforeTime.is_omit() || single_value->field_frequencyListBeforeTime.is_bound())
 || (single_value->field_descrOf1stCh__bt.is_omit() || single_value->field_descrOf1stCh__bt.is_bound())
 || (single_value->field_descrOf2ndCh__bt.is_omit() || single_value->field_descrOf2ndCh__bt.is_bound())
 || (single_value->field_frequencyChannelSequence__bt.is_omit() || single_value->field_frequencyChannelSequence__bt.is_bound())
 || (single_value->field_mobileAllocation__bt.is_omit() || single_value->field_mobileAllocation__bt.is_bound())
 || (single_value->field_cipherModeSetting.is_omit() || single_value->field_cipherModeSetting.is_bound())
 || (single_value->field_vGCS__TargetModeIndication.is_omit() || single_value->field_vGCS__TargetModeIndication.is_bound())
 || (single_value->field_multiRateConfiguration.is_omit() || single_value->field_multiRateConfiguration.is_bound())
 || (single_value->field_dynamicARFCN__Mapping.is_omit() || single_value->field_dynamicARFCN__Mapping.is_bound())
 || (single_value->field_vGCS__Ciphering__Parameters.is_omit() || single_value->field_vGCS__Ciphering__Parameters.is_bound())
 || (single_value->field_dedicatedServiceInformation.is_omit() || single_value->field_dedicatedServiceInformation.is_bound())
 || (single_value->field_pLMNIndex.is_omit() || single_value->field_pLMNIndex.is_bound())
 || (single_value->field_extendedTSCSet__afterTime.is_omit() || single_value->field_extendedTSCSet__afterTime.is_bound())
 || (single_value->field_extendedTSCSet__beforeTime.is_omit() || single_value->field_extendedTSCSet__beforeTime.is_bound());
}

boolean PDU__RRM__HandoverCommand__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_cellDescription.is_value()
 && single_value->field_channelDescription2.is_value()
 && single_value->field_handoverReference.is_value()
 && single_value->field_powerCommandAndAccesstype.is_value()
 && (single_value->field_synchronizationIndication.is_omit() || single_value->field_synchronizationIndication.is_value())
 && (single_value->field_frequencyShortListAfterTime.is_omit() || single_value->field_frequencyShortListAfterTime.is_value())
 && (single_value->field_frequencyListAfterTime.is_omit() || single_value->field_frequencyListAfterTime.is_value())
 && (single_value->field_cellChannelDescription.is_omit() || single_value->field_cellChannelDescription.is_value())
 && (single_value->field_multislotAllocation.is_omit() || single_value->field_multislotAllocation.is_value())
 && (single_value->field_modeOfChannelSet1.is_omit() || single_value->field_modeOfChannelSet1.is_value())
 && (single_value->field_modeOfChannelSet2.is_omit() || single_value->field_modeOfChannelSet2.is_value())
 && (single_value->field_modeOfChannelSet3.is_omit() || single_value->field_modeOfChannelSet3.is_value())
 && (single_value->field_modeOfChannelSet4.is_omit() || single_value->field_modeOfChannelSet4.is_value())
 && (single_value->field_modeOfChannelSet5.is_omit() || single_value->field_modeOfChannelSet5.is_value())
 && (single_value->field_modeOfChannelSet6.is_omit() || single_value->field_modeOfChannelSet6.is_value())
 && (single_value->field_modeOfChannelSet7.is_omit() || single_value->field_modeOfChannelSet7.is_value())
 && (single_value->field_modeOfChannelSet8.is_omit() || single_value->field_modeOfChannelSet8.is_value())
 && (single_value->field_descrOf2ndCh__at.is_omit() || single_value->field_descrOf2ndCh__at.is_value())
 && (single_value->field_modeOf2ndChannel.is_omit() || single_value->field_modeOf2ndChannel.is_value())
 && (single_value->field_frequencyChannelSequence__at.is_omit() || single_value->field_frequencyChannelSequence__at.is_value())
 && (single_value->field_mobileAllocation__at.is_omit() || single_value->field_mobileAllocation__at.is_value())
 && (single_value->field_startingTime.is_omit() || single_value->field_startingTime.is_value())
 && (single_value->field_timeDifference.is_omit() || single_value->field_timeDifference.is_value())
 && (single_value->field_timingAdvance.is_omit() || single_value->field_timingAdvance.is_value())
 && (single_value->field_frequencyShortListBeforeTime.is_omit() || single_value->field_frequencyShortListBeforeTime.is_value())
 && (single_value->field_frequencyListBeforeTime.is_omit() || single_value->field_frequencyListBeforeTime.is_value())
 && (single_value->field_descrOf1stCh__bt.is_omit() || single_value->field_descrOf1stCh__bt.is_value())
 && (single_value->field_descrOf2ndCh__bt.is_omit() || single_value->field_descrOf2ndCh__bt.is_value())
 && (single_value->field_frequencyChannelSequence__bt.is_omit() || single_value->field_frequencyChannelSequence__bt.is_value())
 && (single_value->field_mobileAllocation__bt.is_omit() || single_value->field_mobileAllocation__bt.is_value())
 && (single_value->field_cipherModeSetting.is_omit() || single_value->field_cipherModeSetting.is_value())
 && (single_value->field_vGCS__TargetModeIndication.is_omit() || single_value->field_vGCS__TargetModeIndication.is_value())
 && (single_value->field_multiRateConfiguration.is_omit() || single_value->field_multiRateConfiguration.is_value())
 && (single_value->field_dynamicARFCN__Mapping.is_omit() || single_value->field_dynamicARFCN__Mapping.is_value())
 && (single_value->field_vGCS__Ciphering__Parameters.is_omit() || single_value->field_vGCS__Ciphering__Parameters.is_value())
 && (single_value->field_dedicatedServiceInformation.is_omit() || single_value->field_dedicatedServiceInformation.is_value())
 && (single_value->field_pLMNIndex.is_omit() || single_value->field_pLMNIndex.is_value())
 && (single_value->field_extendedTSCSet__afterTime.is_omit() || single_value->field_extendedTSCSet__afterTime.is_value())
 && (single_value->field_extendedTSCSet__beforeTime.is_omit() || single_value->field_extendedTSCSet__beforeTime.is_value());
}

void PDU__RRM__HandoverCommand__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__RRM__HandoverCommand__NW__MS PDU__RRM__HandoverCommand__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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
PDU__RRM__HandoverCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_cellDescription.is_bound()) {
ret_val.cellDescription() = single_value->field_cellDescription.valueof();
}
if (single_value->field_channelDescription2.is_bound()) {
ret_val.channelDescription2() = single_value->field_channelDescription2.valueof();
}
if (single_value->field_handoverReference.is_bound()) {
ret_val.handoverReference() = single_value->field_handoverReference.valueof();
}
if (single_value->field_powerCommandAndAccesstype.is_bound()) {
ret_val.powerCommandAndAccesstype() = single_value->field_powerCommandAndAccesstype.valueof();
}
if (single_value->field_synchronizationIndication.is_omit()) ret_val.synchronizationIndication() = OMIT_VALUE;
else if (single_value->field_synchronizationIndication.is_bound()) {
ret_val.synchronizationIndication() = single_value->field_synchronizationIndication.valueof();
}
if (single_value->field_frequencyShortListAfterTime.is_omit()) ret_val.frequencyShortListAfterTime() = OMIT_VALUE;
else if (single_value->field_frequencyShortListAfterTime.is_bound()) {
ret_val.frequencyShortListAfterTime() = single_value->field_frequencyShortListAfterTime.valueof();
}
if (single_value->field_frequencyListAfterTime.is_omit()) ret_val.frequencyListAfterTime() = OMIT_VALUE;
else if (single_value->field_frequencyListAfterTime.is_bound()) {
ret_val.frequencyListAfterTime() = single_value->field_frequencyListAfterTime.valueof();
}
if (single_value->field_cellChannelDescription.is_omit()) ret_val.cellChannelDescription() = OMIT_VALUE;
else if (single_value->field_cellChannelDescription.is_bound()) {
ret_val.cellChannelDescription() = single_value->field_cellChannelDescription.valueof();
}
if (single_value->field_multislotAllocation.is_omit()) ret_val.multislotAllocation() = OMIT_VALUE;
else if (single_value->field_multislotAllocation.is_bound()) {
ret_val.multislotAllocation() = single_value->field_multislotAllocation.valueof();
}
if (single_value->field_modeOfChannelSet1.is_omit()) ret_val.modeOfChannelSet1() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet1.is_bound()) {
ret_val.modeOfChannelSet1() = single_value->field_modeOfChannelSet1.valueof();
}
if (single_value->field_modeOfChannelSet2.is_omit()) ret_val.modeOfChannelSet2() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet2.is_bound()) {
ret_val.modeOfChannelSet2() = single_value->field_modeOfChannelSet2.valueof();
}
if (single_value->field_modeOfChannelSet3.is_omit()) ret_val.modeOfChannelSet3() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet3.is_bound()) {
ret_val.modeOfChannelSet3() = single_value->field_modeOfChannelSet3.valueof();
}
if (single_value->field_modeOfChannelSet4.is_omit()) ret_val.modeOfChannelSet4() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet4.is_bound()) {
ret_val.modeOfChannelSet4() = single_value->field_modeOfChannelSet4.valueof();
}
if (single_value->field_modeOfChannelSet5.is_omit()) ret_val.modeOfChannelSet5() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet5.is_bound()) {
ret_val.modeOfChannelSet5() = single_value->field_modeOfChannelSet5.valueof();
}
if (single_value->field_modeOfChannelSet6.is_omit()) ret_val.modeOfChannelSet6() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet6.is_bound()) {
ret_val.modeOfChannelSet6() = single_value->field_modeOfChannelSet6.valueof();
}
if (single_value->field_modeOfChannelSet7.is_omit()) ret_val.modeOfChannelSet7() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet7.is_bound()) {
ret_val.modeOfChannelSet7() = single_value->field_modeOfChannelSet7.valueof();
}
if (single_value->field_modeOfChannelSet8.is_omit()) ret_val.modeOfChannelSet8() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet8.is_bound()) {
ret_val.modeOfChannelSet8() = single_value->field_modeOfChannelSet8.valueof();
}
if (single_value->field_descrOf2ndCh__at.is_omit()) ret_val.descrOf2ndCh__at() = OMIT_VALUE;
else if (single_value->field_descrOf2ndCh__at.is_bound()) {
ret_val.descrOf2ndCh__at() = single_value->field_descrOf2ndCh__at.valueof();
}
if (single_value->field_modeOf2ndChannel.is_omit()) ret_val.modeOf2ndChannel() = OMIT_VALUE;
else if (single_value->field_modeOf2ndChannel.is_bound()) {
ret_val.modeOf2ndChannel() = single_value->field_modeOf2ndChannel.valueof();
}
if (single_value->field_frequencyChannelSequence__at.is_omit()) ret_val.frequencyChannelSequence__at() = OMIT_VALUE;
else if (single_value->field_frequencyChannelSequence__at.is_bound()) {
ret_val.frequencyChannelSequence__at() = single_value->field_frequencyChannelSequence__at.valueof();
}
if (single_value->field_mobileAllocation__at.is_omit()) ret_val.mobileAllocation__at() = OMIT_VALUE;
else if (single_value->field_mobileAllocation__at.is_bound()) {
ret_val.mobileAllocation__at() = single_value->field_mobileAllocation__at.valueof();
}
if (single_value->field_startingTime.is_omit()) ret_val.startingTime() = OMIT_VALUE;
else if (single_value->field_startingTime.is_bound()) {
ret_val.startingTime() = single_value->field_startingTime.valueof();
}
if (single_value->field_timeDifference.is_omit()) ret_val.timeDifference() = OMIT_VALUE;
else if (single_value->field_timeDifference.is_bound()) {
ret_val.timeDifference() = single_value->field_timeDifference.valueof();
}
if (single_value->field_timingAdvance.is_omit()) ret_val.timingAdvance() = OMIT_VALUE;
else if (single_value->field_timingAdvance.is_bound()) {
ret_val.timingAdvance() = single_value->field_timingAdvance.valueof();
}
if (single_value->field_frequencyShortListBeforeTime.is_omit()) ret_val.frequencyShortListBeforeTime() = OMIT_VALUE;
else if (single_value->field_frequencyShortListBeforeTime.is_bound()) {
ret_val.frequencyShortListBeforeTime() = single_value->field_frequencyShortListBeforeTime.valueof();
}
if (single_value->field_frequencyListBeforeTime.is_omit()) ret_val.frequencyListBeforeTime() = OMIT_VALUE;
else if (single_value->field_frequencyListBeforeTime.is_bound()) {
ret_val.frequencyListBeforeTime() = single_value->field_frequencyListBeforeTime.valueof();
}
if (single_value->field_descrOf1stCh__bt.is_omit()) ret_val.descrOf1stCh__bt() = OMIT_VALUE;
else if (single_value->field_descrOf1stCh__bt.is_bound()) {
ret_val.descrOf1stCh__bt() = single_value->field_descrOf1stCh__bt.valueof();
}
if (single_value->field_descrOf2ndCh__bt.is_omit()) ret_val.descrOf2ndCh__bt() = OMIT_VALUE;
else if (single_value->field_descrOf2ndCh__bt.is_bound()) {
ret_val.descrOf2ndCh__bt() = single_value->field_descrOf2ndCh__bt.valueof();
}
if (single_value->field_frequencyChannelSequence__bt.is_omit()) ret_val.frequencyChannelSequence__bt() = OMIT_VALUE;
else if (single_value->field_frequencyChannelSequence__bt.is_bound()) {
ret_val.frequencyChannelSequence__bt() = single_value->field_frequencyChannelSequence__bt.valueof();
}
if (single_value->field_mobileAllocation__bt.is_omit()) ret_val.mobileAllocation__bt() = OMIT_VALUE;
else if (single_value->field_mobileAllocation__bt.is_bound()) {
ret_val.mobileAllocation__bt() = single_value->field_mobileAllocation__bt.valueof();
}
if (single_value->field_cipherModeSetting.is_omit()) ret_val.cipherModeSetting() = OMIT_VALUE;
else if (single_value->field_cipherModeSetting.is_bound()) {
ret_val.cipherModeSetting() = single_value->field_cipherModeSetting.valueof();
}
if (single_value->field_vGCS__TargetModeIndication.is_omit()) ret_val.vGCS__TargetModeIndication() = OMIT_VALUE;
else if (single_value->field_vGCS__TargetModeIndication.is_bound()) {
ret_val.vGCS__TargetModeIndication() = single_value->field_vGCS__TargetModeIndication.valueof();
}
if (single_value->field_multiRateConfiguration.is_omit()) ret_val.multiRateConfiguration() = OMIT_VALUE;
else if (single_value->field_multiRateConfiguration.is_bound()) {
ret_val.multiRateConfiguration() = single_value->field_multiRateConfiguration.valueof();
}
if (single_value->field_dynamicARFCN__Mapping.is_omit()) ret_val.dynamicARFCN__Mapping() = OMIT_VALUE;
else if (single_value->field_dynamicARFCN__Mapping.is_bound()) {
ret_val.dynamicARFCN__Mapping() = single_value->field_dynamicARFCN__Mapping.valueof();
}
if (single_value->field_vGCS__Ciphering__Parameters.is_omit()) ret_val.vGCS__Ciphering__Parameters() = OMIT_VALUE;
else if (single_value->field_vGCS__Ciphering__Parameters.is_bound()) {
ret_val.vGCS__Ciphering__Parameters() = single_value->field_vGCS__Ciphering__Parameters.valueof();
}
if (single_value->field_dedicatedServiceInformation.is_omit()) ret_val.dedicatedServiceInformation() = OMIT_VALUE;
else if (single_value->field_dedicatedServiceInformation.is_bound()) {
ret_val.dedicatedServiceInformation() = single_value->field_dedicatedServiceInformation.valueof();
}
if (single_value->field_pLMNIndex.is_omit()) ret_val.pLMNIndex() = OMIT_VALUE;
else if (single_value->field_pLMNIndex.is_bound()) {
ret_val.pLMNIndex() = single_value->field_pLMNIndex.valueof();
}
if (single_value->field_extendedTSCSet__afterTime.is_omit()) ret_val.extendedTSCSet__afterTime() = OMIT_VALUE;
else if (single_value->field_extendedTSCSet__afterTime.is_bound()) {
ret_val.extendedTSCSet__afterTime() = single_value->field_extendedTSCSet__afterTime.valueof();
}
if (single_value->field_extendedTSCSet__beforeTime.is_omit()) ret_val.extendedTSCSet__beforeTime() = OMIT_VALUE;
else if (single_value->field_extendedTSCSet__beforeTime.is_bound()) {
ret_val.extendedTSCSet__beforeTime() = single_value->field_extendedTSCSet__beforeTime.valueof();
}
return ret_val;
}

void PDU__RRM__HandoverCommand__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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__HandoverCommand__NW__MS_template[list_length];
}

PDU__RRM__HandoverCommand__NW__MS_template& PDU__RRM__HandoverCommand__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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return value_list.list_value[list_index];
}

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

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

CellDescription__V_template& PDU__RRM__HandoverCommand__NW__MS_template::cellDescription()
{
set_specific();
return single_value->field_cellDescription;
}

const CellDescription__V_template& PDU__RRM__HandoverCommand__NW__MS_template::cellDescription() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellDescription of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_cellDescription;
}

ChannelDescription2__V_template& PDU__RRM__HandoverCommand__NW__MS_template::channelDescription2()
{
set_specific();
return single_value->field_channelDescription2;
}

const ChannelDescription2__V_template& PDU__RRM__HandoverCommand__NW__MS_template::channelDescription2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelDescription2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_channelDescription2;
}

HandoverReference__V_template& PDU__RRM__HandoverCommand__NW__MS_template::handoverReference()
{
set_specific();
return single_value->field_handoverReference;
}

const HandoverReference__V_template& PDU__RRM__HandoverCommand__NW__MS_template::handoverReference() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field handoverReference of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_handoverReference;
}

PowerCommandAndAccesstype__V_template& PDU__RRM__HandoverCommand__NW__MS_template::powerCommandAndAccesstype()
{
set_specific();
return single_value->field_powerCommandAndAccesstype;
}

const PowerCommandAndAccesstype__V_template& PDU__RRM__HandoverCommand__NW__MS_template::powerCommandAndAccesstype() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field powerCommandAndAccesstype of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_powerCommandAndAccesstype;
}

SynchronizationIndication__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::synchronizationIndication()
{
set_specific();
return single_value->field_synchronizationIndication;
}

const SynchronizationIndication__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::synchronizationIndication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field synchronizationIndication of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_synchronizationIndication;
}

FrequencyShortList__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyShortListAfterTime()
{
set_specific();
return single_value->field_frequencyShortListAfterTime;
}

const FrequencyShortList__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyShortListAfterTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyShortListAfterTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_frequencyShortListAfterTime;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyListAfterTime()
{
set_specific();
return single_value->field_frequencyListAfterTime;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyListAfterTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyListAfterTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_frequencyListAfterTime;
}

CellChannelDescription__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::cellChannelDescription()
{
set_specific();
return single_value->field_cellChannelDescription;
}

const CellChannelDescription__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::cellChannelDescription() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellChannelDescription of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_cellChannelDescription;
}

MultislotAllocation__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::multislotAllocation()
{
set_specific();
return single_value->field_multislotAllocation;
}

const MultislotAllocation__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::multislotAllocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotAllocation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_multislotAllocation;
}

ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet1()
{
set_specific();
return single_value->field_modeOfChannelSet1;
}

const ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_modeOfChannelSet1;
}

ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet2()
{
set_specific();
return single_value->field_modeOfChannelSet2;
}

const ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_modeOfChannelSet2;
}

ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet3()
{
set_specific();
return single_value->field_modeOfChannelSet3;
}

const ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet3 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_modeOfChannelSet3;
}

ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet4()
{
set_specific();
return single_value->field_modeOfChannelSet4;
}

const ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet4 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_modeOfChannelSet4;
}

ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet5()
{
set_specific();
return single_value->field_modeOfChannelSet5;
}

const ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet5 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_modeOfChannelSet5;
}

ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet6()
{
set_specific();
return single_value->field_modeOfChannelSet6;
}

const ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet6() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet6 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_modeOfChannelSet6;
}

ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet7()
{
set_specific();
return single_value->field_modeOfChannelSet7;
}

const ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet7 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_modeOfChannelSet7;
}

ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet8()
{
set_specific();
return single_value->field_modeOfChannelSet8;
}

const ChannelMode__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOfChannelSet8() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet8 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_modeOfChannelSet8;
}

ChannelDescription__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::descrOf2ndCh__at()
{
set_specific();
return single_value->field_descrOf2ndCh__at;
}

const ChannelDescription__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::descrOf2ndCh__at() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrOf2ndCh_at of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_descrOf2ndCh__at;
}

ChannelMode2__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOf2ndChannel()
{
set_specific();
return single_value->field_modeOf2ndChannel;
}

const ChannelMode2__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::modeOf2ndChannel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOf2ndChannel of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_modeOf2ndChannel;
}

FrequencyChannelSequence__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyChannelSequence__at()
{
set_specific();
return single_value->field_frequencyChannelSequence__at;
}

const FrequencyChannelSequence__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyChannelSequence__at() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyChannelSequence_at of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_frequencyChannelSequence__at;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::mobileAllocation__at()
{
set_specific();
return single_value->field_mobileAllocation__at;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::mobileAllocation__at() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocation_at of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_mobileAllocation__at;
}

StartingTime__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::startingTime()
{
set_specific();
return single_value->field_startingTime;
}

const StartingTime__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::startingTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field startingTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_startingTime;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::timeDifference()
{
set_specific();
return single_value->field_timeDifference;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::timeDifference() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timeDifference of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_timeDifference;
}

TimingAdvance__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::timingAdvance()
{
set_specific();
return single_value->field_timingAdvance;
}

const TimingAdvance__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::timingAdvance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timingAdvance of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_timingAdvance;
}

FrequencyShortList__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyShortListBeforeTime()
{
set_specific();
return single_value->field_frequencyShortListBeforeTime;
}

const FrequencyShortList__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyShortListBeforeTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyShortListBeforeTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_frequencyShortListBeforeTime;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyListBeforeTime()
{
set_specific();
return single_value->field_frequencyListBeforeTime;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyListBeforeTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyListBeforeTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_frequencyListBeforeTime;
}

ChannelDescription2__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::descrOf1stCh__bt()
{
set_specific();
return single_value->field_descrOf1stCh__bt;
}

const ChannelDescription2__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::descrOf1stCh__bt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrOf1stCh_bt of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_descrOf1stCh__bt;
}

ChannelDescription__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::descrOf2ndCh__bt()
{
set_specific();
return single_value->field_descrOf2ndCh__bt;
}

const ChannelDescription__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::descrOf2ndCh__bt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrOf2ndCh_bt of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_descrOf2ndCh__bt;
}

FrequencyChannelSequence__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyChannelSequence__bt()
{
set_specific();
return single_value->field_frequencyChannelSequence__bt;
}

const FrequencyChannelSequence__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::frequencyChannelSequence__bt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyChannelSequence_bt of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_frequencyChannelSequence__bt;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::mobileAllocation__bt()
{
set_specific();
return single_value->field_mobileAllocation__bt;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::mobileAllocation__bt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocation_bt of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_mobileAllocation__bt;
}

CipherModeSetting__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::cipherModeSetting()
{
set_specific();
return single_value->field_cipherModeSetting;
}

const CipherModeSetting__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::cipherModeSetting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipherModeSetting of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_cipherModeSetting;
}

VGCS__TargetModeIndication__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::vGCS__TargetModeIndication()
{
set_specific();
return single_value->field_vGCS__TargetModeIndication;
}

const VGCS__TargetModeIndication__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::vGCS__TargetModeIndication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vGCS_TargetModeIndication of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_vGCS__TargetModeIndication;
}

MultiRateConfiguration__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::multiRateConfiguration()
{
set_specific();
return single_value->field_multiRateConfiguration;
}

const MultiRateConfiguration__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::multiRateConfiguration() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multiRateConfiguration of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_multiRateConfiguration;
}

DynamicARFCN__Mapping__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::dynamicARFCN__Mapping()
{
set_specific();
return single_value->field_dynamicARFCN__Mapping;
}

const DynamicARFCN__Mapping__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::dynamicARFCN__Mapping() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dynamicARFCN_Mapping of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_dynamicARFCN__Mapping;
}

VGCS__Ciphering__Parameters__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::vGCS__Ciphering__Parameters()
{
set_specific();
return single_value->field_vGCS__Ciphering__Parameters;
}

const VGCS__Ciphering__Parameters__TLV_template& PDU__RRM__HandoverCommand__NW__MS_template::vGCS__Ciphering__Parameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vGCS_Ciphering_Parameters of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_vGCS__Ciphering__Parameters;
}

DedicatedServiceInformation__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::dedicatedServiceInformation()
{
set_specific();
return single_value->field_dedicatedServiceInformation;
}

const DedicatedServiceInformation__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::dedicatedServiceInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dedicatedServiceInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_dedicatedServiceInformation;
}

PLMNIndex__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::pLMNIndex()
{
set_specific();
return single_value->field_pLMNIndex;
}

const PLMNIndex__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::pLMNIndex() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pLMNIndex of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_pLMNIndex;
}

ExtendedTSCSet__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::extendedTSCSet__afterTime()
{
set_specific();
return single_value->field_extendedTSCSet__afterTime;
}

const ExtendedTSCSet__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::extendedTSCSet__afterTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedTSCSet_afterTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_extendedTSCSet__afterTime;
}

ExtendedTSCSet__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::extendedTSCSet__beforeTime()
{
set_specific();
return single_value->field_extendedTSCSet__beforeTime;
}

const ExtendedTSCSet__TV_template& PDU__RRM__HandoverCommand__NW__MS_template::extendedTSCSet__beforeTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedTSCSet_beforeTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
return single_value->field_extendedTSCSet__beforeTime;
}

int PDU__RRM__HandoverCommand__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_synchronizationIndication.is_present()) ret_val++;
      if (single_value->field_frequencyShortListAfterTime.is_present()) ret_val++;
      if (single_value->field_frequencyListAfterTime.is_present()) ret_val++;
      if (single_value->field_cellChannelDescription.is_present()) ret_val++;
      if (single_value->field_multislotAllocation.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet1.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet2.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet3.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet4.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet5.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet6.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet7.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet8.is_present()) ret_val++;
      if (single_value->field_descrOf2ndCh__at.is_present()) ret_val++;
      if (single_value->field_modeOf2ndChannel.is_present()) ret_val++;
      if (single_value->field_frequencyChannelSequence__at.is_present()) ret_val++;
      if (single_value->field_mobileAllocation__at.is_present()) ret_val++;
      if (single_value->field_startingTime.is_present()) ret_val++;
      if (single_value->field_timeDifference.is_present()) ret_val++;
      if (single_value->field_timingAdvance.is_present()) ret_val++;
      if (single_value->field_frequencyShortListBeforeTime.is_present()) ret_val++;
      if (single_value->field_frequencyListBeforeTime.is_present()) ret_val++;
      if (single_value->field_descrOf1stCh__bt.is_present()) ret_val++;
      if (single_value->field_descrOf2ndCh__bt.is_present()) ret_val++;
      if (single_value->field_frequencyChannelSequence__bt.is_present()) ret_val++;
      if (single_value->field_mobileAllocation__bt.is_present()) ret_val++;
      if (single_value->field_cipherModeSetting.is_present()) ret_val++;
      if (single_value->field_vGCS__TargetModeIndication.is_present()) ret_val++;
      if (single_value->field_multiRateConfiguration.is_present()) ret_val++;
      if (single_value->field_dynamicARFCN__Mapping.is_present()) ret_val++;
      if (single_value->field_vGCS__Ciphering__Parameters.is_present()) ret_val++;
      if (single_value->field_dedicatedServiceInformation.is_present()) ret_val++;
      if (single_value->field_pLMNIndex.is_present()) ret_val++;
      if (single_value->field_extendedTSCSet__afterTime.is_present()) ret_val++;
      if (single_value->field_extendedTSCSet__beforeTime.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_RRM_Types.PDU_RRM_HandoverCommand_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_RRM_Types.PDU_RRM_HandoverCommand_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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
  }
  return 0;
}

void PDU__RRM__HandoverCommand__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(", cellDescription := ");
single_value->field_cellDescription.log();
TTCN_Logger::log_event_str(", channelDescription2 := ");
single_value->field_channelDescription2.log();
TTCN_Logger::log_event_str(", handoverReference := ");
single_value->field_handoverReference.log();
TTCN_Logger::log_event_str(", powerCommandAndAccesstype := ");
single_value->field_powerCommandAndAccesstype.log();
TTCN_Logger::log_event_str(", synchronizationIndication := ");
single_value->field_synchronizationIndication.log();
TTCN_Logger::log_event_str(", frequencyShortListAfterTime := ");
single_value->field_frequencyShortListAfterTime.log();
TTCN_Logger::log_event_str(", frequencyListAfterTime := ");
single_value->field_frequencyListAfterTime.log();
TTCN_Logger::log_event_str(", cellChannelDescription := ");
single_value->field_cellChannelDescription.log();
TTCN_Logger::log_event_str(", multislotAllocation := ");
single_value->field_multislotAllocation.log();
TTCN_Logger::log_event_str(", modeOfChannelSet1 := ");
single_value->field_modeOfChannelSet1.log();
TTCN_Logger::log_event_str(", modeOfChannelSet2 := ");
single_value->field_modeOfChannelSet2.log();
TTCN_Logger::log_event_str(", modeOfChannelSet3 := ");
single_value->field_modeOfChannelSet3.log();
TTCN_Logger::log_event_str(", modeOfChannelSet4 := ");
single_value->field_modeOfChannelSet4.log();
TTCN_Logger::log_event_str(", modeOfChannelSet5 := ");
single_value->field_modeOfChannelSet5.log();
TTCN_Logger::log_event_str(", modeOfChannelSet6 := ");
single_value->field_modeOfChannelSet6.log();
TTCN_Logger::log_event_str(", modeOfChannelSet7 := ");
single_value->field_modeOfChannelSet7.log();
TTCN_Logger::log_event_str(", modeOfChannelSet8 := ");
single_value->field_modeOfChannelSet8.log();
TTCN_Logger::log_event_str(", descrOf2ndCh_at := ");
single_value->field_descrOf2ndCh__at.log();
TTCN_Logger::log_event_str(", modeOf2ndChannel := ");
single_value->field_modeOf2ndChannel.log();
TTCN_Logger::log_event_str(", frequencyChannelSequence_at := ");
single_value->field_frequencyChannelSequence__at.log();
TTCN_Logger::log_event_str(", mobileAllocation_at := ");
single_value->field_mobileAllocation__at.log();
TTCN_Logger::log_event_str(", startingTime := ");
single_value->field_startingTime.log();
TTCN_Logger::log_event_str(", timeDifference := ");
single_value->field_timeDifference.log();
TTCN_Logger::log_event_str(", timingAdvance := ");
single_value->field_timingAdvance.log();
TTCN_Logger::log_event_str(", frequencyShortListBeforeTime := ");
single_value->field_frequencyShortListBeforeTime.log();
TTCN_Logger::log_event_str(", frequencyListBeforeTime := ");
single_value->field_frequencyListBeforeTime.log();
TTCN_Logger::log_event_str(", descrOf1stCh_bt := ");
single_value->field_descrOf1stCh__bt.log();
TTCN_Logger::log_event_str(", descrOf2ndCh_bt := ");
single_value->field_descrOf2ndCh__bt.log();
TTCN_Logger::log_event_str(", frequencyChannelSequence_bt := ");
single_value->field_frequencyChannelSequence__bt.log();
TTCN_Logger::log_event_str(", mobileAllocation_bt := ");
single_value->field_mobileAllocation__bt.log();
TTCN_Logger::log_event_str(", cipherModeSetting := ");
single_value->field_cipherModeSetting.log();
TTCN_Logger::log_event_str(", vGCS_TargetModeIndication := ");
single_value->field_vGCS__TargetModeIndication.log();
TTCN_Logger::log_event_str(", multiRateConfiguration := ");
single_value->field_multiRateConfiguration.log();
TTCN_Logger::log_event_str(", dynamicARFCN_Mapping := ");
single_value->field_dynamicARFCN__Mapping.log();
TTCN_Logger::log_event_str(", vGCS_Ciphering_Parameters := ");
single_value->field_vGCS__Ciphering__Parameters.log();
TTCN_Logger::log_event_str(", dedicatedServiceInformation := ");
single_value->field_dedicatedServiceInformation.log();
TTCN_Logger::log_event_str(", pLMNIndex := ");
single_value->field_pLMNIndex.log();
TTCN_Logger::log_event_str(", extendedTSCSet_afterTime := ");
single_value->field_extendedTSCSet__afterTime.log();
TTCN_Logger::log_event_str(", extendedTSCSet_beforeTime := ");
single_value->field_extendedTSCSet__beforeTime.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__RRM__HandoverCommand__NW__MS_template::log_match(const PDU__RRM__HandoverCommand__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_cellDescription.match(match_value.cellDescription(), legacy)){
TTCN_Logger::log_logmatch_info(".cellDescription");
single_value->field_cellDescription.log_match(match_value.cellDescription(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_channelDescription2.match(match_value.channelDescription2(), legacy)){
TTCN_Logger::log_logmatch_info(".channelDescription2");
single_value->field_channelDescription2.log_match(match_value.channelDescription2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_handoverReference.match(match_value.handoverReference(), legacy)){
TTCN_Logger::log_logmatch_info(".handoverReference");
single_value->field_handoverReference.log_match(match_value.handoverReference(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_powerCommandAndAccesstype.match(match_value.powerCommandAndAccesstype(), legacy)){
TTCN_Logger::log_logmatch_info(".powerCommandAndAccesstype");
single_value->field_powerCommandAndAccesstype.log_match(match_value.powerCommandAndAccesstype(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.synchronizationIndication().ispresent()){
if(!single_value->field_synchronizationIndication.match(match_value.synchronizationIndication(), legacy)){
TTCN_Logger::log_logmatch_info(".synchronizationIndication");
single_value->field_synchronizationIndication.log_match(match_value.synchronizationIndication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_synchronizationIndication.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".synchronizationIndication := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_synchronizationIndication.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyShortListAfterTime().ispresent()){
if(!single_value->field_frequencyShortListAfterTime.match(match_value.frequencyShortListAfterTime(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyShortListAfterTime");
single_value->field_frequencyShortListAfterTime.log_match(match_value.frequencyShortListAfterTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyShortListAfterTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyShortListAfterTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyShortListAfterTime.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyListAfterTime().ispresent()){
if(!single_value->field_frequencyListAfterTime.match(match_value.frequencyListAfterTime(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyListAfterTime");
single_value->field_frequencyListAfterTime.log_match(match_value.frequencyListAfterTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyListAfterTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyListAfterTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyListAfterTime.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cellChannelDescription().ispresent()){
if(!single_value->field_cellChannelDescription.match(match_value.cellChannelDescription(), legacy)){
TTCN_Logger::log_logmatch_info(".cellChannelDescription");
single_value->field_cellChannelDescription.log_match(match_value.cellChannelDescription(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellChannelDescription.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellChannelDescription := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellChannelDescription.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.multislotAllocation().ispresent()){
if(!single_value->field_multislotAllocation.match(match_value.multislotAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotAllocation");
single_value->field_multislotAllocation.log_match(match_value.multislotAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_multislotAllocation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".multislotAllocation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_multislotAllocation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet1().ispresent()){
if(!single_value->field_modeOfChannelSet1.match(match_value.modeOfChannelSet1(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet1");
single_value->field_modeOfChannelSet1.log_match(match_value.modeOfChannelSet1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet2().ispresent()){
if(!single_value->field_modeOfChannelSet2.match(match_value.modeOfChannelSet2(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet2");
single_value->field_modeOfChannelSet2.log_match(match_value.modeOfChannelSet2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet3().ispresent()){
if(!single_value->field_modeOfChannelSet3.match(match_value.modeOfChannelSet3(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet3");
single_value->field_modeOfChannelSet3.log_match(match_value.modeOfChannelSet3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet4().ispresent()){
if(!single_value->field_modeOfChannelSet4.match(match_value.modeOfChannelSet4(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet4");
single_value->field_modeOfChannelSet4.log_match(match_value.modeOfChannelSet4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet4.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet4 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet4.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet5().ispresent()){
if(!single_value->field_modeOfChannelSet5.match(match_value.modeOfChannelSet5(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet5");
single_value->field_modeOfChannelSet5.log_match(match_value.modeOfChannelSet5(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet5.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet5 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet5.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet6().ispresent()){
if(!single_value->field_modeOfChannelSet6.match(match_value.modeOfChannelSet6(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet6");
single_value->field_modeOfChannelSet6.log_match(match_value.modeOfChannelSet6(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet6.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet6 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet6.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet7().ispresent()){
if(!single_value->field_modeOfChannelSet7.match(match_value.modeOfChannelSet7(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet7");
single_value->field_modeOfChannelSet7.log_match(match_value.modeOfChannelSet7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet7.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet7 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet7.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet8().ispresent()){
if(!single_value->field_modeOfChannelSet8.match(match_value.modeOfChannelSet8(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet8");
single_value->field_modeOfChannelSet8.log_match(match_value.modeOfChannelSet8(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet8.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet8 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet8.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descrOf2ndCh__at().ispresent()){
if(!single_value->field_descrOf2ndCh__at.match(match_value.descrOf2ndCh__at(), legacy)){
TTCN_Logger::log_logmatch_info(".descrOf2ndCh_at");
single_value->field_descrOf2ndCh__at.log_match(match_value.descrOf2ndCh__at(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descrOf2ndCh__at.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descrOf2ndCh_at := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descrOf2ndCh__at.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOf2ndChannel().ispresent()){
if(!single_value->field_modeOf2ndChannel.match(match_value.modeOf2ndChannel(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOf2ndChannel");
single_value->field_modeOf2ndChannel.log_match(match_value.modeOf2ndChannel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOf2ndChannel.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOf2ndChannel := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOf2ndChannel.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyChannelSequence__at().ispresent()){
if(!single_value->field_frequencyChannelSequence__at.match(match_value.frequencyChannelSequence__at(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyChannelSequence_at");
single_value->field_frequencyChannelSequence__at.log_match(match_value.frequencyChannelSequence__at(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyChannelSequence__at.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyChannelSequence_at := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyChannelSequence__at.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileAllocation__at().ispresent()){
if(!single_value->field_mobileAllocation__at.match(match_value.mobileAllocation__at(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocation_at");
single_value->field_mobileAllocation__at.log_match(match_value.mobileAllocation__at(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileAllocation__at.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileAllocation_at := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileAllocation__at.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.startingTime().ispresent()){
if(!single_value->field_startingTime.match(match_value.startingTime(), legacy)){
TTCN_Logger::log_logmatch_info(".startingTime");
single_value->field_startingTime.log_match(match_value.startingTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_startingTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".startingTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_startingTime.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.timeDifference().ispresent()){
if(!single_value->field_timeDifference.match(match_value.timeDifference(), legacy)){
TTCN_Logger::log_logmatch_info(".timeDifference");
single_value->field_timeDifference.log_match(match_value.timeDifference(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_timeDifference.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".timeDifference := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_timeDifference.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.timingAdvance().ispresent()){
if(!single_value->field_timingAdvance.match(match_value.timingAdvance(), legacy)){
TTCN_Logger::log_logmatch_info(".timingAdvance");
single_value->field_timingAdvance.log_match(match_value.timingAdvance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_timingAdvance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".timingAdvance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_timingAdvance.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyShortListBeforeTime().ispresent()){
if(!single_value->field_frequencyShortListBeforeTime.match(match_value.frequencyShortListBeforeTime(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyShortListBeforeTime");
single_value->field_frequencyShortListBeforeTime.log_match(match_value.frequencyShortListBeforeTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyShortListBeforeTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyShortListBeforeTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyShortListBeforeTime.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyListBeforeTime().ispresent()){
if(!single_value->field_frequencyListBeforeTime.match(match_value.frequencyListBeforeTime(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyListBeforeTime");
single_value->field_frequencyListBeforeTime.log_match(match_value.frequencyListBeforeTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyListBeforeTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyListBeforeTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyListBeforeTime.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descrOf1stCh__bt().ispresent()){
if(!single_value->field_descrOf1stCh__bt.match(match_value.descrOf1stCh__bt(), legacy)){
TTCN_Logger::log_logmatch_info(".descrOf1stCh_bt");
single_value->field_descrOf1stCh__bt.log_match(match_value.descrOf1stCh__bt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descrOf1stCh__bt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descrOf1stCh_bt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descrOf1stCh__bt.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descrOf2ndCh__bt().ispresent()){
if(!single_value->field_descrOf2ndCh__bt.match(match_value.descrOf2ndCh__bt(), legacy)){
TTCN_Logger::log_logmatch_info(".descrOf2ndCh_bt");
single_value->field_descrOf2ndCh__bt.log_match(match_value.descrOf2ndCh__bt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descrOf2ndCh__bt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descrOf2ndCh_bt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descrOf2ndCh__bt.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyChannelSequence__bt().ispresent()){
if(!single_value->field_frequencyChannelSequence__bt.match(match_value.frequencyChannelSequence__bt(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyChannelSequence_bt");
single_value->field_frequencyChannelSequence__bt.log_match(match_value.frequencyChannelSequence__bt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyChannelSequence__bt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyChannelSequence_bt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyChannelSequence__bt.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileAllocation__bt().ispresent()){
if(!single_value->field_mobileAllocation__bt.match(match_value.mobileAllocation__bt(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocation_bt");
single_value->field_mobileAllocation__bt.log_match(match_value.mobileAllocation__bt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileAllocation__bt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileAllocation_bt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileAllocation__bt.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cipherModeSetting().ispresent()){
if(!single_value->field_cipherModeSetting.match(match_value.cipherModeSetting(), legacy)){
TTCN_Logger::log_logmatch_info(".cipherModeSetting");
single_value->field_cipherModeSetting.log_match(match_value.cipherModeSetting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cipherModeSetting.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cipherModeSetting := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cipherModeSetting.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.vGCS__TargetModeIndication().ispresent()){
if(!single_value->field_vGCS__TargetModeIndication.match(match_value.vGCS__TargetModeIndication(), legacy)){
TTCN_Logger::log_logmatch_info(".vGCS_TargetModeIndication");
single_value->field_vGCS__TargetModeIndication.log_match(match_value.vGCS__TargetModeIndication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_vGCS__TargetModeIndication.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".vGCS_TargetModeIndication := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_vGCS__TargetModeIndication.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.multiRateConfiguration().ispresent()){
if(!single_value->field_multiRateConfiguration.match(match_value.multiRateConfiguration(), legacy)){
TTCN_Logger::log_logmatch_info(".multiRateConfiguration");
single_value->field_multiRateConfiguration.log_match(match_value.multiRateConfiguration(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_multiRateConfiguration.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".multiRateConfiguration := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_multiRateConfiguration.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.dynamicARFCN__Mapping().ispresent()){
if(!single_value->field_dynamicARFCN__Mapping.match(match_value.dynamicARFCN__Mapping(), legacy)){
TTCN_Logger::log_logmatch_info(".dynamicARFCN_Mapping");
single_value->field_dynamicARFCN__Mapping.log_match(match_value.dynamicARFCN__Mapping(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dynamicARFCN__Mapping.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dynamicARFCN_Mapping := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dynamicARFCN__Mapping.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.vGCS__Ciphering__Parameters().ispresent()){
if(!single_value->field_vGCS__Ciphering__Parameters.match(match_value.vGCS__Ciphering__Parameters(), legacy)){
TTCN_Logger::log_logmatch_info(".vGCS_Ciphering_Parameters");
single_value->field_vGCS__Ciphering__Parameters.log_match(match_value.vGCS__Ciphering__Parameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_vGCS__Ciphering__Parameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".vGCS_Ciphering_Parameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_vGCS__Ciphering__Parameters.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.dedicatedServiceInformation().ispresent()){
if(!single_value->field_dedicatedServiceInformation.match(match_value.dedicatedServiceInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".dedicatedServiceInformation");
single_value->field_dedicatedServiceInformation.log_match(match_value.dedicatedServiceInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dedicatedServiceInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dedicatedServiceInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dedicatedServiceInformation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pLMNIndex().ispresent()){
if(!single_value->field_pLMNIndex.match(match_value.pLMNIndex(), legacy)){
TTCN_Logger::log_logmatch_info(".pLMNIndex");
single_value->field_pLMNIndex.log_match(match_value.pLMNIndex(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pLMNIndex.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pLMNIndex := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pLMNIndex.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedTSCSet__afterTime().ispresent()){
if(!single_value->field_extendedTSCSet__afterTime.match(match_value.extendedTSCSet__afterTime(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedTSCSet_afterTime");
single_value->field_extendedTSCSet__afterTime.log_match(match_value.extendedTSCSet__afterTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedTSCSet__afterTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedTSCSet_afterTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedTSCSet__afterTime.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedTSCSet__beforeTime().ispresent()){
if(!single_value->field_extendedTSCSet__beforeTime.match(match_value.extendedTSCSet__beforeTime(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedTSCSet_beforeTime");
single_value->field_extendedTSCSet__beforeTime.log_match(match_value.extendedTSCSet__beforeTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedTSCSet__beforeTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedTSCSet_beforeTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedTSCSet__beforeTime.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(", cellDescription := ");
single_value->field_cellDescription.log_match(match_value.cellDescription(), legacy);
TTCN_Logger::log_event_str(", channelDescription2 := ");
single_value->field_channelDescription2.log_match(match_value.channelDescription2(), legacy);
TTCN_Logger::log_event_str(", handoverReference := ");
single_value->field_handoverReference.log_match(match_value.handoverReference(), legacy);
TTCN_Logger::log_event_str(", powerCommandAndAccesstype := ");
single_value->field_powerCommandAndAccesstype.log_match(match_value.powerCommandAndAccesstype(), legacy);
TTCN_Logger::log_event_str(", synchronizationIndication := ");
if (match_value.synchronizationIndication().ispresent()) {
single_value->field_synchronizationIndication.log_match(match_value.synchronizationIndication(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_synchronizationIndication.log();
if (single_value->field_synchronizationIndication.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyShortListAfterTime := ");
if (match_value.frequencyShortListAfterTime().ispresent()) {
single_value->field_frequencyShortListAfterTime.log_match(match_value.frequencyShortListAfterTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyShortListAfterTime.log();
if (single_value->field_frequencyShortListAfterTime.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyListAfterTime := ");
if (match_value.frequencyListAfterTime().ispresent()) {
single_value->field_frequencyListAfterTime.log_match(match_value.frequencyListAfterTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyListAfterTime.log();
if (single_value->field_frequencyListAfterTime.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cellChannelDescription := ");
if (match_value.cellChannelDescription().ispresent()) {
single_value->field_cellChannelDescription.log_match(match_value.cellChannelDescription(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellChannelDescription.log();
if (single_value->field_cellChannelDescription.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", multislotAllocation := ");
if (match_value.multislotAllocation().ispresent()) {
single_value->field_multislotAllocation.log_match(match_value.multislotAllocation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_multislotAllocation.log();
if (single_value->field_multislotAllocation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet1 := ");
if (match_value.modeOfChannelSet1().ispresent()) {
single_value->field_modeOfChannelSet1.log_match(match_value.modeOfChannelSet1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet1.log();
if (single_value->field_modeOfChannelSet1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet2 := ");
if (match_value.modeOfChannelSet2().ispresent()) {
single_value->field_modeOfChannelSet2.log_match(match_value.modeOfChannelSet2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet2.log();
if (single_value->field_modeOfChannelSet2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet3 := ");
if (match_value.modeOfChannelSet3().ispresent()) {
single_value->field_modeOfChannelSet3.log_match(match_value.modeOfChannelSet3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet3.log();
if (single_value->field_modeOfChannelSet3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet4 := ");
if (match_value.modeOfChannelSet4().ispresent()) {
single_value->field_modeOfChannelSet4.log_match(match_value.modeOfChannelSet4(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet4.log();
if (single_value->field_modeOfChannelSet4.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet5 := ");
if (match_value.modeOfChannelSet5().ispresent()) {
single_value->field_modeOfChannelSet5.log_match(match_value.modeOfChannelSet5(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet5.log();
if (single_value->field_modeOfChannelSet5.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet6 := ");
if (match_value.modeOfChannelSet6().ispresent()) {
single_value->field_modeOfChannelSet6.log_match(match_value.modeOfChannelSet6(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet6.log();
if (single_value->field_modeOfChannelSet6.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet7 := ");
if (match_value.modeOfChannelSet7().ispresent()) {
single_value->field_modeOfChannelSet7.log_match(match_value.modeOfChannelSet7(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet7.log();
if (single_value->field_modeOfChannelSet7.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet8 := ");
if (match_value.modeOfChannelSet8().ispresent()) {
single_value->field_modeOfChannelSet8.log_match(match_value.modeOfChannelSet8(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet8.log();
if (single_value->field_modeOfChannelSet8.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descrOf2ndCh_at := ");
if (match_value.descrOf2ndCh__at().ispresent()) {
single_value->field_descrOf2ndCh__at.log_match(match_value.descrOf2ndCh__at(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descrOf2ndCh__at.log();
if (single_value->field_descrOf2ndCh__at.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOf2ndChannel := ");
if (match_value.modeOf2ndChannel().ispresent()) {
single_value->field_modeOf2ndChannel.log_match(match_value.modeOf2ndChannel(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOf2ndChannel.log();
if (single_value->field_modeOf2ndChannel.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyChannelSequence_at := ");
if (match_value.frequencyChannelSequence__at().ispresent()) {
single_value->field_frequencyChannelSequence__at.log_match(match_value.frequencyChannelSequence__at(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyChannelSequence__at.log();
if (single_value->field_frequencyChannelSequence__at.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileAllocation_at := ");
if (match_value.mobileAllocation__at().ispresent()) {
single_value->field_mobileAllocation__at.log_match(match_value.mobileAllocation__at(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileAllocation__at.log();
if (single_value->field_mobileAllocation__at.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", startingTime := ");
if (match_value.startingTime().ispresent()) {
single_value->field_startingTime.log_match(match_value.startingTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_startingTime.log();
if (single_value->field_startingTime.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", timeDifference := ");
if (match_value.timeDifference().ispresent()) {
single_value->field_timeDifference.log_match(match_value.timeDifference(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_timeDifference.log();
if (single_value->field_timeDifference.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", timingAdvance := ");
if (match_value.timingAdvance().ispresent()) {
single_value->field_timingAdvance.log_match(match_value.timingAdvance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_timingAdvance.log();
if (single_value->field_timingAdvance.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyShortListBeforeTime := ");
if (match_value.frequencyShortListBeforeTime().ispresent()) {
single_value->field_frequencyShortListBeforeTime.log_match(match_value.frequencyShortListBeforeTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyShortListBeforeTime.log();
if (single_value->field_frequencyShortListBeforeTime.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyListBeforeTime := ");
if (match_value.frequencyListBeforeTime().ispresent()) {
single_value->field_frequencyListBeforeTime.log_match(match_value.frequencyListBeforeTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyListBeforeTime.log();
if (single_value->field_frequencyListBeforeTime.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descrOf1stCh_bt := ");
if (match_value.descrOf1stCh__bt().ispresent()) {
single_value->field_descrOf1stCh__bt.log_match(match_value.descrOf1stCh__bt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descrOf1stCh__bt.log();
if (single_value->field_descrOf1stCh__bt.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descrOf2ndCh_bt := ");
if (match_value.descrOf2ndCh__bt().ispresent()) {
single_value->field_descrOf2ndCh__bt.log_match(match_value.descrOf2ndCh__bt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descrOf2ndCh__bt.log();
if (single_value->field_descrOf2ndCh__bt.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyChannelSequence_bt := ");
if (match_value.frequencyChannelSequence__bt().ispresent()) {
single_value->field_frequencyChannelSequence__bt.log_match(match_value.frequencyChannelSequence__bt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyChannelSequence__bt.log();
if (single_value->field_frequencyChannelSequence__bt.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileAllocation_bt := ");
if (match_value.mobileAllocation__bt().ispresent()) {
single_value->field_mobileAllocation__bt.log_match(match_value.mobileAllocation__bt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileAllocation__bt.log();
if (single_value->field_mobileAllocation__bt.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cipherModeSetting := ");
if (match_value.cipherModeSetting().ispresent()) {
single_value->field_cipherModeSetting.log_match(match_value.cipherModeSetting(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cipherModeSetting.log();
if (single_value->field_cipherModeSetting.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", vGCS_TargetModeIndication := ");
if (match_value.vGCS__TargetModeIndication().ispresent()) {
single_value->field_vGCS__TargetModeIndication.log_match(match_value.vGCS__TargetModeIndication(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_vGCS__TargetModeIndication.log();
if (single_value->field_vGCS__TargetModeIndication.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", multiRateConfiguration := ");
if (match_value.multiRateConfiguration().ispresent()) {
single_value->field_multiRateConfiguration.log_match(match_value.multiRateConfiguration(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_multiRateConfiguration.log();
if (single_value->field_multiRateConfiguration.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", dynamicARFCN_Mapping := ");
if (match_value.dynamicARFCN__Mapping().ispresent()) {
single_value->field_dynamicARFCN__Mapping.log_match(match_value.dynamicARFCN__Mapping(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dynamicARFCN__Mapping.log();
if (single_value->field_dynamicARFCN__Mapping.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", vGCS_Ciphering_Parameters := ");
if (match_value.vGCS__Ciphering__Parameters().ispresent()) {
single_value->field_vGCS__Ciphering__Parameters.log_match(match_value.vGCS__Ciphering__Parameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_vGCS__Ciphering__Parameters.log();
if (single_value->field_vGCS__Ciphering__Parameters.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", dedicatedServiceInformation := ");
if (match_value.dedicatedServiceInformation().ispresent()) {
single_value->field_dedicatedServiceInformation.log_match(match_value.dedicatedServiceInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dedicatedServiceInformation.log();
if (single_value->field_dedicatedServiceInformation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pLMNIndex := ");
if (match_value.pLMNIndex().ispresent()) {
single_value->field_pLMNIndex.log_match(match_value.pLMNIndex(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pLMNIndex.log();
if (single_value->field_pLMNIndex.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedTSCSet_afterTime := ");
if (match_value.extendedTSCSet__afterTime().ispresent()) {
single_value->field_extendedTSCSet__afterTime.log_match(match_value.extendedTSCSet__afterTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedTSCSet__afterTime.log();
if (single_value->field_extendedTSCSet__afterTime.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedTSCSet_beforeTime := ");
if (match_value.extendedTSCSet__beforeTime().ispresent()) {
single_value->field_extendedTSCSet__beforeTime.log_match(match_value.extendedTSCSet__beforeTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedTSCSet__beforeTime.log();
if (single_value->field_extendedTSCSet__beforeTime.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__RRM__HandoverCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cellDescription().is_bound()) cellDescription().set_implicit_omit();
if (channelDescription2().is_bound()) channelDescription2().set_implicit_omit();
if (handoverReference().is_bound()) handoverReference().set_implicit_omit();
if (powerCommandAndAccesstype().is_bound()) powerCommandAndAccesstype().set_implicit_omit();
if (!synchronizationIndication().is_bound()) synchronizationIndication() = OMIT_VALUE;
else synchronizationIndication().set_implicit_omit();
if (!frequencyShortListAfterTime().is_bound()) frequencyShortListAfterTime() = OMIT_VALUE;
else frequencyShortListAfterTime().set_implicit_omit();
if (!frequencyListAfterTime().is_bound()) frequencyListAfterTime() = OMIT_VALUE;
else frequencyListAfterTime().set_implicit_omit();
if (!cellChannelDescription().is_bound()) cellChannelDescription() = OMIT_VALUE;
else cellChannelDescription().set_implicit_omit();
if (!multislotAllocation().is_bound()) multislotAllocation() = OMIT_VALUE;
else multislotAllocation().set_implicit_omit();
if (!modeOfChannelSet1().is_bound()) modeOfChannelSet1() = OMIT_VALUE;
else modeOfChannelSet1().set_implicit_omit();
if (!modeOfChannelSet2().is_bound()) modeOfChannelSet2() = OMIT_VALUE;
else modeOfChannelSet2().set_implicit_omit();
if (!modeOfChannelSet3().is_bound()) modeOfChannelSet3() = OMIT_VALUE;
else modeOfChannelSet3().set_implicit_omit();
if (!modeOfChannelSet4().is_bound()) modeOfChannelSet4() = OMIT_VALUE;
else modeOfChannelSet4().set_implicit_omit();
if (!modeOfChannelSet5().is_bound()) modeOfChannelSet5() = OMIT_VALUE;
else modeOfChannelSet5().set_implicit_omit();
if (!modeOfChannelSet6().is_bound()) modeOfChannelSet6() = OMIT_VALUE;
else modeOfChannelSet6().set_implicit_omit();
if (!modeOfChannelSet7().is_bound()) modeOfChannelSet7() = OMIT_VALUE;
else modeOfChannelSet7().set_implicit_omit();
if (!modeOfChannelSet8().is_bound()) modeOfChannelSet8() = OMIT_VALUE;
else modeOfChannelSet8().set_implicit_omit();
if (!descrOf2ndCh__at().is_bound()) descrOf2ndCh__at() = OMIT_VALUE;
else descrOf2ndCh__at().set_implicit_omit();
if (!modeOf2ndChannel().is_bound()) modeOf2ndChannel() = OMIT_VALUE;
else modeOf2ndChannel().set_implicit_omit();
if (!frequencyChannelSequence__at().is_bound()) frequencyChannelSequence__at() = OMIT_VALUE;
else frequencyChannelSequence__at().set_implicit_omit();
if (!mobileAllocation__at().is_bound()) mobileAllocation__at() = OMIT_VALUE;
else mobileAllocation__at().set_implicit_omit();
if (!startingTime().is_bound()) startingTime() = OMIT_VALUE;
else startingTime().set_implicit_omit();
if (!timeDifference().is_bound()) timeDifference() = OMIT_VALUE;
else timeDifference().set_implicit_omit();
if (!timingAdvance().is_bound()) timingAdvance() = OMIT_VALUE;
else timingAdvance().set_implicit_omit();
if (!frequencyShortListBeforeTime().is_bound()) frequencyShortListBeforeTime() = OMIT_VALUE;
else frequencyShortListBeforeTime().set_implicit_omit();
if (!frequencyListBeforeTime().is_bound()) frequencyListBeforeTime() = OMIT_VALUE;
else frequencyListBeforeTime().set_implicit_omit();
if (!descrOf1stCh__bt().is_bound()) descrOf1stCh__bt() = OMIT_VALUE;
else descrOf1stCh__bt().set_implicit_omit();
if (!descrOf2ndCh__bt().is_bound()) descrOf2ndCh__bt() = OMIT_VALUE;
else descrOf2ndCh__bt().set_implicit_omit();
if (!frequencyChannelSequence__bt().is_bound()) frequencyChannelSequence__bt() = OMIT_VALUE;
else frequencyChannelSequence__bt().set_implicit_omit();
if (!mobileAllocation__bt().is_bound()) mobileAllocation__bt() = OMIT_VALUE;
else mobileAllocation__bt().set_implicit_omit();
if (!cipherModeSetting().is_bound()) cipherModeSetting() = OMIT_VALUE;
else cipherModeSetting().set_implicit_omit();
if (!vGCS__TargetModeIndication().is_bound()) vGCS__TargetModeIndication() = OMIT_VALUE;
else vGCS__TargetModeIndication().set_implicit_omit();
if (!multiRateConfiguration().is_bound()) multiRateConfiguration() = OMIT_VALUE;
else multiRateConfiguration().set_implicit_omit();
if (!dynamicARFCN__Mapping().is_bound()) dynamicARFCN__Mapping() = OMIT_VALUE;
else dynamicARFCN__Mapping().set_implicit_omit();
if (!vGCS__Ciphering__Parameters().is_bound()) vGCS__Ciphering__Parameters() = OMIT_VALUE;
else vGCS__Ciphering__Parameters().set_implicit_omit();
if (!dedicatedServiceInformation().is_bound()) dedicatedServiceInformation() = OMIT_VALUE;
else dedicatedServiceInformation().set_implicit_omit();
if (!pLMNIndex().is_bound()) pLMNIndex() = OMIT_VALUE;
else pLMNIndex().set_implicit_omit();
if (!extendedTSCSet__afterTime().is_bound()) extendedTSCSet__afterTime() = OMIT_VALUE;
else extendedTSCSet__afterTime().set_implicit_omit();
if (!extendedTSCSet__beforeTime().is_bound()) extendedTSCSet__beforeTime() = OMIT_VALUE;
else extendedTSCSet__beforeTime().set_implicit_omit();
}

void PDU__RRM__HandoverCommand__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_cellDescription.encode_text(text_buf);
single_value->field_channelDescription2.encode_text(text_buf);
single_value->field_handoverReference.encode_text(text_buf);
single_value->field_powerCommandAndAccesstype.encode_text(text_buf);
single_value->field_synchronizationIndication.encode_text(text_buf);
single_value->field_frequencyShortListAfterTime.encode_text(text_buf);
single_value->field_frequencyListAfterTime.encode_text(text_buf);
single_value->field_cellChannelDescription.encode_text(text_buf);
single_value->field_multislotAllocation.encode_text(text_buf);
single_value->field_modeOfChannelSet1.encode_text(text_buf);
single_value->field_modeOfChannelSet2.encode_text(text_buf);
single_value->field_modeOfChannelSet3.encode_text(text_buf);
single_value->field_modeOfChannelSet4.encode_text(text_buf);
single_value->field_modeOfChannelSet5.encode_text(text_buf);
single_value->field_modeOfChannelSet6.encode_text(text_buf);
single_value->field_modeOfChannelSet7.encode_text(text_buf);
single_value->field_modeOfChannelSet8.encode_text(text_buf);
single_value->field_descrOf2ndCh__at.encode_text(text_buf);
single_value->field_modeOf2ndChannel.encode_text(text_buf);
single_value->field_frequencyChannelSequence__at.encode_text(text_buf);
single_value->field_mobileAllocation__at.encode_text(text_buf);
single_value->field_startingTime.encode_text(text_buf);
single_value->field_timeDifference.encode_text(text_buf);
single_value->field_timingAdvance.encode_text(text_buf);
single_value->field_frequencyShortListBeforeTime.encode_text(text_buf);
single_value->field_frequencyListBeforeTime.encode_text(text_buf);
single_value->field_descrOf1stCh__bt.encode_text(text_buf);
single_value->field_descrOf2ndCh__bt.encode_text(text_buf);
single_value->field_frequencyChannelSequence__bt.encode_text(text_buf);
single_value->field_mobileAllocation__bt.encode_text(text_buf);
single_value->field_cipherModeSetting.encode_text(text_buf);
single_value->field_vGCS__TargetModeIndication.encode_text(text_buf);
single_value->field_multiRateConfiguration.encode_text(text_buf);
single_value->field_dynamicARFCN__Mapping.encode_text(text_buf);
single_value->field_vGCS__Ciphering__Parameters.encode_text(text_buf);
single_value->field_dedicatedServiceInformation.encode_text(text_buf);
single_value->field_pLMNIndex.encode_text(text_buf);
single_value->field_extendedTSCSet__afterTime.encode_text(text_buf);
single_value->field_extendedTSCSet__beforeTime.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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
}
}

void PDU__RRM__HandoverCommand__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_cellDescription.decode_text(text_buf);
single_value->field_channelDescription2.decode_text(text_buf);
single_value->field_handoverReference.decode_text(text_buf);
single_value->field_powerCommandAndAccesstype.decode_text(text_buf);
single_value->field_synchronizationIndication.decode_text(text_buf);
single_value->field_frequencyShortListAfterTime.decode_text(text_buf);
single_value->field_frequencyListAfterTime.decode_text(text_buf);
single_value->field_cellChannelDescription.decode_text(text_buf);
single_value->field_multislotAllocation.decode_text(text_buf);
single_value->field_modeOfChannelSet1.decode_text(text_buf);
single_value->field_modeOfChannelSet2.decode_text(text_buf);
single_value->field_modeOfChannelSet3.decode_text(text_buf);
single_value->field_modeOfChannelSet4.decode_text(text_buf);
single_value->field_modeOfChannelSet5.decode_text(text_buf);
single_value->field_modeOfChannelSet6.decode_text(text_buf);
single_value->field_modeOfChannelSet7.decode_text(text_buf);
single_value->field_modeOfChannelSet8.decode_text(text_buf);
single_value->field_descrOf2ndCh__at.decode_text(text_buf);
single_value->field_modeOf2ndChannel.decode_text(text_buf);
single_value->field_frequencyChannelSequence__at.decode_text(text_buf);
single_value->field_mobileAllocation__at.decode_text(text_buf);
single_value->field_startingTime.decode_text(text_buf);
single_value->field_timeDifference.decode_text(text_buf);
single_value->field_timingAdvance.decode_text(text_buf);
single_value->field_frequencyShortListBeforeTime.decode_text(text_buf);
single_value->field_frequencyListBeforeTime.decode_text(text_buf);
single_value->field_descrOf1stCh__bt.decode_text(text_buf);
single_value->field_descrOf2ndCh__bt.decode_text(text_buf);
single_value->field_frequencyChannelSequence__bt.decode_text(text_buf);
single_value->field_mobileAllocation__bt.decode_text(text_buf);
single_value->field_cipherModeSetting.decode_text(text_buf);
single_value->field_vGCS__TargetModeIndication.decode_text(text_buf);
single_value->field_multiRateConfiguration.decode_text(text_buf);
single_value->field_dynamicARFCN__Mapping.decode_text(text_buf);
single_value->field_vGCS__Ciphering__Parameters.decode_text(text_buf);
single_value->field_dedicatedServiceInformation.decode_text(text_buf);
single_value->field_pLMNIndex.decode_text(text_buf);
single_value->field_extendedTSCSet__afterTime.decode_text(text_buf);
single_value->field_extendedTSCSet__beforeTime.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__RRM__HandoverCommand__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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS.");
}
}

void PDU__RRM__HandoverCommand__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__RRM__HandoverCommand__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 (40<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS has 40 fields but 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) cellDescription().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelDescription2().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) handoverReference().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) powerCommandAndAccesstype().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) synchronizationIndication().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) frequencyShortListAfterTime().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) frequencyListAfterTime().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescription().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) multislotAllocation().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet1().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet2().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet3().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet4().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet5().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet6().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet7().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet8().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) descrOf2ndCh__at().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) modeOf2ndChannel().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) frequencyChannelSequence__at().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation__at().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) timeDifference().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) timingAdvance().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) frequencyShortListBeforeTime().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) frequencyListBeforeTime().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) descrOf1stCh__bt().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) descrOf2ndCh__bt().set_param(*param.get_elem(28));
    if (param.get_size()>29 && param.get_elem(29)->get_type()!=Module_Param::MP_NotUsed) frequencyChannelSequence__bt().set_param(*param.get_elem(29));
    if (param.get_size()>30 && param.get_elem(30)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation__bt().set_param(*param.get_elem(30));
    if (param.get_size()>31 && param.get_elem(31)->get_type()!=Module_Param::MP_NotUsed) cipherModeSetting().set_param(*param.get_elem(31));
    if (param.get_size()>32 && param.get_elem(32)->get_type()!=Module_Param::MP_NotUsed) vGCS__TargetModeIndication().set_param(*param.get_elem(32));
    if (param.get_size()>33 && param.get_elem(33)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(33));
    if (param.get_size()>34 && param.get_elem(34)->get_type()!=Module_Param::MP_NotUsed) dynamicARFCN__Mapping().set_param(*param.get_elem(34));
    if (param.get_size()>35 && param.get_elem(35)->get_type()!=Module_Param::MP_NotUsed) vGCS__Ciphering__Parameters().set_param(*param.get_elem(35));
    if (param.get_size()>36 && param.get_elem(36)->get_type()!=Module_Param::MP_NotUsed) dedicatedServiceInformation().set_param(*param.get_elem(36));
    if (param.get_size()>37 && param.get_elem(37)->get_type()!=Module_Param::MP_NotUsed) pLMNIndex().set_param(*param.get_elem(37));
    if (param.get_size()>38 && param.get_elem(38)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet__afterTime().set_param(*param.get_elem(38));
    if (param.get_size()>39 && param.get_elem(39)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet__beforeTime().set_param(*param.get_elem(39));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "cellDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescription2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "handoverReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handoverReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "powerCommandAndAccesstype")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          powerCommandAndAccesstype().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "synchronizationIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          synchronizationIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyShortListAfterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyShortListAfterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyListAfterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyListAfterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet6().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrOf2ndCh_at")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf2ndCh__at().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOf2ndChannel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOf2ndChannel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyChannelSequence_at")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyChannelSequence__at().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation_at")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation__at().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startingTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timeDifference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timeDifference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timingAdvance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timingAdvance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyShortListBeforeTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyShortListBeforeTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyListBeforeTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyListBeforeTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrOf1stCh_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf1stCh__bt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrOf2ndCh_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf2ndCh__bt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyChannelSequence_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyChannelSequence__bt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation__bt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipherModeSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipherModeSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vGCS_TargetModeIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vGCS__TargetModeIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multiRateConfiguration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multiRateConfiguration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dynamicARFCN_Mapping")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dynamicARFCN__Mapping().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vGCS_Ciphering_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vGCS__Ciphering__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dedicatedServiceInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dedicatedServiceInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pLMNIndex")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pLMNIndex().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet_afterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet__afterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet_beforeTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet__beforeTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__HandoverCommand__NW__MS_template* precondition = new PDU__RRM__HandoverCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__HandoverCommand__NW__MS_template* implied_template = new PDU__RRM__HandoverCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__HandoverCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__HandoverCommand__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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_cellDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_channelDescription2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_handoverReference.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_powerCommandAndAccesstype.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_synchronizationIndication.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_frequencyShortListAfterTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_frequencyListAfterTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_cellChannelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_multislotAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_modeOfChannelSet1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_modeOfChannelSet2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_modeOfChannelSet3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_modeOfChannelSet4.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_modeOfChannelSet5.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_modeOfChannelSet6.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_modeOfChannelSet7.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_modeOfChannelSet8.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_descrOf2ndCh__at.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_modeOf2ndChannel.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_frequencyChannelSequence__at.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_mobileAllocation__at.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_startingTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_timeDifference.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_timingAdvance.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_frequencyShortListBeforeTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_frequencyListBeforeTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_descrOf1stCh__bt.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_descrOf2ndCh__bt.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_frequencyChannelSequence__bt.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_mobileAllocation__bt.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_cipherModeSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_vGCS__TargetModeIndication.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_multiRateConfiguration.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_dynamicARFCN__Mapping.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_vGCS__Ciphering__Parameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_dedicatedServiceInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_pLMNIndex.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_extendedTSCSet__afterTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
single_value->field_extendedTSCSet__beforeTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverCommand_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_RRM_Types.PDU_RRM_HandoverCommand_NW_MS");
}

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

boolean PDU__RRM__HandoverCommand__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__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS()
{
}

PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS(const BITSTRING& par_messageType,
    const HandoverToUTRANCommand__LV& par_handoverToUTRANCommand,
    const OPTIONAL< CNToMSTransparentInformation__TLV >& par_cNToMSTransparentInformation)
  :   field_messageType(par_messageType),
  field_handoverToUTRANCommand(par_handoverToUTRANCommand),
  field_cNToMSTransparentInformation(par_cNToMSTransparentInformation)
{
}

PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS(const PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.handoverToUTRANCommand().is_bound()) field_handoverToUTRANCommand = other_value.handoverToUTRANCommand();
else field_handoverToUTRANCommand.clean_up();
if (other_value.cNToMSTransparentInformation().is_bound()) field_cNToMSTransparentInformation = other_value.cNToMSTransparentInformation();
else field_cNToMSTransparentInformation.clean_up();
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_handoverToUTRANCommand.clean_up();
field_cNToMSTransparentInformation.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::get_descriptor() const { return &PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_descr_; }
PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS& PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::operator=(const PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.handoverToUTRANCommand().is_bound()) field_handoverToUTRANCommand = other_value.handoverToUTRANCommand();
  else field_handoverToUTRANCommand.clean_up();
  if (other_value.cNToMSTransparentInformation().is_bound()) field_cNToMSTransparentInformation = other_value.cNToMSTransparentInformation();
  else field_cNToMSTransparentInformation.clean_up();
}
return *this;
}

boolean PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::operator==(const PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_handoverToUTRANCommand==other_value.field_handoverToUTRANCommand
  && field_cNToMSTransparentInformation==other_value.field_cNToMSTransparentInformation;
}

boolean PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_handoverToUTRANCommand.is_bound())
  || (OPTIONAL_OMIT == field_cNToMSTransparentInformation.get_selection() || field_cNToMSTransparentInformation.is_bound());
}
boolean PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_handoverToUTRANCommand.is_value()
  && (OPTIONAL_OMIT == field_cNToMSTransparentInformation.get_selection() || field_cNToMSTransparentInformation.is_value());
}
int PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_cNToMSTransparentInformation.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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(", handoverToUTRANCommand := ");
field_handoverToUTRANCommand.log();
TTCN_Logger::log_event_str(", cNToMSTransparentInformation := ");
field_cNToMSTransparentInformation.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (handoverToUTRANCommand().is_bound()) handoverToUTRANCommand().set_implicit_omit();
if (!cNToMSTransparentInformation().is_bound()) cNToMSTransparentInformation() = OMIT_VALUE;
else cNToMSTransparentInformation().set_implicit_omit();
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) handoverToUTRANCommand().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cNToMSTransparentInformation().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(), "handoverToUTRANCommand")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handoverToUTRANCommand().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cNToMSTransparentInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cNToMSTransparentInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS");
  }
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_handoverToUTRANCommand.encode_text(text_buf);
field_cNToMSTransparentInformation.encode_text(text_buf);
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_handoverToUTRANCommand.decode_text(text_buf);
field_cNToMSTransparentInformation.decode_text(text_buf);
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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__RRM__InterSystemToUTRAN__HandoverCommand__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__RRM__InterSystemToUTRAN__HandoverCommand__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, HandoverToUTRANCommand__LV_descr_.raw->forceomit);
  decoded_field_length = field_handoverToUTRANCommand.RAW_decode(HandoverToUTRANCommand__LV_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_cNToMSTransparentInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, CNToMSTransparentInformation__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cNToMSTransparentInformation().RAW_decode(CNToMSTransparentInformation__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_cNToMSTransparentInformation = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_cNToMSTransparentInformation=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__RRM__InterSystemToUTRAN__HandoverCommand__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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, HandoverToUTRANCommand__LV_descr_.raw);
  if (field_cNToMSTransparentInformation.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, CNToMSTransparentInformation__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_handoverToUTRANCommand.RAW_encode(HandoverToUTRANCommand__LV_descr_, *myleaf.body.node.nodes[1]);
  if (field_cNToMSTransparentInformation.ispresent()) {
  encoded_length += field_cNToMSTransparentInformation().RAW_encode(CNToMSTransparentInformation__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
HandoverToUTRANCommand__LV_template field_handoverToUTRANCommand;
CNToMSTransparentInformation__TLV_template field_cNToMSTransparentInformation;
};

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_handoverToUTRANCommand = ANY_VALUE;
single_value->field_cNToMSTransparentInformation = ANY_OR_OMIT;
}
}
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::copy_value(const PDU__RRM__InterSystemToUTRAN__HandoverCommand__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.handoverToUTRANCommand().is_bound()) {
  single_value->field_handoverToUTRANCommand = other_value.handoverToUTRANCommand();
} else {
  single_value->field_handoverToUTRANCommand.clean_up();
}
if (other_value.cNToMSTransparentInformation().is_bound()) {
  if (other_value.cNToMSTransparentInformation().ispresent()) single_value->field_cNToMSTransparentInformation = other_value.cNToMSTransparentInformation()();
  else single_value->field_cNToMSTransparentInformation = OMIT_VALUE;
} else {
  single_value->field_cNToMSTransparentInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::copy_template(const PDU__RRM__InterSystemToUTRAN__HandoverCommand__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.handoverToUTRANCommand().get_selection()) {
single_value->field_handoverToUTRANCommand = other_value.handoverToUTRANCommand();
} else {
single_value->field_handoverToUTRANCommand.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cNToMSTransparentInformation().get_selection()) {
single_value->field_cNToMSTransparentInformation = other_value.cNToMSTransparentInformation();
} else {
single_value->field_cNToMSTransparentInformation.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__RRM__InterSystemToUTRAN__HandoverCommand__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__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template()
{
}

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

PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template(const PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::match(const PDU__RRM__InterSystemToUTRAN__HandoverCommand__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.handoverToUTRANCommand().is_bound()) return FALSE;
if(!single_value->field_handoverToUTRANCommand.match(other_value.handoverToUTRANCommand(), legacy))return FALSE;
if(!other_value.cNToMSTransparentInformation().is_bound()) return FALSE;
if((other_value.cNToMSTransparentInformation().ispresent() ? !single_value->field_cNToMSTransparentInformation.match((const CNToMSTransparentInformation__TLV&)other_value.cNToMSTransparentInformation(), legacy) : !single_value->field_cNToMSTransparentInformation.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_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_handoverToUTRANCommand.is_bound()
 || (single_value->field_cNToMSTransparentInformation.is_omit() || single_value->field_cNToMSTransparentInformation.is_bound());
}

boolean PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_handoverToUTRANCommand.is_value()
 && (single_value->field_cNToMSTransparentInformation.is_omit() || single_value->field_cNToMSTransparentInformation.is_value());
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_handoverToUTRANCommand.is_bound()) {
ret_val.handoverToUTRANCommand() = single_value->field_handoverToUTRANCommand.valueof();
}
if (single_value->field_cNToMSTransparentInformation.is_omit()) ret_val.cNToMSTransparentInformation() = OMIT_VALUE;
else if (single_value->field_cNToMSTransparentInformation.is_bound()) {
ret_val.cNToMSTransparentInformation() = single_value->field_cNToMSTransparentInformation.valueof();
}
return ret_val;
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template[list_length];
}

PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template& PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
return value_list.list_value[list_index];
}

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

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

HandoverToUTRANCommand__LV_template& PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::handoverToUTRANCommand()
{
set_specific();
return single_value->field_handoverToUTRANCommand;
}

const HandoverToUTRANCommand__LV_template& PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::handoverToUTRANCommand() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field handoverToUTRANCommand of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
return single_value->field_handoverToUTRANCommand;
}

CNToMSTransparentInformation__TLV_template& PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::cNToMSTransparentInformation()
{
set_specific();
return single_value->field_cNToMSTransparentInformation;
}

const CNToMSTransparentInformation__TLV_template& PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::cNToMSTransparentInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cNToMSTransparentInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
return single_value->field_cNToMSTransparentInformation;
}

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

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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(", handoverToUTRANCommand := ");
single_value->field_handoverToUTRANCommand.log();
TTCN_Logger::log_event_str(", cNToMSTransparentInformation := ");
single_value->field_cNToMSTransparentInformation.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__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::log_match(const PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_handoverToUTRANCommand.match(match_value.handoverToUTRANCommand(), legacy)){
TTCN_Logger::log_logmatch_info(".handoverToUTRANCommand");
single_value->field_handoverToUTRANCommand.log_match(match_value.handoverToUTRANCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cNToMSTransparentInformation().ispresent()){
if(!single_value->field_cNToMSTransparentInformation.match(match_value.cNToMSTransparentInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".cNToMSTransparentInformation");
single_value->field_cNToMSTransparentInformation.log_match(match_value.cNToMSTransparentInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cNToMSTransparentInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cNToMSTransparentInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cNToMSTransparentInformation.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(", handoverToUTRANCommand := ");
single_value->field_handoverToUTRANCommand.log_match(match_value.handoverToUTRANCommand(), legacy);
TTCN_Logger::log_event_str(", cNToMSTransparentInformation := ");
if (match_value.cNToMSTransparentInformation().ispresent()) {
single_value->field_cNToMSTransparentInformation.log_match(match_value.cNToMSTransparentInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cNToMSTransparentInformation.log();
if (single_value->field_cNToMSTransparentInformation.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__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (handoverToUTRANCommand().is_bound()) handoverToUTRANCommand().set_implicit_omit();
if (!cNToMSTransparentInformation().is_bound()) cNToMSTransparentInformation() = OMIT_VALUE;
else cNToMSTransparentInformation().set_implicit_omit();
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_handoverToUTRANCommand.encode_text(text_buf);
single_value->field_cNToMSTransparentInformation.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_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
}
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_handoverToUTRANCommand.decode_text(text_buf);
single_value->field_cNToMSTransparentInformation.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__RRM__InterSystemToUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS.");
}
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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__RRM__InterSystemToUTRAN__HandoverCommand__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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) handoverToUTRANCommand().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cNToMSTransparentInformation().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(), "handoverToUTRANCommand")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handoverToUTRANCommand().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cNToMSTransparentInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cNToMSTransparentInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template* precondition = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template* implied_template = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__InterSystemToUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS");
single_value->field_handoverToUTRANCommand.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS");
single_value->field_cNToMSTransparentInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_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_RRM_Types.PDU_RRM_InterSystemToUTRAN_HandoverCommand_NW_MS");
}

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

boolean PDU__RRM__InterSystemToUTRAN__HandoverCommand__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__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS()
{
}

PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS(const BITSTRING& par_messageType,
    const HandoverToCDMA2000Command__LV& par_handoverToCDMA2000Command)
  :   field_messageType(par_messageType),
  field_handoverToCDMA2000Command(par_handoverToCDMA2000Command)
{
}

PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS(const PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.handoverToCDMA2000Command().is_bound()) field_handoverToCDMA2000Command = other_value.handoverToCDMA2000Command();
else field_handoverToCDMA2000Command.clean_up();
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_handoverToCDMA2000Command.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::get_descriptor() const { return &PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_descr_; }
PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS& PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::operator=(const PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.handoverToCDMA2000Command().is_bound()) field_handoverToCDMA2000Command = other_value.handoverToCDMA2000Command();
  else field_handoverToCDMA2000Command.clean_up();
}
return *this;
}

boolean PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::operator==(const PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_handoverToCDMA2000Command==other_value.field_handoverToCDMA2000Command;
}

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

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (handoverToCDMA2000Command().is_bound()) handoverToCDMA2000Command().set_implicit_omit();
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS 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) handoverToCDMA2000Command().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(), "handoverToCDMA2000Command")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handoverToCDMA2000Command().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS");
  }
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_handoverToCDMA2000Command.encode_text(text_buf);
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_handoverToCDMA2000Command.decode_text(text_buf);
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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__RRM__InterSystemToCDMA2000HandoverCommand__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__RRM__InterSystemToCDMA2000HandoverCommand__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, HandoverToCDMA2000Command__LV_descr_.raw->forceomit);
  decoded_field_length = field_handoverToCDMA2000Command.RAW_decode(HandoverToCDMA2000Command__LV_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__RRM__InterSystemToCDMA2000HandoverCommand__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 = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, HandoverToCDMA2000Command__LV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_handoverToCDMA2000Command.RAW_encode(HandoverToCDMA2000Command__LV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
HandoverToCDMA2000Command__LV_template field_handoverToCDMA2000Command;
};

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_handoverToCDMA2000Command = ANY_VALUE;
}
}
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::copy_value(const PDU__RRM__InterSystemToCDMA2000HandoverCommand__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.handoverToCDMA2000Command().is_bound()) {
  single_value->field_handoverToCDMA2000Command = other_value.handoverToCDMA2000Command();
} else {
  single_value->field_handoverToCDMA2000Command.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::copy_template(const PDU__RRM__InterSystemToCDMA2000HandoverCommand__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.handoverToCDMA2000Command().get_selection()) {
single_value->field_handoverToCDMA2000Command = other_value.handoverToCDMA2000Command();
} else {
single_value->field_handoverToCDMA2000Command.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__RRM__InterSystemToCDMA2000HandoverCommand__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__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template()
{
}

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

PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template(const PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::match(const PDU__RRM__InterSystemToCDMA2000HandoverCommand__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.handoverToCDMA2000Command().is_bound()) return FALSE;
if(!single_value->field_handoverToCDMA2000Command.match(other_value.handoverToCDMA2000Command(), 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_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_handoverToCDMA2000Command.is_bound();
}

boolean PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_handoverToCDMA2000Command.is_value();
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_handoverToCDMA2000Command.is_bound()) {
ret_val.handoverToCDMA2000Command() = single_value->field_handoverToCDMA2000Command.valueof();
}
return ret_val;
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template[list_length];
}

PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template& PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
return value_list.list_value[list_index];
}

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

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

HandoverToCDMA2000Command__LV_template& PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::handoverToCDMA2000Command()
{
set_specific();
return single_value->field_handoverToCDMA2000Command;
}

const HandoverToCDMA2000Command__LV_template& PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::handoverToCDMA2000Command() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field handoverToCDMA2000Command of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
return single_value->field_handoverToCDMA2000Command;
}

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

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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(", handoverToCDMA2000Command := ");
single_value->field_handoverToCDMA2000Command.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__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::log_match(const PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_handoverToCDMA2000Command.match(match_value.handoverToCDMA2000Command(), legacy)){
TTCN_Logger::log_logmatch_info(".handoverToCDMA2000Command");
single_value->field_handoverToCDMA2000Command.log_match(match_value.handoverToCDMA2000Command(), 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(", handoverToCDMA2000Command := ");
single_value->field_handoverToCDMA2000Command.log_match(match_value.handoverToCDMA2000Command(), 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__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (handoverToCDMA2000Command().is_bound()) handoverToCDMA2000Command().set_implicit_omit();
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_handoverToCDMA2000Command.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_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
}
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_handoverToCDMA2000Command.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__RRM__InterSystemToCDMA2000HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS.");
}
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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__RRM__InterSystemToCDMA2000HandoverCommand__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 (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS 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) handoverToCDMA2000Command().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(), "handoverToCDMA2000Command")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handoverToCDMA2000Command().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template* precondition = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template* implied_template = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__InterSystemToCDMA2000HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS");
single_value->field_handoverToCDMA2000Command.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_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_RRM_Types.PDU_RRM_InterSystemToCDMA2000HandoverCommand_NW_MS");
}

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

boolean PDU__RRM__InterSystemToCDMA2000HandoverCommand__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__RRM__HandoverToGERAN__IuModeCommand__NW__MS::PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS()
{
}

PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS::PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS(const BITSTRING& par_messageType,
    const RadioBearerReconfiguration__LV& par_radioBearerReconfiguration)
  :   field_messageType(par_messageType),
  field_radioBearerReconfiguration(par_radioBearerReconfiguration)
{
}

PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS::PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS(const PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.radioBearerReconfiguration().is_bound()) field_radioBearerReconfiguration = other_value.radioBearerReconfiguration();
else field_radioBearerReconfiguration.clean_up();
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_radioBearerReconfiguration.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS::get_descriptor() const { return &PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_descr_; }
PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS& PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS::operator=(const PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.radioBearerReconfiguration().is_bound()) field_radioBearerReconfiguration = other_value.radioBearerReconfiguration();
  else field_radioBearerReconfiguration.clean_up();
}
return *this;
}

boolean PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS::operator==(const PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_radioBearerReconfiguration==other_value.field_radioBearerReconfiguration;
}

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

void PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (radioBearerReconfiguration().is_bound()) radioBearerReconfiguration().set_implicit_omit();
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS 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) radioBearerReconfiguration().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(), "radioBearerReconfiguration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioBearerReconfiguration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS");
  }
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_radioBearerReconfiguration.encode_text(text_buf);
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_radioBearerReconfiguration.decode_text(text_buf);
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__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__RRM__HandoverToGERAN__IuModeCommand__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__RRM__HandoverToGERAN__IuModeCommand__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, RadioBearerReconfiguration__LV_descr_.raw->forceomit);
  decoded_field_length = field_radioBearerReconfiguration.RAW_decode(RadioBearerReconfiguration__LV_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__RRM__HandoverToGERAN__IuModeCommand__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 = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RadioBearerReconfiguration__LV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_radioBearerReconfiguration.RAW_encode(RadioBearerReconfiguration__LV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
RadioBearerReconfiguration__LV_template field_radioBearerReconfiguration;
};

void PDU__RRM__HandoverToGERAN__IuModeCommand__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_radioBearerReconfiguration = ANY_VALUE;
}
}
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::copy_value(const PDU__RRM__HandoverToGERAN__IuModeCommand__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.radioBearerReconfiguration().is_bound()) {
  single_value->field_radioBearerReconfiguration = other_value.radioBearerReconfiguration();
} else {
  single_value->field_radioBearerReconfiguration.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::copy_template(const PDU__RRM__HandoverToGERAN__IuModeCommand__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.radioBearerReconfiguration().get_selection()) {
single_value->field_radioBearerReconfiguration = other_value.radioBearerReconfiguration();
} else {
single_value->field_radioBearerReconfiguration.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__RRM__HandoverToGERAN__IuModeCommand__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__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__HandoverToGERAN__IuModeCommand__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_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template()
{
}

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

PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template(const PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::match(const PDU__RRM__HandoverToGERAN__IuModeCommand__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.radioBearerReconfiguration().is_bound()) return FALSE;
if(!single_value->field_radioBearerReconfiguration.match(other_value.radioBearerReconfiguration(), 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_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__HandoverToGERAN__IuModeCommand__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_radioBearerReconfiguration.is_bound();
}

boolean PDU__RRM__HandoverToGERAN__IuModeCommand__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_radioBearerReconfiguration.is_value();
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__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__RRM__HandoverToGERAN__IuModeCommand__NW__MS PDU__RRM__HandoverToGERAN__IuModeCommand__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_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_radioBearerReconfiguration.is_bound()) {
ret_val.radioBearerReconfiguration() = single_value->field_radioBearerReconfiguration.valueof();
}
return ret_val;
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__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_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template[list_length];
}

PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template& PDU__RRM__HandoverToGERAN__IuModeCommand__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_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
return value_list.list_value[list_index];
}

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

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

RadioBearerReconfiguration__LV_template& PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::radioBearerReconfiguration()
{
set_specific();
return single_value->field_radioBearerReconfiguration;
}

const RadioBearerReconfiguration__LV_template& PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::radioBearerReconfiguration() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radioBearerReconfiguration of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
return single_value->field_radioBearerReconfiguration;
}

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

void PDU__RRM__HandoverToGERAN__IuModeCommand__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(", radioBearerReconfiguration := ");
single_value->field_radioBearerReconfiguration.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__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::log_match(const PDU__RRM__HandoverToGERAN__IuModeCommand__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_radioBearerReconfiguration.match(match_value.radioBearerReconfiguration(), legacy)){
TTCN_Logger::log_logmatch_info(".radioBearerReconfiguration");
single_value->field_radioBearerReconfiguration.log_match(match_value.radioBearerReconfiguration(), 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(", radioBearerReconfiguration := ");
single_value->field_radioBearerReconfiguration.log_match(match_value.radioBearerReconfiguration(), 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__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (radioBearerReconfiguration().is_bound()) radioBearerReconfiguration().set_implicit_omit();
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__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_radioBearerReconfiguration.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_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
}
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__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_radioBearerReconfiguration.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__RRM__HandoverToGERAN__IuModeCommand__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_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS.");
}
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__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__RRM__HandoverToGERAN__IuModeCommand__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 (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS 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) radioBearerReconfiguration().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(), "radioBearerReconfiguration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioBearerReconfiguration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template* precondition = new PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template* implied_template = new PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__HandoverToGERAN__IuModeCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__HandoverToGERAN__IuModeCommand__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_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS");
single_value->field_radioBearerReconfiguration.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_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_RRM_Types.PDU_RRM_HandoverToGERAN_IuModeCommand_NW_MS");
}

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

boolean PDU__RRM__HandoverToGERAN__IuModeCommand__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__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS()
{
}

PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS(const BITSTRING& par_messageType,
    const DL__DCCH__Message__LV& par_dL__DCCH__Message,
    const CNToMSTransparentInformation__TLV& par_cNToMSTransparentInformation)
  :   field_messageType(par_messageType),
  field_dL__DCCH__Message(par_dL__DCCH__Message),
  field_cNToMSTransparentInformation(par_cNToMSTransparentInformation)
{
}

PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS(const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.dL__DCCH__Message().is_bound()) field_dL__DCCH__Message = other_value.dL__DCCH__Message();
else field_dL__DCCH__Message.clean_up();
if (other_value.cNToMSTransparentInformation().is_bound()) field_cNToMSTransparentInformation = other_value.cNToMSTransparentInformation();
else field_cNToMSTransparentInformation.clean_up();
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_dL__DCCH__Message.clean_up();
field_cNToMSTransparentInformation.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::get_descriptor() const { return &PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_descr_; }
PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS& PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::operator=(const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.dL__DCCH__Message().is_bound()) field_dL__DCCH__Message = other_value.dL__DCCH__Message();
  else field_dL__DCCH__Message.clean_up();
  if (other_value.cNToMSTransparentInformation().is_bound()) field_cNToMSTransparentInformation = other_value.cNToMSTransparentInformation();
  else field_cNToMSTransparentInformation.clean_up();
}
return *this;
}

boolean PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::operator==(const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_dL__DCCH__Message==other_value.field_dL__DCCH__Message
  && field_cNToMSTransparentInformation==other_value.field_cNToMSTransparentInformation;
}

boolean PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_dL__DCCH__Message.is_bound())
  || (field_cNToMSTransparentInformation.is_bound());
}
boolean PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_dL__DCCH__Message.is_value()
  && field_cNToMSTransparentInformation.is_value();
}
void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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(", dL_DCCH_Message := ");
field_dL__DCCH__Message.log();
TTCN_Logger::log_event_str(", cNToMSTransparentInformation := ");
field_cNToMSTransparentInformation.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (dL__DCCH__Message().is_bound()) dL__DCCH__Message().set_implicit_omit();
if (cNToMSTransparentInformation().is_bound()) cNToMSTransparentInformation().set_implicit_omit();
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dL__DCCH__Message().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cNToMSTransparentInformation().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(), "dL_DCCH_Message")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dL__DCCH__Message().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cNToMSTransparentInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cNToMSTransparentInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS");
  }
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_dL__DCCH__Message.encode_text(text_buf);
field_cNToMSTransparentInformation.encode_text(text_buf);
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_dL__DCCH__Message.decode_text(text_buf);
field_cNToMSTransparentInformation.decode_text(text_buf);
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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__RRM__InterSystemToEUTRAN__HandoverCommand__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__RRM__InterSystemToEUTRAN__HandoverCommand__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, DL__DCCH__Message__LV_descr_.raw->forceomit);
  decoded_field_length = field_dL__DCCH__Message.RAW_decode(DL__DCCH__Message__LV_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, CNToMSTransparentInformation__TLV_descr_.raw->forceomit);
  decoded_field_length = field_cNToMSTransparentInformation.RAW_decode(CNToMSTransparentInformation__TLV_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__RRM__InterSystemToEUTRAN__HandoverCommand__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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DL__DCCH__Message__LV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, CNToMSTransparentInformation__TLV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_dL__DCCH__Message.RAW_encode(DL__DCCH__Message__LV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cNToMSTransparentInformation.RAW_encode(CNToMSTransparentInformation__TLV_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
DL__DCCH__Message__LV_template field_dL__DCCH__Message;
CNToMSTransparentInformation__TLV_template field_cNToMSTransparentInformation;
};

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_dL__DCCH__Message = ANY_VALUE;
single_value->field_cNToMSTransparentInformation = ANY_VALUE;
}
}
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::copy_value(const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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.dL__DCCH__Message().is_bound()) {
  single_value->field_dL__DCCH__Message = other_value.dL__DCCH__Message();
} else {
  single_value->field_dL__DCCH__Message.clean_up();
}
if (other_value.cNToMSTransparentInformation().is_bound()) {
  single_value->field_cNToMSTransparentInformation = other_value.cNToMSTransparentInformation();
} else {
  single_value->field_cNToMSTransparentInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::copy_template(const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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.dL__DCCH__Message().get_selection()) {
single_value->field_dL__DCCH__Message = other_value.dL__DCCH__Message();
} else {
single_value->field_dL__DCCH__Message.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cNToMSTransparentInformation().get_selection()) {
single_value->field_cNToMSTransparentInformation = other_value.cNToMSTransparentInformation();
} else {
single_value->field_cNToMSTransparentInformation.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__RRM__InterSystemToEUTRAN__HandoverCommand__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__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template()
{
}

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

PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template(const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::match(const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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.dL__DCCH__Message().is_bound()) return FALSE;
if(!single_value->field_dL__DCCH__Message.match(other_value.dL__DCCH__Message(), legacy))return FALSE;
if(!other_value.cNToMSTransparentInformation().is_bound()) return FALSE;
if(!single_value->field_cNToMSTransparentInformation.match(other_value.cNToMSTransparentInformation(), 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_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_dL__DCCH__Message.is_bound()
 || single_value->field_cNToMSTransparentInformation.is_bound();
}

boolean PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_dL__DCCH__Message.is_value()
 && single_value->field_cNToMSTransparentInformation.is_value();
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_dL__DCCH__Message.is_bound()) {
ret_val.dL__DCCH__Message() = single_value->field_dL__DCCH__Message.valueof();
}
if (single_value->field_cNToMSTransparentInformation.is_bound()) {
ret_val.cNToMSTransparentInformation() = single_value->field_cNToMSTransparentInformation.valueof();
}
return ret_val;
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template[list_length];
}

PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template& PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
return value_list.list_value[list_index];
}

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

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

DL__DCCH__Message__LV_template& PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::dL__DCCH__Message()
{
set_specific();
return single_value->field_dL__DCCH__Message;
}

const DL__DCCH__Message__LV_template& PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::dL__DCCH__Message() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dL_DCCH_Message of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
return single_value->field_dL__DCCH__Message;
}

CNToMSTransparentInformation__TLV_template& PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::cNToMSTransparentInformation()
{
set_specific();
return single_value->field_cNToMSTransparentInformation;
}

const CNToMSTransparentInformation__TLV_template& PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::cNToMSTransparentInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cNToMSTransparentInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
return single_value->field_cNToMSTransparentInformation;
}

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

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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(", dL_DCCH_Message := ");
single_value->field_dL__DCCH__Message.log();
TTCN_Logger::log_event_str(", cNToMSTransparentInformation := ");
single_value->field_cNToMSTransparentInformation.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__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::log_match(const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_dL__DCCH__Message.match(match_value.dL__DCCH__Message(), legacy)){
TTCN_Logger::log_logmatch_info(".dL_DCCH_Message");
single_value->field_dL__DCCH__Message.log_match(match_value.dL__DCCH__Message(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cNToMSTransparentInformation.match(match_value.cNToMSTransparentInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".cNToMSTransparentInformation");
single_value->field_cNToMSTransparentInformation.log_match(match_value.cNToMSTransparentInformation(), 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(", dL_DCCH_Message := ");
single_value->field_dL__DCCH__Message.log_match(match_value.dL__DCCH__Message(), legacy);
TTCN_Logger::log_event_str(", cNToMSTransparentInformation := ");
single_value->field_cNToMSTransparentInformation.log_match(match_value.cNToMSTransparentInformation(), 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__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (dL__DCCH__Message().is_bound()) dL__DCCH__Message().set_implicit_omit();
if (cNToMSTransparentInformation().is_bound()) cNToMSTransparentInformation().set_implicit_omit();
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_dL__DCCH__Message.encode_text(text_buf);
single_value->field_cNToMSTransparentInformation.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_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
}
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_dL__DCCH__Message.decode_text(text_buf);
single_value->field_cNToMSTransparentInformation.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__RRM__InterSystemToEUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS.");
}
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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__RRM__InterSystemToEUTRAN__HandoverCommand__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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dL__DCCH__Message().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cNToMSTransparentInformation().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(), "dL_DCCH_Message")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dL__DCCH__Message().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cNToMSTransparentInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cNToMSTransparentInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template* precondition = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template* implied_template = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS");
single_value->field_dL__DCCH__Message.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS");
single_value->field_cNToMSTransparentInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_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_RRM_Types.PDU_RRM_InterSystemToEUTRAN_HandoverCommand_NW_MS");
}

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

boolean PDU__RRM__InterSystemToEUTRAN__HandoverCommand__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__RRM__HandoverComplete__MS__NW::PDU__RRM__HandoverComplete__MS__NW()
{
}

PDU__RRM__HandoverComplete__MS__NW::PDU__RRM__HandoverComplete__MS__NW(const BITSTRING& par_messageType,
    const RR__Cause__V& par_rRCause,
    const OPTIONAL< MobileTimeDifference__TLV >& par_mobileObsservedTimeDiff,
    const OPTIONAL< MobileTimeDifferenceHyperframe__TLV >& par_mobileTimeDifferenceHyperframe)
  :   field_messageType(par_messageType),
  field_rRCause(par_rRCause),
  field_mobileObsservedTimeDiff(par_mobileObsservedTimeDiff),
  field_mobileTimeDifferenceHyperframe(par_mobileTimeDifferenceHyperframe)
{
}

PDU__RRM__HandoverComplete__MS__NW::PDU__RRM__HandoverComplete__MS__NW(const PDU__RRM__HandoverComplete__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.rRCause().is_bound()) field_rRCause = other_value.rRCause();
else field_rRCause.clean_up();
if (other_value.mobileObsservedTimeDiff().is_bound()) field_mobileObsservedTimeDiff = other_value.mobileObsservedTimeDiff();
else field_mobileObsservedTimeDiff.clean_up();
if (other_value.mobileTimeDifferenceHyperframe().is_bound()) field_mobileTimeDifferenceHyperframe = other_value.mobileTimeDifferenceHyperframe();
else field_mobileTimeDifferenceHyperframe.clean_up();
}

void PDU__RRM__HandoverComplete__MS__NW::clean_up()
{
field_messageType.clean_up();
field_rRCause.clean_up();
field_mobileObsservedTimeDiff.clean_up();
field_mobileTimeDifferenceHyperframe.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__HandoverComplete__MS__NW::get_descriptor() const { return &PDU__RRM__HandoverComplete__MS__NW_descr_; }
PDU__RRM__HandoverComplete__MS__NW& PDU__RRM__HandoverComplete__MS__NW::operator=(const PDU__RRM__HandoverComplete__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.rRCause().is_bound()) field_rRCause = other_value.rRCause();
  else field_rRCause.clean_up();
  if (other_value.mobileObsservedTimeDiff().is_bound()) field_mobileObsservedTimeDiff = other_value.mobileObsservedTimeDiff();
  else field_mobileObsservedTimeDiff.clean_up();
  if (other_value.mobileTimeDifferenceHyperframe().is_bound()) field_mobileTimeDifferenceHyperframe = other_value.mobileTimeDifferenceHyperframe();
  else field_mobileTimeDifferenceHyperframe.clean_up();
}
return *this;
}

boolean PDU__RRM__HandoverComplete__MS__NW::operator==(const PDU__RRM__HandoverComplete__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rRCause==other_value.field_rRCause
  && field_mobileObsservedTimeDiff==other_value.field_mobileObsservedTimeDiff
  && field_mobileTimeDifferenceHyperframe==other_value.field_mobileTimeDifferenceHyperframe;
}

boolean PDU__RRM__HandoverComplete__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_rRCause.is_bound())
  || (OPTIONAL_OMIT == field_mobileObsservedTimeDiff.get_selection() || field_mobileObsservedTimeDiff.is_bound())
  || (OPTIONAL_OMIT == field_mobileTimeDifferenceHyperframe.get_selection() || field_mobileTimeDifferenceHyperframe.is_bound());
}
boolean PDU__RRM__HandoverComplete__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_rRCause.is_value()
  && (OPTIONAL_OMIT == field_mobileObsservedTimeDiff.get_selection() || field_mobileObsservedTimeDiff.is_value())
  && (OPTIONAL_OMIT == field_mobileTimeDifferenceHyperframe.get_selection() || field_mobileTimeDifferenceHyperframe.is_value());
}
int PDU__RRM__HandoverComplete__MS__NW::size_of() const
{
  int ret_val = 2;
  if (field_mobileObsservedTimeDiff.ispresent()) ret_val++;
  if (field_mobileTimeDifferenceHyperframe.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__HandoverComplete__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(", rRCause := ");
field_rRCause.log();
TTCN_Logger::log_event_str(", mobileObsservedTimeDiff := ");
field_mobileObsservedTimeDiff.log();
TTCN_Logger::log_event_str(", mobileTimeDifferenceHyperframe := ");
field_mobileTimeDifferenceHyperframe.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__HandoverComplete__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rRCause().is_bound()) rRCause().set_implicit_omit();
if (!mobileObsservedTimeDiff().is_bound()) mobileObsservedTimeDiff() = OMIT_VALUE;
else mobileObsservedTimeDiff().set_implicit_omit();
if (!mobileTimeDifferenceHyperframe().is_bound()) mobileTimeDifferenceHyperframe() = OMIT_VALUE;
else mobileTimeDifferenceHyperframe().set_implicit_omit();
}

void PDU__RRM__HandoverComplete__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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW 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) rRCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileObsservedTimeDiff().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileTimeDifferenceHyperframe().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(), "rRCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileObsservedTimeDiff")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileObsservedTimeDiff().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileTimeDifferenceHyperframe")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileTimeDifferenceHyperframe().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW");
  }
}

void PDU__RRM__HandoverComplete__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_rRCause.encode_text(text_buf);
field_mobileObsservedTimeDiff.encode_text(text_buf);
field_mobileTimeDifferenceHyperframe.encode_text(text_buf);
}

void PDU__RRM__HandoverComplete__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_rRCause.decode_text(text_buf);
field_mobileObsservedTimeDiff.decode_text(text_buf);
field_mobileTimeDifferenceHyperframe.decode_text(text_buf);
}

void PDU__RRM__HandoverComplete__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__RRM__HandoverComplete__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__RRM__HandoverComplete__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, RR__Cause__V_descr_.raw->forceomit);
  decoded_field_length = field_rRCause.RAW_decode(RR__Cause__V_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_mobileObsservedTimeDiff = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileTimeDifference__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileObsservedTimeDiff().RAW_decode(MobileTimeDifference__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_mobileObsservedTimeDiff = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileObsservedTimeDiff.ispresent() || field_mobileObsservedTimeDiff().elementIdentifier() !=  os_29){
  field_mobileObsservedTimeDiff=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileObsservedTimeDiff=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_mobileTimeDifferenceHyperframe = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileTimeDifferenceHyperframe__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileTimeDifferenceHyperframe().RAW_decode(MobileTimeDifferenceHyperframe__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_mobileTimeDifferenceHyperframe = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileTimeDifferenceHyperframe.ispresent() || field_mobileTimeDifferenceHyperframe().elementIdentifier() !=  os_40){
  field_mobileTimeDifferenceHyperframe=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileTimeDifferenceHyperframe=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__RRM__HandoverComplete__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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RR__Cause__V_descr_.raw);
  if (field_mobileObsservedTimeDiff.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileTimeDifference__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_mobileTimeDifferenceHyperframe.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileTimeDifferenceHyperframe__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rRCause.RAW_encode(RR__Cause__V_descr_, *myleaf.body.node.nodes[1]);
  if (field_mobileObsservedTimeDiff.ispresent()) {
  encoded_length += field_mobileObsservedTimeDiff().RAW_encode(MobileTimeDifference__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_mobileTimeDifferenceHyperframe.ispresent()) {
  encoded_length += field_mobileTimeDifferenceHyperframe().RAW_encode(MobileTimeDifferenceHyperframe__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_mobileObsservedTimeDiff.ispresent() && (!field_mobileObsservedTimeDiff.ispresent() || field_mobileObsservedTimeDiff().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[]={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_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_mobileTimeDifferenceHyperframe.ispresent() && (!field_mobileTimeDifferenceHyperframe.ispresent() || field_mobileTimeDifferenceHyperframe().elementIdentifier() !=  os_40)) {
  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_40.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__RRM__HandoverComplete__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
RR__Cause__V_template field_rRCause;
MobileTimeDifference__TLV_template field_mobileObsservedTimeDiff;
MobileTimeDifferenceHyperframe__TLV_template field_mobileTimeDifferenceHyperframe;
};

void PDU__RRM__HandoverComplete__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_rRCause = ANY_VALUE;
single_value->field_mobileObsservedTimeDiff = ANY_OR_OMIT;
single_value->field_mobileTimeDifferenceHyperframe = ANY_OR_OMIT;
}
}
}

void PDU__RRM__HandoverComplete__MS__NW_template::copy_value(const PDU__RRM__HandoverComplete__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.rRCause().is_bound()) {
  single_value->field_rRCause = other_value.rRCause();
} else {
  single_value->field_rRCause.clean_up();
}
if (other_value.mobileObsservedTimeDiff().is_bound()) {
  if (other_value.mobileObsservedTimeDiff().ispresent()) single_value->field_mobileObsservedTimeDiff = other_value.mobileObsservedTimeDiff()();
  else single_value->field_mobileObsservedTimeDiff = OMIT_VALUE;
} else {
  single_value->field_mobileObsservedTimeDiff.clean_up();
}
if (other_value.mobileTimeDifferenceHyperframe().is_bound()) {
  if (other_value.mobileTimeDifferenceHyperframe().ispresent()) single_value->field_mobileTimeDifferenceHyperframe = other_value.mobileTimeDifferenceHyperframe()();
  else single_value->field_mobileTimeDifferenceHyperframe = OMIT_VALUE;
} else {
  single_value->field_mobileTimeDifferenceHyperframe.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__HandoverComplete__MS__NW_template::copy_template(const PDU__RRM__HandoverComplete__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.rRCause().get_selection()) {
single_value->field_rRCause = other_value.rRCause();
} else {
single_value->field_rRCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileObsservedTimeDiff().get_selection()) {
single_value->field_mobileObsservedTimeDiff = other_value.mobileObsservedTimeDiff();
} else {
single_value->field_mobileObsservedTimeDiff.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileTimeDifferenceHyperframe().get_selection()) {
single_value->field_mobileTimeDifferenceHyperframe = other_value.mobileTimeDifferenceHyperframe();
} else {
single_value->field_mobileTimeDifferenceHyperframe.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__RRM__HandoverComplete__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__RRM__HandoverComplete__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__HandoverComplete__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_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__HandoverComplete__MS__NW_template::PDU__RRM__HandoverComplete__MS__NW_template()
{
}

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

PDU__RRM__HandoverComplete__MS__NW_template::PDU__RRM__HandoverComplete__MS__NW_template(const PDU__RRM__HandoverComplete__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__HandoverComplete__MS__NW_template::match(const PDU__RRM__HandoverComplete__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.rRCause().is_bound()) return FALSE;
if(!single_value->field_rRCause.match(other_value.rRCause(), legacy))return FALSE;
if(!other_value.mobileObsservedTimeDiff().is_bound()) return FALSE;
if((other_value.mobileObsservedTimeDiff().ispresent() ? !single_value->field_mobileObsservedTimeDiff.match((const MobileTimeDifference__TLV&)other_value.mobileObsservedTimeDiff(), legacy) : !single_value->field_mobileObsservedTimeDiff.match_omit(legacy)))return FALSE;
if(!other_value.mobileTimeDifferenceHyperframe().is_bound()) return FALSE;
if((other_value.mobileTimeDifferenceHyperframe().ispresent() ? !single_value->field_mobileTimeDifferenceHyperframe.match((const MobileTimeDifferenceHyperframe__TLV&)other_value.mobileTimeDifferenceHyperframe(), legacy) : !single_value->field_mobileTimeDifferenceHyperframe.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_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__HandoverComplete__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_rRCause.is_bound()
 || (single_value->field_mobileObsservedTimeDiff.is_omit() || single_value->field_mobileObsservedTimeDiff.is_bound())
 || (single_value->field_mobileTimeDifferenceHyperframe.is_omit() || single_value->field_mobileTimeDifferenceHyperframe.is_bound());
}

boolean PDU__RRM__HandoverComplete__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_rRCause.is_value()
 && (single_value->field_mobileObsservedTimeDiff.is_omit() || single_value->field_mobileObsservedTimeDiff.is_value())
 && (single_value->field_mobileTimeDifferenceHyperframe.is_omit() || single_value->field_mobileTimeDifferenceHyperframe.is_value());
}

void PDU__RRM__HandoverComplete__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__RRM__HandoverComplete__MS__NW PDU__RRM__HandoverComplete__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_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
PDU__RRM__HandoverComplete__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_rRCause.is_bound()) {
ret_val.rRCause() = single_value->field_rRCause.valueof();
}
if (single_value->field_mobileObsservedTimeDiff.is_omit()) ret_val.mobileObsservedTimeDiff() = OMIT_VALUE;
else if (single_value->field_mobileObsservedTimeDiff.is_bound()) {
ret_val.mobileObsservedTimeDiff() = single_value->field_mobileObsservedTimeDiff.valueof();
}
if (single_value->field_mobileTimeDifferenceHyperframe.is_omit()) ret_val.mobileTimeDifferenceHyperframe() = OMIT_VALUE;
else if (single_value->field_mobileTimeDifferenceHyperframe.is_bound()) {
ret_val.mobileTimeDifferenceHyperframe() = single_value->field_mobileTimeDifferenceHyperframe.valueof();
}
return ret_val;
}

void PDU__RRM__HandoverComplete__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_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__HandoverComplete__MS__NW_template[list_length];
}

PDU__RRM__HandoverComplete__MS__NW_template& PDU__RRM__HandoverComplete__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_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
return value_list.list_value[list_index];
}

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

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

RR__Cause__V_template& PDU__RRM__HandoverComplete__MS__NW_template::rRCause()
{
set_specific();
return single_value->field_rRCause;
}

const RR__Cause__V_template& PDU__RRM__HandoverComplete__MS__NW_template::rRCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rRCause of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
return single_value->field_rRCause;
}

MobileTimeDifference__TLV_template& PDU__RRM__HandoverComplete__MS__NW_template::mobileObsservedTimeDiff()
{
set_specific();
return single_value->field_mobileObsservedTimeDiff;
}

const MobileTimeDifference__TLV_template& PDU__RRM__HandoverComplete__MS__NW_template::mobileObsservedTimeDiff() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileObsservedTimeDiff of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
return single_value->field_mobileObsservedTimeDiff;
}

MobileTimeDifferenceHyperframe__TLV_template& PDU__RRM__HandoverComplete__MS__NW_template::mobileTimeDifferenceHyperframe()
{
set_specific();
return single_value->field_mobileTimeDifferenceHyperframe;
}

const MobileTimeDifferenceHyperframe__TLV_template& PDU__RRM__HandoverComplete__MS__NW_template::mobileTimeDifferenceHyperframe() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileTimeDifferenceHyperframe of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
return single_value->field_mobileTimeDifferenceHyperframe;
}

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

void PDU__RRM__HandoverComplete__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(", rRCause := ");
single_value->field_rRCause.log();
TTCN_Logger::log_event_str(", mobileObsservedTimeDiff := ");
single_value->field_mobileObsservedTimeDiff.log();
TTCN_Logger::log_event_str(", mobileTimeDifferenceHyperframe := ");
single_value->field_mobileTimeDifferenceHyperframe.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__RRM__HandoverComplete__MS__NW_template::log_match(const PDU__RRM__HandoverComplete__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_rRCause.match(match_value.rRCause(), legacy)){
TTCN_Logger::log_logmatch_info(".rRCause");
single_value->field_rRCause.log_match(match_value.rRCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mobileObsservedTimeDiff().ispresent()){
if(!single_value->field_mobileObsservedTimeDiff.match(match_value.mobileObsservedTimeDiff(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileObsservedTimeDiff");
single_value->field_mobileObsservedTimeDiff.log_match(match_value.mobileObsservedTimeDiff(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileObsservedTimeDiff.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileObsservedTimeDiff := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileObsservedTimeDiff.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileTimeDifferenceHyperframe().ispresent()){
if(!single_value->field_mobileTimeDifferenceHyperframe.match(match_value.mobileTimeDifferenceHyperframe(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileTimeDifferenceHyperframe");
single_value->field_mobileTimeDifferenceHyperframe.log_match(match_value.mobileTimeDifferenceHyperframe(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileTimeDifferenceHyperframe.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileTimeDifferenceHyperframe := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileTimeDifferenceHyperframe.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(", rRCause := ");
single_value->field_rRCause.log_match(match_value.rRCause(), legacy);
TTCN_Logger::log_event_str(", mobileObsservedTimeDiff := ");
if (match_value.mobileObsservedTimeDiff().ispresent()) {
single_value->field_mobileObsservedTimeDiff.log_match(match_value.mobileObsservedTimeDiff(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileObsservedTimeDiff.log();
if (single_value->field_mobileObsservedTimeDiff.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileTimeDifferenceHyperframe := ");
if (match_value.mobileTimeDifferenceHyperframe().ispresent()) {
single_value->field_mobileTimeDifferenceHyperframe.log_match(match_value.mobileTimeDifferenceHyperframe(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileTimeDifferenceHyperframe.log();
if (single_value->field_mobileTimeDifferenceHyperframe.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__RRM__HandoverComplete__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rRCause().is_bound()) rRCause().set_implicit_omit();
if (!mobileObsservedTimeDiff().is_bound()) mobileObsservedTimeDiff() = OMIT_VALUE;
else mobileObsservedTimeDiff().set_implicit_omit();
if (!mobileTimeDifferenceHyperframe().is_bound()) mobileTimeDifferenceHyperframe() = OMIT_VALUE;
else mobileTimeDifferenceHyperframe().set_implicit_omit();
}

void PDU__RRM__HandoverComplete__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_rRCause.encode_text(text_buf);
single_value->field_mobileObsservedTimeDiff.encode_text(text_buf);
single_value->field_mobileTimeDifferenceHyperframe.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_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
}
}

void PDU__RRM__HandoverComplete__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_rRCause.decode_text(text_buf);
single_value->field_mobileObsservedTimeDiff.decode_text(text_buf);
single_value->field_mobileTimeDifferenceHyperframe.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__RRM__HandoverComplete__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_RRM_Types.PDU_RRM_HandoverComplete_MS_NW.");
}
}

void PDU__RRM__HandoverComplete__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__RRM__HandoverComplete__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 (4<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW 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) rRCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileObsservedTimeDiff().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileTimeDifferenceHyperframe().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(), "rRCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileObsservedTimeDiff")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileObsservedTimeDiff().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileTimeDifferenceHyperframe")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileTimeDifferenceHyperframe().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__HandoverComplete__MS__NW_template* precondition = new PDU__RRM__HandoverComplete__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__HandoverComplete__MS__NW_template* implied_template = new PDU__RRM__HandoverComplete__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__HandoverComplete__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__HandoverComplete__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_RRM_Types.PDU_RRM_HandoverComplete_MS_NW");
single_value->field_rRCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW");
single_value->field_mobileObsservedTimeDiff.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverComplete_MS_NW");
single_value->field_mobileTimeDifferenceHyperframe.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverComplete_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_RRM_Types.PDU_RRM_HandoverComplete_MS_NW");
}

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

boolean PDU__RRM__HandoverComplete__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__RRM__HandoverFailure__MS__NW::PDU__RRM__HandoverFailure__MS__NW()
{
}

PDU__RRM__HandoverFailure__MS__NW::PDU__RRM__HandoverFailure__MS__NW(const BITSTRING& par_messageType,
    const RR__Cause__V& par_rRCause,
    const OPTIONAL< PS__Cause__TV >& par_pSCause)
  :   field_messageType(par_messageType),
  field_rRCause(par_rRCause),
  field_pSCause(par_pSCause)
{
}

PDU__RRM__HandoverFailure__MS__NW::PDU__RRM__HandoverFailure__MS__NW(const PDU__RRM__HandoverFailure__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.rRCause().is_bound()) field_rRCause = other_value.rRCause();
else field_rRCause.clean_up();
if (other_value.pSCause().is_bound()) field_pSCause = other_value.pSCause();
else field_pSCause.clean_up();
}

void PDU__RRM__HandoverFailure__MS__NW::clean_up()
{
field_messageType.clean_up();
field_rRCause.clean_up();
field_pSCause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__HandoverFailure__MS__NW::get_descriptor() const { return &PDU__RRM__HandoverFailure__MS__NW_descr_; }
PDU__RRM__HandoverFailure__MS__NW& PDU__RRM__HandoverFailure__MS__NW::operator=(const PDU__RRM__HandoverFailure__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.rRCause().is_bound()) field_rRCause = other_value.rRCause();
  else field_rRCause.clean_up();
  if (other_value.pSCause().is_bound()) field_pSCause = other_value.pSCause();
  else field_pSCause.clean_up();
}
return *this;
}

boolean PDU__RRM__HandoverFailure__MS__NW::operator==(const PDU__RRM__HandoverFailure__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rRCause==other_value.field_rRCause
  && field_pSCause==other_value.field_pSCause;
}

boolean PDU__RRM__HandoverFailure__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_rRCause.is_bound())
  || (OPTIONAL_OMIT == field_pSCause.get_selection() || field_pSCause.is_bound());
}
boolean PDU__RRM__HandoverFailure__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_rRCause.is_value()
  && (OPTIONAL_OMIT == field_pSCause.get_selection() || field_pSCause.is_value());
}
int PDU__RRM__HandoverFailure__MS__NW::size_of() const
{
  int ret_val = 2;
  if (field_pSCause.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__HandoverFailure__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(", rRCause := ");
field_rRCause.log();
TTCN_Logger::log_event_str(", pSCause := ");
field_pSCause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__HandoverFailure__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rRCause().is_bound()) rRCause().set_implicit_omit();
if (!pSCause().is_bound()) pSCause() = OMIT_VALUE;
else pSCause().set_implicit_omit();
}

void PDU__RRM__HandoverFailure__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 (3<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW 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) rRCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pSCause().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(), "rRCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pSCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pSCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW");
  }
}

void PDU__RRM__HandoverFailure__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_rRCause.encode_text(text_buf);
field_pSCause.encode_text(text_buf);
}

void PDU__RRM__HandoverFailure__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_rRCause.decode_text(text_buf);
field_pSCause.decode_text(text_buf);
}

void PDU__RRM__HandoverFailure__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__RRM__HandoverFailure__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__RRM__HandoverFailure__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, RR__Cause__V_descr_.raw->forceomit);
  decoded_field_length = field_rRCause.RAW_decode(RR__Cause__V_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_pSCause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, PS__Cause__TV_descr_.raw->forceomit);
  decoded_field_length = field_pSCause().RAW_decode(PS__Cause__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_pSCause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_pSCause.ispresent() || field_pSCause().elementIdentifier() !=  bs_1){
  field_pSCause=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_pSCause=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__RRM__HandoverFailure__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 = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RR__Cause__V_descr_.raw);
  if (field_pSCause.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PS__Cause__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rRCause.RAW_encode(RR__Cause__V_descr_, *myleaf.body.node.nodes[1]);
  if (field_pSCause.ispresent()) {
  encoded_length += field_pSCause().RAW_encode(PS__Cause__TV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_pSCause.ispresent() && (!field_pSCause.ispresent() || field_pSCause().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[]={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_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);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__HandoverFailure__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
RR__Cause__V_template field_rRCause;
PS__Cause__TV_template field_pSCause;
};

void PDU__RRM__HandoverFailure__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_rRCause = ANY_VALUE;
single_value->field_pSCause = ANY_OR_OMIT;
}
}
}

void PDU__RRM__HandoverFailure__MS__NW_template::copy_value(const PDU__RRM__HandoverFailure__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.rRCause().is_bound()) {
  single_value->field_rRCause = other_value.rRCause();
} else {
  single_value->field_rRCause.clean_up();
}
if (other_value.pSCause().is_bound()) {
  if (other_value.pSCause().ispresent()) single_value->field_pSCause = other_value.pSCause()();
  else single_value->field_pSCause = OMIT_VALUE;
} else {
  single_value->field_pSCause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__HandoverFailure__MS__NW_template::copy_template(const PDU__RRM__HandoverFailure__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.rRCause().get_selection()) {
single_value->field_rRCause = other_value.rRCause();
} else {
single_value->field_rRCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pSCause().get_selection()) {
single_value->field_pSCause = other_value.pSCause();
} else {
single_value->field_pSCause.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__RRM__HandoverFailure__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__RRM__HandoverFailure__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__HandoverFailure__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_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__HandoverFailure__MS__NW_template::PDU__RRM__HandoverFailure__MS__NW_template()
{
}

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

PDU__RRM__HandoverFailure__MS__NW_template::PDU__RRM__HandoverFailure__MS__NW_template(const PDU__RRM__HandoverFailure__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__HandoverFailure__MS__NW_template::match(const PDU__RRM__HandoverFailure__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.rRCause().is_bound()) return FALSE;
if(!single_value->field_rRCause.match(other_value.rRCause(), legacy))return FALSE;
if(!other_value.pSCause().is_bound()) return FALSE;
if((other_value.pSCause().ispresent() ? !single_value->field_pSCause.match((const PS__Cause__TV&)other_value.pSCause(), legacy) : !single_value->field_pSCause.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_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__HandoverFailure__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_rRCause.is_bound()
 || (single_value->field_pSCause.is_omit() || single_value->field_pSCause.is_bound());
}

boolean PDU__RRM__HandoverFailure__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_rRCause.is_value()
 && (single_value->field_pSCause.is_omit() || single_value->field_pSCause.is_value());
}

void PDU__RRM__HandoverFailure__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__RRM__HandoverFailure__MS__NW PDU__RRM__HandoverFailure__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_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
PDU__RRM__HandoverFailure__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_rRCause.is_bound()) {
ret_val.rRCause() = single_value->field_rRCause.valueof();
}
if (single_value->field_pSCause.is_omit()) ret_val.pSCause() = OMIT_VALUE;
else if (single_value->field_pSCause.is_bound()) {
ret_val.pSCause() = single_value->field_pSCause.valueof();
}
return ret_val;
}

void PDU__RRM__HandoverFailure__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_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__HandoverFailure__MS__NW_template[list_length];
}

PDU__RRM__HandoverFailure__MS__NW_template& PDU__RRM__HandoverFailure__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_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
return value_list.list_value[list_index];
}

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

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

RR__Cause__V_template& PDU__RRM__HandoverFailure__MS__NW_template::rRCause()
{
set_specific();
return single_value->field_rRCause;
}

const RR__Cause__V_template& PDU__RRM__HandoverFailure__MS__NW_template::rRCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rRCause of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
return single_value->field_rRCause;
}

PS__Cause__TV_template& PDU__RRM__HandoverFailure__MS__NW_template::pSCause()
{
set_specific();
return single_value->field_pSCause;
}

const PS__Cause__TV_template& PDU__RRM__HandoverFailure__MS__NW_template::pSCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pSCause of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
return single_value->field_pSCause;
}

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

void PDU__RRM__HandoverFailure__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(", rRCause := ");
single_value->field_rRCause.log();
TTCN_Logger::log_event_str(", pSCause := ");
single_value->field_pSCause.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__RRM__HandoverFailure__MS__NW_template::log_match(const PDU__RRM__HandoverFailure__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_rRCause.match(match_value.rRCause(), legacy)){
TTCN_Logger::log_logmatch_info(".rRCause");
single_value->field_rRCause.log_match(match_value.rRCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pSCause().ispresent()){
if(!single_value->field_pSCause.match(match_value.pSCause(), legacy)){
TTCN_Logger::log_logmatch_info(".pSCause");
single_value->field_pSCause.log_match(match_value.pSCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pSCause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pSCause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pSCause.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(", rRCause := ");
single_value->field_rRCause.log_match(match_value.rRCause(), legacy);
TTCN_Logger::log_event_str(", pSCause := ");
if (match_value.pSCause().ispresent()) {
single_value->field_pSCause.log_match(match_value.pSCause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pSCause.log();
if (single_value->field_pSCause.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__RRM__HandoverFailure__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rRCause().is_bound()) rRCause().set_implicit_omit();
if (!pSCause().is_bound()) pSCause() = OMIT_VALUE;
else pSCause().set_implicit_omit();
}

void PDU__RRM__HandoverFailure__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_rRCause.encode_text(text_buf);
single_value->field_pSCause.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_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
}
}

void PDU__RRM__HandoverFailure__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_rRCause.decode_text(text_buf);
single_value->field_pSCause.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__RRM__HandoverFailure__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_RRM_Types.PDU_RRM_HandoverFailure_MS_NW.");
}
}

void PDU__RRM__HandoverFailure__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__RRM__HandoverFailure__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 (3<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW 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) rRCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pSCause().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(), "rRCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rRCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pSCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pSCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__HandoverFailure__MS__NW_template* precondition = new PDU__RRM__HandoverFailure__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__HandoverFailure__MS__NW_template* implied_template = new PDU__RRM__HandoverFailure__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__HandoverFailure__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__HandoverFailure__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_RRM_Types.PDU_RRM_HandoverFailure_MS_NW");
single_value->field_rRCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverFailure_MS_NW");
single_value->field_pSCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_HandoverFailure_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_RRM_Types.PDU_RRM_HandoverFailure_MS_NW");
}

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

boolean PDU__RRM__HandoverFailure__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__RRM__ImmediateAssignment__NW__MS::PDU__RRM__ImmediateAssignment__NW__MS()
{
}

PDU__RRM__ImmediateAssignment__NW__MS::PDU__RRM__ImmediateAssignment__NW__MS(const BITSTRING& par_messageType,
    const PageMode__V& par_pageMode,
    const DedicatedModeOrTBF__V& par_dedicatedModeOrTBF,
    const OPTIONAL< ChannelDescription__V >& par_channelDescription,
    const OPTIONAL< OCTETSTRING >& par_packetChannelDescription,
    const RequestReference__V& par_requestReference,
    const OCTETSTRING& par_timingAdvance,
    const MobileL3__CommonIE__Types::Type4__LV& par_mobileAllocation,
    const OPTIONAL< StartingTime__TV >& par_startingTime,
    const OPTIONAL< OCTETSTRING >& par_iA__RestOctets,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet)
  :   field_messageType(par_messageType),
  field_pageMode(par_pageMode),
  field_dedicatedModeOrTBF(par_dedicatedModeOrTBF),
  field_channelDescription(par_channelDescription),
  field_packetChannelDescription(par_packetChannelDescription),
  field_requestReference(par_requestReference),
  field_timingAdvance(par_timingAdvance),
  field_mobileAllocation(par_mobileAllocation),
  field_startingTime(par_startingTime),
  field_iA__RestOctets(par_iA__RestOctets),
  field_extendedTSCSet(par_extendedTSCSet)
{
}

PDU__RRM__ImmediateAssignment__NW__MS::PDU__RRM__ImmediateAssignment__NW__MS(const PDU__RRM__ImmediateAssignment__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.pageMode().is_bound()) field_pageMode = other_value.pageMode();
else field_pageMode.clean_up();
if (other_value.dedicatedModeOrTBF().is_bound()) field_dedicatedModeOrTBF = other_value.dedicatedModeOrTBF();
else field_dedicatedModeOrTBF.clean_up();
if (other_value.channelDescription().is_bound()) field_channelDescription = other_value.channelDescription();
else field_channelDescription.clean_up();
if (other_value.packetChannelDescription().is_bound()) field_packetChannelDescription = other_value.packetChannelDescription();
else field_packetChannelDescription.clean_up();
if (other_value.requestReference().is_bound()) field_requestReference = other_value.requestReference();
else field_requestReference.clean_up();
if (other_value.timingAdvance().is_bound()) field_timingAdvance = other_value.timingAdvance();
else field_timingAdvance.clean_up();
if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
else field_mobileAllocation.clean_up();
if (other_value.startingTime().is_bound()) field_startingTime = other_value.startingTime();
else field_startingTime.clean_up();
if (other_value.iA__RestOctets().is_bound()) field_iA__RestOctets = other_value.iA__RestOctets();
else field_iA__RestOctets.clean_up();
if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
else field_extendedTSCSet.clean_up();
}

void PDU__RRM__ImmediateAssignment__NW__MS::clean_up()
{
field_messageType.clean_up();
field_pageMode.clean_up();
field_dedicatedModeOrTBF.clean_up();
field_channelDescription.clean_up();
field_packetChannelDescription.clean_up();
field_requestReference.clean_up();
field_timingAdvance.clean_up();
field_mobileAllocation.clean_up();
field_startingTime.clean_up();
field_iA__RestOctets.clean_up();
field_extendedTSCSet.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ImmediateAssignment__NW__MS::get_descriptor() const { return &PDU__RRM__ImmediateAssignment__NW__MS_descr_; }
PDU__RRM__ImmediateAssignment__NW__MS& PDU__RRM__ImmediateAssignment__NW__MS::operator=(const PDU__RRM__ImmediateAssignment__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.pageMode().is_bound()) field_pageMode = other_value.pageMode();
  else field_pageMode.clean_up();
  if (other_value.dedicatedModeOrTBF().is_bound()) field_dedicatedModeOrTBF = other_value.dedicatedModeOrTBF();
  else field_dedicatedModeOrTBF.clean_up();
  if (other_value.channelDescription().is_bound()) field_channelDescription = other_value.channelDescription();
  else field_channelDescription.clean_up();
  if (other_value.packetChannelDescription().is_bound()) field_packetChannelDescription = other_value.packetChannelDescription();
  else field_packetChannelDescription.clean_up();
  if (other_value.requestReference().is_bound()) field_requestReference = other_value.requestReference();
  else field_requestReference.clean_up();
  if (other_value.timingAdvance().is_bound()) field_timingAdvance = other_value.timingAdvance();
  else field_timingAdvance.clean_up();
  if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
  else field_mobileAllocation.clean_up();
  if (other_value.startingTime().is_bound()) field_startingTime = other_value.startingTime();
  else field_startingTime.clean_up();
  if (other_value.iA__RestOctets().is_bound()) field_iA__RestOctets = other_value.iA__RestOctets();
  else field_iA__RestOctets.clean_up();
  if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
  else field_extendedTSCSet.clean_up();
}
return *this;
}

boolean PDU__RRM__ImmediateAssignment__NW__MS::operator==(const PDU__RRM__ImmediateAssignment__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_pageMode==other_value.field_pageMode
  && field_dedicatedModeOrTBF==other_value.field_dedicatedModeOrTBF
  && field_channelDescription==other_value.field_channelDescription
  && field_packetChannelDescription==other_value.field_packetChannelDescription
  && field_requestReference==other_value.field_requestReference
  && field_timingAdvance==other_value.field_timingAdvance
  && field_mobileAllocation==other_value.field_mobileAllocation
  && field_startingTime==other_value.field_startingTime
  && field_iA__RestOctets==other_value.field_iA__RestOctets
  && field_extendedTSCSet==other_value.field_extendedTSCSet;
}

boolean PDU__RRM__ImmediateAssignment__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_pageMode.is_bound())
  || (field_dedicatedModeOrTBF.is_bound())
  || (OPTIONAL_OMIT == field_channelDescription.get_selection() || field_channelDescription.is_bound())
  || (OPTIONAL_OMIT == field_packetChannelDescription.get_selection() || field_packetChannelDescription.is_bound())
  || (field_requestReference.is_bound())
  || (field_timingAdvance.is_bound())
  || (field_mobileAllocation.is_bound())
  || (OPTIONAL_OMIT == field_startingTime.get_selection() || field_startingTime.is_bound())
  || (OPTIONAL_OMIT == field_iA__RestOctets.get_selection() || field_iA__RestOctets.is_bound())
  || (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_bound());
}
boolean PDU__RRM__ImmediateAssignment__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_pageMode.is_value()
  && field_dedicatedModeOrTBF.is_value()
  && (OPTIONAL_OMIT == field_channelDescription.get_selection() || field_channelDescription.is_value())
  && (OPTIONAL_OMIT == field_packetChannelDescription.get_selection() || field_packetChannelDescription.is_value())
  && field_requestReference.is_value()
  && field_timingAdvance.is_value()
  && field_mobileAllocation.is_value()
  && (OPTIONAL_OMIT == field_startingTime.get_selection() || field_startingTime.is_value())
  && (OPTIONAL_OMIT == field_iA__RestOctets.get_selection() || field_iA__RestOctets.is_value())
  && (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_value());
}
int PDU__RRM__ImmediateAssignment__NW__MS::size_of() const
{
  int ret_val = 6;
  if (field_channelDescription.ispresent()) ret_val++;
  if (field_packetChannelDescription.ispresent()) ret_val++;
  if (field_startingTime.ispresent()) ret_val++;
  if (field_iA__RestOctets.ispresent()) ret_val++;
  if (field_extendedTSCSet.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__ImmediateAssignment__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(", pageMode := ");
field_pageMode.log();
TTCN_Logger::log_event_str(", dedicatedModeOrTBF := ");
field_dedicatedModeOrTBF.log();
TTCN_Logger::log_event_str(", channelDescription := ");
field_channelDescription.log();
TTCN_Logger::log_event_str(", packetChannelDescription := ");
field_packetChannelDescription.log();
TTCN_Logger::log_event_str(", requestReference := ");
field_requestReference.log();
TTCN_Logger::log_event_str(", timingAdvance := ");
field_timingAdvance.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
field_mobileAllocation.log();
TTCN_Logger::log_event_str(", startingTime := ");
field_startingTime.log();
TTCN_Logger::log_event_str(", iA_RestOctets := ");
field_iA__RestOctets.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
field_extendedTSCSet.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ImmediateAssignment__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (dedicatedModeOrTBF().is_bound()) dedicatedModeOrTBF().set_implicit_omit();
if (!channelDescription().is_bound()) channelDescription() = OMIT_VALUE;
else channelDescription().set_implicit_omit();
if (!packetChannelDescription().is_bound()) packetChannelDescription() = OMIT_VALUE;
else packetChannelDescription().set_implicit_omit();
if (requestReference().is_bound()) requestReference().set_implicit_omit();
if (timingAdvance().is_bound()) timingAdvance().set_implicit_omit();
if (mobileAllocation().is_bound()) mobileAllocation().set_implicit_omit();
if (!startingTime().is_bound()) startingTime() = OMIT_VALUE;
else startingTime().set_implicit_omit();
if (!iA__RestOctets().is_bound()) iA__RestOctets() = OMIT_VALUE;
else iA__RestOctets().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__ImmediateAssignment__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 (11<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS has 11 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dedicatedModeOrTBF().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) channelDescription().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) packetChannelDescription().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) requestReference().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) timingAdvance().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) iA__RestOctets().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pageMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pageMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dedicatedModeOrTBF")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dedicatedModeOrTBF().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timingAdvance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timingAdvance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startingTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iA_RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iA__RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
  }
}

void PDU__RRM__ImmediateAssignment__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_pageMode.encode_text(text_buf);
field_dedicatedModeOrTBF.encode_text(text_buf);
field_channelDescription.encode_text(text_buf);
field_packetChannelDescription.encode_text(text_buf);
field_requestReference.encode_text(text_buf);
field_timingAdvance.encode_text(text_buf);
field_mobileAllocation.encode_text(text_buf);
field_startingTime.encode_text(text_buf);
field_iA__RestOctets.encode_text(text_buf);
field_extendedTSCSet.encode_text(text_buf);
}

void PDU__RRM__ImmediateAssignment__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_pageMode.decode_text(text_buf);
field_dedicatedModeOrTBF.decode_text(text_buf);
field_channelDescription.decode_text(text_buf);
field_packetChannelDescription.decode_text(text_buf);
field_requestReference.decode_text(text_buf);
field_timingAdvance.decode_text(text_buf);
field_mobileAllocation.decode_text(text_buf);
field_startingTime.decode_text(text_buf);
field_iA__RestOctets.decode_text(text_buf);
field_extendedTSCSet.decode_text(text_buf);
}

void PDU__RRM__ImmediateAssignment__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__RRM__ImmediateAssignment__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__RRM__ImmediateAssignment__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, PageMode__V_descr_.raw->forceomit);
  decoded_field_length = field_pageMode.RAW_decode(PageMode__V_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, DedicatedModeOrTBF__V_descr_.raw->forceomit);
  decoded_field_length = field_dedicatedModeOrTBF.RAW_decode(DedicatedModeOrTBF__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_dedicatedModeOrTBF.tMA__dL__tD() ==  bs_7){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_channelDescription = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__RRM__ImmediateAssignment__NW__MS_channelDescription_descr_.raw->forceomit);
  decoded_field_length = field_channelDescription().RAW_decode(PDU__RRM__ImmediateAssignment__NW__MS_channelDescription_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_channelDescription = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_channelDescription=OMIT_VALUE;
  if (limit > 0 && (field_dedicatedModeOrTBF.tMA__dL__tD() ==  bs_8 || field_dedicatedModeOrTBF.tMA__dL__tD() ==  bs_9 || field_dedicatedModeOrTBF.tMA__dL__tD() ==  bs_10 || field_dedicatedModeOrTBF.tMA__dL__tD() ==  bs_11)){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_packetChannelDescription = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PDU__RRM__ImmediateAssignment__NW__MS_packetChannelDescription_descr_.raw->forceomit);
  decoded_field_length = field_packetChannelDescription().RAW_decode(PDU__RRM__ImmediateAssignment__NW__MS_packetChannelDescription_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_packetChannelDescription = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_packetChannelDescription=OMIT_VALUE;
  RAW_Force_Omit field_5_force_omit(5, force_omit, RequestReference__V_descr_.raw->forceomit);
  decoded_field_length = field_requestReference.RAW_decode(RequestReference__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_timingAdvance.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocation.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_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_startingTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, StartingTime__TV_descr_.raw->forceomit);
  decoded_field_length = field_startingTime().RAW_decode(StartingTime__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_startingTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_startingTime.ispresent() || field_startingTime().elementIdentifier() !=  os_1){
  field_startingTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_startingTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_iA__RestOctets = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_iA__RestOctets().RAW_decode(OCTETSTRING_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_iA__RestOctets = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iA__RestOctets=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_extendedTSCSet = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, ExtendedTSCSet__TV_descr_.raw->forceomit);
  decoded_field_length = field_extendedTSCSet().RAW_decode(ExtendedTSCSet__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_extendedTSCSet = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_extendedTSCSet.ispresent() || field_extendedTSCSet().elementIdentifier() !=  os_2){
  field_extendedTSCSet=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_extendedTSCSet=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__RRM__ImmediateAssignment__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 = 11;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(11);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PageMode__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DedicatedModeOrTBF__V_descr_.raw);
  if (field_channelDescription.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__RRM__ImmediateAssignment__NW__MS_channelDescription_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_packetChannelDescription.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PDU__RRM__ImmediateAssignment__NW__MS_packetChannelDescription_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RequestReference__V_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  if (field_startingTime.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, StartingTime__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_iA__RestOctets.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, OCTETSTRING_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_extendedTSCSet.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, ExtendedTSCSet__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pageMode.RAW_encode(PageMode__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_dedicatedModeOrTBF.RAW_encode(DedicatedModeOrTBF__V_descr_, *myleaf.body.node.nodes[2]);
  if (field_channelDescription.ispresent()) {
  encoded_length += field_channelDescription().RAW_encode(PDU__RRM__ImmediateAssignment__NW__MS_channelDescription_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_packetChannelDescription.ispresent()) {
  encoded_length += field_packetChannelDescription().RAW_encode(PDU__RRM__ImmediateAssignment__NW__MS_packetChannelDescription_descr_, *myleaf.body.node.nodes[4]);
  }
  encoded_length += field_requestReference.RAW_encode(RequestReference__V_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_timingAdvance.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_mobileAllocation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[7]);
  if (field_startingTime.ispresent()) {
  encoded_length += field_startingTime().RAW_encode(StartingTime__TV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_iA__RestOctets.ispresent()) {
  encoded_length += field_iA__RestOctets().RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_extendedTSCSet.ispresent()) {
  encoded_length += field_extendedTSCSet().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_channelDescription.ispresent() && (field_dedicatedModeOrTBF.tMA__dL__tD() !=  bs_7)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_7.RAW_encode(General__Types::BIT3_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_packetChannelDescription.ispresent() && (field_dedicatedModeOrTBF.tMA__dL__tD() !=  bs_8 && field_dedicatedModeOrTBF.tMA__dL__tD() !=  bs_9 && field_dedicatedModeOrTBF.tMA__dL__tD() !=  bs_10 && field_dedicatedModeOrTBF.tMA__dL__tD() !=  bs_11)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_8.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+2;
  int new_pos1[]={2,0};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   bs_9.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos2;
  pr_pos2.level=myleaf.curr_pos.level+2;
  int new_pos2[]={2,0};
  pr_pos2.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos2);
  temp_leaf = myleaf.get_node(pr_pos2);
  if(temp_leaf != NULL){
   bs_10.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos3;
  pr_pos3.level=myleaf.curr_pos.level+2;
  int new_pos3[]={2,0};
  pr_pos3.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos3);
  temp_leaf = myleaf.get_node(pr_pos3);
  if(temp_leaf != NULL){
   bs_11.RAW_encode(General__Types::BIT3_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos3.pos);
  }
  free_tree_pos(pr_pos2.pos);
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_startingTime.ispresent() && (!field_startingTime.ispresent() || field_startingTime().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[]={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_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_extendedTSCSet.ispresent() && (!field_extendedTSCSet.ispresent() || field_extendedTSCSet().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[]={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_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__RRM__ImmediateAssignment__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
PageMode__V_template field_pageMode;
DedicatedModeOrTBF__V_template field_dedicatedModeOrTBF;
ChannelDescription__V_template field_channelDescription;
OCTETSTRING_template field_packetChannelDescription;
RequestReference__V_template field_requestReference;
OCTETSTRING_template field_timingAdvance;
MobileL3__CommonIE__Types::Type4__LV_template field_mobileAllocation;
StartingTime__TV_template field_startingTime;
OCTETSTRING_template field_iA__RestOctets;
ExtendedTSCSet__TV_template field_extendedTSCSet;
};

void PDU__RRM__ImmediateAssignment__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_pageMode = ANY_VALUE;
single_value->field_dedicatedModeOrTBF = ANY_VALUE;
single_value->field_channelDescription = ANY_OR_OMIT;
single_value->field_packetChannelDescription = ANY_OR_OMIT;
single_value->field_requestReference = ANY_VALUE;
single_value->field_timingAdvance = ANY_VALUE;
single_value->field_mobileAllocation = ANY_VALUE;
single_value->field_startingTime = ANY_OR_OMIT;
single_value->field_iA__RestOctets = ANY_OR_OMIT;
single_value->field_extendedTSCSet = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ImmediateAssignment__NW__MS_template::copy_value(const PDU__RRM__ImmediateAssignment__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.pageMode().is_bound()) {
  single_value->field_pageMode = other_value.pageMode();
} else {
  single_value->field_pageMode.clean_up();
}
if (other_value.dedicatedModeOrTBF().is_bound()) {
  single_value->field_dedicatedModeOrTBF = other_value.dedicatedModeOrTBF();
} else {
  single_value->field_dedicatedModeOrTBF.clean_up();
}
if (other_value.channelDescription().is_bound()) {
  if (other_value.channelDescription().ispresent()) single_value->field_channelDescription = other_value.channelDescription()();
  else single_value->field_channelDescription = OMIT_VALUE;
} else {
  single_value->field_channelDescription.clean_up();
}
if (other_value.packetChannelDescription().is_bound()) {
  if (other_value.packetChannelDescription().ispresent()) single_value->field_packetChannelDescription = other_value.packetChannelDescription()();
  else single_value->field_packetChannelDescription = OMIT_VALUE;
} else {
  single_value->field_packetChannelDescription.clean_up();
}
if (other_value.requestReference().is_bound()) {
  single_value->field_requestReference = other_value.requestReference();
} else {
  single_value->field_requestReference.clean_up();
}
if (other_value.timingAdvance().is_bound()) {
  single_value->field_timingAdvance = other_value.timingAdvance();
} else {
  single_value->field_timingAdvance.clean_up();
}
if (other_value.mobileAllocation().is_bound()) {
  single_value->field_mobileAllocation = other_value.mobileAllocation();
} else {
  single_value->field_mobileAllocation.clean_up();
}
if (other_value.startingTime().is_bound()) {
  if (other_value.startingTime().ispresent()) single_value->field_startingTime = other_value.startingTime()();
  else single_value->field_startingTime = OMIT_VALUE;
} else {
  single_value->field_startingTime.clean_up();
}
if (other_value.iA__RestOctets().is_bound()) {
  if (other_value.iA__RestOctets().ispresent()) single_value->field_iA__RestOctets = other_value.iA__RestOctets()();
  else single_value->field_iA__RestOctets = OMIT_VALUE;
} else {
  single_value->field_iA__RestOctets.clean_up();
}
if (other_value.extendedTSCSet().is_bound()) {
  if (other_value.extendedTSCSet().ispresent()) single_value->field_extendedTSCSet = other_value.extendedTSCSet()();
  else single_value->field_extendedTSCSet = OMIT_VALUE;
} else {
  single_value->field_extendedTSCSet.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ImmediateAssignment__NW__MS_template::copy_template(const PDU__RRM__ImmediateAssignment__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.pageMode().get_selection()) {
single_value->field_pageMode = other_value.pageMode();
} else {
single_value->field_pageMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dedicatedModeOrTBF().get_selection()) {
single_value->field_dedicatedModeOrTBF = other_value.dedicatedModeOrTBF();
} else {
single_value->field_dedicatedModeOrTBF.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelDescription().get_selection()) {
single_value->field_channelDescription = other_value.channelDescription();
} else {
single_value->field_channelDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.packetChannelDescription().get_selection()) {
single_value->field_packetChannelDescription = other_value.packetChannelDescription();
} else {
single_value->field_packetChannelDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestReference().get_selection()) {
single_value->field_requestReference = other_value.requestReference();
} else {
single_value->field_requestReference.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.timingAdvance().get_selection()) {
single_value->field_timingAdvance = other_value.timingAdvance();
} else {
single_value->field_timingAdvance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocation().get_selection()) {
single_value->field_mobileAllocation = other_value.mobileAllocation();
} else {
single_value->field_mobileAllocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.startingTime().get_selection()) {
single_value->field_startingTime = other_value.startingTime();
} else {
single_value->field_startingTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iA__RestOctets().get_selection()) {
single_value->field_iA__RestOctets = other_value.iA__RestOctets();
} else {
single_value->field_iA__RestOctets.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedTSCSet().get_selection()) {
single_value->field_extendedTSCSet = other_value.extendedTSCSet();
} else {
single_value->field_extendedTSCSet.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__RRM__ImmediateAssignment__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__RRM__ImmediateAssignment__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ImmediateAssignment__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_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ImmediateAssignment__NW__MS_template::PDU__RRM__ImmediateAssignment__NW__MS_template()
{
}

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

PDU__RRM__ImmediateAssignment__NW__MS_template::PDU__RRM__ImmediateAssignment__NW__MS_template(const PDU__RRM__ImmediateAssignment__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__ImmediateAssignment__NW__MS_template::match(const PDU__RRM__ImmediateAssignment__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.pageMode().is_bound()) return FALSE;
if(!single_value->field_pageMode.match(other_value.pageMode(), legacy))return FALSE;
if(!other_value.dedicatedModeOrTBF().is_bound()) return FALSE;
if(!single_value->field_dedicatedModeOrTBF.match(other_value.dedicatedModeOrTBF(), legacy))return FALSE;
if(!other_value.channelDescription().is_bound()) return FALSE;
if((other_value.channelDescription().ispresent() ? !single_value->field_channelDescription.match((const ChannelDescription__V&)other_value.channelDescription(), legacy) : !single_value->field_channelDescription.match_omit(legacy)))return FALSE;
if(!other_value.packetChannelDescription().is_bound()) return FALSE;
if((other_value.packetChannelDescription().ispresent() ? !single_value->field_packetChannelDescription.match((const OCTETSTRING&)other_value.packetChannelDescription(), legacy) : !single_value->field_packetChannelDescription.match_omit(legacy)))return FALSE;
if(!other_value.requestReference().is_bound()) return FALSE;
if(!single_value->field_requestReference.match(other_value.requestReference(), legacy))return FALSE;
if(!other_value.timingAdvance().is_bound()) return FALSE;
if(!single_value->field_timingAdvance.match(other_value.timingAdvance(), legacy))return FALSE;
if(!other_value.mobileAllocation().is_bound()) return FALSE;
if(!single_value->field_mobileAllocation.match(other_value.mobileAllocation(), legacy))return FALSE;
if(!other_value.startingTime().is_bound()) return FALSE;
if((other_value.startingTime().ispresent() ? !single_value->field_startingTime.match((const StartingTime__TV&)other_value.startingTime(), legacy) : !single_value->field_startingTime.match_omit(legacy)))return FALSE;
if(!other_value.iA__RestOctets().is_bound()) return FALSE;
if((other_value.iA__RestOctets().ispresent() ? !single_value->field_iA__RestOctets.match((const OCTETSTRING&)other_value.iA__RestOctets(), legacy) : !single_value->field_iA__RestOctets.match_omit(legacy)))return FALSE;
if(!other_value.extendedTSCSet().is_bound()) return FALSE;
if((other_value.extendedTSCSet().ispresent() ? !single_value->field_extendedTSCSet.match((const ExtendedTSCSet__TV&)other_value.extendedTSCSet(), legacy) : !single_value->field_extendedTSCSet.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_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ImmediateAssignment__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_pageMode.is_bound()
 || single_value->field_dedicatedModeOrTBF.is_bound()
 || (single_value->field_channelDescription.is_omit() || single_value->field_channelDescription.is_bound())
 || (single_value->field_packetChannelDescription.is_omit() || single_value->field_packetChannelDescription.is_bound())
 || single_value->field_requestReference.is_bound()
 || single_value->field_timingAdvance.is_bound()
 || single_value->field_mobileAllocation.is_bound()
 || (single_value->field_startingTime.is_omit() || single_value->field_startingTime.is_bound())
 || (single_value->field_iA__RestOctets.is_omit() || single_value->field_iA__RestOctets.is_bound())
 || (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_bound());
}

boolean PDU__RRM__ImmediateAssignment__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_pageMode.is_value()
 && single_value->field_dedicatedModeOrTBF.is_value()
 && (single_value->field_channelDescription.is_omit() || single_value->field_channelDescription.is_value())
 && (single_value->field_packetChannelDescription.is_omit() || single_value->field_packetChannelDescription.is_value())
 && single_value->field_requestReference.is_value()
 && single_value->field_timingAdvance.is_value()
 && single_value->field_mobileAllocation.is_value()
 && (single_value->field_startingTime.is_omit() || single_value->field_startingTime.is_value())
 && (single_value->field_iA__RestOctets.is_omit() || single_value->field_iA__RestOctets.is_value())
 && (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_value());
}

void PDU__RRM__ImmediateAssignment__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__RRM__ImmediateAssignment__NW__MS PDU__RRM__ImmediateAssignment__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_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
PDU__RRM__ImmediateAssignment__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_pageMode.is_bound()) {
ret_val.pageMode() = single_value->field_pageMode.valueof();
}
if (single_value->field_dedicatedModeOrTBF.is_bound()) {
ret_val.dedicatedModeOrTBF() = single_value->field_dedicatedModeOrTBF.valueof();
}
if (single_value->field_channelDescription.is_omit()) ret_val.channelDescription() = OMIT_VALUE;
else if (single_value->field_channelDescription.is_bound()) {
ret_val.channelDescription() = single_value->field_channelDescription.valueof();
}
if (single_value->field_packetChannelDescription.is_omit()) ret_val.packetChannelDescription() = OMIT_VALUE;
else if (single_value->field_packetChannelDescription.is_bound()) {
ret_val.packetChannelDescription() = single_value->field_packetChannelDescription.valueof();
}
if (single_value->field_requestReference.is_bound()) {
ret_val.requestReference() = single_value->field_requestReference.valueof();
}
if (single_value->field_timingAdvance.is_bound()) {
ret_val.timingAdvance() = single_value->field_timingAdvance.valueof();
}
if (single_value->field_mobileAllocation.is_bound()) {
ret_val.mobileAllocation() = single_value->field_mobileAllocation.valueof();
}
if (single_value->field_startingTime.is_omit()) ret_val.startingTime() = OMIT_VALUE;
else if (single_value->field_startingTime.is_bound()) {
ret_val.startingTime() = single_value->field_startingTime.valueof();
}
if (single_value->field_iA__RestOctets.is_omit()) ret_val.iA__RestOctets() = OMIT_VALUE;
else if (single_value->field_iA__RestOctets.is_bound()) {
ret_val.iA__RestOctets() = single_value->field_iA__RestOctets.valueof();
}
if (single_value->field_extendedTSCSet.is_omit()) ret_val.extendedTSCSet() = OMIT_VALUE;
else if (single_value->field_extendedTSCSet.is_bound()) {
ret_val.extendedTSCSet() = single_value->field_extendedTSCSet.valueof();
}
return ret_val;
}

void PDU__RRM__ImmediateAssignment__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_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ImmediateAssignment__NW__MS_template[list_length];
}

PDU__RRM__ImmediateAssignment__NW__MS_template& PDU__RRM__ImmediateAssignment__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_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return value_list.list_value[list_index];
}

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

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

PageMode__V_template& PDU__RRM__ImmediateAssignment__NW__MS_template::pageMode()
{
set_specific();
return single_value->field_pageMode;
}

const PageMode__V_template& PDU__RRM__ImmediateAssignment__NW__MS_template::pageMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pageMode of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_pageMode;
}

DedicatedModeOrTBF__V_template& PDU__RRM__ImmediateAssignment__NW__MS_template::dedicatedModeOrTBF()
{
set_specific();
return single_value->field_dedicatedModeOrTBF;
}

const DedicatedModeOrTBF__V_template& PDU__RRM__ImmediateAssignment__NW__MS_template::dedicatedModeOrTBF() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dedicatedModeOrTBF of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_dedicatedModeOrTBF;
}

ChannelDescription__V_template& PDU__RRM__ImmediateAssignment__NW__MS_template::channelDescription()
{
set_specific();
return single_value->field_channelDescription;
}

const ChannelDescription__V_template& PDU__RRM__ImmediateAssignment__NW__MS_template::channelDescription() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelDescription of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_channelDescription;
}

OCTETSTRING_template& PDU__RRM__ImmediateAssignment__NW__MS_template::packetChannelDescription()
{
set_specific();
return single_value->field_packetChannelDescription;
}

const OCTETSTRING_template& PDU__RRM__ImmediateAssignment__NW__MS_template::packetChannelDescription() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field packetChannelDescription of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_packetChannelDescription;
}

RequestReference__V_template& PDU__RRM__ImmediateAssignment__NW__MS_template::requestReference()
{
set_specific();
return single_value->field_requestReference;
}

const RequestReference__V_template& PDU__RRM__ImmediateAssignment__NW__MS_template::requestReference() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestReference of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_requestReference;
}

OCTETSTRING_template& PDU__RRM__ImmediateAssignment__NW__MS_template::timingAdvance()
{
set_specific();
return single_value->field_timingAdvance;
}

const OCTETSTRING_template& PDU__RRM__ImmediateAssignment__NW__MS_template::timingAdvance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timingAdvance of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_timingAdvance;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__ImmediateAssignment__NW__MS_template::mobileAllocation()
{
set_specific();
return single_value->field_mobileAllocation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__ImmediateAssignment__NW__MS_template::mobileAllocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_mobileAllocation;
}

StartingTime__TV_template& PDU__RRM__ImmediateAssignment__NW__MS_template::startingTime()
{
set_specific();
return single_value->field_startingTime;
}

const StartingTime__TV_template& PDU__RRM__ImmediateAssignment__NW__MS_template::startingTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field startingTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_startingTime;
}

OCTETSTRING_template& PDU__RRM__ImmediateAssignment__NW__MS_template::iA__RestOctets()
{
set_specific();
return single_value->field_iA__RestOctets;
}

const OCTETSTRING_template& PDU__RRM__ImmediateAssignment__NW__MS_template::iA__RestOctets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iA_RestOctets of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_iA__RestOctets;
}

ExtendedTSCSet__TV_template& PDU__RRM__ImmediateAssignment__NW__MS_template::extendedTSCSet()
{
set_specific();
return single_value->field_extendedTSCSet;
}

const ExtendedTSCSet__TV_template& PDU__RRM__ImmediateAssignment__NW__MS_template::extendedTSCSet() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedTSCSet of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
return single_value->field_extendedTSCSet;
}

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

void PDU__RRM__ImmediateAssignment__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(", pageMode := ");
single_value->field_pageMode.log();
TTCN_Logger::log_event_str(", dedicatedModeOrTBF := ");
single_value->field_dedicatedModeOrTBF.log();
TTCN_Logger::log_event_str(", channelDescription := ");
single_value->field_channelDescription.log();
TTCN_Logger::log_event_str(", packetChannelDescription := ");
single_value->field_packetChannelDescription.log();
TTCN_Logger::log_event_str(", requestReference := ");
single_value->field_requestReference.log();
TTCN_Logger::log_event_str(", timingAdvance := ");
single_value->field_timingAdvance.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
single_value->field_mobileAllocation.log();
TTCN_Logger::log_event_str(", startingTime := ");
single_value->field_startingTime.log();
TTCN_Logger::log_event_str(", iA_RestOctets := ");
single_value->field_iA__RestOctets.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
single_value->field_extendedTSCSet.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__RRM__ImmediateAssignment__NW__MS_template::log_match(const PDU__RRM__ImmediateAssignment__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_pageMode.match(match_value.pageMode(), legacy)){
TTCN_Logger::log_logmatch_info(".pageMode");
single_value->field_pageMode.log_match(match_value.pageMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dedicatedModeOrTBF.match(match_value.dedicatedModeOrTBF(), legacy)){
TTCN_Logger::log_logmatch_info(".dedicatedModeOrTBF");
single_value->field_dedicatedModeOrTBF.log_match(match_value.dedicatedModeOrTBF(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.channelDescription().ispresent()){
if(!single_value->field_channelDescription.match(match_value.channelDescription(), legacy)){
TTCN_Logger::log_logmatch_info(".channelDescription");
single_value->field_channelDescription.log_match(match_value.channelDescription(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelDescription.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelDescription := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelDescription.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.packetChannelDescription().ispresent()){
if(!single_value->field_packetChannelDescription.match(match_value.packetChannelDescription(), legacy)){
TTCN_Logger::log_logmatch_info(".packetChannelDescription");
single_value->field_packetChannelDescription.log_match(match_value.packetChannelDescription(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_packetChannelDescription.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".packetChannelDescription := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_packetChannelDescription.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_requestReference.match(match_value.requestReference(), legacy)){
TTCN_Logger::log_logmatch_info(".requestReference");
single_value->field_requestReference.log_match(match_value.requestReference(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_timingAdvance.match(match_value.timingAdvance(), legacy)){
TTCN_Logger::log_logmatch_info(".timingAdvance");
single_value->field_timingAdvance.log_match(match_value.timingAdvance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileAllocation.match(match_value.mobileAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocation");
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.startingTime().ispresent()){
if(!single_value->field_startingTime.match(match_value.startingTime(), legacy)){
TTCN_Logger::log_logmatch_info(".startingTime");
single_value->field_startingTime.log_match(match_value.startingTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_startingTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".startingTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_startingTime.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.iA__RestOctets().ispresent()){
if(!single_value->field_iA__RestOctets.match(match_value.iA__RestOctets(), legacy)){
TTCN_Logger::log_logmatch_info(".iA_RestOctets");
single_value->field_iA__RestOctets.log_match(match_value.iA__RestOctets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iA__RestOctets.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iA_RestOctets := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iA__RestOctets.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedTSCSet().ispresent()){
if(!single_value->field_extendedTSCSet.match(match_value.extendedTSCSet(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedTSCSet");
single_value->field_extendedTSCSet.log_match(match_value.extendedTSCSet(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedTSCSet.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedTSCSet := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedTSCSet.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(", pageMode := ");
single_value->field_pageMode.log_match(match_value.pageMode(), legacy);
TTCN_Logger::log_event_str(", dedicatedModeOrTBF := ");
single_value->field_dedicatedModeOrTBF.log_match(match_value.dedicatedModeOrTBF(), legacy);
TTCN_Logger::log_event_str(", channelDescription := ");
if (match_value.channelDescription().ispresent()) {
single_value->field_channelDescription.log_match(match_value.channelDescription(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelDescription.log();
if (single_value->field_channelDescription.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", packetChannelDescription := ");
if (match_value.packetChannelDescription().ispresent()) {
single_value->field_packetChannelDescription.log_match(match_value.packetChannelDescription(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_packetChannelDescription.log();
if (single_value->field_packetChannelDescription.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", requestReference := ");
single_value->field_requestReference.log_match(match_value.requestReference(), legacy);
TTCN_Logger::log_event_str(", timingAdvance := ");
single_value->field_timingAdvance.log_match(match_value.timingAdvance(), legacy);
TTCN_Logger::log_event_str(", mobileAllocation := ");
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
TTCN_Logger::log_event_str(", startingTime := ");
if (match_value.startingTime().ispresent()) {
single_value->field_startingTime.log_match(match_value.startingTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_startingTime.log();
if (single_value->field_startingTime.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", iA_RestOctets := ");
if (match_value.iA__RestOctets().ispresent()) {
single_value->field_iA__RestOctets.log_match(match_value.iA__RestOctets(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iA__RestOctets.log();
if (single_value->field_iA__RestOctets.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedTSCSet := ");
if (match_value.extendedTSCSet().ispresent()) {
single_value->field_extendedTSCSet.log_match(match_value.extendedTSCSet(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedTSCSet.log();
if (single_value->field_extendedTSCSet.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__RRM__ImmediateAssignment__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (dedicatedModeOrTBF().is_bound()) dedicatedModeOrTBF().set_implicit_omit();
if (!channelDescription().is_bound()) channelDescription() = OMIT_VALUE;
else channelDescription().set_implicit_omit();
if (!packetChannelDescription().is_bound()) packetChannelDescription() = OMIT_VALUE;
else packetChannelDescription().set_implicit_omit();
if (requestReference().is_bound()) requestReference().set_implicit_omit();
if (timingAdvance().is_bound()) timingAdvance().set_implicit_omit();
if (mobileAllocation().is_bound()) mobileAllocation().set_implicit_omit();
if (!startingTime().is_bound()) startingTime() = OMIT_VALUE;
else startingTime().set_implicit_omit();
if (!iA__RestOctets().is_bound()) iA__RestOctets() = OMIT_VALUE;
else iA__RestOctets().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__ImmediateAssignment__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_pageMode.encode_text(text_buf);
single_value->field_dedicatedModeOrTBF.encode_text(text_buf);
single_value->field_channelDescription.encode_text(text_buf);
single_value->field_packetChannelDescription.encode_text(text_buf);
single_value->field_requestReference.encode_text(text_buf);
single_value->field_timingAdvance.encode_text(text_buf);
single_value->field_mobileAllocation.encode_text(text_buf);
single_value->field_startingTime.encode_text(text_buf);
single_value->field_iA__RestOctets.encode_text(text_buf);
single_value->field_extendedTSCSet.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_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
}
}

void PDU__RRM__ImmediateAssignment__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_pageMode.decode_text(text_buf);
single_value->field_dedicatedModeOrTBF.decode_text(text_buf);
single_value->field_channelDescription.decode_text(text_buf);
single_value->field_packetChannelDescription.decode_text(text_buf);
single_value->field_requestReference.decode_text(text_buf);
single_value->field_timingAdvance.decode_text(text_buf);
single_value->field_mobileAllocation.decode_text(text_buf);
single_value->field_startingTime.decode_text(text_buf);
single_value->field_iA__RestOctets.decode_text(text_buf);
single_value->field_extendedTSCSet.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__RRM__ImmediateAssignment__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_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS.");
}
}

void PDU__RRM__ImmediateAssignment__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__RRM__ImmediateAssignment__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 (11<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS has 11 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dedicatedModeOrTBF().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) channelDescription().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) packetChannelDescription().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) requestReference().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) timingAdvance().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) iA__RestOctets().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pageMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pageMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dedicatedModeOrTBF")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dedicatedModeOrTBF().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "packetChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          packetChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timingAdvance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timingAdvance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startingTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iA_RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iA__RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ImmediateAssignment__NW__MS_template* precondition = new PDU__RRM__ImmediateAssignment__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ImmediateAssignment__NW__MS_template* implied_template = new PDU__RRM__ImmediateAssignment__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ImmediateAssignment__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ImmediateAssignment__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_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_pageMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_dedicatedModeOrTBF.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_channelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_packetChannelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_requestReference.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_timingAdvance.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_mobileAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_startingTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_iA__RestOctets.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
single_value->field_extendedTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignment_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_RRM_Types.PDU_RRM_ImmediateAssignment_NW_MS");
}

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

boolean PDU__RRM__ImmediateAssignment__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__RRM__ImmediatePacketAssignment__NW__MS::PDU__RRM__ImmediatePacketAssignment__NW__MS()
{
}

PDU__RRM__ImmediatePacketAssignment__NW__MS::PDU__RRM__ImmediatePacketAssignment__NW__MS(const BITSTRING& par_messageType,
    const PageMode__V& par_pageMode,
    const FeatureIndicator__V& par_featureIndicator,
    const OCTETSTRING& par_iPA__RestOctets)
  :   field_messageType(par_messageType),
  field_pageMode(par_pageMode),
  field_featureIndicator(par_featureIndicator),
  field_iPA__RestOctets(par_iPA__RestOctets)
{
}

PDU__RRM__ImmediatePacketAssignment__NW__MS::PDU__RRM__ImmediatePacketAssignment__NW__MS(const PDU__RRM__ImmediatePacketAssignment__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.pageMode().is_bound()) field_pageMode = other_value.pageMode();
else field_pageMode.clean_up();
if (other_value.featureIndicator().is_bound()) field_featureIndicator = other_value.featureIndicator();
else field_featureIndicator.clean_up();
if (other_value.iPA__RestOctets().is_bound()) field_iPA__RestOctets = other_value.iPA__RestOctets();
else field_iPA__RestOctets.clean_up();
}

void PDU__RRM__ImmediatePacketAssignment__NW__MS::clean_up()
{
field_messageType.clean_up();
field_pageMode.clean_up();
field_featureIndicator.clean_up();
field_iPA__RestOctets.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ImmediatePacketAssignment__NW__MS::get_descriptor() const { return &PDU__RRM__ImmediatePacketAssignment__NW__MS_descr_; }
PDU__RRM__ImmediatePacketAssignment__NW__MS& PDU__RRM__ImmediatePacketAssignment__NW__MS::operator=(const PDU__RRM__ImmediatePacketAssignment__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.pageMode().is_bound()) field_pageMode = other_value.pageMode();
  else field_pageMode.clean_up();
  if (other_value.featureIndicator().is_bound()) field_featureIndicator = other_value.featureIndicator();
  else field_featureIndicator.clean_up();
  if (other_value.iPA__RestOctets().is_bound()) field_iPA__RestOctets = other_value.iPA__RestOctets();
  else field_iPA__RestOctets.clean_up();
}
return *this;
}

boolean PDU__RRM__ImmediatePacketAssignment__NW__MS::operator==(const PDU__RRM__ImmediatePacketAssignment__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_pageMode==other_value.field_pageMode
  && field_featureIndicator==other_value.field_featureIndicator
  && field_iPA__RestOctets==other_value.field_iPA__RestOctets;
}

boolean PDU__RRM__ImmediatePacketAssignment__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_pageMode.is_bound())
  || (field_featureIndicator.is_bound())
  || (field_iPA__RestOctets.is_bound());
}
boolean PDU__RRM__ImmediatePacketAssignment__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_pageMode.is_value()
  && field_featureIndicator.is_value()
  && field_iPA__RestOctets.is_value();
}
void PDU__RRM__ImmediatePacketAssignment__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(", pageMode := ");
field_pageMode.log();
TTCN_Logger::log_event_str(", featureIndicator := ");
field_featureIndicator.log();
TTCN_Logger::log_event_str(", iPA_RestOctets := ");
field_iPA__RestOctets.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ImmediatePacketAssignment__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (featureIndicator().is_bound()) featureIndicator().set_implicit_omit();
if (iPA__RestOctets().is_bound()) iPA__RestOctets().set_implicit_omit();
}

void PDU__RRM__ImmediatePacketAssignment__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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) featureIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iPA__RestOctets().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(), "pageMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pageMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "featureIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          featureIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iPA_RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iPA__RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS");
  }
}

void PDU__RRM__ImmediatePacketAssignment__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_pageMode.encode_text(text_buf);
field_featureIndicator.encode_text(text_buf);
field_iPA__RestOctets.encode_text(text_buf);
}

void PDU__RRM__ImmediatePacketAssignment__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_pageMode.decode_text(text_buf);
field_featureIndicator.decode_text(text_buf);
field_iPA__RestOctets.decode_text(text_buf);
}

void PDU__RRM__ImmediatePacketAssignment__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__RRM__ImmediatePacketAssignment__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__RRM__ImmediatePacketAssignment__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, PageMode__V_descr_.raw->forceomit);
  decoded_field_length = field_pageMode.RAW_decode(PageMode__V_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, FeatureIndicator__V_descr_.raw->forceomit);
  decoded_field_length = field_featureIndicator.RAW_decode(FeatureIndicator__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__RRM__ImmediatePacketAssignment__NW__MS_iPA__RestOctets_descr_.raw->forceomit);
  decoded_field_length = field_iPA__RestOctets.RAW_decode(PDU__RRM__ImmediatePacketAssignment__NW__MS_iPA__RestOctets_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__RRM__ImmediatePacketAssignment__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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PageMode__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, FeatureIndicator__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__RRM__ImmediatePacketAssignment__NW__MS_iPA__RestOctets_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pageMode.RAW_encode(PageMode__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_featureIndicator.RAW_encode(FeatureIndicator__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_iPA__RestOctets.RAW_encode(PDU__RRM__ImmediatePacketAssignment__NW__MS_iPA__RestOctets_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ImmediatePacketAssignment__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
PageMode__V_template field_pageMode;
FeatureIndicator__V_template field_featureIndicator;
OCTETSTRING_template field_iPA__RestOctets;
};

void PDU__RRM__ImmediatePacketAssignment__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_pageMode = ANY_VALUE;
single_value->field_featureIndicator = ANY_VALUE;
single_value->field_iPA__RestOctets = ANY_VALUE;
}
}
}

void PDU__RRM__ImmediatePacketAssignment__NW__MS_template::copy_value(const PDU__RRM__ImmediatePacketAssignment__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.pageMode().is_bound()) {
  single_value->field_pageMode = other_value.pageMode();
} else {
  single_value->field_pageMode.clean_up();
}
if (other_value.featureIndicator().is_bound()) {
  single_value->field_featureIndicator = other_value.featureIndicator();
} else {
  single_value->field_featureIndicator.clean_up();
}
if (other_value.iPA__RestOctets().is_bound()) {
  single_value->field_iPA__RestOctets = other_value.iPA__RestOctets();
} else {
  single_value->field_iPA__RestOctets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ImmediatePacketAssignment__NW__MS_template::copy_template(const PDU__RRM__ImmediatePacketAssignment__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.pageMode().get_selection()) {
single_value->field_pageMode = other_value.pageMode();
} else {
single_value->field_pageMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.featureIndicator().get_selection()) {
single_value->field_featureIndicator = other_value.featureIndicator();
} else {
single_value->field_featureIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iPA__RestOctets().get_selection()) {
single_value->field_iPA__RestOctets = other_value.iPA__RestOctets();
} else {
single_value->field_iPA__RestOctets.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__RRM__ImmediatePacketAssignment__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__RRM__ImmediatePacketAssignment__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ImmediatePacketAssignment__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_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ImmediatePacketAssignment__NW__MS_template::PDU__RRM__ImmediatePacketAssignment__NW__MS_template()
{
}

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

PDU__RRM__ImmediatePacketAssignment__NW__MS_template::PDU__RRM__ImmediatePacketAssignment__NW__MS_template(const PDU__RRM__ImmediatePacketAssignment__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__ImmediatePacketAssignment__NW__MS_template::match(const PDU__RRM__ImmediatePacketAssignment__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.pageMode().is_bound()) return FALSE;
if(!single_value->field_pageMode.match(other_value.pageMode(), legacy))return FALSE;
if(!other_value.featureIndicator().is_bound()) return FALSE;
if(!single_value->field_featureIndicator.match(other_value.featureIndicator(), legacy))return FALSE;
if(!other_value.iPA__RestOctets().is_bound()) return FALSE;
if(!single_value->field_iPA__RestOctets.match(other_value.iPA__RestOctets(), 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_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ImmediatePacketAssignment__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_pageMode.is_bound()
 || single_value->field_featureIndicator.is_bound()
 || single_value->field_iPA__RestOctets.is_bound();
}

boolean PDU__RRM__ImmediatePacketAssignment__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_pageMode.is_value()
 && single_value->field_featureIndicator.is_value()
 && single_value->field_iPA__RestOctets.is_value();
}

void PDU__RRM__ImmediatePacketAssignment__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__RRM__ImmediatePacketAssignment__NW__MS PDU__RRM__ImmediatePacketAssignment__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_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
PDU__RRM__ImmediatePacketAssignment__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_pageMode.is_bound()) {
ret_val.pageMode() = single_value->field_pageMode.valueof();
}
if (single_value->field_featureIndicator.is_bound()) {
ret_val.featureIndicator() = single_value->field_featureIndicator.valueof();
}
if (single_value->field_iPA__RestOctets.is_bound()) {
ret_val.iPA__RestOctets() = single_value->field_iPA__RestOctets.valueof();
}
return ret_val;
}

void PDU__RRM__ImmediatePacketAssignment__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_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ImmediatePacketAssignment__NW__MS_template[list_length];
}

PDU__RRM__ImmediatePacketAssignment__NW__MS_template& PDU__RRM__ImmediatePacketAssignment__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_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
return value_list.list_value[list_index];
}

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

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

PageMode__V_template& PDU__RRM__ImmediatePacketAssignment__NW__MS_template::pageMode()
{
set_specific();
return single_value->field_pageMode;
}

const PageMode__V_template& PDU__RRM__ImmediatePacketAssignment__NW__MS_template::pageMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pageMode of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
return single_value->field_pageMode;
}

FeatureIndicator__V_template& PDU__RRM__ImmediatePacketAssignment__NW__MS_template::featureIndicator()
{
set_specific();
return single_value->field_featureIndicator;
}

const FeatureIndicator__V_template& PDU__RRM__ImmediatePacketAssignment__NW__MS_template::featureIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field featureIndicator of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
return single_value->field_featureIndicator;
}

OCTETSTRING_template& PDU__RRM__ImmediatePacketAssignment__NW__MS_template::iPA__RestOctets()
{
set_specific();
return single_value->field_iPA__RestOctets;
}

const OCTETSTRING_template& PDU__RRM__ImmediatePacketAssignment__NW__MS_template::iPA__RestOctets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iPA_RestOctets of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
return single_value->field_iPA__RestOctets;
}

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

void PDU__RRM__ImmediatePacketAssignment__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(", pageMode := ");
single_value->field_pageMode.log();
TTCN_Logger::log_event_str(", featureIndicator := ");
single_value->field_featureIndicator.log();
TTCN_Logger::log_event_str(", iPA_RestOctets := ");
single_value->field_iPA__RestOctets.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__RRM__ImmediatePacketAssignment__NW__MS_template::log_match(const PDU__RRM__ImmediatePacketAssignment__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_pageMode.match(match_value.pageMode(), legacy)){
TTCN_Logger::log_logmatch_info(".pageMode");
single_value->field_pageMode.log_match(match_value.pageMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_featureIndicator.match(match_value.featureIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".featureIndicator");
single_value->field_featureIndicator.log_match(match_value.featureIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iPA__RestOctets.match(match_value.iPA__RestOctets(), legacy)){
TTCN_Logger::log_logmatch_info(".iPA_RestOctets");
single_value->field_iPA__RestOctets.log_match(match_value.iPA__RestOctets(), 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(", pageMode := ");
single_value->field_pageMode.log_match(match_value.pageMode(), legacy);
TTCN_Logger::log_event_str(", featureIndicator := ");
single_value->field_featureIndicator.log_match(match_value.featureIndicator(), legacy);
TTCN_Logger::log_event_str(", iPA_RestOctets := ");
single_value->field_iPA__RestOctets.log_match(match_value.iPA__RestOctets(), 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__RRM__ImmediatePacketAssignment__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (featureIndicator().is_bound()) featureIndicator().set_implicit_omit();
if (iPA__RestOctets().is_bound()) iPA__RestOctets().set_implicit_omit();
}

void PDU__RRM__ImmediatePacketAssignment__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_pageMode.encode_text(text_buf);
single_value->field_featureIndicator.encode_text(text_buf);
single_value->field_iPA__RestOctets.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_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
}
}

void PDU__RRM__ImmediatePacketAssignment__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_pageMode.decode_text(text_buf);
single_value->field_featureIndicator.decode_text(text_buf);
single_value->field_iPA__RestOctets.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__RRM__ImmediatePacketAssignment__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_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS.");
}
}

void PDU__RRM__ImmediatePacketAssignment__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__RRM__ImmediatePacketAssignment__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 (4<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) featureIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iPA__RestOctets().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(), "pageMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pageMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "featureIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          featureIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iPA_RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iPA__RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ImmediatePacketAssignment__NW__MS_template* precondition = new PDU__RRM__ImmediatePacketAssignment__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ImmediatePacketAssignment__NW__MS_template* implied_template = new PDU__RRM__ImmediatePacketAssignment__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ImmediatePacketAssignment__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ImmediatePacketAssignment__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_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS");
single_value->field_pageMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS");
single_value->field_featureIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS");
single_value->field_iPA__RestOctets.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediatePacketAssignment_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_RRM_Types.PDU_RRM_ImmediatePacketAssignment_NW_MS");
}

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

boolean PDU__RRM__ImmediatePacketAssignment__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__RRM__ImmediateAssignmentExtended__NW__MS::PDU__RRM__ImmediateAssignmentExtended__NW__MS()
{
}

PDU__RRM__ImmediateAssignmentExtended__NW__MS::PDU__RRM__ImmediateAssignmentExtended__NW__MS(const BITSTRING& par_messageType,
    const PageMode__V& par_pageMode,
    const FeatureIndicator__V& par_featureIndicator,
    const ChannelDescription__V& par_channelDescription1,
    const RequestReference__V& par_requestReference1,
    const OCTETSTRING& par_timingAdvance1,
    const ChannelDescription__V& par_channelDescription2,
    const RequestReference__V& par_requestReference2,
    const OCTETSTRING& par_timingAdvance2,
    const MobileL3__CommonIE__Types::Type4__LV& par_mobileAllocation,
    const OPTIONAL< StartingTime__TV >& par_startingTime,
    const OPTIONAL< OCTETSTRING >& par_iAX__RestOctets)
  :   field_messageType(par_messageType),
  field_pageMode(par_pageMode),
  field_featureIndicator(par_featureIndicator),
  field_channelDescription1(par_channelDescription1),
  field_requestReference1(par_requestReference1),
  field_timingAdvance1(par_timingAdvance1),
  field_channelDescription2(par_channelDescription2),
  field_requestReference2(par_requestReference2),
  field_timingAdvance2(par_timingAdvance2),
  field_mobileAllocation(par_mobileAllocation),
  field_startingTime(par_startingTime),
  field_iAX__RestOctets(par_iAX__RestOctets)
{
}

PDU__RRM__ImmediateAssignmentExtended__NW__MS::PDU__RRM__ImmediateAssignmentExtended__NW__MS(const PDU__RRM__ImmediateAssignmentExtended__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.pageMode().is_bound()) field_pageMode = other_value.pageMode();
else field_pageMode.clean_up();
if (other_value.featureIndicator().is_bound()) field_featureIndicator = other_value.featureIndicator();
else field_featureIndicator.clean_up();
if (other_value.channelDescription1().is_bound()) field_channelDescription1 = other_value.channelDescription1();
else field_channelDescription1.clean_up();
if (other_value.requestReference1().is_bound()) field_requestReference1 = other_value.requestReference1();
else field_requestReference1.clean_up();
if (other_value.timingAdvance1().is_bound()) field_timingAdvance1 = other_value.timingAdvance1();
else field_timingAdvance1.clean_up();
if (other_value.channelDescription2().is_bound()) field_channelDescription2 = other_value.channelDescription2();
else field_channelDescription2.clean_up();
if (other_value.requestReference2().is_bound()) field_requestReference2 = other_value.requestReference2();
else field_requestReference2.clean_up();
if (other_value.timingAdvance2().is_bound()) field_timingAdvance2 = other_value.timingAdvance2();
else field_timingAdvance2.clean_up();
if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
else field_mobileAllocation.clean_up();
if (other_value.startingTime().is_bound()) field_startingTime = other_value.startingTime();
else field_startingTime.clean_up();
if (other_value.iAX__RestOctets().is_bound()) field_iAX__RestOctets = other_value.iAX__RestOctets();
else field_iAX__RestOctets.clean_up();
}

void PDU__RRM__ImmediateAssignmentExtended__NW__MS::clean_up()
{
field_messageType.clean_up();
field_pageMode.clean_up();
field_featureIndicator.clean_up();
field_channelDescription1.clean_up();
field_requestReference1.clean_up();
field_timingAdvance1.clean_up();
field_channelDescription2.clean_up();
field_requestReference2.clean_up();
field_timingAdvance2.clean_up();
field_mobileAllocation.clean_up();
field_startingTime.clean_up();
field_iAX__RestOctets.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ImmediateAssignmentExtended__NW__MS::get_descriptor() const { return &PDU__RRM__ImmediateAssignmentExtended__NW__MS_descr_; }
PDU__RRM__ImmediateAssignmentExtended__NW__MS& PDU__RRM__ImmediateAssignmentExtended__NW__MS::operator=(const PDU__RRM__ImmediateAssignmentExtended__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.pageMode().is_bound()) field_pageMode = other_value.pageMode();
  else field_pageMode.clean_up();
  if (other_value.featureIndicator().is_bound()) field_featureIndicator = other_value.featureIndicator();
  else field_featureIndicator.clean_up();
  if (other_value.channelDescription1().is_bound()) field_channelDescription1 = other_value.channelDescription1();
  else field_channelDescription1.clean_up();
  if (other_value.requestReference1().is_bound()) field_requestReference1 = other_value.requestReference1();
  else field_requestReference1.clean_up();
  if (other_value.timingAdvance1().is_bound()) field_timingAdvance1 = other_value.timingAdvance1();
  else field_timingAdvance1.clean_up();
  if (other_value.channelDescription2().is_bound()) field_channelDescription2 = other_value.channelDescription2();
  else field_channelDescription2.clean_up();
  if (other_value.requestReference2().is_bound()) field_requestReference2 = other_value.requestReference2();
  else field_requestReference2.clean_up();
  if (other_value.timingAdvance2().is_bound()) field_timingAdvance2 = other_value.timingAdvance2();
  else field_timingAdvance2.clean_up();
  if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
  else field_mobileAllocation.clean_up();
  if (other_value.startingTime().is_bound()) field_startingTime = other_value.startingTime();
  else field_startingTime.clean_up();
  if (other_value.iAX__RestOctets().is_bound()) field_iAX__RestOctets = other_value.iAX__RestOctets();
  else field_iAX__RestOctets.clean_up();
}
return *this;
}

boolean PDU__RRM__ImmediateAssignmentExtended__NW__MS::operator==(const PDU__RRM__ImmediateAssignmentExtended__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_pageMode==other_value.field_pageMode
  && field_featureIndicator==other_value.field_featureIndicator
  && field_channelDescription1==other_value.field_channelDescription1
  && field_requestReference1==other_value.field_requestReference1
  && field_timingAdvance1==other_value.field_timingAdvance1
  && field_channelDescription2==other_value.field_channelDescription2
  && field_requestReference2==other_value.field_requestReference2
  && field_timingAdvance2==other_value.field_timingAdvance2
  && field_mobileAllocation==other_value.field_mobileAllocation
  && field_startingTime==other_value.field_startingTime
  && field_iAX__RestOctets==other_value.field_iAX__RestOctets;
}

boolean PDU__RRM__ImmediateAssignmentExtended__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_pageMode.is_bound())
  || (field_featureIndicator.is_bound())
  || (field_channelDescription1.is_bound())
  || (field_requestReference1.is_bound())
  || (field_timingAdvance1.is_bound())
  || (field_channelDescription2.is_bound())
  || (field_requestReference2.is_bound())
  || (field_timingAdvance2.is_bound())
  || (field_mobileAllocation.is_bound())
  || (OPTIONAL_OMIT == field_startingTime.get_selection() || field_startingTime.is_bound())
  || (OPTIONAL_OMIT == field_iAX__RestOctets.get_selection() || field_iAX__RestOctets.is_bound());
}
boolean PDU__RRM__ImmediateAssignmentExtended__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_pageMode.is_value()
  && field_featureIndicator.is_value()
  && field_channelDescription1.is_value()
  && field_requestReference1.is_value()
  && field_timingAdvance1.is_value()
  && field_channelDescription2.is_value()
  && field_requestReference2.is_value()
  && field_timingAdvance2.is_value()
  && field_mobileAllocation.is_value()
  && (OPTIONAL_OMIT == field_startingTime.get_selection() || field_startingTime.is_value())
  && (OPTIONAL_OMIT == field_iAX__RestOctets.get_selection() || field_iAX__RestOctets.is_value());
}
int PDU__RRM__ImmediateAssignmentExtended__NW__MS::size_of() const
{
  int ret_val = 10;
  if (field_startingTime.ispresent()) ret_val++;
  if (field_iAX__RestOctets.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__ImmediateAssignmentExtended__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(", pageMode := ");
field_pageMode.log();
TTCN_Logger::log_event_str(", featureIndicator := ");
field_featureIndicator.log();
TTCN_Logger::log_event_str(", channelDescription1 := ");
field_channelDescription1.log();
TTCN_Logger::log_event_str(", requestReference1 := ");
field_requestReference1.log();
TTCN_Logger::log_event_str(", timingAdvance1 := ");
field_timingAdvance1.log();
TTCN_Logger::log_event_str(", channelDescription2 := ");
field_channelDescription2.log();
TTCN_Logger::log_event_str(", requestReference2 := ");
field_requestReference2.log();
TTCN_Logger::log_event_str(", timingAdvance2 := ");
field_timingAdvance2.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
field_mobileAllocation.log();
TTCN_Logger::log_event_str(", startingTime := ");
field_startingTime.log();
TTCN_Logger::log_event_str(", iAX_RestOctets := ");
field_iAX__RestOctets.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ImmediateAssignmentExtended__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (featureIndicator().is_bound()) featureIndicator().set_implicit_omit();
if (channelDescription1().is_bound()) channelDescription1().set_implicit_omit();
if (requestReference1().is_bound()) requestReference1().set_implicit_omit();
if (timingAdvance1().is_bound()) timingAdvance1().set_implicit_omit();
if (channelDescription2().is_bound()) channelDescription2().set_implicit_omit();
if (requestReference2().is_bound()) requestReference2().set_implicit_omit();
if (timingAdvance2().is_bound()) timingAdvance2().set_implicit_omit();
if (mobileAllocation().is_bound()) mobileAllocation().set_implicit_omit();
if (!startingTime().is_bound()) startingTime() = OMIT_VALUE;
else startingTime().set_implicit_omit();
if (!iAX__RestOctets().is_bound()) iAX__RestOctets() = OMIT_VALUE;
else iAX__RestOctets().set_implicit_omit();
}

void PDU__RRM__ImmediateAssignmentExtended__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 (12<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) featureIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) channelDescription1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) requestReference1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) timingAdvance1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) channelDescription2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) requestReference2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) timingAdvance2().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) iAX__RestOctets().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pageMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pageMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "featureIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          featureIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescription1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timingAdvance1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timingAdvance1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescription2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timingAdvance2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timingAdvance2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startingTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iAX_RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iAX__RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
  }
}

void PDU__RRM__ImmediateAssignmentExtended__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_pageMode.encode_text(text_buf);
field_featureIndicator.encode_text(text_buf);
field_channelDescription1.encode_text(text_buf);
field_requestReference1.encode_text(text_buf);
field_timingAdvance1.encode_text(text_buf);
field_channelDescription2.encode_text(text_buf);
field_requestReference2.encode_text(text_buf);
field_timingAdvance2.encode_text(text_buf);
field_mobileAllocation.encode_text(text_buf);
field_startingTime.encode_text(text_buf);
field_iAX__RestOctets.encode_text(text_buf);
}

void PDU__RRM__ImmediateAssignmentExtended__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_pageMode.decode_text(text_buf);
field_featureIndicator.decode_text(text_buf);
field_channelDescription1.decode_text(text_buf);
field_requestReference1.decode_text(text_buf);
field_timingAdvance1.decode_text(text_buf);
field_channelDescription2.decode_text(text_buf);
field_requestReference2.decode_text(text_buf);
field_timingAdvance2.decode_text(text_buf);
field_mobileAllocation.decode_text(text_buf);
field_startingTime.decode_text(text_buf);
field_iAX__RestOctets.decode_text(text_buf);
}

void PDU__RRM__ImmediateAssignmentExtended__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__RRM__ImmediateAssignmentExtended__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__RRM__ImmediateAssignmentExtended__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, PageMode__V_descr_.raw->forceomit);
  decoded_field_length = field_pageMode.RAW_decode(PageMode__V_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, FeatureIndicator__V_descr_.raw->forceomit);
  decoded_field_length = field_featureIndicator.RAW_decode(FeatureIndicator__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, ChannelDescription__V_descr_.raw->forceomit);
  decoded_field_length = field_channelDescription1.RAW_decode(ChannelDescription__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, RequestReference__V_descr_.raw->forceomit);
  decoded_field_length = field_requestReference1.RAW_decode(RequestReference__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_timingAdvance1.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, ChannelDescription__V_descr_.raw->forceomit);
  decoded_field_length = field_channelDescription2.RAW_decode(ChannelDescription__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, RequestReference__V_descr_.raw->forceomit);
  decoded_field_length = field_requestReference2.RAW_decode(RequestReference__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_timingAdvance2.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_9_force_omit(9, force_omit, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocation.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return 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)(10)) {
    field_startingTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, StartingTime__TV_descr_.raw->forceomit);
  decoded_field_length = field_startingTime().RAW_decode(StartingTime__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_startingTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_startingTime.ispresent() || field_startingTime().elementIdentifier() !=  os_1){
  field_startingTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_startingTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_iAX__RestOctets = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_iAX__RestOctets().RAW_decode(OCTETSTRING_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_iAX__RestOctets = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iAX__RestOctets=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__RRM__ImmediateAssignmentExtended__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 = 12;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PageMode__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, FeatureIndicator__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ChannelDescription__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RequestReference__V_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ChannelDescription__V_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, RequestReference__V_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  if (field_startingTime.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, StartingTime__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_iAX__RestOctets.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, OCTETSTRING_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pageMode.RAW_encode(PageMode__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_featureIndicator.RAW_encode(FeatureIndicator__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_channelDescription1.RAW_encode(ChannelDescription__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_requestReference1.RAW_encode(RequestReference__V_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_timingAdvance1.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_channelDescription2.RAW_encode(ChannelDescription__V_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_requestReference2.RAW_encode(RequestReference__V_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_timingAdvance2.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_mobileAllocation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[9]);
  if (field_startingTime.ispresent()) {
  encoded_length += field_startingTime().RAW_encode(StartingTime__TV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_iAX__RestOctets.ispresent()) {
  encoded_length += field_iAX__RestOctets().RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_startingTime.ispresent() && (!field_startingTime.ispresent() || field_startingTime().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[]={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_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);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
PageMode__V_template field_pageMode;
FeatureIndicator__V_template field_featureIndicator;
ChannelDescription__V_template field_channelDescription1;
RequestReference__V_template field_requestReference1;
OCTETSTRING_template field_timingAdvance1;
ChannelDescription__V_template field_channelDescription2;
RequestReference__V_template field_requestReference2;
OCTETSTRING_template field_timingAdvance2;
MobileL3__CommonIE__Types::Type4__LV_template field_mobileAllocation;
StartingTime__TV_template field_startingTime;
OCTETSTRING_template field_iAX__RestOctets;
};

void PDU__RRM__ImmediateAssignmentExtended__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_pageMode = ANY_VALUE;
single_value->field_featureIndicator = ANY_VALUE;
single_value->field_channelDescription1 = ANY_VALUE;
single_value->field_requestReference1 = ANY_VALUE;
single_value->field_timingAdvance1 = ANY_VALUE;
single_value->field_channelDescription2 = ANY_VALUE;
single_value->field_requestReference2 = ANY_VALUE;
single_value->field_timingAdvance2 = ANY_VALUE;
single_value->field_mobileAllocation = ANY_VALUE;
single_value->field_startingTime = ANY_OR_OMIT;
single_value->field_iAX__RestOctets = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::copy_value(const PDU__RRM__ImmediateAssignmentExtended__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.pageMode().is_bound()) {
  single_value->field_pageMode = other_value.pageMode();
} else {
  single_value->field_pageMode.clean_up();
}
if (other_value.featureIndicator().is_bound()) {
  single_value->field_featureIndicator = other_value.featureIndicator();
} else {
  single_value->field_featureIndicator.clean_up();
}
if (other_value.channelDescription1().is_bound()) {
  single_value->field_channelDescription1 = other_value.channelDescription1();
} else {
  single_value->field_channelDescription1.clean_up();
}
if (other_value.requestReference1().is_bound()) {
  single_value->field_requestReference1 = other_value.requestReference1();
} else {
  single_value->field_requestReference1.clean_up();
}
if (other_value.timingAdvance1().is_bound()) {
  single_value->field_timingAdvance1 = other_value.timingAdvance1();
} else {
  single_value->field_timingAdvance1.clean_up();
}
if (other_value.channelDescription2().is_bound()) {
  single_value->field_channelDescription2 = other_value.channelDescription2();
} else {
  single_value->field_channelDescription2.clean_up();
}
if (other_value.requestReference2().is_bound()) {
  single_value->field_requestReference2 = other_value.requestReference2();
} else {
  single_value->field_requestReference2.clean_up();
}
if (other_value.timingAdvance2().is_bound()) {
  single_value->field_timingAdvance2 = other_value.timingAdvance2();
} else {
  single_value->field_timingAdvance2.clean_up();
}
if (other_value.mobileAllocation().is_bound()) {
  single_value->field_mobileAllocation = other_value.mobileAllocation();
} else {
  single_value->field_mobileAllocation.clean_up();
}
if (other_value.startingTime().is_bound()) {
  if (other_value.startingTime().ispresent()) single_value->field_startingTime = other_value.startingTime()();
  else single_value->field_startingTime = OMIT_VALUE;
} else {
  single_value->field_startingTime.clean_up();
}
if (other_value.iAX__RestOctets().is_bound()) {
  if (other_value.iAX__RestOctets().ispresent()) single_value->field_iAX__RestOctets = other_value.iAX__RestOctets()();
  else single_value->field_iAX__RestOctets = OMIT_VALUE;
} else {
  single_value->field_iAX__RestOctets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::copy_template(const PDU__RRM__ImmediateAssignmentExtended__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.pageMode().get_selection()) {
single_value->field_pageMode = other_value.pageMode();
} else {
single_value->field_pageMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.featureIndicator().get_selection()) {
single_value->field_featureIndicator = other_value.featureIndicator();
} else {
single_value->field_featureIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelDescription1().get_selection()) {
single_value->field_channelDescription1 = other_value.channelDescription1();
} else {
single_value->field_channelDescription1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestReference1().get_selection()) {
single_value->field_requestReference1 = other_value.requestReference1();
} else {
single_value->field_requestReference1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.timingAdvance1().get_selection()) {
single_value->field_timingAdvance1 = other_value.timingAdvance1();
} else {
single_value->field_timingAdvance1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelDescription2().get_selection()) {
single_value->field_channelDescription2 = other_value.channelDescription2();
} else {
single_value->field_channelDescription2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestReference2().get_selection()) {
single_value->field_requestReference2 = other_value.requestReference2();
} else {
single_value->field_requestReference2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.timingAdvance2().get_selection()) {
single_value->field_timingAdvance2 = other_value.timingAdvance2();
} else {
single_value->field_timingAdvance2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocation().get_selection()) {
single_value->field_mobileAllocation = other_value.mobileAllocation();
} else {
single_value->field_mobileAllocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.startingTime().get_selection()) {
single_value->field_startingTime = other_value.startingTime();
} else {
single_value->field_startingTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iAX__RestOctets().get_selection()) {
single_value->field_iAX__RestOctets = other_value.iAX__RestOctets();
} else {
single_value->field_iAX__RestOctets.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__RRM__ImmediateAssignmentExtended__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__RRM__ImmediateAssignmentExtended__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ImmediateAssignmentExtended__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_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::PDU__RRM__ImmediateAssignmentExtended__NW__MS_template()
{
}

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

PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::PDU__RRM__ImmediateAssignmentExtended__NW__MS_template(const PDU__RRM__ImmediateAssignmentExtended__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::match(const PDU__RRM__ImmediateAssignmentExtended__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.pageMode().is_bound()) return FALSE;
if(!single_value->field_pageMode.match(other_value.pageMode(), legacy))return FALSE;
if(!other_value.featureIndicator().is_bound()) return FALSE;
if(!single_value->field_featureIndicator.match(other_value.featureIndicator(), legacy))return FALSE;
if(!other_value.channelDescription1().is_bound()) return FALSE;
if(!single_value->field_channelDescription1.match(other_value.channelDescription1(), legacy))return FALSE;
if(!other_value.requestReference1().is_bound()) return FALSE;
if(!single_value->field_requestReference1.match(other_value.requestReference1(), legacy))return FALSE;
if(!other_value.timingAdvance1().is_bound()) return FALSE;
if(!single_value->field_timingAdvance1.match(other_value.timingAdvance1(), legacy))return FALSE;
if(!other_value.channelDescription2().is_bound()) return FALSE;
if(!single_value->field_channelDescription2.match(other_value.channelDescription2(), legacy))return FALSE;
if(!other_value.requestReference2().is_bound()) return FALSE;
if(!single_value->field_requestReference2.match(other_value.requestReference2(), legacy))return FALSE;
if(!other_value.timingAdvance2().is_bound()) return FALSE;
if(!single_value->field_timingAdvance2.match(other_value.timingAdvance2(), legacy))return FALSE;
if(!other_value.mobileAllocation().is_bound()) return FALSE;
if(!single_value->field_mobileAllocation.match(other_value.mobileAllocation(), legacy))return FALSE;
if(!other_value.startingTime().is_bound()) return FALSE;
if((other_value.startingTime().ispresent() ? !single_value->field_startingTime.match((const StartingTime__TV&)other_value.startingTime(), legacy) : !single_value->field_startingTime.match_omit(legacy)))return FALSE;
if(!other_value.iAX__RestOctets().is_bound()) return FALSE;
if((other_value.iAX__RestOctets().ispresent() ? !single_value->field_iAX__RestOctets.match((const OCTETSTRING&)other_value.iAX__RestOctets(), legacy) : !single_value->field_iAX__RestOctets.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_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ImmediateAssignmentExtended__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_pageMode.is_bound()
 || single_value->field_featureIndicator.is_bound()
 || single_value->field_channelDescription1.is_bound()
 || single_value->field_requestReference1.is_bound()
 || single_value->field_timingAdvance1.is_bound()
 || single_value->field_channelDescription2.is_bound()
 || single_value->field_requestReference2.is_bound()
 || single_value->field_timingAdvance2.is_bound()
 || single_value->field_mobileAllocation.is_bound()
 || (single_value->field_startingTime.is_omit() || single_value->field_startingTime.is_bound())
 || (single_value->field_iAX__RestOctets.is_omit() || single_value->field_iAX__RestOctets.is_bound());
}

boolean PDU__RRM__ImmediateAssignmentExtended__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_pageMode.is_value()
 && single_value->field_featureIndicator.is_value()
 && single_value->field_channelDescription1.is_value()
 && single_value->field_requestReference1.is_value()
 && single_value->field_timingAdvance1.is_value()
 && single_value->field_channelDescription2.is_value()
 && single_value->field_requestReference2.is_value()
 && single_value->field_timingAdvance2.is_value()
 && single_value->field_mobileAllocation.is_value()
 && (single_value->field_startingTime.is_omit() || single_value->field_startingTime.is_value())
 && (single_value->field_iAX__RestOctets.is_omit() || single_value->field_iAX__RestOctets.is_value());
}

void PDU__RRM__ImmediateAssignmentExtended__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__RRM__ImmediateAssignmentExtended__NW__MS PDU__RRM__ImmediateAssignmentExtended__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_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
PDU__RRM__ImmediateAssignmentExtended__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_pageMode.is_bound()) {
ret_val.pageMode() = single_value->field_pageMode.valueof();
}
if (single_value->field_featureIndicator.is_bound()) {
ret_val.featureIndicator() = single_value->field_featureIndicator.valueof();
}
if (single_value->field_channelDescription1.is_bound()) {
ret_val.channelDescription1() = single_value->field_channelDescription1.valueof();
}
if (single_value->field_requestReference1.is_bound()) {
ret_val.requestReference1() = single_value->field_requestReference1.valueof();
}
if (single_value->field_timingAdvance1.is_bound()) {
ret_val.timingAdvance1() = single_value->field_timingAdvance1.valueof();
}
if (single_value->field_channelDescription2.is_bound()) {
ret_val.channelDescription2() = single_value->field_channelDescription2.valueof();
}
if (single_value->field_requestReference2.is_bound()) {
ret_val.requestReference2() = single_value->field_requestReference2.valueof();
}
if (single_value->field_timingAdvance2.is_bound()) {
ret_val.timingAdvance2() = single_value->field_timingAdvance2.valueof();
}
if (single_value->field_mobileAllocation.is_bound()) {
ret_val.mobileAllocation() = single_value->field_mobileAllocation.valueof();
}
if (single_value->field_startingTime.is_omit()) ret_val.startingTime() = OMIT_VALUE;
else if (single_value->field_startingTime.is_bound()) {
ret_val.startingTime() = single_value->field_startingTime.valueof();
}
if (single_value->field_iAX__RestOctets.is_omit()) ret_val.iAX__RestOctets() = OMIT_VALUE;
else if (single_value->field_iAX__RestOctets.is_bound()) {
ret_val.iAX__RestOctets() = single_value->field_iAX__RestOctets.valueof();
}
return ret_val;
}

void PDU__RRM__ImmediateAssignmentExtended__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_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ImmediateAssignmentExtended__NW__MS_template[list_length];
}

PDU__RRM__ImmediateAssignmentExtended__NW__MS_template& PDU__RRM__ImmediateAssignmentExtended__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_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return value_list.list_value[list_index];
}

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

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

PageMode__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::pageMode()
{
set_specific();
return single_value->field_pageMode;
}

const PageMode__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::pageMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pageMode of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_pageMode;
}

FeatureIndicator__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::featureIndicator()
{
set_specific();
return single_value->field_featureIndicator;
}

const FeatureIndicator__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::featureIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field featureIndicator of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_featureIndicator;
}

ChannelDescription__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::channelDescription1()
{
set_specific();
return single_value->field_channelDescription1;
}

const ChannelDescription__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::channelDescription1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelDescription1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_channelDescription1;
}

RequestReference__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::requestReference1()
{
set_specific();
return single_value->field_requestReference1;
}

const RequestReference__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::requestReference1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestReference1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_requestReference1;
}

OCTETSTRING_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::timingAdvance1()
{
set_specific();
return single_value->field_timingAdvance1;
}

const OCTETSTRING_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::timingAdvance1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timingAdvance1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_timingAdvance1;
}

ChannelDescription__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::channelDescription2()
{
set_specific();
return single_value->field_channelDescription2;
}

const ChannelDescription__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::channelDescription2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelDescription2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_channelDescription2;
}

RequestReference__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::requestReference2()
{
set_specific();
return single_value->field_requestReference2;
}

const RequestReference__V_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::requestReference2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestReference2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_requestReference2;
}

OCTETSTRING_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::timingAdvance2()
{
set_specific();
return single_value->field_timingAdvance2;
}

const OCTETSTRING_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::timingAdvance2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timingAdvance2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_timingAdvance2;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::mobileAllocation()
{
set_specific();
return single_value->field_mobileAllocation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::mobileAllocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_mobileAllocation;
}

StartingTime__TV_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::startingTime()
{
set_specific();
return single_value->field_startingTime;
}

const StartingTime__TV_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::startingTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field startingTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_startingTime;
}

OCTETSTRING_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::iAX__RestOctets()
{
set_specific();
return single_value->field_iAX__RestOctets;
}

const OCTETSTRING_template& PDU__RRM__ImmediateAssignmentExtended__NW__MS_template::iAX__RestOctets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iAX_RestOctets of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
return single_value->field_iAX__RestOctets;
}

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

void PDU__RRM__ImmediateAssignmentExtended__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(", pageMode := ");
single_value->field_pageMode.log();
TTCN_Logger::log_event_str(", featureIndicator := ");
single_value->field_featureIndicator.log();
TTCN_Logger::log_event_str(", channelDescription1 := ");
single_value->field_channelDescription1.log();
TTCN_Logger::log_event_str(", requestReference1 := ");
single_value->field_requestReference1.log();
TTCN_Logger::log_event_str(", timingAdvance1 := ");
single_value->field_timingAdvance1.log();
TTCN_Logger::log_event_str(", channelDescription2 := ");
single_value->field_channelDescription2.log();
TTCN_Logger::log_event_str(", requestReference2 := ");
single_value->field_requestReference2.log();
TTCN_Logger::log_event_str(", timingAdvance2 := ");
single_value->field_timingAdvance2.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
single_value->field_mobileAllocation.log();
TTCN_Logger::log_event_str(", startingTime := ");
single_value->field_startingTime.log();
TTCN_Logger::log_event_str(", iAX_RestOctets := ");
single_value->field_iAX__RestOctets.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__RRM__ImmediateAssignmentExtended__NW__MS_template::log_match(const PDU__RRM__ImmediateAssignmentExtended__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_pageMode.match(match_value.pageMode(), legacy)){
TTCN_Logger::log_logmatch_info(".pageMode");
single_value->field_pageMode.log_match(match_value.pageMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_featureIndicator.match(match_value.featureIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".featureIndicator");
single_value->field_featureIndicator.log_match(match_value.featureIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_channelDescription1.match(match_value.channelDescription1(), legacy)){
TTCN_Logger::log_logmatch_info(".channelDescription1");
single_value->field_channelDescription1.log_match(match_value.channelDescription1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestReference1.match(match_value.requestReference1(), legacy)){
TTCN_Logger::log_logmatch_info(".requestReference1");
single_value->field_requestReference1.log_match(match_value.requestReference1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_timingAdvance1.match(match_value.timingAdvance1(), legacy)){
TTCN_Logger::log_logmatch_info(".timingAdvance1");
single_value->field_timingAdvance1.log_match(match_value.timingAdvance1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_channelDescription2.match(match_value.channelDescription2(), legacy)){
TTCN_Logger::log_logmatch_info(".channelDescription2");
single_value->field_channelDescription2.log_match(match_value.channelDescription2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestReference2.match(match_value.requestReference2(), legacy)){
TTCN_Logger::log_logmatch_info(".requestReference2");
single_value->field_requestReference2.log_match(match_value.requestReference2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_timingAdvance2.match(match_value.timingAdvance2(), legacy)){
TTCN_Logger::log_logmatch_info(".timingAdvance2");
single_value->field_timingAdvance2.log_match(match_value.timingAdvance2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileAllocation.match(match_value.mobileAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocation");
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.startingTime().ispresent()){
if(!single_value->field_startingTime.match(match_value.startingTime(), legacy)){
TTCN_Logger::log_logmatch_info(".startingTime");
single_value->field_startingTime.log_match(match_value.startingTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_startingTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".startingTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_startingTime.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.iAX__RestOctets().ispresent()){
if(!single_value->field_iAX__RestOctets.match(match_value.iAX__RestOctets(), legacy)){
TTCN_Logger::log_logmatch_info(".iAX_RestOctets");
single_value->field_iAX__RestOctets.log_match(match_value.iAX__RestOctets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iAX__RestOctets.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iAX_RestOctets := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iAX__RestOctets.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(", pageMode := ");
single_value->field_pageMode.log_match(match_value.pageMode(), legacy);
TTCN_Logger::log_event_str(", featureIndicator := ");
single_value->field_featureIndicator.log_match(match_value.featureIndicator(), legacy);
TTCN_Logger::log_event_str(", channelDescription1 := ");
single_value->field_channelDescription1.log_match(match_value.channelDescription1(), legacy);
TTCN_Logger::log_event_str(", requestReference1 := ");
single_value->field_requestReference1.log_match(match_value.requestReference1(), legacy);
TTCN_Logger::log_event_str(", timingAdvance1 := ");
single_value->field_timingAdvance1.log_match(match_value.timingAdvance1(), legacy);
TTCN_Logger::log_event_str(", channelDescription2 := ");
single_value->field_channelDescription2.log_match(match_value.channelDescription2(), legacy);
TTCN_Logger::log_event_str(", requestReference2 := ");
single_value->field_requestReference2.log_match(match_value.requestReference2(), legacy);
TTCN_Logger::log_event_str(", timingAdvance2 := ");
single_value->field_timingAdvance2.log_match(match_value.timingAdvance2(), legacy);
TTCN_Logger::log_event_str(", mobileAllocation := ");
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
TTCN_Logger::log_event_str(", startingTime := ");
if (match_value.startingTime().ispresent()) {
single_value->field_startingTime.log_match(match_value.startingTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_startingTime.log();
if (single_value->field_startingTime.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", iAX_RestOctets := ");
if (match_value.iAX__RestOctets().ispresent()) {
single_value->field_iAX__RestOctets.log_match(match_value.iAX__RestOctets(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iAX__RestOctets.log();
if (single_value->field_iAX__RestOctets.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__RRM__ImmediateAssignmentExtended__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (featureIndicator().is_bound()) featureIndicator().set_implicit_omit();
if (channelDescription1().is_bound()) channelDescription1().set_implicit_omit();
if (requestReference1().is_bound()) requestReference1().set_implicit_omit();
if (timingAdvance1().is_bound()) timingAdvance1().set_implicit_omit();
if (channelDescription2().is_bound()) channelDescription2().set_implicit_omit();
if (requestReference2().is_bound()) requestReference2().set_implicit_omit();
if (timingAdvance2().is_bound()) timingAdvance2().set_implicit_omit();
if (mobileAllocation().is_bound()) mobileAllocation().set_implicit_omit();
if (!startingTime().is_bound()) startingTime() = OMIT_VALUE;
else startingTime().set_implicit_omit();
if (!iAX__RestOctets().is_bound()) iAX__RestOctets() = OMIT_VALUE;
else iAX__RestOctets().set_implicit_omit();
}

void PDU__RRM__ImmediateAssignmentExtended__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_pageMode.encode_text(text_buf);
single_value->field_featureIndicator.encode_text(text_buf);
single_value->field_channelDescription1.encode_text(text_buf);
single_value->field_requestReference1.encode_text(text_buf);
single_value->field_timingAdvance1.encode_text(text_buf);
single_value->field_channelDescription2.encode_text(text_buf);
single_value->field_requestReference2.encode_text(text_buf);
single_value->field_timingAdvance2.encode_text(text_buf);
single_value->field_mobileAllocation.encode_text(text_buf);
single_value->field_startingTime.encode_text(text_buf);
single_value->field_iAX__RestOctets.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_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
}
}

void PDU__RRM__ImmediateAssignmentExtended__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_pageMode.decode_text(text_buf);
single_value->field_featureIndicator.decode_text(text_buf);
single_value->field_channelDescription1.decode_text(text_buf);
single_value->field_requestReference1.decode_text(text_buf);
single_value->field_timingAdvance1.decode_text(text_buf);
single_value->field_channelDescription2.decode_text(text_buf);
single_value->field_requestReference2.decode_text(text_buf);
single_value->field_timingAdvance2.decode_text(text_buf);
single_value->field_mobileAllocation.decode_text(text_buf);
single_value->field_startingTime.decode_text(text_buf);
single_value->field_iAX__RestOctets.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__RRM__ImmediateAssignmentExtended__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_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS.");
}
}

void PDU__RRM__ImmediateAssignmentExtended__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__RRM__ImmediateAssignmentExtended__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 (12<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) featureIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) channelDescription1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) requestReference1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) timingAdvance1().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) channelDescription2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) requestReference2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) timingAdvance2().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) iAX__RestOctets().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pageMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pageMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "featureIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          featureIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescription1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timingAdvance1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timingAdvance1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescription2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescription2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timingAdvance2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timingAdvance2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "startingTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          startingTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iAX_RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iAX__RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ImmediateAssignmentExtended__NW__MS_template* precondition = new PDU__RRM__ImmediateAssignmentExtended__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ImmediateAssignmentExtended__NW__MS_template* implied_template = new PDU__RRM__ImmediateAssignmentExtended__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ImmediateAssignmentExtended__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ImmediateAssignmentExtended__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_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_pageMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_featureIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_channelDescription1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_requestReference1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_timingAdvance1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_channelDescription2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_requestReference2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_timingAdvance2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_mobileAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_startingTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
single_value->field_iAX__RestOctets.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_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_RRM_Types.PDU_RRM_ImmediateAssignmentExtended_NW_MS");
}

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

boolean PDU__RRM__ImmediateAssignmentExtended__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__RRM__ImmediateAssignmentReject__NW__MS::PDU__RRM__ImmediateAssignmentReject__NW__MS()
{
}

PDU__RRM__ImmediateAssignmentReject__NW__MS::PDU__RRM__ImmediateAssignmentReject__NW__MS(const BITSTRING& par_messageType,
    const PageMode__V& par_pageMode,
    const FeatureIndicator__V& par_featureIndicator,
    const RequestReference__V& par_requestReference1,
    const WaitIndication__V& par_waitIndication1,
    const RequestReference__V& par_requestReference2,
    const WaitIndication__V& par_waitIndication2,
    const RequestReference__V& par_requestReference3,
    const WaitIndication__V& par_waitIndication3,
    const RequestReference__V& par_requestReference4,
    const WaitIndication__V& par_waitIndication4,
    const OCTETSTRING& par_iAR__RestOctets)
  :   field_messageType(par_messageType),
  field_pageMode(par_pageMode),
  field_featureIndicator(par_featureIndicator),
  field_requestReference1(par_requestReference1),
  field_waitIndication1(par_waitIndication1),
  field_requestReference2(par_requestReference2),
  field_waitIndication2(par_waitIndication2),
  field_requestReference3(par_requestReference3),
  field_waitIndication3(par_waitIndication3),
  field_requestReference4(par_requestReference4),
  field_waitIndication4(par_waitIndication4),
  field_iAR__RestOctets(par_iAR__RestOctets)
{
}

PDU__RRM__ImmediateAssignmentReject__NW__MS::PDU__RRM__ImmediateAssignmentReject__NW__MS(const PDU__RRM__ImmediateAssignmentReject__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.pageMode().is_bound()) field_pageMode = other_value.pageMode();
else field_pageMode.clean_up();
if (other_value.featureIndicator().is_bound()) field_featureIndicator = other_value.featureIndicator();
else field_featureIndicator.clean_up();
if (other_value.requestReference1().is_bound()) field_requestReference1 = other_value.requestReference1();
else field_requestReference1.clean_up();
if (other_value.waitIndication1().is_bound()) field_waitIndication1 = other_value.waitIndication1();
else field_waitIndication1.clean_up();
if (other_value.requestReference2().is_bound()) field_requestReference2 = other_value.requestReference2();
else field_requestReference2.clean_up();
if (other_value.waitIndication2().is_bound()) field_waitIndication2 = other_value.waitIndication2();
else field_waitIndication2.clean_up();
if (other_value.requestReference3().is_bound()) field_requestReference3 = other_value.requestReference3();
else field_requestReference3.clean_up();
if (other_value.waitIndication3().is_bound()) field_waitIndication3 = other_value.waitIndication3();
else field_waitIndication3.clean_up();
if (other_value.requestReference4().is_bound()) field_requestReference4 = other_value.requestReference4();
else field_requestReference4.clean_up();
if (other_value.waitIndication4().is_bound()) field_waitIndication4 = other_value.waitIndication4();
else field_waitIndication4.clean_up();
if (other_value.iAR__RestOctets().is_bound()) field_iAR__RestOctets = other_value.iAR__RestOctets();
else field_iAR__RestOctets.clean_up();
}

void PDU__RRM__ImmediateAssignmentReject__NW__MS::clean_up()
{
field_messageType.clean_up();
field_pageMode.clean_up();
field_featureIndicator.clean_up();
field_requestReference1.clean_up();
field_waitIndication1.clean_up();
field_requestReference2.clean_up();
field_waitIndication2.clean_up();
field_requestReference3.clean_up();
field_waitIndication3.clean_up();
field_requestReference4.clean_up();
field_waitIndication4.clean_up();
field_iAR__RestOctets.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ImmediateAssignmentReject__NW__MS::get_descriptor() const { return &PDU__RRM__ImmediateAssignmentReject__NW__MS_descr_; }
PDU__RRM__ImmediateAssignmentReject__NW__MS& PDU__RRM__ImmediateAssignmentReject__NW__MS::operator=(const PDU__RRM__ImmediateAssignmentReject__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.pageMode().is_bound()) field_pageMode = other_value.pageMode();
  else field_pageMode.clean_up();
  if (other_value.featureIndicator().is_bound()) field_featureIndicator = other_value.featureIndicator();
  else field_featureIndicator.clean_up();
  if (other_value.requestReference1().is_bound()) field_requestReference1 = other_value.requestReference1();
  else field_requestReference1.clean_up();
  if (other_value.waitIndication1().is_bound()) field_waitIndication1 = other_value.waitIndication1();
  else field_waitIndication1.clean_up();
  if (other_value.requestReference2().is_bound()) field_requestReference2 = other_value.requestReference2();
  else field_requestReference2.clean_up();
  if (other_value.waitIndication2().is_bound()) field_waitIndication2 = other_value.waitIndication2();
  else field_waitIndication2.clean_up();
  if (other_value.requestReference3().is_bound()) field_requestReference3 = other_value.requestReference3();
  else field_requestReference3.clean_up();
  if (other_value.waitIndication3().is_bound()) field_waitIndication3 = other_value.waitIndication3();
  else field_waitIndication3.clean_up();
  if (other_value.requestReference4().is_bound()) field_requestReference4 = other_value.requestReference4();
  else field_requestReference4.clean_up();
  if (other_value.waitIndication4().is_bound()) field_waitIndication4 = other_value.waitIndication4();
  else field_waitIndication4.clean_up();
  if (other_value.iAR__RestOctets().is_bound()) field_iAR__RestOctets = other_value.iAR__RestOctets();
  else field_iAR__RestOctets.clean_up();
}
return *this;
}

boolean PDU__RRM__ImmediateAssignmentReject__NW__MS::operator==(const PDU__RRM__ImmediateAssignmentReject__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_pageMode==other_value.field_pageMode
  && field_featureIndicator==other_value.field_featureIndicator
  && field_requestReference1==other_value.field_requestReference1
  && field_waitIndication1==other_value.field_waitIndication1
  && field_requestReference2==other_value.field_requestReference2
  && field_waitIndication2==other_value.field_waitIndication2
  && field_requestReference3==other_value.field_requestReference3
  && field_waitIndication3==other_value.field_waitIndication3
  && field_requestReference4==other_value.field_requestReference4
  && field_waitIndication4==other_value.field_waitIndication4
  && field_iAR__RestOctets==other_value.field_iAR__RestOctets;
}

boolean PDU__RRM__ImmediateAssignmentReject__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_pageMode.is_bound())
  || (field_featureIndicator.is_bound())
  || (field_requestReference1.is_bound())
  || (field_waitIndication1.is_bound())
  || (field_requestReference2.is_bound())
  || (field_waitIndication2.is_bound())
  || (field_requestReference3.is_bound())
  || (field_waitIndication3.is_bound())
  || (field_requestReference4.is_bound())
  || (field_waitIndication4.is_bound())
  || (field_iAR__RestOctets.is_bound());
}
boolean PDU__RRM__ImmediateAssignmentReject__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_pageMode.is_value()
  && field_featureIndicator.is_value()
  && field_requestReference1.is_value()
  && field_waitIndication1.is_value()
  && field_requestReference2.is_value()
  && field_waitIndication2.is_value()
  && field_requestReference3.is_value()
  && field_waitIndication3.is_value()
  && field_requestReference4.is_value()
  && field_waitIndication4.is_value()
  && field_iAR__RestOctets.is_value();
}
void PDU__RRM__ImmediateAssignmentReject__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(", pageMode := ");
field_pageMode.log();
TTCN_Logger::log_event_str(", featureIndicator := ");
field_featureIndicator.log();
TTCN_Logger::log_event_str(", requestReference1 := ");
field_requestReference1.log();
TTCN_Logger::log_event_str(", waitIndication1 := ");
field_waitIndication1.log();
TTCN_Logger::log_event_str(", requestReference2 := ");
field_requestReference2.log();
TTCN_Logger::log_event_str(", waitIndication2 := ");
field_waitIndication2.log();
TTCN_Logger::log_event_str(", requestReference3 := ");
field_requestReference3.log();
TTCN_Logger::log_event_str(", waitIndication3 := ");
field_waitIndication3.log();
TTCN_Logger::log_event_str(", requestReference4 := ");
field_requestReference4.log();
TTCN_Logger::log_event_str(", waitIndication4 := ");
field_waitIndication4.log();
TTCN_Logger::log_event_str(", iAR_RestOctets := ");
field_iAR__RestOctets.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ImmediateAssignmentReject__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (featureIndicator().is_bound()) featureIndicator().set_implicit_omit();
if (requestReference1().is_bound()) requestReference1().set_implicit_omit();
if (waitIndication1().is_bound()) waitIndication1().set_implicit_omit();
if (requestReference2().is_bound()) requestReference2().set_implicit_omit();
if (waitIndication2().is_bound()) waitIndication2().set_implicit_omit();
if (requestReference3().is_bound()) requestReference3().set_implicit_omit();
if (waitIndication3().is_bound()) waitIndication3().set_implicit_omit();
if (requestReference4().is_bound()) requestReference4().set_implicit_omit();
if (waitIndication4().is_bound()) waitIndication4().set_implicit_omit();
if (iAR__RestOctets().is_bound()) iAR__RestOctets().set_implicit_omit();
}

void PDU__RRM__ImmediateAssignmentReject__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 (12<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) featureIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) requestReference1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) waitIndication1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) requestReference2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) waitIndication2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) requestReference3().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) waitIndication3().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) requestReference4().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) waitIndication4().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) iAR__RestOctets().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pageMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pageMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "featureIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          featureIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "waitIndication1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "waitIndication2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "waitIndication3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "waitIndication4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iAR_RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iAR__RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
  }
}

void PDU__RRM__ImmediateAssignmentReject__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_pageMode.encode_text(text_buf);
field_featureIndicator.encode_text(text_buf);
field_requestReference1.encode_text(text_buf);
field_waitIndication1.encode_text(text_buf);
field_requestReference2.encode_text(text_buf);
field_waitIndication2.encode_text(text_buf);
field_requestReference3.encode_text(text_buf);
field_waitIndication3.encode_text(text_buf);
field_requestReference4.encode_text(text_buf);
field_waitIndication4.encode_text(text_buf);
field_iAR__RestOctets.encode_text(text_buf);
}

void PDU__RRM__ImmediateAssignmentReject__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_pageMode.decode_text(text_buf);
field_featureIndicator.decode_text(text_buf);
field_requestReference1.decode_text(text_buf);
field_waitIndication1.decode_text(text_buf);
field_requestReference2.decode_text(text_buf);
field_waitIndication2.decode_text(text_buf);
field_requestReference3.decode_text(text_buf);
field_waitIndication3.decode_text(text_buf);
field_requestReference4.decode_text(text_buf);
field_waitIndication4.decode_text(text_buf);
field_iAR__RestOctets.decode_text(text_buf);
}

void PDU__RRM__ImmediateAssignmentReject__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__RRM__ImmediateAssignmentReject__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__RRM__ImmediateAssignmentReject__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, PageMode__V_descr_.raw->forceomit);
  decoded_field_length = field_pageMode.RAW_decode(PageMode__V_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, FeatureIndicator__V_descr_.raw->forceomit);
  decoded_field_length = field_featureIndicator.RAW_decode(FeatureIndicator__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, RequestReference__V_descr_.raw->forceomit);
  decoded_field_length = field_requestReference1.RAW_decode(RequestReference__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, WaitIndication__V_descr_.raw->forceomit);
  decoded_field_length = field_waitIndication1.RAW_decode(WaitIndication__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, RequestReference__V_descr_.raw->forceomit);
  decoded_field_length = field_requestReference2.RAW_decode(RequestReference__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, WaitIndication__V_descr_.raw->forceomit);
  decoded_field_length = field_waitIndication2.RAW_decode(WaitIndication__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, RequestReference__V_descr_.raw->forceomit);
  decoded_field_length = field_requestReference3.RAW_decode(RequestReference__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, WaitIndication__V_descr_.raw->forceomit);
  decoded_field_length = field_waitIndication3.RAW_decode(WaitIndication__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_9_force_omit(9, force_omit, RequestReference__V_descr_.raw->forceomit);
  decoded_field_length = field_requestReference4.RAW_decode(RequestReference__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return 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_10_force_omit(10, force_omit, WaitIndication__V_descr_.raw->forceomit);
  decoded_field_length = field_waitIndication4.RAW_decode(WaitIndication__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 0) return 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_11_force_omit(11, force_omit, PDU__RRM__ImmediateAssignmentReject__NW__MS_iAR__RestOctets_descr_.raw->forceomit);
  decoded_field_length = field_iAR__RestOctets.RAW_decode(PDU__RRM__ImmediateAssignmentReject__NW__MS_iAR__RestOctets_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 0) return 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__RRM__ImmediateAssignmentReject__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 = 12;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PageMode__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, FeatureIndicator__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RequestReference__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, WaitIndication__V_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RequestReference__V_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, WaitIndication__V_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, RequestReference__V_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, WaitIndication__V_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, RequestReference__V_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, WaitIndication__V_descr_.raw);
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, PDU__RRM__ImmediateAssignmentReject__NW__MS_iAR__RestOctets_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pageMode.RAW_encode(PageMode__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_featureIndicator.RAW_encode(FeatureIndicator__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_requestReference1.RAW_encode(RequestReference__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_waitIndication1.RAW_encode(WaitIndication__V_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_requestReference2.RAW_encode(RequestReference__V_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_waitIndication2.RAW_encode(WaitIndication__V_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_requestReference3.RAW_encode(RequestReference__V_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_waitIndication3.RAW_encode(WaitIndication__V_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_requestReference4.RAW_encode(RequestReference__V_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_waitIndication4.RAW_encode(WaitIndication__V_descr_, *myleaf.body.node.nodes[10]);
  encoded_length += field_iAR__RestOctets.RAW_encode(PDU__RRM__ImmediateAssignmentReject__NW__MS_iAR__RestOctets_descr_, *myleaf.body.node.nodes[11]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ImmediateAssignmentReject__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
PageMode__V_template field_pageMode;
FeatureIndicator__V_template field_featureIndicator;
RequestReference__V_template field_requestReference1;
WaitIndication__V_template field_waitIndication1;
RequestReference__V_template field_requestReference2;
WaitIndication__V_template field_waitIndication2;
RequestReference__V_template field_requestReference3;
WaitIndication__V_template field_waitIndication3;
RequestReference__V_template field_requestReference4;
WaitIndication__V_template field_waitIndication4;
OCTETSTRING_template field_iAR__RestOctets;
};

void PDU__RRM__ImmediateAssignmentReject__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_pageMode = ANY_VALUE;
single_value->field_featureIndicator = ANY_VALUE;
single_value->field_requestReference1 = ANY_VALUE;
single_value->field_waitIndication1 = ANY_VALUE;
single_value->field_requestReference2 = ANY_VALUE;
single_value->field_waitIndication2 = ANY_VALUE;
single_value->field_requestReference3 = ANY_VALUE;
single_value->field_waitIndication3 = ANY_VALUE;
single_value->field_requestReference4 = ANY_VALUE;
single_value->field_waitIndication4 = ANY_VALUE;
single_value->field_iAR__RestOctets = ANY_VALUE;
}
}
}

void PDU__RRM__ImmediateAssignmentReject__NW__MS_template::copy_value(const PDU__RRM__ImmediateAssignmentReject__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.pageMode().is_bound()) {
  single_value->field_pageMode = other_value.pageMode();
} else {
  single_value->field_pageMode.clean_up();
}
if (other_value.featureIndicator().is_bound()) {
  single_value->field_featureIndicator = other_value.featureIndicator();
} else {
  single_value->field_featureIndicator.clean_up();
}
if (other_value.requestReference1().is_bound()) {
  single_value->field_requestReference1 = other_value.requestReference1();
} else {
  single_value->field_requestReference1.clean_up();
}
if (other_value.waitIndication1().is_bound()) {
  single_value->field_waitIndication1 = other_value.waitIndication1();
} else {
  single_value->field_waitIndication1.clean_up();
}
if (other_value.requestReference2().is_bound()) {
  single_value->field_requestReference2 = other_value.requestReference2();
} else {
  single_value->field_requestReference2.clean_up();
}
if (other_value.waitIndication2().is_bound()) {
  single_value->field_waitIndication2 = other_value.waitIndication2();
} else {
  single_value->field_waitIndication2.clean_up();
}
if (other_value.requestReference3().is_bound()) {
  single_value->field_requestReference3 = other_value.requestReference3();
} else {
  single_value->field_requestReference3.clean_up();
}
if (other_value.waitIndication3().is_bound()) {
  single_value->field_waitIndication3 = other_value.waitIndication3();
} else {
  single_value->field_waitIndication3.clean_up();
}
if (other_value.requestReference4().is_bound()) {
  single_value->field_requestReference4 = other_value.requestReference4();
} else {
  single_value->field_requestReference4.clean_up();
}
if (other_value.waitIndication4().is_bound()) {
  single_value->field_waitIndication4 = other_value.waitIndication4();
} else {
  single_value->field_waitIndication4.clean_up();
}
if (other_value.iAR__RestOctets().is_bound()) {
  single_value->field_iAR__RestOctets = other_value.iAR__RestOctets();
} else {
  single_value->field_iAR__RestOctets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ImmediateAssignmentReject__NW__MS_template::copy_template(const PDU__RRM__ImmediateAssignmentReject__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.pageMode().get_selection()) {
single_value->field_pageMode = other_value.pageMode();
} else {
single_value->field_pageMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.featureIndicator().get_selection()) {
single_value->field_featureIndicator = other_value.featureIndicator();
} else {
single_value->field_featureIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestReference1().get_selection()) {
single_value->field_requestReference1 = other_value.requestReference1();
} else {
single_value->field_requestReference1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.waitIndication1().get_selection()) {
single_value->field_waitIndication1 = other_value.waitIndication1();
} else {
single_value->field_waitIndication1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestReference2().get_selection()) {
single_value->field_requestReference2 = other_value.requestReference2();
} else {
single_value->field_requestReference2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.waitIndication2().get_selection()) {
single_value->field_waitIndication2 = other_value.waitIndication2();
} else {
single_value->field_waitIndication2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestReference3().get_selection()) {
single_value->field_requestReference3 = other_value.requestReference3();
} else {
single_value->field_requestReference3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.waitIndication3().get_selection()) {
single_value->field_waitIndication3 = other_value.waitIndication3();
} else {
single_value->field_waitIndication3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestReference4().get_selection()) {
single_value->field_requestReference4 = other_value.requestReference4();
} else {
single_value->field_requestReference4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.waitIndication4().get_selection()) {
single_value->field_waitIndication4 = other_value.waitIndication4();
} else {
single_value->field_waitIndication4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iAR__RestOctets().get_selection()) {
single_value->field_iAR__RestOctets = other_value.iAR__RestOctets();
} else {
single_value->field_iAR__RestOctets.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__RRM__ImmediateAssignmentReject__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__RRM__ImmediateAssignmentReject__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ImmediateAssignmentReject__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_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ImmediateAssignmentReject__NW__MS_template::PDU__RRM__ImmediateAssignmentReject__NW__MS_template()
{
}

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

PDU__RRM__ImmediateAssignmentReject__NW__MS_template::PDU__RRM__ImmediateAssignmentReject__NW__MS_template(const PDU__RRM__ImmediateAssignmentReject__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__ImmediateAssignmentReject__NW__MS_template::match(const PDU__RRM__ImmediateAssignmentReject__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.pageMode().is_bound()) return FALSE;
if(!single_value->field_pageMode.match(other_value.pageMode(), legacy))return FALSE;
if(!other_value.featureIndicator().is_bound()) return FALSE;
if(!single_value->field_featureIndicator.match(other_value.featureIndicator(), legacy))return FALSE;
if(!other_value.requestReference1().is_bound()) return FALSE;
if(!single_value->field_requestReference1.match(other_value.requestReference1(), legacy))return FALSE;
if(!other_value.waitIndication1().is_bound()) return FALSE;
if(!single_value->field_waitIndication1.match(other_value.waitIndication1(), legacy))return FALSE;
if(!other_value.requestReference2().is_bound()) return FALSE;
if(!single_value->field_requestReference2.match(other_value.requestReference2(), legacy))return FALSE;
if(!other_value.waitIndication2().is_bound()) return FALSE;
if(!single_value->field_waitIndication2.match(other_value.waitIndication2(), legacy))return FALSE;
if(!other_value.requestReference3().is_bound()) return FALSE;
if(!single_value->field_requestReference3.match(other_value.requestReference3(), legacy))return FALSE;
if(!other_value.waitIndication3().is_bound()) return FALSE;
if(!single_value->field_waitIndication3.match(other_value.waitIndication3(), legacy))return FALSE;
if(!other_value.requestReference4().is_bound()) return FALSE;
if(!single_value->field_requestReference4.match(other_value.requestReference4(), legacy))return FALSE;
if(!other_value.waitIndication4().is_bound()) return FALSE;
if(!single_value->field_waitIndication4.match(other_value.waitIndication4(), legacy))return FALSE;
if(!other_value.iAR__RestOctets().is_bound()) return FALSE;
if(!single_value->field_iAR__RestOctets.match(other_value.iAR__RestOctets(), 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_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ImmediateAssignmentReject__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_pageMode.is_bound()
 || single_value->field_featureIndicator.is_bound()
 || single_value->field_requestReference1.is_bound()
 || single_value->field_waitIndication1.is_bound()
 || single_value->field_requestReference2.is_bound()
 || single_value->field_waitIndication2.is_bound()
 || single_value->field_requestReference3.is_bound()
 || single_value->field_waitIndication3.is_bound()
 || single_value->field_requestReference4.is_bound()
 || single_value->field_waitIndication4.is_bound()
 || single_value->field_iAR__RestOctets.is_bound();
}

boolean PDU__RRM__ImmediateAssignmentReject__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_pageMode.is_value()
 && single_value->field_featureIndicator.is_value()
 && single_value->field_requestReference1.is_value()
 && single_value->field_waitIndication1.is_value()
 && single_value->field_requestReference2.is_value()
 && single_value->field_waitIndication2.is_value()
 && single_value->field_requestReference3.is_value()
 && single_value->field_waitIndication3.is_value()
 && single_value->field_requestReference4.is_value()
 && single_value->field_waitIndication4.is_value()
 && single_value->field_iAR__RestOctets.is_value();
}

void PDU__RRM__ImmediateAssignmentReject__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__RRM__ImmediateAssignmentReject__NW__MS PDU__RRM__ImmediateAssignmentReject__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_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
PDU__RRM__ImmediateAssignmentReject__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_pageMode.is_bound()) {
ret_val.pageMode() = single_value->field_pageMode.valueof();
}
if (single_value->field_featureIndicator.is_bound()) {
ret_val.featureIndicator() = single_value->field_featureIndicator.valueof();
}
if (single_value->field_requestReference1.is_bound()) {
ret_val.requestReference1() = single_value->field_requestReference1.valueof();
}
if (single_value->field_waitIndication1.is_bound()) {
ret_val.waitIndication1() = single_value->field_waitIndication1.valueof();
}
if (single_value->field_requestReference2.is_bound()) {
ret_val.requestReference2() = single_value->field_requestReference2.valueof();
}
if (single_value->field_waitIndication2.is_bound()) {
ret_val.waitIndication2() = single_value->field_waitIndication2.valueof();
}
if (single_value->field_requestReference3.is_bound()) {
ret_val.requestReference3() = single_value->field_requestReference3.valueof();
}
if (single_value->field_waitIndication3.is_bound()) {
ret_val.waitIndication3() = single_value->field_waitIndication3.valueof();
}
if (single_value->field_requestReference4.is_bound()) {
ret_val.requestReference4() = single_value->field_requestReference4.valueof();
}
if (single_value->field_waitIndication4.is_bound()) {
ret_val.waitIndication4() = single_value->field_waitIndication4.valueof();
}
if (single_value->field_iAR__RestOctets.is_bound()) {
ret_val.iAR__RestOctets() = single_value->field_iAR__RestOctets.valueof();
}
return ret_val;
}

void PDU__RRM__ImmediateAssignmentReject__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_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ImmediateAssignmentReject__NW__MS_template[list_length];
}

PDU__RRM__ImmediateAssignmentReject__NW__MS_template& PDU__RRM__ImmediateAssignmentReject__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_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return value_list.list_value[list_index];
}

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

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

PageMode__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::pageMode()
{
set_specific();
return single_value->field_pageMode;
}

const PageMode__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::pageMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pageMode of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_pageMode;
}

FeatureIndicator__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::featureIndicator()
{
set_specific();
return single_value->field_featureIndicator;
}

const FeatureIndicator__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::featureIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field featureIndicator of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_featureIndicator;
}

RequestReference__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::requestReference1()
{
set_specific();
return single_value->field_requestReference1;
}

const RequestReference__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::requestReference1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestReference1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_requestReference1;
}

WaitIndication__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::waitIndication1()
{
set_specific();
return single_value->field_waitIndication1;
}

const WaitIndication__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::waitIndication1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field waitIndication1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_waitIndication1;
}

RequestReference__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::requestReference2()
{
set_specific();
return single_value->field_requestReference2;
}

const RequestReference__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::requestReference2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestReference2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_requestReference2;
}

WaitIndication__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::waitIndication2()
{
set_specific();
return single_value->field_waitIndication2;
}

const WaitIndication__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::waitIndication2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field waitIndication2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_waitIndication2;
}

RequestReference__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::requestReference3()
{
set_specific();
return single_value->field_requestReference3;
}

const RequestReference__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::requestReference3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestReference3 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_requestReference3;
}

WaitIndication__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::waitIndication3()
{
set_specific();
return single_value->field_waitIndication3;
}

const WaitIndication__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::waitIndication3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field waitIndication3 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_waitIndication3;
}

RequestReference__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::requestReference4()
{
set_specific();
return single_value->field_requestReference4;
}

const RequestReference__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::requestReference4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestReference4 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_requestReference4;
}

WaitIndication__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::waitIndication4()
{
set_specific();
return single_value->field_waitIndication4;
}

const WaitIndication__V_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::waitIndication4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field waitIndication4 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_waitIndication4;
}

OCTETSTRING_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::iAR__RestOctets()
{
set_specific();
return single_value->field_iAR__RestOctets;
}

const OCTETSTRING_template& PDU__RRM__ImmediateAssignmentReject__NW__MS_template::iAR__RestOctets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iAR_RestOctets of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
return single_value->field_iAR__RestOctets;
}

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

void PDU__RRM__ImmediateAssignmentReject__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(", pageMode := ");
single_value->field_pageMode.log();
TTCN_Logger::log_event_str(", featureIndicator := ");
single_value->field_featureIndicator.log();
TTCN_Logger::log_event_str(", requestReference1 := ");
single_value->field_requestReference1.log();
TTCN_Logger::log_event_str(", waitIndication1 := ");
single_value->field_waitIndication1.log();
TTCN_Logger::log_event_str(", requestReference2 := ");
single_value->field_requestReference2.log();
TTCN_Logger::log_event_str(", waitIndication2 := ");
single_value->field_waitIndication2.log();
TTCN_Logger::log_event_str(", requestReference3 := ");
single_value->field_requestReference3.log();
TTCN_Logger::log_event_str(", waitIndication3 := ");
single_value->field_waitIndication3.log();
TTCN_Logger::log_event_str(", requestReference4 := ");
single_value->field_requestReference4.log();
TTCN_Logger::log_event_str(", waitIndication4 := ");
single_value->field_waitIndication4.log();
TTCN_Logger::log_event_str(", iAR_RestOctets := ");
single_value->field_iAR__RestOctets.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__RRM__ImmediateAssignmentReject__NW__MS_template::log_match(const PDU__RRM__ImmediateAssignmentReject__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_pageMode.match(match_value.pageMode(), legacy)){
TTCN_Logger::log_logmatch_info(".pageMode");
single_value->field_pageMode.log_match(match_value.pageMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_featureIndicator.match(match_value.featureIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".featureIndicator");
single_value->field_featureIndicator.log_match(match_value.featureIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestReference1.match(match_value.requestReference1(), legacy)){
TTCN_Logger::log_logmatch_info(".requestReference1");
single_value->field_requestReference1.log_match(match_value.requestReference1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_waitIndication1.match(match_value.waitIndication1(), legacy)){
TTCN_Logger::log_logmatch_info(".waitIndication1");
single_value->field_waitIndication1.log_match(match_value.waitIndication1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestReference2.match(match_value.requestReference2(), legacy)){
TTCN_Logger::log_logmatch_info(".requestReference2");
single_value->field_requestReference2.log_match(match_value.requestReference2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_waitIndication2.match(match_value.waitIndication2(), legacy)){
TTCN_Logger::log_logmatch_info(".waitIndication2");
single_value->field_waitIndication2.log_match(match_value.waitIndication2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestReference3.match(match_value.requestReference3(), legacy)){
TTCN_Logger::log_logmatch_info(".requestReference3");
single_value->field_requestReference3.log_match(match_value.requestReference3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_waitIndication3.match(match_value.waitIndication3(), legacy)){
TTCN_Logger::log_logmatch_info(".waitIndication3");
single_value->field_waitIndication3.log_match(match_value.waitIndication3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requestReference4.match(match_value.requestReference4(), legacy)){
TTCN_Logger::log_logmatch_info(".requestReference4");
single_value->field_requestReference4.log_match(match_value.requestReference4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_waitIndication4.match(match_value.waitIndication4(), legacy)){
TTCN_Logger::log_logmatch_info(".waitIndication4");
single_value->field_waitIndication4.log_match(match_value.waitIndication4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iAR__RestOctets.match(match_value.iAR__RestOctets(), legacy)){
TTCN_Logger::log_logmatch_info(".iAR_RestOctets");
single_value->field_iAR__RestOctets.log_match(match_value.iAR__RestOctets(), 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(", pageMode := ");
single_value->field_pageMode.log_match(match_value.pageMode(), legacy);
TTCN_Logger::log_event_str(", featureIndicator := ");
single_value->field_featureIndicator.log_match(match_value.featureIndicator(), legacy);
TTCN_Logger::log_event_str(", requestReference1 := ");
single_value->field_requestReference1.log_match(match_value.requestReference1(), legacy);
TTCN_Logger::log_event_str(", waitIndication1 := ");
single_value->field_waitIndication1.log_match(match_value.waitIndication1(), legacy);
TTCN_Logger::log_event_str(", requestReference2 := ");
single_value->field_requestReference2.log_match(match_value.requestReference2(), legacy);
TTCN_Logger::log_event_str(", waitIndication2 := ");
single_value->field_waitIndication2.log_match(match_value.waitIndication2(), legacy);
TTCN_Logger::log_event_str(", requestReference3 := ");
single_value->field_requestReference3.log_match(match_value.requestReference3(), legacy);
TTCN_Logger::log_event_str(", waitIndication3 := ");
single_value->field_waitIndication3.log_match(match_value.waitIndication3(), legacy);
TTCN_Logger::log_event_str(", requestReference4 := ");
single_value->field_requestReference4.log_match(match_value.requestReference4(), legacy);
TTCN_Logger::log_event_str(", waitIndication4 := ");
single_value->field_waitIndication4.log_match(match_value.waitIndication4(), legacy);
TTCN_Logger::log_event_str(", iAR_RestOctets := ");
single_value->field_iAR__RestOctets.log_match(match_value.iAR__RestOctets(), 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__RRM__ImmediateAssignmentReject__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (featureIndicator().is_bound()) featureIndicator().set_implicit_omit();
if (requestReference1().is_bound()) requestReference1().set_implicit_omit();
if (waitIndication1().is_bound()) waitIndication1().set_implicit_omit();
if (requestReference2().is_bound()) requestReference2().set_implicit_omit();
if (waitIndication2().is_bound()) waitIndication2().set_implicit_omit();
if (requestReference3().is_bound()) requestReference3().set_implicit_omit();
if (waitIndication3().is_bound()) waitIndication3().set_implicit_omit();
if (requestReference4().is_bound()) requestReference4().set_implicit_omit();
if (waitIndication4().is_bound()) waitIndication4().set_implicit_omit();
if (iAR__RestOctets().is_bound()) iAR__RestOctets().set_implicit_omit();
}

void PDU__RRM__ImmediateAssignmentReject__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_pageMode.encode_text(text_buf);
single_value->field_featureIndicator.encode_text(text_buf);
single_value->field_requestReference1.encode_text(text_buf);
single_value->field_waitIndication1.encode_text(text_buf);
single_value->field_requestReference2.encode_text(text_buf);
single_value->field_waitIndication2.encode_text(text_buf);
single_value->field_requestReference3.encode_text(text_buf);
single_value->field_waitIndication3.encode_text(text_buf);
single_value->field_requestReference4.encode_text(text_buf);
single_value->field_waitIndication4.encode_text(text_buf);
single_value->field_iAR__RestOctets.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_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
}
}

void PDU__RRM__ImmediateAssignmentReject__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_pageMode.decode_text(text_buf);
single_value->field_featureIndicator.decode_text(text_buf);
single_value->field_requestReference1.decode_text(text_buf);
single_value->field_waitIndication1.decode_text(text_buf);
single_value->field_requestReference2.decode_text(text_buf);
single_value->field_waitIndication2.decode_text(text_buf);
single_value->field_requestReference3.decode_text(text_buf);
single_value->field_waitIndication3.decode_text(text_buf);
single_value->field_requestReference4.decode_text(text_buf);
single_value->field_waitIndication4.decode_text(text_buf);
single_value->field_iAR__RestOctets.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__RRM__ImmediateAssignmentReject__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_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS.");
}
}

void PDU__RRM__ImmediateAssignmentReject__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__RRM__ImmediateAssignmentReject__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 (12<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) featureIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) requestReference1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) waitIndication1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) requestReference2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) waitIndication2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) requestReference3().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) waitIndication3().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) requestReference4().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) waitIndication4().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) iAR__RestOctets().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pageMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pageMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "featureIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          featureIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "waitIndication1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "waitIndication2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "waitIndication3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestReference4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestReference4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "waitIndication4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          waitIndication4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iAR_RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iAR__RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ImmediateAssignmentReject__NW__MS_template* precondition = new PDU__RRM__ImmediateAssignmentReject__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ImmediateAssignmentReject__NW__MS_template* implied_template = new PDU__RRM__ImmediateAssignmentReject__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ImmediateAssignmentReject__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ImmediateAssignmentReject__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_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_pageMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_featureIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_requestReference1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_waitIndication1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_requestReference2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_waitIndication2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_requestReference3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_waitIndication3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_requestReference4.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_waitIndication4.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
single_value->field_iAR__RestOctets.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ImmediateAssignmentReject_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_RRM_Types.PDU_RRM_ImmediateAssignmentReject_NW_MS");
}

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

boolean PDU__RRM__ImmediateAssignmentReject__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__RRM__NotificationResponse__MS__NW::PDU__RRM__NotificationResponse__MS__NW()
{
}

PDU__RRM__NotificationResponse__MS__NW::PDU__RRM__NotificationResponse__MS__NW(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::MobileStationClassmark2__LV& par_mobileStationClassmark,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity,
    const MobileL3__CommonIE__Types::DescriptiveGroupOrBroadcastCallReference__V& par_groupOrBroadcastCallReference)
  :   field_messageType(par_messageType),
  field_mobileStationClassmark(par_mobileStationClassmark),
  field_mobileIdentity(par_mobileIdentity),
  field_groupOrBroadcastCallReference(par_groupOrBroadcastCallReference)
{
}

PDU__RRM__NotificationResponse__MS__NW::PDU__RRM__NotificationResponse__MS__NW(const PDU__RRM__NotificationResponse__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.mobileStationClassmark().is_bound()) field_mobileStationClassmark = other_value.mobileStationClassmark();
else field_mobileStationClassmark.clean_up();
if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
else field_mobileIdentity.clean_up();
if (other_value.groupOrBroadcastCallReference().is_bound()) field_groupOrBroadcastCallReference = other_value.groupOrBroadcastCallReference();
else field_groupOrBroadcastCallReference.clean_up();
}

void PDU__RRM__NotificationResponse__MS__NW::clean_up()
{
field_messageType.clean_up();
field_mobileStationClassmark.clean_up();
field_mobileIdentity.clean_up();
field_groupOrBroadcastCallReference.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__NotificationResponse__MS__NW::get_descriptor() const { return &PDU__RRM__NotificationResponse__MS__NW_descr_; }
PDU__RRM__NotificationResponse__MS__NW& PDU__RRM__NotificationResponse__MS__NW::operator=(const PDU__RRM__NotificationResponse__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.mobileStationClassmark().is_bound()) field_mobileStationClassmark = other_value.mobileStationClassmark();
  else field_mobileStationClassmark.clean_up();
  if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
  else field_mobileIdentity.clean_up();
  if (other_value.groupOrBroadcastCallReference().is_bound()) field_groupOrBroadcastCallReference = other_value.groupOrBroadcastCallReference();
  else field_groupOrBroadcastCallReference.clean_up();
}
return *this;
}

boolean PDU__RRM__NotificationResponse__MS__NW::operator==(const PDU__RRM__NotificationResponse__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_mobileStationClassmark==other_value.field_mobileStationClassmark
  && field_mobileIdentity==other_value.field_mobileIdentity
  && field_groupOrBroadcastCallReference==other_value.field_groupOrBroadcastCallReference;
}

boolean PDU__RRM__NotificationResponse__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_mobileStationClassmark.is_bound())
  || (field_mobileIdentity.is_bound())
  || (field_groupOrBroadcastCallReference.is_bound());
}
boolean PDU__RRM__NotificationResponse__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_mobileStationClassmark.is_value()
  && field_mobileIdentity.is_value()
  && field_groupOrBroadcastCallReference.is_value();
}
void PDU__RRM__NotificationResponse__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(", mobileStationClassmark := ");
field_mobileStationClassmark.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
field_mobileIdentity.log();
TTCN_Logger::log_event_str(", groupOrBroadcastCallReference := ");
field_groupOrBroadcastCallReference.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__NotificationResponse__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (mobileStationClassmark().is_bound()) mobileStationClassmark().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
if (groupOrBroadcastCallReference().is_bound()) groupOrBroadcastCallReference().set_implicit_omit();
}

void PDU__RRM__NotificationResponse__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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW 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) mobileStationClassmark().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) groupOrBroadcastCallReference().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(), "mobileStationClassmark")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "groupOrBroadcastCallReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          groupOrBroadcastCallReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW");
  }
}

void PDU__RRM__NotificationResponse__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_mobileStationClassmark.encode_text(text_buf);
field_mobileIdentity.encode_text(text_buf);
field_groupOrBroadcastCallReference.encode_text(text_buf);
}

void PDU__RRM__NotificationResponse__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_mobileStationClassmark.decode_text(text_buf);
field_mobileIdentity.decode_text(text_buf);
field_groupOrBroadcastCallReference.decode_text(text_buf);
}

void PDU__RRM__NotificationResponse__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__RRM__NotificationResponse__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__RRM__NotificationResponse__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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark.RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark2__LV_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::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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::DescriptiveGroupOrBroadcastCallReference__V_descr_.raw->forceomit);
  decoded_field_length = field_groupOrBroadcastCallReference.RAW_decode(MobileL3__CommonIE__Types::DescriptiveGroupOrBroadcastCallReference__V_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__RRM__NotificationResponse__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 = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::DescriptiveGroupOrBroadcastCallReference__V_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mobileStationClassmark.RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mobileIdentity.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_groupOrBroadcastCallReference.RAW_encode(MobileL3__CommonIE__Types::DescriptiveGroupOrBroadcastCallReference__V_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__NotificationResponse__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template field_mobileStationClassmark;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentity;
MobileL3__CommonIE__Types::DescriptiveGroupOrBroadcastCallReference__V_template field_groupOrBroadcastCallReference;
};

void PDU__RRM__NotificationResponse__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_mobileStationClassmark = ANY_VALUE;
single_value->field_mobileIdentity = ANY_VALUE;
single_value->field_groupOrBroadcastCallReference = ANY_VALUE;
}
}
}

void PDU__RRM__NotificationResponse__MS__NW_template::copy_value(const PDU__RRM__NotificationResponse__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.mobileStationClassmark().is_bound()) {
  single_value->field_mobileStationClassmark = other_value.mobileStationClassmark();
} else {
  single_value->field_mobileStationClassmark.clean_up();
}
if (other_value.mobileIdentity().is_bound()) {
  single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
  single_value->field_mobileIdentity.clean_up();
}
if (other_value.groupOrBroadcastCallReference().is_bound()) {
  single_value->field_groupOrBroadcastCallReference = other_value.groupOrBroadcastCallReference();
} else {
  single_value->field_groupOrBroadcastCallReference.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__NotificationResponse__MS__NW_template::copy_template(const PDU__RRM__NotificationResponse__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.mobileStationClassmark().get_selection()) {
single_value->field_mobileStationClassmark = other_value.mobileStationClassmark();
} else {
single_value->field_mobileStationClassmark.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity().get_selection()) {
single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
single_value->field_mobileIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.groupOrBroadcastCallReference().get_selection()) {
single_value->field_groupOrBroadcastCallReference = other_value.groupOrBroadcastCallReference();
} else {
single_value->field_groupOrBroadcastCallReference.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__RRM__NotificationResponse__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__RRM__NotificationResponse__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__NotificationResponse__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_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__NotificationResponse__MS__NW_template::PDU__RRM__NotificationResponse__MS__NW_template()
{
}

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

PDU__RRM__NotificationResponse__MS__NW_template::PDU__RRM__NotificationResponse__MS__NW_template(const PDU__RRM__NotificationResponse__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__NotificationResponse__MS__NW_template::match(const PDU__RRM__NotificationResponse__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.mobileStationClassmark().is_bound()) return FALSE;
if(!single_value->field_mobileStationClassmark.match(other_value.mobileStationClassmark(), legacy))return FALSE;
if(!other_value.mobileIdentity().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity.match(other_value.mobileIdentity(), legacy))return FALSE;
if(!other_value.groupOrBroadcastCallReference().is_bound()) return FALSE;
if(!single_value->field_groupOrBroadcastCallReference.match(other_value.groupOrBroadcastCallReference(), 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_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__NotificationResponse__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_mobileStationClassmark.is_bound()
 || single_value->field_mobileIdentity.is_bound()
 || single_value->field_groupOrBroadcastCallReference.is_bound();
}

boolean PDU__RRM__NotificationResponse__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_mobileStationClassmark.is_value()
 && single_value->field_mobileIdentity.is_value()
 && single_value->field_groupOrBroadcastCallReference.is_value();
}

void PDU__RRM__NotificationResponse__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__RRM__NotificationResponse__MS__NW PDU__RRM__NotificationResponse__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_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
PDU__RRM__NotificationResponse__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_mobileStationClassmark.is_bound()) {
ret_val.mobileStationClassmark() = single_value->field_mobileStationClassmark.valueof();
}
if (single_value->field_mobileIdentity.is_bound()) {
ret_val.mobileIdentity() = single_value->field_mobileIdentity.valueof();
}
if (single_value->field_groupOrBroadcastCallReference.is_bound()) {
ret_val.groupOrBroadcastCallReference() = single_value->field_groupOrBroadcastCallReference.valueof();
}
return ret_val;
}

void PDU__RRM__NotificationResponse__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_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__NotificationResponse__MS__NW_template[list_length];
}

PDU__RRM__NotificationResponse__MS__NW_template& PDU__RRM__NotificationResponse__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_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
return value_list.list_value[list_index];
}

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

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

MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__RRM__NotificationResponse__MS__NW_template::mobileStationClassmark()
{
set_specific();
return single_value->field_mobileStationClassmark;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__RRM__NotificationResponse__MS__NW_template::mobileStationClassmark() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
return single_value->field_mobileStationClassmark;
}

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

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

MobileL3__CommonIE__Types::DescriptiveGroupOrBroadcastCallReference__V_template& PDU__RRM__NotificationResponse__MS__NW_template::groupOrBroadcastCallReference()
{
set_specific();
return single_value->field_groupOrBroadcastCallReference;
}

const MobileL3__CommonIE__Types::DescriptiveGroupOrBroadcastCallReference__V_template& PDU__RRM__NotificationResponse__MS__NW_template::groupOrBroadcastCallReference() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field groupOrBroadcastCallReference of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
return single_value->field_groupOrBroadcastCallReference;
}

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

void PDU__RRM__NotificationResponse__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(", mobileStationClassmark := ");
single_value->field_mobileStationClassmark.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log();
TTCN_Logger::log_event_str(", groupOrBroadcastCallReference := ");
single_value->field_groupOrBroadcastCallReference.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__RRM__NotificationResponse__MS__NW_template::log_match(const PDU__RRM__NotificationResponse__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_mobileStationClassmark.match(match_value.mobileStationClassmark(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark");
single_value->field_mobileStationClassmark.log_match(match_value.mobileStationClassmark(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity.match(match_value.mobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_groupOrBroadcastCallReference.match(match_value.groupOrBroadcastCallReference(), legacy)){
TTCN_Logger::log_logmatch_info(".groupOrBroadcastCallReference");
single_value->field_groupOrBroadcastCallReference.log_match(match_value.groupOrBroadcastCallReference(), 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(", mobileStationClassmark := ");
single_value->field_mobileStationClassmark.log_match(match_value.mobileStationClassmark(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
TTCN_Logger::log_event_str(", groupOrBroadcastCallReference := ");
single_value->field_groupOrBroadcastCallReference.log_match(match_value.groupOrBroadcastCallReference(), 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__RRM__NotificationResponse__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (mobileStationClassmark().is_bound()) mobileStationClassmark().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
if (groupOrBroadcastCallReference().is_bound()) groupOrBroadcastCallReference().set_implicit_omit();
}

void PDU__RRM__NotificationResponse__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_mobileStationClassmark.encode_text(text_buf);
single_value->field_mobileIdentity.encode_text(text_buf);
single_value->field_groupOrBroadcastCallReference.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_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
}
}

void PDU__RRM__NotificationResponse__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_mobileStationClassmark.decode_text(text_buf);
single_value->field_mobileIdentity.decode_text(text_buf);
single_value->field_groupOrBroadcastCallReference.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__RRM__NotificationResponse__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_RRM_Types.PDU_RRM_NotificationResponse_MS_NW.");
}
}

void PDU__RRM__NotificationResponse__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__RRM__NotificationResponse__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 (4<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW 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) mobileStationClassmark().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) groupOrBroadcastCallReference().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(), "mobileStationClassmark")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "groupOrBroadcastCallReference")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          groupOrBroadcastCallReference().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__NotificationResponse__MS__NW_template* precondition = new PDU__RRM__NotificationResponse__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__NotificationResponse__MS__NW_template* implied_template = new PDU__RRM__NotificationResponse__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__NotificationResponse__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__NotificationResponse__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_RRM_Types.PDU_RRM_NotificationResponse_MS_NW");
single_value->field_mobileStationClassmark.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NotificationResponse_MS_NW");
single_value->field_groupOrBroadcastCallReference.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NotificationResponse_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_RRM_Types.PDU_RRM_NotificationResponse_MS_NW");
}

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

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


} /* end of namespace */
