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

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

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

/* Including header files */

#include "MobileL3_RRM_Types.hh"

namespace MobileL3__RRM__Types {

/* Member functions of C++ classes */

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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;}
  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;}
  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::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;
}

PDU__RRM__PacketNotification__NW__MS::PDU__RRM__PacketNotification__NW__MS()
{
}

PDU__RRM__PacketNotification__NW__MS::PDU__RRM__PacketNotification__NW__MS(const BITSTRING& par_messageType,
    const OPTIONAL< TMSIP__TMSI__TV >& par_p__TMSI,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_mobileIdentity)
  :   field_messageType(par_messageType),
  field_p__TMSI(par_p__TMSI),
  field_mobileIdentity(par_mobileIdentity)
{
}

PDU__RRM__PacketNotification__NW__MS::PDU__RRM__PacketNotification__NW__MS(const PDU__RRM__PacketNotification__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.p__TMSI().is_bound()) field_p__TMSI = other_value.p__TMSI();
else field_p__TMSI.clean_up();
if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
else field_mobileIdentity.clean_up();
}

void PDU__RRM__PacketNotification__NW__MS::clean_up()
{
field_messageType.clean_up();
field_p__TMSI.clean_up();
field_mobileIdentity.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__PacketNotification__NW__MS::get_descriptor() const { return &PDU__RRM__PacketNotification__NW__MS_descr_; }
PDU__RRM__PacketNotification__NW__MS& PDU__RRM__PacketNotification__NW__MS::operator=(const PDU__RRM__PacketNotification__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_PacketNotification_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.p__TMSI().is_bound()) field_p__TMSI = other_value.p__TMSI();
  else field_p__TMSI.clean_up();
  if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
  else field_mobileIdentity.clean_up();
}
return *this;
}

boolean PDU__RRM__PacketNotification__NW__MS::operator==(const PDU__RRM__PacketNotification__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_p__TMSI==other_value.field_p__TMSI
  && field_mobileIdentity==other_value.field_mobileIdentity;
}

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

void PDU__RRM__PacketNotification__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(", p_TMSI := ");
field_p__TMSI.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
field_mobileIdentity.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__PacketNotification__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!p__TMSI().is_bound()) p__TMSI() = OMIT_VALUE;
else p__TMSI().set_implicit_omit();
if (!mobileIdentity().is_bound()) mobileIdentity() = OMIT_VALUE;
else mobileIdentity().set_implicit_omit();
}

void PDU__RRM__PacketNotification__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_PacketNotification_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) p__TMSI().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));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "p_TMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS");
  }
}

void PDU__RRM__PacketNotification__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_p__TMSI.encode_text(text_buf);
field_mobileIdentity.encode_text(text_buf);
}

void PDU__RRM__PacketNotification__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_p__TMSI.decode_text(text_buf);
field_mobileIdentity.decode_text(text_buf);
}

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

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

int PDU__RRM__PacketNotification__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_p__TMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, TMSIP__TMSI__TV_descr_.raw->forceomit);
  decoded_field_length = field_p__TMSI().RAW_decode(TMSIP__TMSI__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_p__TMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_p__TMSI.ispresent() || field_p__TMSI().elementIdentifier() !=  os_5){
  field_p__TMSI=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_p__TMSI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_mobileIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_mobileIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileIdentity.ispresent() || field_mobileIdentity().elementIdentifier() !=  bs_12){
  field_mobileIdentity=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileIdentity=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__PacketNotification__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);
  if (field_p__TMSI.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TMSIP__TMSI__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_mobileIdentity.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_p__TMSI.ispresent()) {
  encoded_length += field_p__TMSI().RAW_encode(TMSIP__TMSI__TV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_mobileIdentity.ispresent()) {
  encoded_length += field_mobileIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_p__TMSI.ispresent() && (!field_p__TMSI.ispresent() || field_p__TMSI().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);
  }
  }
  if (field_mobileIdentity.ispresent() && (!field_mobileIdentity.ispresent() || field_mobileIdentity().elementIdentifier() !=  bs_12)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_12.RAW_encode(General__Types::BIT7_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__PacketNotification__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
TMSIP__TMSI__TV_template field_p__TMSI;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_mobileIdentity;
};

void PDU__RRM__PacketNotification__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_p__TMSI = ANY_OR_OMIT;
single_value->field_mobileIdentity = ANY_OR_OMIT;
}
}
}

void PDU__RRM__PacketNotification__NW__MS_template::copy_value(const PDU__RRM__PacketNotification__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.p__TMSI().is_bound()) {
  if (other_value.p__TMSI().ispresent()) single_value->field_p__TMSI = other_value.p__TMSI()();
  else single_value->field_p__TMSI = OMIT_VALUE;
} else {
  single_value->field_p__TMSI.clean_up();
}
if (other_value.mobileIdentity().is_bound()) {
  if (other_value.mobileIdentity().ispresent()) single_value->field_mobileIdentity = other_value.mobileIdentity()();
  else single_value->field_mobileIdentity = OMIT_VALUE;
} else {
  single_value->field_mobileIdentity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__PacketNotification__NW__MS_template::copy_template(const PDU__RRM__PacketNotification__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.p__TMSI().get_selection()) {
single_value->field_p__TMSI = other_value.p__TMSI();
} else {
single_value->field_p__TMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity().get_selection()) {
single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
single_value->field_mobileIdentity.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__RRM__PacketNotification__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__PacketNotification__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__PacketNotification__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_PacketNotification_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__PacketNotification__NW__MS_template::PDU__RRM__PacketNotification__NW__MS_template()
{
}

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

PDU__RRM__PacketNotification__NW__MS_template::PDU__RRM__PacketNotification__NW__MS_template(const PDU__RRM__PacketNotification__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__PacketNotification__NW__MS_template::PDU__RRM__PacketNotification__NW__MS_template(const OPTIONAL<PDU__RRM__PacketNotification__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__PacketNotification__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_PacketNotification_NW_MS from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__PacketNotification__NW__MS_template::match(const PDU__RRM__PacketNotification__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.p__TMSI().is_bound()) return FALSE;
if((other_value.p__TMSI().ispresent() ? !single_value->field_p__TMSI.match((const TMSIP__TMSI__TV&)other_value.p__TMSI(), legacy) : !single_value->field_p__TMSI.match_omit(legacy)))return FALSE;
if(!other_value.mobileIdentity().is_bound()) return FALSE;
if((other_value.mobileIdentity().ispresent() ? !single_value->field_mobileIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.mobileIdentity(), legacy) : !single_value->field_mobileIdentity.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_PacketNotification_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__PacketNotification__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_p__TMSI.is_omit() || single_value->field_p__TMSI.is_bound())
 || (single_value->field_mobileIdentity.is_omit() || single_value->field_mobileIdentity.is_bound());
}

boolean PDU__RRM__PacketNotification__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_p__TMSI.is_omit() || single_value->field_p__TMSI.is_value())
 && (single_value->field_mobileIdentity.is_omit() || single_value->field_mobileIdentity.is_value());
}

void PDU__RRM__PacketNotification__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__PacketNotification__NW__MS PDU__RRM__PacketNotification__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_PacketNotification_NW_MS.");
PDU__RRM__PacketNotification__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_p__TMSI.is_omit()) ret_val.p__TMSI() = OMIT_VALUE;
else if (single_value->field_p__TMSI.is_bound()) {
ret_val.p__TMSI() = single_value->field_p__TMSI.valueof();
}
if (single_value->field_mobileIdentity.is_omit()) ret_val.mobileIdentity() = OMIT_VALUE;
else if (single_value->field_mobileIdentity.is_bound()) {
ret_val.mobileIdentity() = single_value->field_mobileIdentity.valueof();
}
return ret_val;
}

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

PDU__RRM__PacketNotification__NW__MS_template& PDU__RRM__PacketNotification__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_PacketNotification_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_PacketNotification_NW_MS.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__PacketNotification__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_PacketNotification_NW_MS.");
return single_value->field_messageType;
}

TMSIP__TMSI__TV_template& PDU__RRM__PacketNotification__NW__MS_template::p__TMSI()
{
set_specific();
return single_value->field_p__TMSI;
}

const TMSIP__TMSI__TV_template& PDU__RRM__PacketNotification__NW__MS_template::p__TMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p_TMSI of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS.");
return single_value->field_p__TMSI;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__RRM__PacketNotification__NW__MS_template::mobileIdentity()
{
set_specific();
return single_value->field_mobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__RRM__PacketNotification__NW__MS_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_PacketNotification_NW_MS.");
return single_value->field_mobileIdentity;
}

int PDU__RRM__PacketNotification__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_p__TMSI.is_present()) ret_val++;
      if (single_value->field_mobileIdentity.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_PacketNotification_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_PacketNotification_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_PacketNotification_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_PacketNotification_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_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_PacketNotification_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS.");
  }
  return 0;
}

void PDU__RRM__PacketNotification__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(", p_TMSI := ");
single_value->field_p__TMSI.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__RRM__PacketNotification__NW__MS_template::log_match(const PDU__RRM__PacketNotification__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.p__TMSI().ispresent()){
if(!single_value->field_p__TMSI.match(match_value.p__TMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".p_TMSI");
single_value->field_p__TMSI.log_match(match_value.p__TMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_p__TMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".p_TMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_p__TMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileIdentity().ispresent()){
if(!single_value->field_mobileIdentity.match(match_value.mobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileIdentity.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(", p_TMSI := ");
if (match_value.p__TMSI().ispresent()) {
single_value->field_p__TMSI.log_match(match_value.p__TMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_p__TMSI.log();
if (single_value->field_p__TMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileIdentity := ");
if (match_value.mobileIdentity().ispresent()) {
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileIdentity.log();
if (single_value->field_mobileIdentity.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__PacketNotification__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_p__TMSI.encode_text(text_buf);
single_value->field_mobileIdentity.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS.");
}
}

void PDU__RRM__PacketNotification__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_p__TMSI.decode_text(text_buf);
single_value->field_mobileIdentity.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__RRM__PacketNotification__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_PacketNotification_NW_MS.");
}
}

void PDU__RRM__PacketNotification__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__PacketNotification__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_PacketNotification_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) p__TMSI().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));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "p_TMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__PacketNotification__NW__MS_template* precondition = new PDU__RRM__PacketNotification__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__PacketNotification__NW__MS_template* implied_template = new PDU__RRM__PacketNotification__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__PacketNotification__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__PacketNotification__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_PacketNotification_NW_MS");
single_value->field_p__TMSI.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PacketNotification_NW_MS");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PacketNotification_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_PacketNotification_NW_MS");
}

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

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

MBMS__Announcement__NW__MS::MBMS__Announcement__NW__MS()
{
}

MBMS__Announcement__NW__MS::MBMS__Announcement__NW__MS(const BITSTRING& par_messageType,
    const MobileL3__GMM__SM__Types::TemporaryMobileGroupIDLV& par_tMGI,
    const OPTIONAL< MBMS__SessionIdentity__TV >& par_mBMS__SessionIdentity,
    const OPTIONAL< MPRACH__Description__TLV >& par_mBMS__CountingChannelDescription,
    const OPTIONAL< MBMS__ptm__ChannelDescription__TLV >& par_mBMS__ptm__ChannelDescription,
    const OPTIONAL< MBMS__SessionParameterList__TLV >& par_mBMS__SessionParameterList,
    const OPTIONAL< RestrictionTimer__TV >& par_restrictionTimer)
  :   field_messageType(par_messageType),
  field_tMGI(par_tMGI),
  field_mBMS__SessionIdentity(par_mBMS__SessionIdentity),
  field_mBMS__CountingChannelDescription(par_mBMS__CountingChannelDescription),
  field_mBMS__ptm__ChannelDescription(par_mBMS__ptm__ChannelDescription),
  field_mBMS__SessionParameterList(par_mBMS__SessionParameterList),
  field_restrictionTimer(par_restrictionTimer)
{
}

MBMS__Announcement__NW__MS::MBMS__Announcement__NW__MS(const MBMS__Announcement__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.tMGI().is_bound()) field_tMGI = other_value.tMGI();
else field_tMGI.clean_up();
if (other_value.mBMS__SessionIdentity().is_bound()) field_mBMS__SessionIdentity = other_value.mBMS__SessionIdentity();
else field_mBMS__SessionIdentity.clean_up();
if (other_value.mBMS__CountingChannelDescription().is_bound()) field_mBMS__CountingChannelDescription = other_value.mBMS__CountingChannelDescription();
else field_mBMS__CountingChannelDescription.clean_up();
if (other_value.mBMS__ptm__ChannelDescription().is_bound()) field_mBMS__ptm__ChannelDescription = other_value.mBMS__ptm__ChannelDescription();
else field_mBMS__ptm__ChannelDescription.clean_up();
if (other_value.mBMS__SessionParameterList().is_bound()) field_mBMS__SessionParameterList = other_value.mBMS__SessionParameterList();
else field_mBMS__SessionParameterList.clean_up();
if (other_value.restrictionTimer().is_bound()) field_restrictionTimer = other_value.restrictionTimer();
else field_restrictionTimer.clean_up();
}

void MBMS__Announcement__NW__MS::clean_up()
{
field_messageType.clean_up();
field_tMGI.clean_up();
field_mBMS__SessionIdentity.clean_up();
field_mBMS__CountingChannelDescription.clean_up();
field_mBMS__ptm__ChannelDescription.clean_up();
field_mBMS__SessionParameterList.clean_up();
field_restrictionTimer.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__Announcement__NW__MS::get_descriptor() const { return &MBMS__Announcement__NW__MS_descr_; }
MBMS__Announcement__NW__MS& MBMS__Announcement__NW__MS::operator=(const MBMS__Announcement__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.MBMS_Announcement_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.tMGI().is_bound()) field_tMGI = other_value.tMGI();
  else field_tMGI.clean_up();
  if (other_value.mBMS__SessionIdentity().is_bound()) field_mBMS__SessionIdentity = other_value.mBMS__SessionIdentity();
  else field_mBMS__SessionIdentity.clean_up();
  if (other_value.mBMS__CountingChannelDescription().is_bound()) field_mBMS__CountingChannelDescription = other_value.mBMS__CountingChannelDescription();
  else field_mBMS__CountingChannelDescription.clean_up();
  if (other_value.mBMS__ptm__ChannelDescription().is_bound()) field_mBMS__ptm__ChannelDescription = other_value.mBMS__ptm__ChannelDescription();
  else field_mBMS__ptm__ChannelDescription.clean_up();
  if (other_value.mBMS__SessionParameterList().is_bound()) field_mBMS__SessionParameterList = other_value.mBMS__SessionParameterList();
  else field_mBMS__SessionParameterList.clean_up();
  if (other_value.restrictionTimer().is_bound()) field_restrictionTimer = other_value.restrictionTimer();
  else field_restrictionTimer.clean_up();
}
return *this;
}

boolean MBMS__Announcement__NW__MS::operator==(const MBMS__Announcement__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_tMGI==other_value.field_tMGI
  && field_mBMS__SessionIdentity==other_value.field_mBMS__SessionIdentity
  && field_mBMS__CountingChannelDescription==other_value.field_mBMS__CountingChannelDescription
  && field_mBMS__ptm__ChannelDescription==other_value.field_mBMS__ptm__ChannelDescription
  && field_mBMS__SessionParameterList==other_value.field_mBMS__SessionParameterList
  && field_restrictionTimer==other_value.field_restrictionTimer;
}

boolean MBMS__Announcement__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_tMGI.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__SessionIdentity.get_selection() || field_mBMS__SessionIdentity.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__CountingChannelDescription.get_selection() || field_mBMS__CountingChannelDescription.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__ptm__ChannelDescription.get_selection() || field_mBMS__ptm__ChannelDescription.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__SessionParameterList.get_selection() || field_mBMS__SessionParameterList.is_bound())
  || (OPTIONAL_OMIT == field_restrictionTimer.get_selection() || field_restrictionTimer.is_bound());
}
boolean MBMS__Announcement__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_tMGI.is_value()
  && (OPTIONAL_OMIT == field_mBMS__SessionIdentity.get_selection() || field_mBMS__SessionIdentity.is_value())
  && (OPTIONAL_OMIT == field_mBMS__CountingChannelDescription.get_selection() || field_mBMS__CountingChannelDescription.is_value())
  && (OPTIONAL_OMIT == field_mBMS__ptm__ChannelDescription.get_selection() || field_mBMS__ptm__ChannelDescription.is_value())
  && (OPTIONAL_OMIT == field_mBMS__SessionParameterList.get_selection() || field_mBMS__SessionParameterList.is_value())
  && (OPTIONAL_OMIT == field_restrictionTimer.get_selection() || field_restrictionTimer.is_value());
}
int MBMS__Announcement__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_mBMS__SessionIdentity.ispresent()) ret_val++;
  if (field_mBMS__CountingChannelDescription.ispresent()) ret_val++;
  if (field_mBMS__ptm__ChannelDescription.ispresent()) ret_val++;
  if (field_mBMS__SessionParameterList.ispresent()) ret_val++;
  if (field_restrictionTimer.ispresent()) ret_val++;
  return ret_val;
}

void MBMS__Announcement__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(", tMGI := ");
field_tMGI.log();
TTCN_Logger::log_event_str(", mBMS_SessionIdentity := ");
field_mBMS__SessionIdentity.log();
TTCN_Logger::log_event_str(", mBMS_CountingChannelDescription := ");
field_mBMS__CountingChannelDescription.log();
TTCN_Logger::log_event_str(", mBMS_ptm_ChannelDescription := ");
field_mBMS__ptm__ChannelDescription.log();
TTCN_Logger::log_event_str(", mBMS_SessionParameterList := ");
field_mBMS__SessionParameterList.log();
TTCN_Logger::log_event_str(", restrictionTimer := ");
field_restrictionTimer.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__Announcement__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (tMGI().is_bound()) tMGI().set_implicit_omit();
if (!mBMS__SessionIdentity().is_bound()) mBMS__SessionIdentity() = OMIT_VALUE;
else mBMS__SessionIdentity().set_implicit_omit();
if (!mBMS__CountingChannelDescription().is_bound()) mBMS__CountingChannelDescription() = OMIT_VALUE;
else mBMS__CountingChannelDescription().set_implicit_omit();
if (!mBMS__ptm__ChannelDescription().is_bound()) mBMS__ptm__ChannelDescription() = OMIT_VALUE;
else mBMS__ptm__ChannelDescription().set_implicit_omit();
if (!mBMS__SessionParameterList().is_bound()) mBMS__SessionParameterList() = OMIT_VALUE;
else mBMS__SessionParameterList().set_implicit_omit();
if (!restrictionTimer().is_bound()) restrictionTimer() = OMIT_VALUE;
else restrictionTimer().set_implicit_omit();
}

void MBMS__Announcement__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tMGI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS__SessionIdentity().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mBMS__CountingChannelDescription().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mBMS__ptm__ChannelDescription().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mBMS__SessionParameterList().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) restrictionTimer().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMGI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMGI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_SessionIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__SessionIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_CountingChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__CountingChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_ptm_ChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ptm__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(), "mBMS_SessionParameterList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__SessionParameterList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "restrictionTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          restrictionTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.MBMS_Announcement_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.MBMS_Announcement_NW_MS");
  }
}

void MBMS__Announcement__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_tMGI.encode_text(text_buf);
field_mBMS__SessionIdentity.encode_text(text_buf);
field_mBMS__CountingChannelDescription.encode_text(text_buf);
field_mBMS__ptm__ChannelDescription.encode_text(text_buf);
field_mBMS__SessionParameterList.encode_text(text_buf);
field_restrictionTimer.encode_text(text_buf);
}

void MBMS__Announcement__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_tMGI.decode_text(text_buf);
field_mBMS__SessionIdentity.decode_text(text_buf);
field_mBMS__CountingChannelDescription.decode_text(text_buf);
field_mBMS__ptm__ChannelDescription.decode_text(text_buf);
field_mBMS__SessionParameterList.decode_text(text_buf);
field_restrictionTimer.decode_text(text_buf);
}

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

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

int MBMS__Announcement__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::TemporaryMobileGroupIDLV_descr_.raw->forceomit);
  decoded_field_length = field_tMGI.RAW_decode(MobileL3__GMM__SM__Types::TemporaryMobileGroupIDLV_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_mBMS__SessionIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MBMS__SessionIdentity__TV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__SessionIdentity().RAW_decode(MBMS__SessionIdentity__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__SessionIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mBMS__SessionIdentity.ispresent() || field_mBMS__SessionIdentity().elementIdentifier() !=  os_21){
  field_mBMS__SessionIdentity=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mBMS__SessionIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_mBMS__CountingChannelDescription = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MPRACH__Description__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__CountingChannelDescription().RAW_decode(MPRACH__Description__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__CountingChannelDescription = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mBMS__CountingChannelDescription.ispresent() || field_mBMS__CountingChannelDescription().elementIdentifier() !=  os_36){
  field_mBMS__CountingChannelDescription=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mBMS__CountingChannelDescription=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_mBMS__ptm__ChannelDescription = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, MBMS__ptm__ChannelDescription__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__ptm__ChannelDescription().RAW_decode(MBMS__ptm__ChannelDescription__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__ptm__ChannelDescription = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mBMS__ptm__ChannelDescription.ispresent() || field_mBMS__ptm__ChannelDescription().elementIdentifier() !=  os_22){
  field_mBMS__ptm__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_mBMS__ptm__ChannelDescription=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_mBMS__SessionParameterList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MBMS__SessionParameterList__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__SessionParameterList().RAW_decode(MBMS__SessionParameterList__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__SessionParameterList = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mBMS__SessionParameterList.ispresent() || field_mBMS__SessionParameterList().elementIdentifier() !=  os_23){
  field_mBMS__SessionParameterList=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mBMS__SessionParameterList=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_restrictionTimer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, RestrictionTimer__TV_descr_.raw->forceomit);
  decoded_field_length = field_restrictionTimer().RAW_decode(RestrictionTimer__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_restrictionTimer = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_restrictionTimer.ispresent() || field_restrictionTimer().elementIdentifier() !=  os_3){
  field_restrictionTimer=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_restrictionTimer=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__Announcement__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__GMM__SM__Types::TemporaryMobileGroupIDLV_descr_.raw);
  if (field_mBMS__SessionIdentity.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__SessionIdentity__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_mBMS__CountingChannelDescription.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MPRACH__Description__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_mBMS__ptm__ChannelDescription.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MBMS__ptm__ChannelDescription__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_mBMS__SessionParameterList.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MBMS__SessionParameterList__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_restrictionTimer.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RestrictionTimer__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tMGI.RAW_encode(MobileL3__GMM__SM__Types::TemporaryMobileGroupIDLV_descr_, *myleaf.body.node.nodes[1]);
  if (field_mBMS__SessionIdentity.ispresent()) {
  encoded_length += field_mBMS__SessionIdentity().RAW_encode(MBMS__SessionIdentity__TV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_mBMS__CountingChannelDescription.ispresent()) {
  encoded_length += field_mBMS__CountingChannelDescription().RAW_encode(MPRACH__Description__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_mBMS__ptm__ChannelDescription.ispresent()) {
  encoded_length += field_mBMS__ptm__ChannelDescription().RAW_encode(MBMS__ptm__ChannelDescription__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_mBMS__SessionParameterList.ispresent()) {
  encoded_length += field_mBMS__SessionParameterList().RAW_encode(MBMS__SessionParameterList__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_restrictionTimer.ispresent()) {
  encoded_length += field_restrictionTimer().RAW_encode(RestrictionTimer__TV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_mBMS__SessionIdentity.ispresent() && (!field_mBMS__SessionIdentity.ispresent() || field_mBMS__SessionIdentity().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[]={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_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_mBMS__CountingChannelDescription.ispresent() && (!field_mBMS__CountingChannelDescription.ispresent() || field_mBMS__CountingChannelDescription().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[]={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_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_mBMS__ptm__ChannelDescription.ispresent() && (!field_mBMS__ptm__ChannelDescription.ispresent() || field_mBMS__ptm__ChannelDescription().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[]={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_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_mBMS__SessionParameterList.ispresent() && (!field_mBMS__SessionParameterList.ispresent() || field_mBMS__SessionParameterList().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[]={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_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_restrictionTimer.ispresent() && (!field_restrictionTimer.ispresent() || field_restrictionTimer().elementIdentifier() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MBMS__Announcement__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__GMM__SM__Types::TemporaryMobileGroupIDLV_template field_tMGI;
MBMS__SessionIdentity__TV_template field_mBMS__SessionIdentity;
MPRACH__Description__TLV_template field_mBMS__CountingChannelDescription;
MBMS__ptm__ChannelDescription__TLV_template field_mBMS__ptm__ChannelDescription;
MBMS__SessionParameterList__TLV_template field_mBMS__SessionParameterList;
RestrictionTimer__TV_template field_restrictionTimer;
};

void MBMS__Announcement__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_tMGI = ANY_VALUE;
single_value->field_mBMS__SessionIdentity = ANY_OR_OMIT;
single_value->field_mBMS__CountingChannelDescription = ANY_OR_OMIT;
single_value->field_mBMS__ptm__ChannelDescription = ANY_OR_OMIT;
single_value->field_mBMS__SessionParameterList = ANY_OR_OMIT;
single_value->field_restrictionTimer = ANY_OR_OMIT;
}
}
}

void MBMS__Announcement__NW__MS_template::copy_value(const MBMS__Announcement__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.tMGI().is_bound()) {
  single_value->field_tMGI = other_value.tMGI();
} else {
  single_value->field_tMGI.clean_up();
}
if (other_value.mBMS__SessionIdentity().is_bound()) {
  if (other_value.mBMS__SessionIdentity().ispresent()) single_value->field_mBMS__SessionIdentity = other_value.mBMS__SessionIdentity()();
  else single_value->field_mBMS__SessionIdentity = OMIT_VALUE;
} else {
  single_value->field_mBMS__SessionIdentity.clean_up();
}
if (other_value.mBMS__CountingChannelDescription().is_bound()) {
  if (other_value.mBMS__CountingChannelDescription().ispresent()) single_value->field_mBMS__CountingChannelDescription = other_value.mBMS__CountingChannelDescription()();
  else single_value->field_mBMS__CountingChannelDescription = OMIT_VALUE;
} else {
  single_value->field_mBMS__CountingChannelDescription.clean_up();
}
if (other_value.mBMS__ptm__ChannelDescription().is_bound()) {
  if (other_value.mBMS__ptm__ChannelDescription().ispresent()) single_value->field_mBMS__ptm__ChannelDescription = other_value.mBMS__ptm__ChannelDescription()();
  else single_value->field_mBMS__ptm__ChannelDescription = OMIT_VALUE;
} else {
  single_value->field_mBMS__ptm__ChannelDescription.clean_up();
}
if (other_value.mBMS__SessionParameterList().is_bound()) {
  if (other_value.mBMS__SessionParameterList().ispresent()) single_value->field_mBMS__SessionParameterList = other_value.mBMS__SessionParameterList()();
  else single_value->field_mBMS__SessionParameterList = OMIT_VALUE;
} else {
  single_value->field_mBMS__SessionParameterList.clean_up();
}
if (other_value.restrictionTimer().is_bound()) {
  if (other_value.restrictionTimer().ispresent()) single_value->field_restrictionTimer = other_value.restrictionTimer()();
  else single_value->field_restrictionTimer = OMIT_VALUE;
} else {
  single_value->field_restrictionTimer.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMS__Announcement__NW__MS_template::copy_template(const MBMS__Announcement__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.tMGI().get_selection()) {
single_value->field_tMGI = other_value.tMGI();
} else {
single_value->field_tMGI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__SessionIdentity().get_selection()) {
single_value->field_mBMS__SessionIdentity = other_value.mBMS__SessionIdentity();
} else {
single_value->field_mBMS__SessionIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__CountingChannelDescription().get_selection()) {
single_value->field_mBMS__CountingChannelDescription = other_value.mBMS__CountingChannelDescription();
} else {
single_value->field_mBMS__CountingChannelDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__ptm__ChannelDescription().get_selection()) {
single_value->field_mBMS__ptm__ChannelDescription = other_value.mBMS__ptm__ChannelDescription();
} else {
single_value->field_mBMS__ptm__ChannelDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__SessionParameterList().get_selection()) {
single_value->field_mBMS__SessionParameterList = other_value.mBMS__SessionParameterList();
} else {
single_value->field_mBMS__SessionParameterList.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.restrictionTimer().get_selection()) {
single_value->field_restrictionTimer = other_value.restrictionTimer();
} else {
single_value->field_restrictionTimer.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new MBMS__Announcement__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 MBMS__Announcement__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__Announcement__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.MBMS_Announcement_NW_MS.");
break;
}
set_selection(other_value);
}

MBMS__Announcement__NW__MS_template::MBMS__Announcement__NW__MS_template()
{
}

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

MBMS__Announcement__NW__MS_template::MBMS__Announcement__NW__MS_template(const MBMS__Announcement__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMS__Announcement__NW__MS_template::match(const MBMS__Announcement__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.tMGI().is_bound()) return FALSE;
if(!single_value->field_tMGI.match(other_value.tMGI(), legacy))return FALSE;
if(!other_value.mBMS__SessionIdentity().is_bound()) return FALSE;
if((other_value.mBMS__SessionIdentity().ispresent() ? !single_value->field_mBMS__SessionIdentity.match((const MBMS__SessionIdentity__TV&)other_value.mBMS__SessionIdentity(), legacy) : !single_value->field_mBMS__SessionIdentity.match_omit(legacy)))return FALSE;
if(!other_value.mBMS__CountingChannelDescription().is_bound()) return FALSE;
if((other_value.mBMS__CountingChannelDescription().ispresent() ? !single_value->field_mBMS__CountingChannelDescription.match((const MPRACH__Description__TLV&)other_value.mBMS__CountingChannelDescription(), legacy) : !single_value->field_mBMS__CountingChannelDescription.match_omit(legacy)))return FALSE;
if(!other_value.mBMS__ptm__ChannelDescription().is_bound()) return FALSE;
if((other_value.mBMS__ptm__ChannelDescription().ispresent() ? !single_value->field_mBMS__ptm__ChannelDescription.match((const MBMS__ptm__ChannelDescription__TLV&)other_value.mBMS__ptm__ChannelDescription(), legacy) : !single_value->field_mBMS__ptm__ChannelDescription.match_omit(legacy)))return FALSE;
if(!other_value.mBMS__SessionParameterList().is_bound()) return FALSE;
if((other_value.mBMS__SessionParameterList().ispresent() ? !single_value->field_mBMS__SessionParameterList.match((const MBMS__SessionParameterList__TLV&)other_value.mBMS__SessionParameterList(), legacy) : !single_value->field_mBMS__SessionParameterList.match_omit(legacy)))return FALSE;
if(!other_value.restrictionTimer().is_bound()) return FALSE;
if((other_value.restrictionTimer().ispresent() ? !single_value->field_restrictionTimer.match((const RestrictionTimer__TV&)other_value.restrictionTimer(), legacy) : !single_value->field_restrictionTimer.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.MBMS_Announcement_NW_MS.");
}
return FALSE;
}

boolean MBMS__Announcement__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_tMGI.is_bound()
 || (single_value->field_mBMS__SessionIdentity.is_omit() || single_value->field_mBMS__SessionIdentity.is_bound())
 || (single_value->field_mBMS__CountingChannelDescription.is_omit() || single_value->field_mBMS__CountingChannelDescription.is_bound())
 || (single_value->field_mBMS__ptm__ChannelDescription.is_omit() || single_value->field_mBMS__ptm__ChannelDescription.is_bound())
 || (single_value->field_mBMS__SessionParameterList.is_omit() || single_value->field_mBMS__SessionParameterList.is_bound())
 || (single_value->field_restrictionTimer.is_omit() || single_value->field_restrictionTimer.is_bound());
}

boolean MBMS__Announcement__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_tMGI.is_value()
 && (single_value->field_mBMS__SessionIdentity.is_omit() || single_value->field_mBMS__SessionIdentity.is_value())
 && (single_value->field_mBMS__CountingChannelDescription.is_omit() || single_value->field_mBMS__CountingChannelDescription.is_value())
 && (single_value->field_mBMS__ptm__ChannelDescription.is_omit() || single_value->field_mBMS__ptm__ChannelDescription.is_value())
 && (single_value->field_mBMS__SessionParameterList.is_omit() || single_value->field_mBMS__SessionParameterList.is_value())
 && (single_value->field_restrictionTimer.is_omit() || single_value->field_restrictionTimer.is_value());
}

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

MBMS__Announcement__NW__MS MBMS__Announcement__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.MBMS_Announcement_NW_MS.");
MBMS__Announcement__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_tMGI.is_bound()) {
ret_val.tMGI() = single_value->field_tMGI.valueof();
}
if (single_value->field_mBMS__SessionIdentity.is_omit()) ret_val.mBMS__SessionIdentity() = OMIT_VALUE;
else if (single_value->field_mBMS__SessionIdentity.is_bound()) {
ret_val.mBMS__SessionIdentity() = single_value->field_mBMS__SessionIdentity.valueof();
}
if (single_value->field_mBMS__CountingChannelDescription.is_omit()) ret_val.mBMS__CountingChannelDescription() = OMIT_VALUE;
else if (single_value->field_mBMS__CountingChannelDescription.is_bound()) {
ret_val.mBMS__CountingChannelDescription() = single_value->field_mBMS__CountingChannelDescription.valueof();
}
if (single_value->field_mBMS__ptm__ChannelDescription.is_omit()) ret_val.mBMS__ptm__ChannelDescription() = OMIT_VALUE;
else if (single_value->field_mBMS__ptm__ChannelDescription.is_bound()) {
ret_val.mBMS__ptm__ChannelDescription() = single_value->field_mBMS__ptm__ChannelDescription.valueof();
}
if (single_value->field_mBMS__SessionParameterList.is_omit()) ret_val.mBMS__SessionParameterList() = OMIT_VALUE;
else if (single_value->field_mBMS__SessionParameterList.is_bound()) {
ret_val.mBMS__SessionParameterList() = single_value->field_mBMS__SessionParameterList.valueof();
}
if (single_value->field_restrictionTimer.is_omit()) ret_val.restrictionTimer() = OMIT_VALUE;
else if (single_value->field_restrictionTimer.is_bound()) {
ret_val.restrictionTimer() = single_value->field_restrictionTimer.valueof();
}
return ret_val;
}

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

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

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

const BITSTRING_template& MBMS__Announcement__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.MBMS_Announcement_NW_MS.");
return single_value->field_messageType;
}

MobileL3__GMM__SM__Types::TemporaryMobileGroupIDLV_template& MBMS__Announcement__NW__MS_template::tMGI()
{
set_specific();
return single_value->field_tMGI;
}

const MobileL3__GMM__SM__Types::TemporaryMobileGroupIDLV_template& MBMS__Announcement__NW__MS_template::tMGI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tMGI of a non-specific template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS.");
return single_value->field_tMGI;
}

MBMS__SessionIdentity__TV_template& MBMS__Announcement__NW__MS_template::mBMS__SessionIdentity()
{
set_specific();
return single_value->field_mBMS__SessionIdentity;
}

const MBMS__SessionIdentity__TV_template& MBMS__Announcement__NW__MS_template::mBMS__SessionIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_SessionIdentity of a non-specific template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS.");
return single_value->field_mBMS__SessionIdentity;
}

MPRACH__Description__TLV_template& MBMS__Announcement__NW__MS_template::mBMS__CountingChannelDescription()
{
set_specific();
return single_value->field_mBMS__CountingChannelDescription;
}

const MPRACH__Description__TLV_template& MBMS__Announcement__NW__MS_template::mBMS__CountingChannelDescription() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_CountingChannelDescription of a non-specific template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS.");
return single_value->field_mBMS__CountingChannelDescription;
}

MBMS__ptm__ChannelDescription__TLV_template& MBMS__Announcement__NW__MS_template::mBMS__ptm__ChannelDescription()
{
set_specific();
return single_value->field_mBMS__ptm__ChannelDescription;
}

const MBMS__ptm__ChannelDescription__TLV_template& MBMS__Announcement__NW__MS_template::mBMS__ptm__ChannelDescription() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_ptm_ChannelDescription of a non-specific template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS.");
return single_value->field_mBMS__ptm__ChannelDescription;
}

MBMS__SessionParameterList__TLV_template& MBMS__Announcement__NW__MS_template::mBMS__SessionParameterList()
{
set_specific();
return single_value->field_mBMS__SessionParameterList;
}

const MBMS__SessionParameterList__TLV_template& MBMS__Announcement__NW__MS_template::mBMS__SessionParameterList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_SessionParameterList of a non-specific template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS.");
return single_value->field_mBMS__SessionParameterList;
}

RestrictionTimer__TV_template& MBMS__Announcement__NW__MS_template::restrictionTimer()
{
set_specific();
return single_value->field_restrictionTimer;
}

const RestrictionTimer__TV_template& MBMS__Announcement__NW__MS_template::restrictionTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field restrictionTimer of a non-specific template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS.");
return single_value->field_restrictionTimer;
}

int MBMS__Announcement__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_mBMS__SessionIdentity.is_present()) ret_val++;
      if (single_value->field_mBMS__CountingChannelDescription.is_present()) ret_val++;
      if (single_value->field_mBMS__ptm__ChannelDescription.is_present()) ret_val++;
      if (single_value->field_mBMS__SessionParameterList.is_present()) ret_val++;
      if (single_value->field_restrictionTimer.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.MBMS_Announcement_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.MBMS_Announcement_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.MBMS_Announcement_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.MBMS_Announcement_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS.");
  }
  return 0;
}

void MBMS__Announcement__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(", tMGI := ");
single_value->field_tMGI.log();
TTCN_Logger::log_event_str(", mBMS_SessionIdentity := ");
single_value->field_mBMS__SessionIdentity.log();
TTCN_Logger::log_event_str(", mBMS_CountingChannelDescription := ");
single_value->field_mBMS__CountingChannelDescription.log();
TTCN_Logger::log_event_str(", mBMS_ptm_ChannelDescription := ");
single_value->field_mBMS__ptm__ChannelDescription.log();
TTCN_Logger::log_event_str(", mBMS_SessionParameterList := ");
single_value->field_mBMS__SessionParameterList.log();
TTCN_Logger::log_event_str(", restrictionTimer := ");
single_value->field_restrictionTimer.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void MBMS__Announcement__NW__MS_template::log_match(const MBMS__Announcement__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_tMGI.match(match_value.tMGI(), legacy)){
TTCN_Logger::log_logmatch_info(".tMGI");
single_value->field_tMGI.log_match(match_value.tMGI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mBMS__SessionIdentity().ispresent()){
if(!single_value->field_mBMS__SessionIdentity.match(match_value.mBMS__SessionIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_SessionIdentity");
single_value->field_mBMS__SessionIdentity.log_match(match_value.mBMS__SessionIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__SessionIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_SessionIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__SessionIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mBMS__CountingChannelDescription().ispresent()){
if(!single_value->field_mBMS__CountingChannelDescription.match(match_value.mBMS__CountingChannelDescription(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_CountingChannelDescription");
single_value->field_mBMS__CountingChannelDescription.log_match(match_value.mBMS__CountingChannelDescription(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__CountingChannelDescription.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_CountingChannelDescription := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__CountingChannelDescription.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mBMS__ptm__ChannelDescription().ispresent()){
if(!single_value->field_mBMS__ptm__ChannelDescription.match(match_value.mBMS__ptm__ChannelDescription(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_ptm_ChannelDescription");
single_value->field_mBMS__ptm__ChannelDescription.log_match(match_value.mBMS__ptm__ChannelDescription(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__ptm__ChannelDescription.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_ptm_ChannelDescription := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__ptm__ChannelDescription.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mBMS__SessionParameterList().ispresent()){
if(!single_value->field_mBMS__SessionParameterList.match(match_value.mBMS__SessionParameterList(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_SessionParameterList");
single_value->field_mBMS__SessionParameterList.log_match(match_value.mBMS__SessionParameterList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__SessionParameterList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_SessionParameterList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__SessionParameterList.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.restrictionTimer().ispresent()){
if(!single_value->field_restrictionTimer.match(match_value.restrictionTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".restrictionTimer");
single_value->field_restrictionTimer.log_match(match_value.restrictionTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_restrictionTimer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".restrictionTimer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_restrictionTimer.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(", tMGI := ");
single_value->field_tMGI.log_match(match_value.tMGI(), legacy);
TTCN_Logger::log_event_str(", mBMS_SessionIdentity := ");
if (match_value.mBMS__SessionIdentity().ispresent()) {
single_value->field_mBMS__SessionIdentity.log_match(match_value.mBMS__SessionIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__SessionIdentity.log();
if (single_value->field_mBMS__SessionIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mBMS_CountingChannelDescription := ");
if (match_value.mBMS__CountingChannelDescription().ispresent()) {
single_value->field_mBMS__CountingChannelDescription.log_match(match_value.mBMS__CountingChannelDescription(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__CountingChannelDescription.log();
if (single_value->field_mBMS__CountingChannelDescription.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mBMS_ptm_ChannelDescription := ");
if (match_value.mBMS__ptm__ChannelDescription().ispresent()) {
single_value->field_mBMS__ptm__ChannelDescription.log_match(match_value.mBMS__ptm__ChannelDescription(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__ptm__ChannelDescription.log();
if (single_value->field_mBMS__ptm__ChannelDescription.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mBMS_SessionParameterList := ");
if (match_value.mBMS__SessionParameterList().ispresent()) {
single_value->field_mBMS__SessionParameterList.log_match(match_value.mBMS__SessionParameterList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__SessionParameterList.log();
if (single_value->field_mBMS__SessionParameterList.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", restrictionTimer := ");
if (match_value.restrictionTimer().ispresent()) {
single_value->field_restrictionTimer.log_match(match_value.restrictionTimer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_restrictionTimer.log();
if (single_value->field_restrictionTimer.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 MBMS__Announcement__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_tMGI.encode_text(text_buf);
single_value->field_mBMS__SessionIdentity.encode_text(text_buf);
single_value->field_mBMS__CountingChannelDescription.encode_text(text_buf);
single_value->field_mBMS__ptm__ChannelDescription.encode_text(text_buf);
single_value->field_mBMS__SessionParameterList.encode_text(text_buf);
single_value->field_restrictionTimer.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.MBMS_Announcement_NW_MS.");
}
}

void MBMS__Announcement__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_tMGI.decode_text(text_buf);
single_value->field_mBMS__SessionIdentity.decode_text(text_buf);
single_value->field_mBMS__CountingChannelDescription.decode_text(text_buf);
single_value->field_mBMS__ptm__ChannelDescription.decode_text(text_buf);
single_value->field_mBMS__SessionParameterList.decode_text(text_buf);
single_value->field_restrictionTimer.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MBMS__Announcement__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.MBMS_Announcement_NW_MS.");
}
}

void MBMS__Announcement__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: {
    MBMS__Announcement__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.MBMS_Announcement_NW_MS has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tMGI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS__SessionIdentity().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mBMS__CountingChannelDescription().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mBMS__ptm__ChannelDescription().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mBMS__SessionParameterList().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) restrictionTimer().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMGI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMGI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_SessionIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__SessionIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_CountingChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__CountingChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_ptm_ChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ptm__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(), "mBMS_SessionParameterList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__SessionParameterList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "restrictionTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          restrictionTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.MBMS_Announcement_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__Announcement__NW__MS_template* precondition = new MBMS__Announcement__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__Announcement__NW__MS_template* implied_template = new MBMS__Announcement__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__Announcement__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.MBMS_Announcement_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void MBMS__Announcement__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.MBMS_Announcement_NW_MS");
single_value->field_tMGI.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.MBMS_Announcement_NW_MS");
single_value->field_mBMS__SessionIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.MBMS_Announcement_NW_MS");
single_value->field_mBMS__CountingChannelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.MBMS_Announcement_NW_MS");
single_value->field_mBMS__ptm__ChannelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.MBMS_Announcement_NW_MS");
single_value->field_mBMS__SessionParameterList.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.MBMS_Announcement_NW_MS");
single_value->field_restrictionTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.MBMS_Announcement_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.MBMS_Announcement_NW_MS");
}

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

boolean MBMS__Announcement__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__PagingReq__Type1__NW__MS::PDU__RRM__PagingReq__Type1__NW__MS()
{
}

PDU__RRM__PagingReq__Type1__NW__MS::PDU__RRM__PagingReq__Type1__NW__MS(const BITSTRING& par_messageType,
    const PageMode__V& par_pageMode,
    const ChannelNeeded__V& par_channelNeeded,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity1,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_mobileIdentity2,
    const OCTETSTRING& par_p1RestOctets)
  :   field_messageType(par_messageType),
  field_pageMode(par_pageMode),
  field_channelNeeded(par_channelNeeded),
  field_mobileIdentity1(par_mobileIdentity1),
  field_mobileIdentity2(par_mobileIdentity2),
  field_p1RestOctets(par_p1RestOctets)
{
}

PDU__RRM__PagingReq__Type1__NW__MS::PDU__RRM__PagingReq__Type1__NW__MS(const PDU__RRM__PagingReq__Type1__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_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.channelNeeded().is_bound()) field_channelNeeded = other_value.channelNeeded();
else field_channelNeeded.clean_up();
if (other_value.mobileIdentity1().is_bound()) field_mobileIdentity1 = other_value.mobileIdentity1();
else field_mobileIdentity1.clean_up();
if (other_value.mobileIdentity2().is_bound()) field_mobileIdentity2 = other_value.mobileIdentity2();
else field_mobileIdentity2.clean_up();
if (other_value.p1RestOctets().is_bound()) field_p1RestOctets = other_value.p1RestOctets();
else field_p1RestOctets.clean_up();
}

void PDU__RRM__PagingReq__Type1__NW__MS::clean_up()
{
field_messageType.clean_up();
field_pageMode.clean_up();
field_channelNeeded.clean_up();
field_mobileIdentity1.clean_up();
field_mobileIdentity2.clean_up();
field_p1RestOctets.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__PagingReq__Type1__NW__MS::get_descriptor() const { return &PDU__RRM__PagingReq__Type1__NW__MS_descr_; }
PDU__RRM__PagingReq__Type1__NW__MS& PDU__RRM__PagingReq__Type1__NW__MS::operator=(const PDU__RRM__PagingReq__Type1__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_PagingReq_Type1_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.channelNeeded().is_bound()) field_channelNeeded = other_value.channelNeeded();
  else field_channelNeeded.clean_up();
  if (other_value.mobileIdentity1().is_bound()) field_mobileIdentity1 = other_value.mobileIdentity1();
  else field_mobileIdentity1.clean_up();
  if (other_value.mobileIdentity2().is_bound()) field_mobileIdentity2 = other_value.mobileIdentity2();
  else field_mobileIdentity2.clean_up();
  if (other_value.p1RestOctets().is_bound()) field_p1RestOctets = other_value.p1RestOctets();
  else field_p1RestOctets.clean_up();
}
return *this;
}

boolean PDU__RRM__PagingReq__Type1__NW__MS::operator==(const PDU__RRM__PagingReq__Type1__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_pageMode==other_value.field_pageMode
  && field_channelNeeded==other_value.field_channelNeeded
  && field_mobileIdentity1==other_value.field_mobileIdentity1
  && field_mobileIdentity2==other_value.field_mobileIdentity2
  && field_p1RestOctets==other_value.field_p1RestOctets;
}

boolean PDU__RRM__PagingReq__Type1__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_pageMode.is_bound())
  || (field_channelNeeded.is_bound())
  || (field_mobileIdentity1.is_bound())
  || (OPTIONAL_OMIT == field_mobileIdentity2.get_selection() || field_mobileIdentity2.is_bound())
  || (field_p1RestOctets.is_bound());
}
boolean PDU__RRM__PagingReq__Type1__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_pageMode.is_value()
  && field_channelNeeded.is_value()
  && field_mobileIdentity1.is_value()
  && (OPTIONAL_OMIT == field_mobileIdentity2.get_selection() || field_mobileIdentity2.is_value())
  && field_p1RestOctets.is_value();
}
int PDU__RRM__PagingReq__Type1__NW__MS::size_of() const
{
  int ret_val = 5;
  if (field_mobileIdentity2.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__PagingReq__Type1__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(", channelNeeded := ");
field_channelNeeded.log();
TTCN_Logger::log_event_str(", mobileIdentity1 := ");
field_mobileIdentity1.log();
TTCN_Logger::log_event_str(", mobileIdentity2 := ");
field_mobileIdentity2.log();
TTCN_Logger::log_event_str(", p1RestOctets := ");
field_p1RestOctets.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__PagingReq__Type1__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (channelNeeded().is_bound()) channelNeeded().set_implicit_omit();
if (mobileIdentity1().is_bound()) mobileIdentity1().set_implicit_omit();
if (!mobileIdentity2().is_bound()) mobileIdentity2() = OMIT_VALUE;
else mobileIdentity2().set_implicit_omit();
if (p1RestOctets().is_bound()) p1RestOctets().set_implicit_omit();
}

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

void PDU__RRM__PagingReq__Type1__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_pageMode.encode_text(text_buf);
field_channelNeeded.encode_text(text_buf);
field_mobileIdentity1.encode_text(text_buf);
field_mobileIdentity2.encode_text(text_buf);
field_p1RestOctets.encode_text(text_buf);
}

void PDU__RRM__PagingReq__Type1__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_pageMode.decode_text(text_buf);
field_channelNeeded.decode_text(text_buf);
field_mobileIdentity1.decode_text(text_buf);
field_mobileIdentity2.decode_text(text_buf);
field_p1RestOctets.decode_text(text_buf);
}

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

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

int PDU__RRM__PagingReq__Type1__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, ChannelNeeded__V_descr_.raw->forceomit);
  decoded_field_length = field_channelNeeded.RAW_decode(ChannelNeeded__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity1.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_mobileIdentity2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity2().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_mobileIdentity2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileIdentity2.ispresent() || field_mobileIdentity2().elementIdentifier() !=  bs_5){
  field_mobileIdentity2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileIdentity2=OMIT_VALUE;
  RAW_Force_Omit field_5_force_omit(5, force_omit, P1RestOctets_descr_.raw->forceomit);
  decoded_field_length = field_p1RestOctets.RAW_decode(P1RestOctets_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__PagingReq__Type1__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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, ChannelNeeded__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  if (field_mobileIdentity2.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, P1RestOctets_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_channelNeeded.RAW_encode(ChannelNeeded__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mobileIdentity1.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[3]);
  if (field_mobileIdentity2.ispresent()) {
  encoded_length += field_mobileIdentity2().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[4]);
  }
  encoded_length += field_p1RestOctets.RAW_encode(P1RestOctets_descr_, *myleaf.body.node.nodes[5]);
  if (field_mobileIdentity2.ispresent() && (!field_mobileIdentity2.ispresent() || field_mobileIdentity2().elementIdentifier() !=  bs_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_5.RAW_encode(General__Types::BIT7_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__PagingReq__Type1__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
PageMode__V_template field_pageMode;
ChannelNeeded__V_template field_channelNeeded;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentity1;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_mobileIdentity2;
OCTETSTRING_template field_p1RestOctets;
};

void PDU__RRM__PagingReq__Type1__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_channelNeeded = ANY_VALUE;
single_value->field_mobileIdentity1 = ANY_VALUE;
single_value->field_mobileIdentity2 = ANY_OR_OMIT;
single_value->field_p1RestOctets = ANY_VALUE;
}
}
}

void PDU__RRM__PagingReq__Type1__NW__MS_template::copy_value(const PDU__RRM__PagingReq__Type1__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.channelNeeded().is_bound()) {
  single_value->field_channelNeeded = other_value.channelNeeded();
} else {
  single_value->field_channelNeeded.clean_up();
}
if (other_value.mobileIdentity1().is_bound()) {
  single_value->field_mobileIdentity1 = other_value.mobileIdentity1();
} else {
  single_value->field_mobileIdentity1.clean_up();
}
if (other_value.mobileIdentity2().is_bound()) {
  if (other_value.mobileIdentity2().ispresent()) single_value->field_mobileIdentity2 = other_value.mobileIdentity2()();
  else single_value->field_mobileIdentity2 = OMIT_VALUE;
} else {
  single_value->field_mobileIdentity2.clean_up();
}
if (other_value.p1RestOctets().is_bound()) {
  single_value->field_p1RestOctets = other_value.p1RestOctets();
} else {
  single_value->field_p1RestOctets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__PagingReq__Type1__NW__MS_template::copy_template(const PDU__RRM__PagingReq__Type1__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.channelNeeded().get_selection()) {
single_value->field_channelNeeded = other_value.channelNeeded();
} else {
single_value->field_channelNeeded.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity1().get_selection()) {
single_value->field_mobileIdentity1 = other_value.mobileIdentity1();
} else {
single_value->field_mobileIdentity1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity2().get_selection()) {
single_value->field_mobileIdentity2 = other_value.mobileIdentity2();
} else {
single_value->field_mobileIdentity2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.p1RestOctets().get_selection()) {
single_value->field_p1RestOctets = other_value.p1RestOctets();
} else {
single_value->field_p1RestOctets.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__PagingReq__Type1__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__PagingReq__Type1__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__PagingReq__Type1__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_PagingReq_Type1_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__PagingReq__Type1__NW__MS_template::PDU__RRM__PagingReq__Type1__NW__MS_template()
{
}

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

PDU__RRM__PagingReq__Type1__NW__MS_template::PDU__RRM__PagingReq__Type1__NW__MS_template(const PDU__RRM__PagingReq__Type1__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__PagingReq__Type1__NW__MS_template::PDU__RRM__PagingReq__Type1__NW__MS_template(const OPTIONAL<PDU__RRM__PagingReq__Type1__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__PagingReq__Type1__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_PagingReq_Type1_NW_MS from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__PagingReq__Type1__NW__MS_template::match(const PDU__RRM__PagingReq__Type1__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.channelNeeded().is_bound()) return FALSE;
if(!single_value->field_channelNeeded.match(other_value.channelNeeded(), legacy))return FALSE;
if(!other_value.mobileIdentity1().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity1.match(other_value.mobileIdentity1(), legacy))return FALSE;
if(!other_value.mobileIdentity2().is_bound()) return FALSE;
if((other_value.mobileIdentity2().ispresent() ? !single_value->field_mobileIdentity2.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.mobileIdentity2(), legacy) : !single_value->field_mobileIdentity2.match_omit(legacy)))return FALSE;
if(!other_value.p1RestOctets().is_bound()) return FALSE;
if(!single_value->field_p1RestOctets.match(other_value.p1RestOctets(), 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_PagingReq_Type1_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__PagingReq__Type1__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_channelNeeded.is_bound()
 || single_value->field_mobileIdentity1.is_bound()
 || (single_value->field_mobileIdentity2.is_omit() || single_value->field_mobileIdentity2.is_bound())
 || single_value->field_p1RestOctets.is_bound();
}

boolean PDU__RRM__PagingReq__Type1__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_channelNeeded.is_value()
 && single_value->field_mobileIdentity1.is_value()
 && (single_value->field_mobileIdentity2.is_omit() || single_value->field_mobileIdentity2.is_value())
 && single_value->field_p1RestOctets.is_value();
}

void PDU__RRM__PagingReq__Type1__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__PagingReq__Type1__NW__MS PDU__RRM__PagingReq__Type1__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_PagingReq_Type1_NW_MS.");
PDU__RRM__PagingReq__Type1__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_channelNeeded.is_bound()) {
ret_val.channelNeeded() = single_value->field_channelNeeded.valueof();
}
if (single_value->field_mobileIdentity1.is_bound()) {
ret_val.mobileIdentity1() = single_value->field_mobileIdentity1.valueof();
}
if (single_value->field_mobileIdentity2.is_omit()) ret_val.mobileIdentity2() = OMIT_VALUE;
else if (single_value->field_mobileIdentity2.is_bound()) {
ret_val.mobileIdentity2() = single_value->field_mobileIdentity2.valueof();
}
if (single_value->field_p1RestOctets.is_bound()) {
ret_val.p1RestOctets() = single_value->field_p1RestOctets.valueof();
}
return ret_val;
}

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

PDU__RRM__PagingReq__Type1__NW__MS_template& PDU__RRM__PagingReq__Type1__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_PagingReq_Type1_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_PagingReq_Type1_NW_MS.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__PagingReq__Type1__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_PagingReq_Type1_NW_MS.");
return single_value->field_messageType;
}

PageMode__V_template& PDU__RRM__PagingReq__Type1__NW__MS_template::pageMode()
{
set_specific();
return single_value->field_pageMode;
}

const PageMode__V_template& PDU__RRM__PagingReq__Type1__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_PagingReq_Type1_NW_MS.");
return single_value->field_pageMode;
}

ChannelNeeded__V_template& PDU__RRM__PagingReq__Type1__NW__MS_template::channelNeeded()
{
set_specific();
return single_value->field_channelNeeded;
}

const ChannelNeeded__V_template& PDU__RRM__PagingReq__Type1__NW__MS_template::channelNeeded() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelNeeded of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS.");
return single_value->field_channelNeeded;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__RRM__PagingReq__Type1__NW__MS_template::mobileIdentity1()
{
set_specific();
return single_value->field_mobileIdentity1;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__RRM__PagingReq__Type1__NW__MS_template::mobileIdentity1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS.");
return single_value->field_mobileIdentity1;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__RRM__PagingReq__Type1__NW__MS_template::mobileIdentity2()
{
set_specific();
return single_value->field_mobileIdentity2;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__RRM__PagingReq__Type1__NW__MS_template::mobileIdentity2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS.");
return single_value->field_mobileIdentity2;
}

OCTETSTRING_template& PDU__RRM__PagingReq__Type1__NW__MS_template::p1RestOctets()
{
set_specific();
return single_value->field_p1RestOctets;
}

const OCTETSTRING_template& PDU__RRM__PagingReq__Type1__NW__MS_template::p1RestOctets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p1RestOctets of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS.");
return single_value->field_p1RestOctets;
}

int PDU__RRM__PagingReq__Type1__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_mobileIdentity2.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_PagingReq_Type1_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_PagingReq_Type1_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_PagingReq_Type1_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_PagingReq_Type1_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_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_PagingReq_Type1_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS.");
  }
  return 0;
}

void PDU__RRM__PagingReq__Type1__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(", channelNeeded := ");
single_value->field_channelNeeded.log();
TTCN_Logger::log_event_str(", mobileIdentity1 := ");
single_value->field_mobileIdentity1.log();
TTCN_Logger::log_event_str(", mobileIdentity2 := ");
single_value->field_mobileIdentity2.log();
TTCN_Logger::log_event_str(", p1RestOctets := ");
single_value->field_p1RestOctets.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__PagingReq__Type1__NW__MS_template::log_match(const PDU__RRM__PagingReq__Type1__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_channelNeeded.match(match_value.channelNeeded(), legacy)){
TTCN_Logger::log_logmatch_info(".channelNeeded");
single_value->field_channelNeeded.log_match(match_value.channelNeeded(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity1.match(match_value.mobileIdentity1(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity1");
single_value->field_mobileIdentity1.log_match(match_value.mobileIdentity1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mobileIdentity2().ispresent()){
if(!single_value->field_mobileIdentity2.match(match_value.mobileIdentity2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity2");
single_value->field_mobileIdentity2.log_match(match_value.mobileIdentity2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileIdentity2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileIdentity2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileIdentity2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_p1RestOctets.match(match_value.p1RestOctets(), legacy)){
TTCN_Logger::log_logmatch_info(".p1RestOctets");
single_value->field_p1RestOctets.log_match(match_value.p1RestOctets(), 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(", channelNeeded := ");
single_value->field_channelNeeded.log_match(match_value.channelNeeded(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity1 := ");
single_value->field_mobileIdentity1.log_match(match_value.mobileIdentity1(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity2 := ");
if (match_value.mobileIdentity2().ispresent()) {
single_value->field_mobileIdentity2.log_match(match_value.mobileIdentity2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileIdentity2.log();
if (single_value->field_mobileIdentity2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", p1RestOctets := ");
single_value->field_p1RestOctets.log_match(match_value.p1RestOctets(), 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__PagingReq__Type1__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_channelNeeded.encode_text(text_buf);
single_value->field_mobileIdentity1.encode_text(text_buf);
single_value->field_mobileIdentity2.encode_text(text_buf);
single_value->field_p1RestOctets.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_PagingReq_Type1_NW_MS.");
}
}

void PDU__RRM__PagingReq__Type1__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_channelNeeded.decode_text(text_buf);
single_value->field_mobileIdentity1.decode_text(text_buf);
single_value->field_mobileIdentity2.decode_text(text_buf);
single_value->field_p1RestOctets.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__PagingReq__Type1__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_PagingReq_Type1_NW_MS.");
}
}

void PDU__RRM__PagingReq__Type1__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__PagingReq__Type1__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelNeeded().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) p1RestOctets().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "channelNeeded")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelNeeded().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p1RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p1RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_PagingReq_Type1_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__PagingReq__Type1__NW__MS_template* precondition = new PDU__RRM__PagingReq__Type1__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__PagingReq__Type1__NW__MS_template* implied_template = new PDU__RRM__PagingReq__Type1__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__PagingReq__Type1__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__PagingReq__Type1__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_PagingReq_Type1_NW_MS");
single_value->field_pageMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS");
single_value->field_channelNeeded.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS");
single_value->field_mobileIdentity1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS");
single_value->field_mobileIdentity2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_NW_MS");
single_value->field_p1RestOctets.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type1_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_PagingReq_Type1_NW_MS");
}

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

boolean PDU__RRM__PagingReq__Type1__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__PagingReq__Type2__NW__MS::PDU__RRM__PagingReq__Type2__NW__MS()
{
}

PDU__RRM__PagingReq__Type2__NW__MS::PDU__RRM__PagingReq__Type2__NW__MS(const BITSTRING& par_messageType,
    const PageMode__V& par_pageMode,
    const ChannelNeeded__V& par_channelNeeded,
    const OCTETSTRING& par_mobileIdentity1,
    const OCTETSTRING& par_mobileIdentity2,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_mobileIdentity3,
    const OCTETSTRING& par_p2RestOctets)
  :   field_messageType(par_messageType),
  field_pageMode(par_pageMode),
  field_channelNeeded(par_channelNeeded),
  field_mobileIdentity1(par_mobileIdentity1),
  field_mobileIdentity2(par_mobileIdentity2),
  field_mobileIdentity3(par_mobileIdentity3),
  field_p2RestOctets(par_p2RestOctets)
{
}

PDU__RRM__PagingReq__Type2__NW__MS::PDU__RRM__PagingReq__Type2__NW__MS(const PDU__RRM__PagingReq__Type2__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_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.channelNeeded().is_bound()) field_channelNeeded = other_value.channelNeeded();
else field_channelNeeded.clean_up();
if (other_value.mobileIdentity1().is_bound()) field_mobileIdentity1 = other_value.mobileIdentity1();
else field_mobileIdentity1.clean_up();
if (other_value.mobileIdentity2().is_bound()) field_mobileIdentity2 = other_value.mobileIdentity2();
else field_mobileIdentity2.clean_up();
if (other_value.mobileIdentity3().is_bound()) field_mobileIdentity3 = other_value.mobileIdentity3();
else field_mobileIdentity3.clean_up();
if (other_value.p2RestOctets().is_bound()) field_p2RestOctets = other_value.p2RestOctets();
else field_p2RestOctets.clean_up();
}

void PDU__RRM__PagingReq__Type2__NW__MS::clean_up()
{
field_messageType.clean_up();
field_pageMode.clean_up();
field_channelNeeded.clean_up();
field_mobileIdentity1.clean_up();
field_mobileIdentity2.clean_up();
field_mobileIdentity3.clean_up();
field_p2RestOctets.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__PagingReq__Type2__NW__MS::get_descriptor() const { return &PDU__RRM__PagingReq__Type2__NW__MS_descr_; }
PDU__RRM__PagingReq__Type2__NW__MS& PDU__RRM__PagingReq__Type2__NW__MS::operator=(const PDU__RRM__PagingReq__Type2__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_PagingReq_Type2_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.channelNeeded().is_bound()) field_channelNeeded = other_value.channelNeeded();
  else field_channelNeeded.clean_up();
  if (other_value.mobileIdentity1().is_bound()) field_mobileIdentity1 = other_value.mobileIdentity1();
  else field_mobileIdentity1.clean_up();
  if (other_value.mobileIdentity2().is_bound()) field_mobileIdentity2 = other_value.mobileIdentity2();
  else field_mobileIdentity2.clean_up();
  if (other_value.mobileIdentity3().is_bound()) field_mobileIdentity3 = other_value.mobileIdentity3();
  else field_mobileIdentity3.clean_up();
  if (other_value.p2RestOctets().is_bound()) field_p2RestOctets = other_value.p2RestOctets();
  else field_p2RestOctets.clean_up();
}
return *this;
}

boolean PDU__RRM__PagingReq__Type2__NW__MS::operator==(const PDU__RRM__PagingReq__Type2__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_pageMode==other_value.field_pageMode
  && field_channelNeeded==other_value.field_channelNeeded
  && field_mobileIdentity1==other_value.field_mobileIdentity1
  && field_mobileIdentity2==other_value.field_mobileIdentity2
  && field_mobileIdentity3==other_value.field_mobileIdentity3
  && field_p2RestOctets==other_value.field_p2RestOctets;
}

boolean PDU__RRM__PagingReq__Type2__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_pageMode.is_bound())
  || (field_channelNeeded.is_bound())
  || (field_mobileIdentity1.is_bound())
  || (field_mobileIdentity2.is_bound())
  || (OPTIONAL_OMIT == field_mobileIdentity3.get_selection() || field_mobileIdentity3.is_bound())
  || (field_p2RestOctets.is_bound());
}
boolean PDU__RRM__PagingReq__Type2__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_pageMode.is_value()
  && field_channelNeeded.is_value()
  && field_mobileIdentity1.is_value()
  && field_mobileIdentity2.is_value()
  && (OPTIONAL_OMIT == field_mobileIdentity3.get_selection() || field_mobileIdentity3.is_value())
  && field_p2RestOctets.is_value();
}
int PDU__RRM__PagingReq__Type2__NW__MS::size_of() const
{
  int ret_val = 6;
  if (field_mobileIdentity3.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__PagingReq__Type2__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(", channelNeeded := ");
field_channelNeeded.log();
TTCN_Logger::log_event_str(", mobileIdentity1 := ");
field_mobileIdentity1.log();
TTCN_Logger::log_event_str(", mobileIdentity2 := ");
field_mobileIdentity2.log();
TTCN_Logger::log_event_str(", mobileIdentity3 := ");
field_mobileIdentity3.log();
TTCN_Logger::log_event_str(", p2RestOctets := ");
field_p2RestOctets.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__PagingReq__Type2__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (channelNeeded().is_bound()) channelNeeded().set_implicit_omit();
if (mobileIdentity1().is_bound()) mobileIdentity1().set_implicit_omit();
if (mobileIdentity2().is_bound()) mobileIdentity2().set_implicit_omit();
if (!mobileIdentity3().is_bound()) mobileIdentity3() = OMIT_VALUE;
else mobileIdentity3().set_implicit_omit();
if (p2RestOctets().is_bound()) p2RestOctets().set_implicit_omit();
}

void PDU__RRM__PagingReq__Type2__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelNeeded().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) p2RestOctets().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "channelNeeded")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelNeeded().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p2RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p2RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_PagingReq_Type2_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS");
  }
}

void PDU__RRM__PagingReq__Type2__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_pageMode.encode_text(text_buf);
field_channelNeeded.encode_text(text_buf);
field_mobileIdentity1.encode_text(text_buf);
field_mobileIdentity2.encode_text(text_buf);
field_mobileIdentity3.encode_text(text_buf);
field_p2RestOctets.encode_text(text_buf);
}

void PDU__RRM__PagingReq__Type2__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_pageMode.decode_text(text_buf);
field_channelNeeded.decode_text(text_buf);
field_mobileIdentity1.decode_text(text_buf);
field_mobileIdentity2.decode_text(text_buf);
field_mobileIdentity3.decode_text(text_buf);
field_p2RestOctets.decode_text(text_buf);
}

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

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

int PDU__RRM__PagingReq__Type2__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, ChannelNeeded__V_descr_.raw->forceomit);
  decoded_field_length = field_channelNeeded.RAW_decode(ChannelNeeded__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, TMSIP__TMSI__V_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity1.RAW_decode(TMSIP__TMSI__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, TMSIP__TMSI__V_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity2.RAW_decode(TMSIP__TMSI__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_mobileIdentity3 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity3().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_mobileIdentity3 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileIdentity3.ispresent() || field_mobileIdentity3().elementIdentifier() !=  bs_5){
  field_mobileIdentity3=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileIdentity3=OMIT_VALUE;
  RAW_Force_Omit field_6_force_omit(6, force_omit, P2RestOctets_descr_.raw->forceomit);
  decoded_field_length = field_p2RestOctets.RAW_decode(P2RestOctets_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__PagingReq__Type2__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::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, ChannelNeeded__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, TMSIP__TMSI__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, TMSIP__TMSI__V_descr_.raw);
  if (field_mobileIdentity3.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, P2RestOctets_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_channelNeeded.RAW_encode(ChannelNeeded__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mobileIdentity1.RAW_encode(TMSIP__TMSI__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mobileIdentity2.RAW_encode(TMSIP__TMSI__V_descr_, *myleaf.body.node.nodes[4]);
  if (field_mobileIdentity3.ispresent()) {
  encoded_length += field_mobileIdentity3().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  encoded_length += field_p2RestOctets.RAW_encode(P2RestOctets_descr_, *myleaf.body.node.nodes[6]);
  if (field_mobileIdentity3.ispresent() && (!field_mobileIdentity3.ispresent() || field_mobileIdentity3().elementIdentifier() !=  bs_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_5.RAW_encode(General__Types::BIT7_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__PagingReq__Type2__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
PageMode__V_template field_pageMode;
ChannelNeeded__V_template field_channelNeeded;
OCTETSTRING_template field_mobileIdentity1;
OCTETSTRING_template field_mobileIdentity2;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_mobileIdentity3;
OCTETSTRING_template field_p2RestOctets;
};

void PDU__RRM__PagingReq__Type2__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_channelNeeded = ANY_VALUE;
single_value->field_mobileIdentity1 = ANY_VALUE;
single_value->field_mobileIdentity2 = ANY_VALUE;
single_value->field_mobileIdentity3 = ANY_OR_OMIT;
single_value->field_p2RestOctets = ANY_VALUE;
}
}
}

void PDU__RRM__PagingReq__Type2__NW__MS_template::copy_value(const PDU__RRM__PagingReq__Type2__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.channelNeeded().is_bound()) {
  single_value->field_channelNeeded = other_value.channelNeeded();
} else {
  single_value->field_channelNeeded.clean_up();
}
if (other_value.mobileIdentity1().is_bound()) {
  single_value->field_mobileIdentity1 = other_value.mobileIdentity1();
} else {
  single_value->field_mobileIdentity1.clean_up();
}
if (other_value.mobileIdentity2().is_bound()) {
  single_value->field_mobileIdentity2 = other_value.mobileIdentity2();
} else {
  single_value->field_mobileIdentity2.clean_up();
}
if (other_value.mobileIdentity3().is_bound()) {
  if (other_value.mobileIdentity3().ispresent()) single_value->field_mobileIdentity3 = other_value.mobileIdentity3()();
  else single_value->field_mobileIdentity3 = OMIT_VALUE;
} else {
  single_value->field_mobileIdentity3.clean_up();
}
if (other_value.p2RestOctets().is_bound()) {
  single_value->field_p2RestOctets = other_value.p2RestOctets();
} else {
  single_value->field_p2RestOctets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__PagingReq__Type2__NW__MS_template::copy_template(const PDU__RRM__PagingReq__Type2__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.channelNeeded().get_selection()) {
single_value->field_channelNeeded = other_value.channelNeeded();
} else {
single_value->field_channelNeeded.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity1().get_selection()) {
single_value->field_mobileIdentity1 = other_value.mobileIdentity1();
} else {
single_value->field_mobileIdentity1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity2().get_selection()) {
single_value->field_mobileIdentity2 = other_value.mobileIdentity2();
} else {
single_value->field_mobileIdentity2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity3().get_selection()) {
single_value->field_mobileIdentity3 = other_value.mobileIdentity3();
} else {
single_value->field_mobileIdentity3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.p2RestOctets().get_selection()) {
single_value->field_p2RestOctets = other_value.p2RestOctets();
} else {
single_value->field_p2RestOctets.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__PagingReq__Type2__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__PagingReq__Type2__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__PagingReq__Type2__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_PagingReq_Type2_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__PagingReq__Type2__NW__MS_template::PDU__RRM__PagingReq__Type2__NW__MS_template()
{
}

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

PDU__RRM__PagingReq__Type2__NW__MS_template::PDU__RRM__PagingReq__Type2__NW__MS_template(const PDU__RRM__PagingReq__Type2__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__PagingReq__Type2__NW__MS_template::PDU__RRM__PagingReq__Type2__NW__MS_template(const OPTIONAL<PDU__RRM__PagingReq__Type2__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__PagingReq__Type2__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_PagingReq_Type2_NW_MS from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__PagingReq__Type2__NW__MS_template::match(const PDU__RRM__PagingReq__Type2__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.channelNeeded().is_bound()) return FALSE;
if(!single_value->field_channelNeeded.match(other_value.channelNeeded(), legacy))return FALSE;
if(!other_value.mobileIdentity1().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity1.match(other_value.mobileIdentity1(), legacy))return FALSE;
if(!other_value.mobileIdentity2().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity2.match(other_value.mobileIdentity2(), legacy))return FALSE;
if(!other_value.mobileIdentity3().is_bound()) return FALSE;
if((other_value.mobileIdentity3().ispresent() ? !single_value->field_mobileIdentity3.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.mobileIdentity3(), legacy) : !single_value->field_mobileIdentity3.match_omit(legacy)))return FALSE;
if(!other_value.p2RestOctets().is_bound()) return FALSE;
if(!single_value->field_p2RestOctets.match(other_value.p2RestOctets(), 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_PagingReq_Type2_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__PagingReq__Type2__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_channelNeeded.is_bound()
 || single_value->field_mobileIdentity1.is_bound()
 || single_value->field_mobileIdentity2.is_bound()
 || (single_value->field_mobileIdentity3.is_omit() || single_value->field_mobileIdentity3.is_bound())
 || single_value->field_p2RestOctets.is_bound();
}

boolean PDU__RRM__PagingReq__Type2__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_channelNeeded.is_value()
 && single_value->field_mobileIdentity1.is_value()
 && single_value->field_mobileIdentity2.is_value()
 && (single_value->field_mobileIdentity3.is_omit() || single_value->field_mobileIdentity3.is_value())
 && single_value->field_p2RestOctets.is_value();
}

void PDU__RRM__PagingReq__Type2__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__PagingReq__Type2__NW__MS PDU__RRM__PagingReq__Type2__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_PagingReq_Type2_NW_MS.");
PDU__RRM__PagingReq__Type2__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_channelNeeded.is_bound()) {
ret_val.channelNeeded() = single_value->field_channelNeeded.valueof();
}
if (single_value->field_mobileIdentity1.is_bound()) {
ret_val.mobileIdentity1() = single_value->field_mobileIdentity1.valueof();
}
if (single_value->field_mobileIdentity2.is_bound()) {
ret_val.mobileIdentity2() = single_value->field_mobileIdentity2.valueof();
}
if (single_value->field_mobileIdentity3.is_omit()) ret_val.mobileIdentity3() = OMIT_VALUE;
else if (single_value->field_mobileIdentity3.is_bound()) {
ret_val.mobileIdentity3() = single_value->field_mobileIdentity3.valueof();
}
if (single_value->field_p2RestOctets.is_bound()) {
ret_val.p2RestOctets() = single_value->field_p2RestOctets.valueof();
}
return ret_val;
}

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

PDU__RRM__PagingReq__Type2__NW__MS_template& PDU__RRM__PagingReq__Type2__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_PagingReq_Type2_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_PagingReq_Type2_NW_MS.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__PagingReq__Type2__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_PagingReq_Type2_NW_MS.");
return single_value->field_messageType;
}

PageMode__V_template& PDU__RRM__PagingReq__Type2__NW__MS_template::pageMode()
{
set_specific();
return single_value->field_pageMode;
}

const PageMode__V_template& PDU__RRM__PagingReq__Type2__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_PagingReq_Type2_NW_MS.");
return single_value->field_pageMode;
}

ChannelNeeded__V_template& PDU__RRM__PagingReq__Type2__NW__MS_template::channelNeeded()
{
set_specific();
return single_value->field_channelNeeded;
}

const ChannelNeeded__V_template& PDU__RRM__PagingReq__Type2__NW__MS_template::channelNeeded() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelNeeded of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS.");
return single_value->field_channelNeeded;
}

OCTETSTRING_template& PDU__RRM__PagingReq__Type2__NW__MS_template::mobileIdentity1()
{
set_specific();
return single_value->field_mobileIdentity1;
}

const OCTETSTRING_template& PDU__RRM__PagingReq__Type2__NW__MS_template::mobileIdentity1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS.");
return single_value->field_mobileIdentity1;
}

OCTETSTRING_template& PDU__RRM__PagingReq__Type2__NW__MS_template::mobileIdentity2()
{
set_specific();
return single_value->field_mobileIdentity2;
}

const OCTETSTRING_template& PDU__RRM__PagingReq__Type2__NW__MS_template::mobileIdentity2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS.");
return single_value->field_mobileIdentity2;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__RRM__PagingReq__Type2__NW__MS_template::mobileIdentity3()
{
set_specific();
return single_value->field_mobileIdentity3;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__RRM__PagingReq__Type2__NW__MS_template::mobileIdentity3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity3 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS.");
return single_value->field_mobileIdentity3;
}

OCTETSTRING_template& PDU__RRM__PagingReq__Type2__NW__MS_template::p2RestOctets()
{
set_specific();
return single_value->field_p2RestOctets;
}

const OCTETSTRING_template& PDU__RRM__PagingReq__Type2__NW__MS_template::p2RestOctets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p2RestOctets of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS.");
return single_value->field_p2RestOctets;
}

int PDU__RRM__PagingReq__Type2__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 6;
      if (single_value->field_mobileIdentity3.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_PagingReq_Type2_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_PagingReq_Type2_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_PagingReq_Type2_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_PagingReq_Type2_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_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_PagingReq_Type2_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS.");
  }
  return 0;
}

void PDU__RRM__PagingReq__Type2__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(", channelNeeded := ");
single_value->field_channelNeeded.log();
TTCN_Logger::log_event_str(", mobileIdentity1 := ");
single_value->field_mobileIdentity1.log();
TTCN_Logger::log_event_str(", mobileIdentity2 := ");
single_value->field_mobileIdentity2.log();
TTCN_Logger::log_event_str(", mobileIdentity3 := ");
single_value->field_mobileIdentity3.log();
TTCN_Logger::log_event_str(", p2RestOctets := ");
single_value->field_p2RestOctets.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__PagingReq__Type2__NW__MS_template::log_match(const PDU__RRM__PagingReq__Type2__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_channelNeeded.match(match_value.channelNeeded(), legacy)){
TTCN_Logger::log_logmatch_info(".channelNeeded");
single_value->field_channelNeeded.log_match(match_value.channelNeeded(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity1.match(match_value.mobileIdentity1(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity1");
single_value->field_mobileIdentity1.log_match(match_value.mobileIdentity1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity2.match(match_value.mobileIdentity2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity2");
single_value->field_mobileIdentity2.log_match(match_value.mobileIdentity2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mobileIdentity3().ispresent()){
if(!single_value->field_mobileIdentity3.match(match_value.mobileIdentity3(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity3");
single_value->field_mobileIdentity3.log_match(match_value.mobileIdentity3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileIdentity3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileIdentity3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileIdentity3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_p2RestOctets.match(match_value.p2RestOctets(), legacy)){
TTCN_Logger::log_logmatch_info(".p2RestOctets");
single_value->field_p2RestOctets.log_match(match_value.p2RestOctets(), 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(", channelNeeded := ");
single_value->field_channelNeeded.log_match(match_value.channelNeeded(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity1 := ");
single_value->field_mobileIdentity1.log_match(match_value.mobileIdentity1(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity2 := ");
single_value->field_mobileIdentity2.log_match(match_value.mobileIdentity2(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity3 := ");
if (match_value.mobileIdentity3().ispresent()) {
single_value->field_mobileIdentity3.log_match(match_value.mobileIdentity3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileIdentity3.log();
if (single_value->field_mobileIdentity3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", p2RestOctets := ");
single_value->field_p2RestOctets.log_match(match_value.p2RestOctets(), 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__PagingReq__Type2__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_channelNeeded.encode_text(text_buf);
single_value->field_mobileIdentity1.encode_text(text_buf);
single_value->field_mobileIdentity2.encode_text(text_buf);
single_value->field_mobileIdentity3.encode_text(text_buf);
single_value->field_p2RestOctets.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_PagingReq_Type2_NW_MS.");
}
}

void PDU__RRM__PagingReq__Type2__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_channelNeeded.decode_text(text_buf);
single_value->field_mobileIdentity1.decode_text(text_buf);
single_value->field_mobileIdentity2.decode_text(text_buf);
single_value->field_mobileIdentity3.decode_text(text_buf);
single_value->field_p2RestOctets.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__PagingReq__Type2__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_PagingReq_Type2_NW_MS.");
}
}

void PDU__RRM__PagingReq__Type2__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__PagingReq__Type2__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelNeeded().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) p2RestOctets().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "channelNeeded")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelNeeded().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p2RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p2RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_PagingReq_Type2_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__PagingReq__Type2__NW__MS_template* precondition = new PDU__RRM__PagingReq__Type2__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__PagingReq__Type2__NW__MS_template* implied_template = new PDU__RRM__PagingReq__Type2__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__PagingReq__Type2__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__PagingReq__Type2__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_PagingReq_Type2_NW_MS");
single_value->field_pageMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS");
single_value->field_channelNeeded.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS");
single_value->field_mobileIdentity1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS");
single_value->field_mobileIdentity2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS");
single_value->field_mobileIdentity3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_NW_MS");
single_value->field_p2RestOctets.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type2_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_PagingReq_Type2_NW_MS");
}

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

boolean PDU__RRM__PagingReq__Type2__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__PagingReq__Type3__NW__MS::PDU__RRM__PagingReq__Type3__NW__MS()
{
}

PDU__RRM__PagingReq__Type3__NW__MS::PDU__RRM__PagingReq__Type3__NW__MS(const BITSTRING& par_messageType,
    const PageMode__V& par_pageMode,
    const ChannelNeeded__V& par_channelNeeded,
    const OCTETSTRING& par_mobileIdentity1,
    const OCTETSTRING& par_mobileIdentity2,
    const OCTETSTRING& par_mobileIdentity3,
    const OCTETSTRING& par_mobileIdentity4,
    const OCTETSTRING& par_p3RestOctets)
  :   field_messageType(par_messageType),
  field_pageMode(par_pageMode),
  field_channelNeeded(par_channelNeeded),
  field_mobileIdentity1(par_mobileIdentity1),
  field_mobileIdentity2(par_mobileIdentity2),
  field_mobileIdentity3(par_mobileIdentity3),
  field_mobileIdentity4(par_mobileIdentity4),
  field_p3RestOctets(par_p3RestOctets)
{
}

PDU__RRM__PagingReq__Type3__NW__MS::PDU__RRM__PagingReq__Type3__NW__MS(const PDU__RRM__PagingReq__Type3__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_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.channelNeeded().is_bound()) field_channelNeeded = other_value.channelNeeded();
else field_channelNeeded.clean_up();
if (other_value.mobileIdentity1().is_bound()) field_mobileIdentity1 = other_value.mobileIdentity1();
else field_mobileIdentity1.clean_up();
if (other_value.mobileIdentity2().is_bound()) field_mobileIdentity2 = other_value.mobileIdentity2();
else field_mobileIdentity2.clean_up();
if (other_value.mobileIdentity3().is_bound()) field_mobileIdentity3 = other_value.mobileIdentity3();
else field_mobileIdentity3.clean_up();
if (other_value.mobileIdentity4().is_bound()) field_mobileIdentity4 = other_value.mobileIdentity4();
else field_mobileIdentity4.clean_up();
if (other_value.p3RestOctets().is_bound()) field_p3RestOctets = other_value.p3RestOctets();
else field_p3RestOctets.clean_up();
}

void PDU__RRM__PagingReq__Type3__NW__MS::clean_up()
{
field_messageType.clean_up();
field_pageMode.clean_up();
field_channelNeeded.clean_up();
field_mobileIdentity1.clean_up();
field_mobileIdentity2.clean_up();
field_mobileIdentity3.clean_up();
field_mobileIdentity4.clean_up();
field_p3RestOctets.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__PagingReq__Type3__NW__MS::get_descriptor() const { return &PDU__RRM__PagingReq__Type3__NW__MS_descr_; }
PDU__RRM__PagingReq__Type3__NW__MS& PDU__RRM__PagingReq__Type3__NW__MS::operator=(const PDU__RRM__PagingReq__Type3__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_PagingReq_Type3_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.channelNeeded().is_bound()) field_channelNeeded = other_value.channelNeeded();
  else field_channelNeeded.clean_up();
  if (other_value.mobileIdentity1().is_bound()) field_mobileIdentity1 = other_value.mobileIdentity1();
  else field_mobileIdentity1.clean_up();
  if (other_value.mobileIdentity2().is_bound()) field_mobileIdentity2 = other_value.mobileIdentity2();
  else field_mobileIdentity2.clean_up();
  if (other_value.mobileIdentity3().is_bound()) field_mobileIdentity3 = other_value.mobileIdentity3();
  else field_mobileIdentity3.clean_up();
  if (other_value.mobileIdentity4().is_bound()) field_mobileIdentity4 = other_value.mobileIdentity4();
  else field_mobileIdentity4.clean_up();
  if (other_value.p3RestOctets().is_bound()) field_p3RestOctets = other_value.p3RestOctets();
  else field_p3RestOctets.clean_up();
}
return *this;
}

boolean PDU__RRM__PagingReq__Type3__NW__MS::operator==(const PDU__RRM__PagingReq__Type3__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_pageMode==other_value.field_pageMode
  && field_channelNeeded==other_value.field_channelNeeded
  && field_mobileIdentity1==other_value.field_mobileIdentity1
  && field_mobileIdentity2==other_value.field_mobileIdentity2
  && field_mobileIdentity3==other_value.field_mobileIdentity3
  && field_mobileIdentity4==other_value.field_mobileIdentity4
  && field_p3RestOctets==other_value.field_p3RestOctets;
}

boolean PDU__RRM__PagingReq__Type3__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_pageMode.is_bound())
  || (field_channelNeeded.is_bound())
  || (field_mobileIdentity1.is_bound())
  || (field_mobileIdentity2.is_bound())
  || (field_mobileIdentity3.is_bound())
  || (field_mobileIdentity4.is_bound())
  || (field_p3RestOctets.is_bound());
}
boolean PDU__RRM__PagingReq__Type3__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_pageMode.is_value()
  && field_channelNeeded.is_value()
  && field_mobileIdentity1.is_value()
  && field_mobileIdentity2.is_value()
  && field_mobileIdentity3.is_value()
  && field_mobileIdentity4.is_value()
  && field_p3RestOctets.is_value();
}
void PDU__RRM__PagingReq__Type3__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(", channelNeeded := ");
field_channelNeeded.log();
TTCN_Logger::log_event_str(", mobileIdentity1 := ");
field_mobileIdentity1.log();
TTCN_Logger::log_event_str(", mobileIdentity2 := ");
field_mobileIdentity2.log();
TTCN_Logger::log_event_str(", mobileIdentity3 := ");
field_mobileIdentity3.log();
TTCN_Logger::log_event_str(", mobileIdentity4 := ");
field_mobileIdentity4.log();
TTCN_Logger::log_event_str(", p3RestOctets := ");
field_p3RestOctets.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__PagingReq__Type3__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (pageMode().is_bound()) pageMode().set_implicit_omit();
if (channelNeeded().is_bound()) channelNeeded().set_implicit_omit();
if (mobileIdentity1().is_bound()) mobileIdentity1().set_implicit_omit();
if (mobileIdentity2().is_bound()) mobileIdentity2().set_implicit_omit();
if (mobileIdentity3().is_bound()) mobileIdentity3().set_implicit_omit();
if (mobileIdentity4().is_bound()) mobileIdentity4().set_implicit_omit();
if (p3RestOctets().is_bound()) p3RestOctets().set_implicit_omit();
}

void PDU__RRM__PagingReq__Type3__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 (8<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelNeeded().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity4().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) p3RestOctets().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "channelNeeded")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelNeeded().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p3RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p3RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_PagingReq_Type3_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS");
  }
}

void PDU__RRM__PagingReq__Type3__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_pageMode.encode_text(text_buf);
field_channelNeeded.encode_text(text_buf);
field_mobileIdentity1.encode_text(text_buf);
field_mobileIdentity2.encode_text(text_buf);
field_mobileIdentity3.encode_text(text_buf);
field_mobileIdentity4.encode_text(text_buf);
field_p3RestOctets.encode_text(text_buf);
}

void PDU__RRM__PagingReq__Type3__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_pageMode.decode_text(text_buf);
field_channelNeeded.decode_text(text_buf);
field_mobileIdentity1.decode_text(text_buf);
field_mobileIdentity2.decode_text(text_buf);
field_mobileIdentity3.decode_text(text_buf);
field_mobileIdentity4.decode_text(text_buf);
field_p3RestOctets.decode_text(text_buf);
}

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

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

int PDU__RRM__PagingReq__Type3__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, ChannelNeeded__V_descr_.raw->forceomit);
  decoded_field_length = field_channelNeeded.RAW_decode(ChannelNeeded__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, TMSIP__TMSI__V_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity1.RAW_decode(TMSIP__TMSI__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, TMSIP__TMSI__V_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity2.RAW_decode(TMSIP__TMSI__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, TMSIP__TMSI__V_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity3.RAW_decode(TMSIP__TMSI__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, TMSIP__TMSI__V_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity4.RAW_decode(TMSIP__TMSI__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, P3RestOctets_descr_.raw->forceomit);
  decoded_field_length = field_p3RestOctets.RAW_decode(P3RestOctets_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__PagingReq__Type3__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 = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PageMode__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ChannelNeeded__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, TMSIP__TMSI__V_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, TMSIP__TMSI__V_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, TMSIP__TMSI__V_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, TMSIP__TMSI__V_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, P3RestOctets_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_channelNeeded.RAW_encode(ChannelNeeded__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mobileIdentity1.RAW_encode(TMSIP__TMSI__V_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mobileIdentity2.RAW_encode(TMSIP__TMSI__V_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mobileIdentity3.RAW_encode(TMSIP__TMSI__V_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mobileIdentity4.RAW_encode(TMSIP__TMSI__V_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_p3RestOctets.RAW_encode(P3RestOctets_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__PagingReq__Type3__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
PageMode__V_template field_pageMode;
ChannelNeeded__V_template field_channelNeeded;
OCTETSTRING_template field_mobileIdentity1;
OCTETSTRING_template field_mobileIdentity2;
OCTETSTRING_template field_mobileIdentity3;
OCTETSTRING_template field_mobileIdentity4;
OCTETSTRING_template field_p3RestOctets;
};

void PDU__RRM__PagingReq__Type3__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_channelNeeded = ANY_VALUE;
single_value->field_mobileIdentity1 = ANY_VALUE;
single_value->field_mobileIdentity2 = ANY_VALUE;
single_value->field_mobileIdentity3 = ANY_VALUE;
single_value->field_mobileIdentity4 = ANY_VALUE;
single_value->field_p3RestOctets = ANY_VALUE;
}
}
}

void PDU__RRM__PagingReq__Type3__NW__MS_template::copy_value(const PDU__RRM__PagingReq__Type3__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.channelNeeded().is_bound()) {
  single_value->field_channelNeeded = other_value.channelNeeded();
} else {
  single_value->field_channelNeeded.clean_up();
}
if (other_value.mobileIdentity1().is_bound()) {
  single_value->field_mobileIdentity1 = other_value.mobileIdentity1();
} else {
  single_value->field_mobileIdentity1.clean_up();
}
if (other_value.mobileIdentity2().is_bound()) {
  single_value->field_mobileIdentity2 = other_value.mobileIdentity2();
} else {
  single_value->field_mobileIdentity2.clean_up();
}
if (other_value.mobileIdentity3().is_bound()) {
  single_value->field_mobileIdentity3 = other_value.mobileIdentity3();
} else {
  single_value->field_mobileIdentity3.clean_up();
}
if (other_value.mobileIdentity4().is_bound()) {
  single_value->field_mobileIdentity4 = other_value.mobileIdentity4();
} else {
  single_value->field_mobileIdentity4.clean_up();
}
if (other_value.p3RestOctets().is_bound()) {
  single_value->field_p3RestOctets = other_value.p3RestOctets();
} else {
  single_value->field_p3RestOctets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__PagingReq__Type3__NW__MS_template::copy_template(const PDU__RRM__PagingReq__Type3__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.channelNeeded().get_selection()) {
single_value->field_channelNeeded = other_value.channelNeeded();
} else {
single_value->field_channelNeeded.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity1().get_selection()) {
single_value->field_mobileIdentity1 = other_value.mobileIdentity1();
} else {
single_value->field_mobileIdentity1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity2().get_selection()) {
single_value->field_mobileIdentity2 = other_value.mobileIdentity2();
} else {
single_value->field_mobileIdentity2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity3().get_selection()) {
single_value->field_mobileIdentity3 = other_value.mobileIdentity3();
} else {
single_value->field_mobileIdentity3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity4().get_selection()) {
single_value->field_mobileIdentity4 = other_value.mobileIdentity4();
} else {
single_value->field_mobileIdentity4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.p3RestOctets().get_selection()) {
single_value->field_p3RestOctets = other_value.p3RestOctets();
} else {
single_value->field_p3RestOctets.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__PagingReq__Type3__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__PagingReq__Type3__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__PagingReq__Type3__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_PagingReq_Type3_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__PagingReq__Type3__NW__MS_template::PDU__RRM__PagingReq__Type3__NW__MS_template()
{
}

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

PDU__RRM__PagingReq__Type3__NW__MS_template::PDU__RRM__PagingReq__Type3__NW__MS_template(const PDU__RRM__PagingReq__Type3__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__PagingReq__Type3__NW__MS_template::PDU__RRM__PagingReq__Type3__NW__MS_template(const OPTIONAL<PDU__RRM__PagingReq__Type3__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__PagingReq__Type3__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_PagingReq_Type3_NW_MS from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__PagingReq__Type3__NW__MS_template::match(const PDU__RRM__PagingReq__Type3__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.channelNeeded().is_bound()) return FALSE;
if(!single_value->field_channelNeeded.match(other_value.channelNeeded(), legacy))return FALSE;
if(!other_value.mobileIdentity1().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity1.match(other_value.mobileIdentity1(), legacy))return FALSE;
if(!other_value.mobileIdentity2().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity2.match(other_value.mobileIdentity2(), legacy))return FALSE;
if(!other_value.mobileIdentity3().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity3.match(other_value.mobileIdentity3(), legacy))return FALSE;
if(!other_value.mobileIdentity4().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity4.match(other_value.mobileIdentity4(), legacy))return FALSE;
if(!other_value.p3RestOctets().is_bound()) return FALSE;
if(!single_value->field_p3RestOctets.match(other_value.p3RestOctets(), 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_PagingReq_Type3_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__PagingReq__Type3__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_channelNeeded.is_bound()
 || single_value->field_mobileIdentity1.is_bound()
 || single_value->field_mobileIdentity2.is_bound()
 || single_value->field_mobileIdentity3.is_bound()
 || single_value->field_mobileIdentity4.is_bound()
 || single_value->field_p3RestOctets.is_bound();
}

boolean PDU__RRM__PagingReq__Type3__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_channelNeeded.is_value()
 && single_value->field_mobileIdentity1.is_value()
 && single_value->field_mobileIdentity2.is_value()
 && single_value->field_mobileIdentity3.is_value()
 && single_value->field_mobileIdentity4.is_value()
 && single_value->field_p3RestOctets.is_value();
}

void PDU__RRM__PagingReq__Type3__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__PagingReq__Type3__NW__MS PDU__RRM__PagingReq__Type3__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_PagingReq_Type3_NW_MS.");
PDU__RRM__PagingReq__Type3__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_channelNeeded.is_bound()) {
ret_val.channelNeeded() = single_value->field_channelNeeded.valueof();
}
if (single_value->field_mobileIdentity1.is_bound()) {
ret_val.mobileIdentity1() = single_value->field_mobileIdentity1.valueof();
}
if (single_value->field_mobileIdentity2.is_bound()) {
ret_val.mobileIdentity2() = single_value->field_mobileIdentity2.valueof();
}
if (single_value->field_mobileIdentity3.is_bound()) {
ret_val.mobileIdentity3() = single_value->field_mobileIdentity3.valueof();
}
if (single_value->field_mobileIdentity4.is_bound()) {
ret_val.mobileIdentity4() = single_value->field_mobileIdentity4.valueof();
}
if (single_value->field_p3RestOctets.is_bound()) {
ret_val.p3RestOctets() = single_value->field_p3RestOctets.valueof();
}
return ret_val;
}

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

PDU__RRM__PagingReq__Type3__NW__MS_template& PDU__RRM__PagingReq__Type3__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_PagingReq_Type3_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_PagingReq_Type3_NW_MS.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__PagingReq__Type3__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_PagingReq_Type3_NW_MS.");
return single_value->field_messageType;
}

PageMode__V_template& PDU__RRM__PagingReq__Type3__NW__MS_template::pageMode()
{
set_specific();
return single_value->field_pageMode;
}

const PageMode__V_template& PDU__RRM__PagingReq__Type3__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_PagingReq_Type3_NW_MS.");
return single_value->field_pageMode;
}

ChannelNeeded__V_template& PDU__RRM__PagingReq__Type3__NW__MS_template::channelNeeded()
{
set_specific();
return single_value->field_channelNeeded;
}

const ChannelNeeded__V_template& PDU__RRM__PagingReq__Type3__NW__MS_template::channelNeeded() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelNeeded of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS.");
return single_value->field_channelNeeded;
}

OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::mobileIdentity1()
{
set_specific();
return single_value->field_mobileIdentity1;
}

const OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::mobileIdentity1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS.");
return single_value->field_mobileIdentity1;
}

OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::mobileIdentity2()
{
set_specific();
return single_value->field_mobileIdentity2;
}

const OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::mobileIdentity2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS.");
return single_value->field_mobileIdentity2;
}

OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::mobileIdentity3()
{
set_specific();
return single_value->field_mobileIdentity3;
}

const OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::mobileIdentity3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity3 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS.");
return single_value->field_mobileIdentity3;
}

OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::mobileIdentity4()
{
set_specific();
return single_value->field_mobileIdentity4;
}

const OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::mobileIdentity4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity4 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS.");
return single_value->field_mobileIdentity4;
}

OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::p3RestOctets()
{
set_specific();
return single_value->field_p3RestOctets;
}

const OCTETSTRING_template& PDU__RRM__PagingReq__Type3__NW__MS_template::p3RestOctets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p3RestOctets of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS.");
return single_value->field_p3RestOctets;
}

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

void PDU__RRM__PagingReq__Type3__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(", channelNeeded := ");
single_value->field_channelNeeded.log();
TTCN_Logger::log_event_str(", mobileIdentity1 := ");
single_value->field_mobileIdentity1.log();
TTCN_Logger::log_event_str(", mobileIdentity2 := ");
single_value->field_mobileIdentity2.log();
TTCN_Logger::log_event_str(", mobileIdentity3 := ");
single_value->field_mobileIdentity3.log();
TTCN_Logger::log_event_str(", mobileIdentity4 := ");
single_value->field_mobileIdentity4.log();
TTCN_Logger::log_event_str(", p3RestOctets := ");
single_value->field_p3RestOctets.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__PagingReq__Type3__NW__MS_template::log_match(const PDU__RRM__PagingReq__Type3__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_channelNeeded.match(match_value.channelNeeded(), legacy)){
TTCN_Logger::log_logmatch_info(".channelNeeded");
single_value->field_channelNeeded.log_match(match_value.channelNeeded(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity1.match(match_value.mobileIdentity1(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity1");
single_value->field_mobileIdentity1.log_match(match_value.mobileIdentity1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity2.match(match_value.mobileIdentity2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity2");
single_value->field_mobileIdentity2.log_match(match_value.mobileIdentity2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity3.match(match_value.mobileIdentity3(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity3");
single_value->field_mobileIdentity3.log_match(match_value.mobileIdentity3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity4.match(match_value.mobileIdentity4(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity4");
single_value->field_mobileIdentity4.log_match(match_value.mobileIdentity4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_p3RestOctets.match(match_value.p3RestOctets(), legacy)){
TTCN_Logger::log_logmatch_info(".p3RestOctets");
single_value->field_p3RestOctets.log_match(match_value.p3RestOctets(), 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(", channelNeeded := ");
single_value->field_channelNeeded.log_match(match_value.channelNeeded(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity1 := ");
single_value->field_mobileIdentity1.log_match(match_value.mobileIdentity1(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity2 := ");
single_value->field_mobileIdentity2.log_match(match_value.mobileIdentity2(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity3 := ");
single_value->field_mobileIdentity3.log_match(match_value.mobileIdentity3(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity4 := ");
single_value->field_mobileIdentity4.log_match(match_value.mobileIdentity4(), legacy);
TTCN_Logger::log_event_str(", p3RestOctets := ");
single_value->field_p3RestOctets.log_match(match_value.p3RestOctets(), 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__PagingReq__Type3__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_channelNeeded.encode_text(text_buf);
single_value->field_mobileIdentity1.encode_text(text_buf);
single_value->field_mobileIdentity2.encode_text(text_buf);
single_value->field_mobileIdentity3.encode_text(text_buf);
single_value->field_mobileIdentity4.encode_text(text_buf);
single_value->field_p3RestOctets.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_PagingReq_Type3_NW_MS.");
}
}

void PDU__RRM__PagingReq__Type3__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_channelNeeded.decode_text(text_buf);
single_value->field_mobileIdentity1.decode_text(text_buf);
single_value->field_mobileIdentity2.decode_text(text_buf);
single_value->field_mobileIdentity3.decode_text(text_buf);
single_value->field_mobileIdentity4.decode_text(text_buf);
single_value->field_p3RestOctets.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__PagingReq__Type3__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_PagingReq_Type3_NW_MS.");
}
}

void PDU__RRM__PagingReq__Type3__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__PagingReq__Type3__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 (8<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pageMode().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelNeeded().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity4().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) p3RestOctets().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "channelNeeded")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelNeeded().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p3RestOctets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p3RestOctets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_PagingReq_Type3_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__PagingReq__Type3__NW__MS_template* precondition = new PDU__RRM__PagingReq__Type3__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__PagingReq__Type3__NW__MS_template* implied_template = new PDU__RRM__PagingReq__Type3__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__PagingReq__Type3__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__PagingReq__Type3__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_PagingReq_Type3_NW_MS");
single_value->field_pageMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS");
single_value->field_channelNeeded.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS");
single_value->field_mobileIdentity1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS");
single_value->field_mobileIdentity2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS");
single_value->field_mobileIdentity3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS");
single_value->field_mobileIdentity4.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_NW_MS");
single_value->field_p3RestOctets.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingReq_Type3_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_PagingReq_Type3_NW_MS");
}

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

boolean PDU__RRM__PagingReq__Type3__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__PagingResponse__MS__NW::PDU__RRM__PagingResponse__MS__NW()
{
}

PDU__RRM__PagingResponse__MS__NW::PDU__RRM__PagingResponse__MS__NW(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_cipheringKeySequenceNumber,
    const BITSTRING& par_spare1__4,
    const MobileL3__CommonIE__Types::MobileStationClassmark2__LV& par_mobileStationClassmark,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity,
    const OPTIONAL< MobileL3__CommonIE__Types::AdditionalUpdateParameterTV >& par_additionalUpdateParameters)
  :   field_messageType(par_messageType),
  field_cipheringKeySequenceNumber(par_cipheringKeySequenceNumber),
  field_spare1__4(par_spare1__4),
  field_mobileStationClassmark(par_mobileStationClassmark),
  field_mobileIdentity(par_mobileIdentity),
  field_additionalUpdateParameters(par_additionalUpdateParameters)
{
}

PDU__RRM__PagingResponse__MS__NW::PDU__RRM__PagingResponse__MS__NW(const PDU__RRM__PagingResponse__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
else field_cipheringKeySequenceNumber.clean_up();
if (other_value.spare1__4().is_bound()) field_spare1__4 = other_value.spare1__4();
else field_spare1__4.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.additionalUpdateParameters().is_bound()) field_additionalUpdateParameters = other_value.additionalUpdateParameters();
else field_additionalUpdateParameters.clean_up();
}

void PDU__RRM__PagingResponse__MS__NW::clean_up()
{
field_messageType.clean_up();
field_cipheringKeySequenceNumber.clean_up();
field_spare1__4.clean_up();
field_mobileStationClassmark.clean_up();
field_mobileIdentity.clean_up();
field_additionalUpdateParameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__PagingResponse__MS__NW::get_descriptor() const { return &PDU__RRM__PagingResponse__MS__NW_descr_; }
PDU__RRM__PagingResponse__MS__NW& PDU__RRM__PagingResponse__MS__NW::operator=(const PDU__RRM__PagingResponse__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_PagingResponse_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
  else field_cipheringKeySequenceNumber.clean_up();
  if (other_value.spare1__4().is_bound()) field_spare1__4 = other_value.spare1__4();
  else field_spare1__4.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.additionalUpdateParameters().is_bound()) field_additionalUpdateParameters = other_value.additionalUpdateParameters();
  else field_additionalUpdateParameters.clean_up();
}
return *this;
}

boolean PDU__RRM__PagingResponse__MS__NW::operator==(const PDU__RRM__PagingResponse__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_cipheringKeySequenceNumber==other_value.field_cipheringKeySequenceNumber
  && field_spare1__4==other_value.field_spare1__4
  && field_mobileStationClassmark==other_value.field_mobileStationClassmark
  && field_mobileIdentity==other_value.field_mobileIdentity
  && field_additionalUpdateParameters==other_value.field_additionalUpdateParameters;
}

boolean PDU__RRM__PagingResponse__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_cipheringKeySequenceNumber.is_bound())
  || (field_spare1__4.is_bound())
  || (field_mobileStationClassmark.is_bound())
  || (field_mobileIdentity.is_bound())
  || (OPTIONAL_OMIT == field_additionalUpdateParameters.get_selection() || field_additionalUpdateParameters.is_bound());
}
boolean PDU__RRM__PagingResponse__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_cipheringKeySequenceNumber.is_value()
  && field_spare1__4.is_value()
  && field_mobileStationClassmark.is_value()
  && field_mobileIdentity.is_value()
  && (OPTIONAL_OMIT == field_additionalUpdateParameters.get_selection() || field_additionalUpdateParameters.is_value());
}
int PDU__RRM__PagingResponse__MS__NW::size_of() const
{
  int ret_val = 5;
  if (field_additionalUpdateParameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__PagingResponse__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(", cipheringKeySequenceNumber := ");
field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", spare1_4 := ");
field_spare1__4.log();
TTCN_Logger::log_event_str(", mobileStationClassmark := ");
field_mobileStationClassmark.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
field_mobileIdentity.log();
TTCN_Logger::log_event_str(", additionalUpdateParameters := ");
field_additionalUpdateParameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__PagingResponse__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber().set_implicit_omit();
if (spare1__4().is_bound()) spare1__4().set_implicit_omit();
if (mobileStationClassmark().is_bound()) mobileStationClassmark().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
if (!additionalUpdateParameters().is_bound()) additionalUpdateParameters() = OMIT_VALUE;
else additionalUpdateParameters().set_implicit_omit();
}

void PDU__RRM__PagingResponse__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare1__4().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateParameters().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1_4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1__4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "additionalUpdateParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_PagingResponse_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW");
  }
}

void PDU__RRM__PagingResponse__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_cipheringKeySequenceNumber.encode_text(text_buf);
field_spare1__4.encode_text(text_buf);
field_mobileStationClassmark.encode_text(text_buf);
field_mobileIdentity.encode_text(text_buf);
field_additionalUpdateParameters.encode_text(text_buf);
}

void PDU__RRM__PagingResponse__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_cipheringKeySequenceNumber.decode_text(text_buf);
field_spare1__4.decode_text(text_buf);
field_mobileStationClassmark.decode_text(text_buf);
field_mobileIdentity.decode_text(text_buf);
field_additionalUpdateParameters.decode_text(text_buf);
}

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

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

int PDU__RRM__PagingResponse__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::CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringKeySequenceNumber.RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare1__4.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, 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_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__CommonIE__Types::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_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_additionalUpdateParameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_.raw->forceomit);
  decoded_field_length = field_additionalUpdateParameters().RAW_decode(MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_additionalUpdateParameters = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_additionalUpdateParameters=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__PagingResponse__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  if (field_additionalUpdateParameters.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cipheringKeySequenceNumber.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare1__4.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mobileStationClassmark.RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mobileIdentity.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[4]);
  if (field_additionalUpdateParameters.ispresent()) {
  encoded_length += field_additionalUpdateParameters().RAW_encode(MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_descr_, *myleaf.body.node.nodes[5]);
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__PagingResponse__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_cipheringKeySequenceNumber;
BITSTRING_template field_spare1__4;
MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template field_mobileStationClassmark;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentity;
MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_template field_additionalUpdateParameters;
};

void PDU__RRM__PagingResponse__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_cipheringKeySequenceNumber = ANY_VALUE;
single_value->field_spare1__4 = ANY_VALUE;
single_value->field_mobileStationClassmark = ANY_VALUE;
single_value->field_mobileIdentity = ANY_VALUE;
single_value->field_additionalUpdateParameters = ANY_OR_OMIT;
}
}
}

void PDU__RRM__PagingResponse__MS__NW_template::copy_value(const PDU__RRM__PagingResponse__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.cipheringKeySequenceNumber().is_bound()) {
  single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
  single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (other_value.spare1__4().is_bound()) {
  single_value->field_spare1__4 = other_value.spare1__4();
} else {
  single_value->field_spare1__4.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.additionalUpdateParameters().is_bound()) {
  if (other_value.additionalUpdateParameters().ispresent()) single_value->field_additionalUpdateParameters = other_value.additionalUpdateParameters()();
  else single_value->field_additionalUpdateParameters = OMIT_VALUE;
} else {
  single_value->field_additionalUpdateParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__PagingResponse__MS__NW_template::copy_template(const PDU__RRM__PagingResponse__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.cipheringKeySequenceNumber().get_selection()) {
single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare1__4().get_selection()) {
single_value->field_spare1__4 = other_value.spare1__4();
} else {
single_value->field_spare1__4.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.additionalUpdateParameters().get_selection()) {
single_value->field_additionalUpdateParameters = other_value.additionalUpdateParameters();
} else {
single_value->field_additionalUpdateParameters.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__PagingResponse__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__PagingResponse__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__PagingResponse__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_PagingResponse_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__PagingResponse__MS__NW_template::PDU__RRM__PagingResponse__MS__NW_template()
{
}

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

PDU__RRM__PagingResponse__MS__NW_template::PDU__RRM__PagingResponse__MS__NW_template(const PDU__RRM__PagingResponse__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__PagingResponse__MS__NW_template::PDU__RRM__PagingResponse__MS__NW_template(const OPTIONAL<PDU__RRM__PagingResponse__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__PagingResponse__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_PagingResponse_MS_NW from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__PagingResponse__MS__NW_template::match(const PDU__RRM__PagingResponse__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.cipheringKeySequenceNumber().is_bound()) return FALSE;
if(!single_value->field_cipheringKeySequenceNumber.match(other_value.cipheringKeySequenceNumber(), legacy))return FALSE;
if(!other_value.spare1__4().is_bound()) return FALSE;
if(!single_value->field_spare1__4.match(other_value.spare1__4(), 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.additionalUpdateParameters().is_bound()) return FALSE;
if((other_value.additionalUpdateParameters().ispresent() ? !single_value->field_additionalUpdateParameters.match((const MobileL3__CommonIE__Types::AdditionalUpdateParameterTV&)other_value.additionalUpdateParameters(), legacy) : !single_value->field_additionalUpdateParameters.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_PagingResponse_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__PagingResponse__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_cipheringKeySequenceNumber.is_bound()
 || single_value->field_spare1__4.is_bound()
 || single_value->field_mobileStationClassmark.is_bound()
 || single_value->field_mobileIdentity.is_bound()
 || (single_value->field_additionalUpdateParameters.is_omit() || single_value->field_additionalUpdateParameters.is_bound());
}

boolean PDU__RRM__PagingResponse__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_cipheringKeySequenceNumber.is_value()
 && single_value->field_spare1__4.is_value()
 && single_value->field_mobileStationClassmark.is_value()
 && single_value->field_mobileIdentity.is_value()
 && (single_value->field_additionalUpdateParameters.is_omit() || single_value->field_additionalUpdateParameters.is_value());
}

void PDU__RRM__PagingResponse__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__PagingResponse__MS__NW PDU__RRM__PagingResponse__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_PagingResponse_MS_NW.");
PDU__RRM__PagingResponse__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_cipheringKeySequenceNumber.is_bound()) {
ret_val.cipheringKeySequenceNumber() = single_value->field_cipheringKeySequenceNumber.valueof();
}
if (single_value->field_spare1__4.is_bound()) {
ret_val.spare1__4() = single_value->field_spare1__4.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_additionalUpdateParameters.is_omit()) ret_val.additionalUpdateParameters() = OMIT_VALUE;
else if (single_value->field_additionalUpdateParameters.is_bound()) {
ret_val.additionalUpdateParameters() = single_value->field_additionalUpdateParameters.valueof();
}
return ret_val;
}

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

PDU__RRM__PagingResponse__MS__NW_template& PDU__RRM__PagingResponse__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_PagingResponse_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_PagingResponse_MS_NW.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__PagingResponse__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_PagingResponse_MS_NW.");
return single_value->field_messageType;
}

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

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

BITSTRING_template& PDU__RRM__PagingResponse__MS__NW_template::spare1__4()
{
set_specific();
return single_value->field_spare1__4;
}

const BITSTRING_template& PDU__RRM__PagingResponse__MS__NW_template::spare1__4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare1_4 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW.");
return single_value->field_spare1__4;
}

MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__RRM__PagingResponse__MS__NW_template::mobileStationClassmark()
{
set_specific();
return single_value->field_mobileStationClassmark;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__RRM__PagingResponse__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_PagingResponse_MS_NW.");
return single_value->field_mobileStationClassmark;
}

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

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__RRM__PagingResponse__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_PagingResponse_MS_NW.");
return single_value->field_mobileIdentity;
}

MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_template& PDU__RRM__PagingResponse__MS__NW_template::additionalUpdateParameters()
{
set_specific();
return single_value->field_additionalUpdateParameters;
}

const MobileL3__CommonIE__Types::AdditionalUpdateParameterTV_template& PDU__RRM__PagingResponse__MS__NW_template::additionalUpdateParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalUpdateParameters of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW.");
return single_value->field_additionalUpdateParameters;
}

int PDU__RRM__PagingResponse__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_additionalUpdateParameters.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_PagingResponse_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_PagingResponse_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_PagingResponse_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_PagingResponse_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_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_PagingResponse_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW.");
  }
  return 0;
}

void PDU__RRM__PagingResponse__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(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", spare1_4 := ");
single_value->field_spare1__4.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(", additionalUpdateParameters := ");
single_value->field_additionalUpdateParameters.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__PagingResponse__MS__NW_template::log_match(const PDU__RRM__PagingResponse__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_cipheringKeySequenceNumber.match(match_value.cipheringKeySequenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare1__4.match(match_value.spare1__4(), legacy)){
TTCN_Logger::log_logmatch_info(".spare1_4");
single_value->field_spare1__4.log_match(match_value.spare1__4(), 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 (match_value.additionalUpdateParameters().ispresent()){
if(!single_value->field_additionalUpdateParameters.match(match_value.additionalUpdateParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalUpdateParameters");
single_value->field_additionalUpdateParameters.log_match(match_value.additionalUpdateParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalUpdateParameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalUpdateParameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalUpdateParameters.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(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::log_event_str(", spare1_4 := ");
single_value->field_spare1__4.log_match(match_value.spare1__4(), 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(", additionalUpdateParameters := ");
if (match_value.additionalUpdateParameters().ispresent()) {
single_value->field_additionalUpdateParameters.log_match(match_value.additionalUpdateParameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalUpdateParameters.log();
if (single_value->field_additionalUpdateParameters.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__PagingResponse__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_cipheringKeySequenceNumber.encode_text(text_buf);
single_value->field_spare1__4.encode_text(text_buf);
single_value->field_mobileStationClassmark.encode_text(text_buf);
single_value->field_mobileIdentity.encode_text(text_buf);
single_value->field_additionalUpdateParameters.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_PagingResponse_MS_NW.");
}
}

void PDU__RRM__PagingResponse__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_cipheringKeySequenceNumber.decode_text(text_buf);
single_value->field_spare1__4.decode_text(text_buf);
single_value->field_mobileStationClassmark.decode_text(text_buf);
single_value->field_mobileIdentity.decode_text(text_buf);
single_value->field_additionalUpdateParameters.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__PagingResponse__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_PagingResponse_MS_NW.");
}
}

void PDU__RRM__PagingResponse__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__PagingResponse__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare1__4().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateParameters().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1_4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1__4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "additionalUpdateParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_PagingResponse_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__PagingResponse__MS__NW_template* precondition = new PDU__RRM__PagingResponse__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__PagingResponse__MS__NW_template* implied_template = new PDU__RRM__PagingResponse__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__PagingResponse__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__PagingResponse__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_PagingResponse_MS_NW");
single_value->field_cipheringKeySequenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW");
single_value->field_spare1__4.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW");
single_value->field_mobileStationClassmark.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingResponse_MS_NW");
single_value->field_additionalUpdateParameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PagingResponse_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_PagingResponse_MS_NW");
}

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

boolean PDU__RRM__PagingResponse__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__PartialRelease__NW__MS::PDU__RRM__PartialRelease__NW__MS()
{
}

PDU__RRM__PartialRelease__NW__MS::PDU__RRM__PartialRelease__NW__MS(const BITSTRING& par_messageType,
    const ChannelDescription__V& par_channelDescription)
  :   field_messageType(par_messageType),
  field_channelDescription(par_channelDescription)
{
}

PDU__RRM__PartialRelease__NW__MS::PDU__RRM__PartialRelease__NW__MS(const PDU__RRM__PartialRelease__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_PartialRelease_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();
}

void PDU__RRM__PartialRelease__NW__MS::clean_up()
{
field_messageType.clean_up();
field_channelDescription.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__PartialRelease__NW__MS::get_descriptor() const { return &PDU__RRM__PartialRelease__NW__MS_descr_; }
PDU__RRM__PartialRelease__NW__MS& PDU__RRM__PartialRelease__NW__MS::operator=(const PDU__RRM__PartialRelease__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_PartialRelease_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();
}
return *this;
}

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

boolean PDU__RRM__PartialRelease__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_channelDescription.is_bound());
}
boolean PDU__RRM__PartialRelease__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_channelDescription.is_value();
}
void PDU__RRM__PartialRelease__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(" }");
}

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

void PDU__RRM__PartialRelease__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_PartialRelease_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) channelDescription().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(), "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++) if (!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_PartialRelease_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_PartialRelease_NW_MS");
  }
}

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

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

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

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

int PDU__RRM__PartialRelease__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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__PartialRelease__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, ChannelDescription__V_descr_.raw);
  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]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__PartialRelease__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
ChannelDescription__V_template field_channelDescription;
};

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

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

void PDU__RRM__PartialRelease__NW__MS_template::copy_template(const PDU__RRM__PartialRelease__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();
}
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__PartialRelease__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__PartialRelease__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__PartialRelease__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_PartialRelease_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__PartialRelease__NW__MS_template::PDU__RRM__PartialRelease__NW__MS_template()
{
}

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

PDU__RRM__PartialRelease__NW__MS_template::PDU__RRM__PartialRelease__NW__MS_template(const PDU__RRM__PartialRelease__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__PartialRelease__NW__MS_template::PDU__RRM__PartialRelease__NW__MS_template(const OPTIONAL<PDU__RRM__PartialRelease__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__PartialRelease__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_PartialRelease_NW_MS from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__PartialRelease__NW__MS_template::match(const PDU__RRM__PartialRelease__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;
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_PartialRelease_NW_MS.");
}
return FALSE;
}

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

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

void PDU__RRM__PartialRelease__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__PartialRelease__NW__MS PDU__RRM__PartialRelease__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_PartialRelease_NW_MS.");
PDU__RRM__PartialRelease__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();
}
return ret_val;
}

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

PDU__RRM__PartialRelease__NW__MS_template& PDU__RRM__PartialRelease__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_PartialRelease_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_PartialRelease_NW_MS.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__PartialRelease__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_PartialRelease_NW_MS.");
return single_value->field_messageType;
}

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

const ChannelDescription__V_template& PDU__RRM__PartialRelease__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_PartialRelease_NW_MS.");
return single_value->field_channelDescription;
}

int PDU__RRM__PartialRelease__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PartialRelease_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_PartialRelease_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_PartialRelease_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_PartialRelease_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_PartialRelease_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PartialRelease_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PartialRelease_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_PartialRelease_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PartialRelease_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_PartialRelease_NW_MS.");
  }
  return 0;
}

void PDU__RRM__PartialRelease__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(" }");
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__PartialRelease__NW__MS_template::log_match(const PDU__RRM__PartialRelease__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);
}
}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(" }");
} 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__PartialRelease__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);
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_PartialRelease_NW_MS.");
}
}

void PDU__RRM__PartialRelease__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);
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__PartialRelease__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_PartialRelease_NW_MS.");
}
}

void PDU__RRM__PartialRelease__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__PartialRelease__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_PartialRelease_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) channelDescription().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(), "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++) if (!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_PartialRelease_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__PartialRelease__NW__MS_template* precondition = new PDU__RRM__PartialRelease__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__PartialRelease__NW__MS_template* implied_template = new PDU__RRM__PartialRelease__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__PartialRelease__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_PartialRelease_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__PartialRelease__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_PartialRelease_NW_MS");
single_value->field_channelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PartialRelease_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_PartialRelease_NW_MS");
}

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

boolean PDU__RRM__PartialRelease__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__PartialReleaseComplete__MS__NW::PDU__RRM__PartialReleaseComplete__MS__NW()
{
}

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

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

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

const TTCN_Typedescriptor_t* PDU__RRM__PartialReleaseComplete__MS__NW::get_descriptor() const { return &PDU__RRM__PartialReleaseComplete__MS__NW_descr_; }
PDU__RRM__PartialReleaseComplete__MS__NW& PDU__RRM__PartialReleaseComplete__MS__NW::operator=(const PDU__RRM__PartialReleaseComplete__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_PartialReleaseComplete_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
}
return *this;
}

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

boolean PDU__RRM__PartialReleaseComplete__MS__NW::is_bound() const
{
return (field_messageType.is_bound());
}
boolean PDU__RRM__PartialReleaseComplete__MS__NW::is_value() const
{
return field_messageType.is_value();
}
void PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
}

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

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

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

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

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

int PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__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__PartialReleaseComplete__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
};

void PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__MS__NW_template::copy_value(const PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__MS__NW_template::copy_template(const PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__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__PartialReleaseComplete__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__PartialReleaseComplete__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_PartialReleaseComplete_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__PartialReleaseComplete__MS__NW_template::PDU__RRM__PartialReleaseComplete__MS__NW_template()
{
}

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

PDU__RRM__PartialReleaseComplete__MS__NW_template::PDU__RRM__PartialReleaseComplete__MS__NW_template(const PDU__RRM__PartialReleaseComplete__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__PartialReleaseComplete__MS__NW_template::PDU__RRM__PartialReleaseComplete__MS__NW_template(const OPTIONAL<PDU__RRM__PartialReleaseComplete__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__PartialReleaseComplete__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_PartialReleaseComplete_MS_NW from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__PartialReleaseComplete__MS__NW_template::match(const PDU__RRM__PartialReleaseComplete__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_PartialReleaseComplete_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__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__PartialReleaseComplete__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__PartialReleaseComplete__MS__NW PDU__RRM__PartialReleaseComplete__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_PartialReleaseComplete_MS_NW.");
PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__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_PartialReleaseComplete_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__PartialReleaseComplete__MS__NW_template[list_length];
}

PDU__RRM__PartialReleaseComplete__MS__NW_template& PDU__RRM__PartialReleaseComplete__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_PartialReleaseComplete_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_PartialReleaseComplete_MS_NW.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__PartialReleaseComplete__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_PartialReleaseComplete_MS_NW.");
return single_value->field_messageType;
}

int PDU__RRM__PartialReleaseComplete__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PartialReleaseComplete_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_PartialReleaseComplete_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_PartialReleaseComplete_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_PartialReleaseComplete_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_PartialReleaseComplete_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PartialReleaseComplete_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PartialReleaseComplete_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_PartialReleaseComplete_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PartialReleaseComplete_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_PartialReleaseComplete_MS_NW.");
  }
  return 0;
}

void PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__MS__NW_template::log_match(const PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__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_PartialReleaseComplete_MS_NW.");
}
}

void PDU__RRM__PartialReleaseComplete__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__PartialReleaseComplete__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_PartialReleaseComplete_MS_NW.");
}
}

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

void PDU__RRM__PartialReleaseComplete__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_PartialReleaseComplete_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_PartialReleaseComplete_MS_NW");
}

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

boolean PDU__RRM__PartialReleaseComplete__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__PhysicalInformation__NW__MS::PDU__RRM__PhysicalInformation__NW__MS()
{
}

PDU__RRM__PhysicalInformation__NW__MS::PDU__RRM__PhysicalInformation__NW__MS(const BITSTRING& par_messageType,
    const OCTETSTRING& par_timingAdvance)
  :   field_messageType(par_messageType),
  field_timingAdvance(par_timingAdvance)
{
}

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

void PDU__RRM__PhysicalInformation__NW__MS::clean_up()
{
field_messageType.clean_up();
field_timingAdvance.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__PhysicalInformation__NW__MS::get_descriptor() const { return &PDU__RRM__PhysicalInformation__NW__MS_descr_; }
PDU__RRM__PhysicalInformation__NW__MS& PDU__RRM__PhysicalInformation__NW__MS::operator=(const PDU__RRM__PhysicalInformation__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_PhysicalInformation_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.timingAdvance().is_bound()) field_timingAdvance = other_value.timingAdvance();
  else field_timingAdvance.clean_up();
}
return *this;
}

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

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

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

void PDU__RRM__PhysicalInformation__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_PhysicalInformation_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) timingAdvance().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(), "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++) if (!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_PhysicalInformation_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_PhysicalInformation_NW_MS");
  }
}

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

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

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

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

int PDU__RRM__PhysicalInformation__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, 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_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__PhysicalInformation__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, General__Types::OCT1_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_timingAdvance.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__PhysicalInformation__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
OCTETSTRING_template field_timingAdvance;
};

void PDU__RRM__PhysicalInformation__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_timingAdvance = ANY_VALUE;
}
}
}

void PDU__RRM__PhysicalInformation__NW__MS_template::copy_value(const PDU__RRM__PhysicalInformation__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.timingAdvance().is_bound()) {
  single_value->field_timingAdvance = other_value.timingAdvance();
} else {
  single_value->field_timingAdvance.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__PhysicalInformation__NW__MS_template::copy_template(const PDU__RRM__PhysicalInformation__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.timingAdvance().get_selection()) {
single_value->field_timingAdvance = other_value.timingAdvance();
} else {
single_value->field_timingAdvance.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__PhysicalInformation__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__PhysicalInformation__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__PhysicalInformation__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_PhysicalInformation_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__PhysicalInformation__NW__MS_template::PDU__RRM__PhysicalInformation__NW__MS_template()
{
}

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

PDU__RRM__PhysicalInformation__NW__MS_template::PDU__RRM__PhysicalInformation__NW__MS_template(const PDU__RRM__PhysicalInformation__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__PhysicalInformation__NW__MS_template::PDU__RRM__PhysicalInformation__NW__MS_template(const OPTIONAL<PDU__RRM__PhysicalInformation__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__PhysicalInformation__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_PhysicalInformation_NW_MS from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__PhysicalInformation__NW__MS_template::match(const PDU__RRM__PhysicalInformation__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.timingAdvance().is_bound()) return FALSE;
if(!single_value->field_timingAdvance.match(other_value.timingAdvance(), 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_PhysicalInformation_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__PhysicalInformation__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_timingAdvance.is_bound();
}

boolean PDU__RRM__PhysicalInformation__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_timingAdvance.is_value();
}

void PDU__RRM__PhysicalInformation__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__PhysicalInformation__NW__MS PDU__RRM__PhysicalInformation__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_PhysicalInformation_NW_MS.");
PDU__RRM__PhysicalInformation__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_timingAdvance.is_bound()) {
ret_val.timingAdvance() = single_value->field_timingAdvance.valueof();
}
return ret_val;
}

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

PDU__RRM__PhysicalInformation__NW__MS_template& PDU__RRM__PhysicalInformation__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_PhysicalInformation_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_PhysicalInformation_NW_MS.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__PhysicalInformation__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_PhysicalInformation_NW_MS.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__RRM__PhysicalInformation__NW__MS_template::timingAdvance()
{
set_specific();
return single_value->field_timingAdvance;
}

const OCTETSTRING_template& PDU__RRM__PhysicalInformation__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_PhysicalInformation_NW_MS.");
return single_value->field_timingAdvance;
}

int PDU__RRM__PhysicalInformation__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PhysicalInformation_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_PhysicalInformation_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_PhysicalInformation_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_PhysicalInformation_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_PhysicalInformation_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PhysicalInformation_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PhysicalInformation_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_PhysicalInformation_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_PhysicalInformation_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_PhysicalInformation_NW_MS.");
  }
  return 0;
}

void PDU__RRM__PhysicalInformation__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(", timingAdvance := ");
single_value->field_timingAdvance.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__PhysicalInformation__NW__MS_template::log_match(const PDU__RRM__PhysicalInformation__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_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 {
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(", timingAdvance := ");
single_value->field_timingAdvance.log_match(match_value.timingAdvance(), 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__PhysicalInformation__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_timingAdvance.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_PhysicalInformation_NW_MS.");
}
}

void PDU__RRM__PhysicalInformation__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_timingAdvance.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__PhysicalInformation__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_PhysicalInformation_NW_MS.");
}
}

void PDU__RRM__PhysicalInformation__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__PhysicalInformation__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_PhysicalInformation_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) timingAdvance().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(), "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++) if (!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_PhysicalInformation_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__PhysicalInformation__NW__MS_template* precondition = new PDU__RRM__PhysicalInformation__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__PhysicalInformation__NW__MS_template* implied_template = new PDU__RRM__PhysicalInformation__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__PhysicalInformation__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_PhysicalInformation_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__PhysicalInformation__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_PhysicalInformation_NW_MS");
single_value->field_timingAdvance.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_PhysicalInformation_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_PhysicalInformation_NW_MS");
}

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

boolean PDU__RRM__PhysicalInformation__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__RR__Status::PDU__RRM__RR__Status()
{
}

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

PDU__RRM__RR__Status::PDU__RRM__RR__Status(const PDU__RRM__RR__Status& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_RR_Status.");
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__RR__Status::clean_up()
{
field_messageType.clean_up();
field_rR__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__RR__Status::get_descriptor() const { return &PDU__RRM__RR__Status_descr_; }
PDU__RRM__RR__Status& PDU__RRM__RR__Status::operator=(const PDU__RRM__RR__Status& 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_RR_Status.");
  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__RR__Status::operator==(const PDU__RRM__RR__Status& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rR__Cause==other_value.field_rR__Cause;
}

boolean PDU__RRM__RR__Status::is_bound() const
{
return (field_messageType.is_bound())
  || (field_rR__Cause.is_bound());
}
boolean PDU__RRM__RR__Status::is_value() const
{
return field_messageType.is_value()
  && field_rR__Cause.is_value();
}
void PDU__RRM__RR__Status::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", rR_Cause := ");
field_rR__Cause.log();
TTCN_Logger::log_event_str(" }");
}

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

void PDU__RRM__RR__Status::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_RR_Status has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) 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_RR_Status: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_RR_Status");
  }
}

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

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

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

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

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

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

void PDU__RRM__RR__Status_template::copy_value(const PDU__RRM__RR__Status& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.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__RR__Status_template::copy_template(const PDU__RRM__RR__Status_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.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__RR__Status_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__RRM__RR__Status_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__RR__Status_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status.");
break;
}
set_selection(other_value);
}

PDU__RRM__RR__Status_template::PDU__RRM__RR__Status_template()
{
}

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

PDU__RRM__RR__Status_template::PDU__RRM__RR__Status_template(const PDU__RRM__RR__Status& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__RR__Status_template::match(const PDU__RRM__RR__Status& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.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_RR_Status.");
}
return FALSE;
}

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

boolean PDU__RRM__RR__Status_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__RR__Status_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__RRM__RR__Status PDU__RRM__RR__Status_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status.");
PDU__RRM__RR__Status 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__RR__Status_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__RR__Status_template[list_length];
}

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

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

const BITSTRING_template& PDU__RRM__RR__Status_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_RR_Status.");
return single_value->field_messageType;
}

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

const RR__Cause__V_template& PDU__RRM__RR__Status_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_RR_Status.");
return single_value->field_rR__Cause;
}

int PDU__RRM__RR__Status_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status 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_RR_Status containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status.");
  }
  return 0;
}

void PDU__RRM__RR__Status_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", 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__RR__Status_template::log_match(const PDU__RRM__RR__Status& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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__RR__Status_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_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_RR_Status.");
}
}

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

void PDU__RRM__RR__Status_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__RRM__RR__Status_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_RR_Status has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) 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_RR_Status: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__RR__Status_template* precondition = new PDU__RRM__RR__Status_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__RR__Status_template* implied_template = new PDU__RRM__RR__Status_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__RR__Status_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_RR_Status");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

PDU__RRM__TalkerIndication__MS__NW::PDU__RRM__TalkerIndication__MS__NW()
{
}

PDU__RRM__TalkerIndication__MS__NW::PDU__RRM__TalkerIndication__MS__NW(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::MobileStationClassmark2__LV& par_mobileStationClassmark,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity,
    const OPTIONAL< MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV >& par_cipheringKeySequenceNumber)
  :   field_messageType(par_messageType),
  field_mobileStationClassmark(par_mobileStationClassmark),
  field_mobileIdentity(par_mobileIdentity),
  field_cipheringKeySequenceNumber(par_cipheringKeySequenceNumber)
{
}

PDU__RRM__TalkerIndication__MS__NW::PDU__RRM__TalkerIndication__MS__NW(const PDU__RRM__TalkerIndication__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_TalkerIndication_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.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
else field_cipheringKeySequenceNumber.clean_up();
}

void PDU__RRM__TalkerIndication__MS__NW::clean_up()
{
field_messageType.clean_up();
field_mobileStationClassmark.clean_up();
field_mobileIdentity.clean_up();
field_cipheringKeySequenceNumber.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__TalkerIndication__MS__NW::get_descriptor() const { return &PDU__RRM__TalkerIndication__MS__NW_descr_; }
PDU__RRM__TalkerIndication__MS__NW& PDU__RRM__TalkerIndication__MS__NW::operator=(const PDU__RRM__TalkerIndication__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_TalkerIndication_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.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
  else field_cipheringKeySequenceNumber.clean_up();
}
return *this;
}

boolean PDU__RRM__TalkerIndication__MS__NW::operator==(const PDU__RRM__TalkerIndication__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_cipheringKeySequenceNumber==other_value.field_cipheringKeySequenceNumber;
}

boolean PDU__RRM__TalkerIndication__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_mobileStationClassmark.is_bound())
  || (field_mobileIdentity.is_bound())
  || (OPTIONAL_OMIT == field_cipheringKeySequenceNumber.get_selection() || field_cipheringKeySequenceNumber.is_bound());
}
boolean PDU__RRM__TalkerIndication__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_mobileStationClassmark.is_value()
  && field_mobileIdentity.is_value()
  && (OPTIONAL_OMIT == field_cipheringKeySequenceNumber.get_selection() || field_cipheringKeySequenceNumber.is_value());
}
int PDU__RRM__TalkerIndication__MS__NW::size_of() const
{
  int ret_val = 3;
  if (field_cipheringKeySequenceNumber.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__TalkerIndication__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(", cipheringKeySequenceNumber := ");
field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__TalkerIndication__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 (!cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber() = OMIT_VALUE;
else cipheringKeySequenceNumber().set_implicit_omit();
}

void PDU__RRM__TalkerIndication__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_TalkerIndication_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) cipheringKeySequenceNumber().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(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_TalkerIndication_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_TalkerIndication_MS_NW");
  }
}

void PDU__RRM__TalkerIndication__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_cipheringKeySequenceNumber.encode_text(text_buf);
}

void PDU__RRM__TalkerIndication__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_cipheringKeySequenceNumber.decode_text(text_buf);
}

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

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

int PDU__RRM__TalkerIndication__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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_cipheringKeySequenceNumber = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringKeySequenceNumber().RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_cipheringKeySequenceNumber = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cipheringKeySequenceNumber.ispresent() || field_cipheringKeySequenceNumber().elementIdentifier() !=  bs_13){
  field_cipheringKeySequenceNumber=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cipheringKeySequenceNumber=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__TalkerIndication__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);
  if (field_cipheringKeySequenceNumber.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_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_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]);
  if (field_cipheringKeySequenceNumber.ispresent()) {
  encoded_length += field_cipheringKeySequenceNumber().RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_cipheringKeySequenceNumber.ispresent() && (!field_cipheringKeySequenceNumber.ispresent() || field_cipheringKeySequenceNumber().elementIdentifier() !=  bs_13)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,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_13.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__TalkerIndication__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::CipheringKeySequenceNumberTV_template field_cipheringKeySequenceNumber;
};

void PDU__RRM__TalkerIndication__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_cipheringKeySequenceNumber = ANY_OR_OMIT;
}
}
}

void PDU__RRM__TalkerIndication__MS__NW_template::copy_value(const PDU__RRM__TalkerIndication__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.cipheringKeySequenceNumber().is_bound()) {
  if (other_value.cipheringKeySequenceNumber().ispresent()) single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber()();
  else single_value->field_cipheringKeySequenceNumber = OMIT_VALUE;
} else {
  single_value->field_cipheringKeySequenceNumber.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__TalkerIndication__MS__NW_template::copy_template(const PDU__RRM__TalkerIndication__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.cipheringKeySequenceNumber().get_selection()) {
single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
single_value->field_cipheringKeySequenceNumber.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__TalkerIndication__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__TalkerIndication__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__TalkerIndication__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_TalkerIndication_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__TalkerIndication__MS__NW_template::PDU__RRM__TalkerIndication__MS__NW_template()
{
}

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

PDU__RRM__TalkerIndication__MS__NW_template::PDU__RRM__TalkerIndication__MS__NW_template(const PDU__RRM__TalkerIndication__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__TalkerIndication__MS__NW_template::PDU__RRM__TalkerIndication__MS__NW_template(const OPTIONAL<PDU__RRM__TalkerIndication__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__TalkerIndication__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_TalkerIndication_MS_NW from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__TalkerIndication__MS__NW_template::match(const PDU__RRM__TalkerIndication__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.cipheringKeySequenceNumber().is_bound()) return FALSE;
if((other_value.cipheringKeySequenceNumber().ispresent() ? !single_value->field_cipheringKeySequenceNumber.match((const MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV&)other_value.cipheringKeySequenceNumber(), legacy) : !single_value->field_cipheringKeySequenceNumber.match_omit(legacy)))return FALSE;
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_TalkerIndication_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__TalkerIndication__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_cipheringKeySequenceNumber.is_omit() || single_value->field_cipheringKeySequenceNumber.is_bound());
}

boolean PDU__RRM__TalkerIndication__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_cipheringKeySequenceNumber.is_omit() || single_value->field_cipheringKeySequenceNumber.is_value());
}

void PDU__RRM__TalkerIndication__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__TalkerIndication__MS__NW PDU__RRM__TalkerIndication__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_TalkerIndication_MS_NW.");
PDU__RRM__TalkerIndication__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_cipheringKeySequenceNumber.is_omit()) ret_val.cipheringKeySequenceNumber() = OMIT_VALUE;
else if (single_value->field_cipheringKeySequenceNumber.is_bound()) {
ret_val.cipheringKeySequenceNumber() = single_value->field_cipheringKeySequenceNumber.valueof();
}
return ret_val;
}

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

PDU__RRM__TalkerIndication__MS__NW_template& PDU__RRM__TalkerIndication__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_TalkerIndication_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_TalkerIndication_MS_NW.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__TalkerIndication__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_TalkerIndication_MS_NW.");
return single_value->field_messageType;
}

MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__RRM__TalkerIndication__MS__NW_template::mobileStationClassmark()
{
set_specific();
return single_value->field_mobileStationClassmark;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__RRM__TalkerIndication__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_TalkerIndication_MS_NW.");
return single_value->field_mobileStationClassmark;
}

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

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__RRM__TalkerIndication__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_TalkerIndication_MS_NW.");
return single_value->field_mobileIdentity;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_template& PDU__RRM__TalkerIndication__MS__NW_template::cipheringKeySequenceNumber()
{
set_specific();
return single_value->field_cipheringKeySequenceNumber;
}

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

int PDU__RRM__TalkerIndication__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_TalkerIndication_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_cipheringKeySequenceNumber.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_TalkerIndication_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_TalkerIndication_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_TalkerIndication_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_TalkerIndication_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_TalkerIndication_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_TalkerIndication_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_TalkerIndication_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_TalkerIndication_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_TalkerIndication_MS_NW.");
  }
  return 0;
}

void PDU__RRM__TalkerIndication__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(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.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__TalkerIndication__MS__NW_template::log_match(const PDU__RRM__TalkerIndication__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 (match_value.cipheringKeySequenceNumber().ispresent()){
if(!single_value->field_cipheringKeySequenceNumber.match(match_value.cipheringKeySequenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cipheringKeySequenceNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}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(", cipheringKeySequenceNumber := ");
if (match_value.cipheringKeySequenceNumber().ispresent()) {
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cipheringKeySequenceNumber.log();
if (single_value->field_cipheringKeySequenceNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} 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__TalkerIndication__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_cipheringKeySequenceNumber.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_TalkerIndication_MS_NW.");
}
}

void PDU__RRM__TalkerIndication__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_cipheringKeySequenceNumber.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__TalkerIndication__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_TalkerIndication_MS_NW.");
}
}

void PDU__RRM__TalkerIndication__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__TalkerIndication__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_TalkerIndication_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) cipheringKeySequenceNumber().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(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_TalkerIndication_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__TalkerIndication__MS__NW_template* precondition = new PDU__RRM__TalkerIndication__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__TalkerIndication__MS__NW_template* implied_template = new PDU__RRM__TalkerIndication__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__TalkerIndication__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_TalkerIndication_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__TalkerIndication__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_TalkerIndication_MS_NW");
single_value->field_mobileStationClassmark.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_TalkerIndication_MS_NW");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_TalkerIndication_MS_NW");
single_value->field_cipheringKeySequenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_TalkerIndication_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_TalkerIndication_MS_NW");
}

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

boolean PDU__RRM__TalkerIndication__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__UplinkBusy__NW__MS::PDU__RRM__UplinkBusy__NW__MS()
{
}

PDU__RRM__UplinkBusy__NW__MS::PDU__RRM__UplinkBusy__NW__MS(const BITSTRING& par_messageType,
    const OPTIONAL< TalkerPriorityStatus__TLV >& par_talkerPriorityStatus,
    const OPTIONAL< Token__TV >& par_token,
    const OPTIONAL< TalkerIdentity__TLV >& par_talkerIdentity,
    const OPTIONAL< UplinkAccessIndication__TV >& par_uplinkAccessIndication)
  :   field_messageType(par_messageType),
  field_talkerPriorityStatus(par_talkerPriorityStatus),
  field_token(par_token),
  field_talkerIdentity(par_talkerIdentity),
  field_uplinkAccessIndication(par_uplinkAccessIndication)
{
}

PDU__RRM__UplinkBusy__NW__MS::PDU__RRM__UplinkBusy__NW__MS(const PDU__RRM__UplinkBusy__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.talkerPriorityStatus().is_bound()) field_talkerPriorityStatus = other_value.talkerPriorityStatus();
else field_talkerPriorityStatus.clean_up();
if (other_value.token().is_bound()) field_token = other_value.token();
else field_token.clean_up();
if (other_value.talkerIdentity().is_bound()) field_talkerIdentity = other_value.talkerIdentity();
else field_talkerIdentity.clean_up();
if (other_value.uplinkAccessIndication().is_bound()) field_uplinkAccessIndication = other_value.uplinkAccessIndication();
else field_uplinkAccessIndication.clean_up();
}

void PDU__RRM__UplinkBusy__NW__MS::clean_up()
{
field_messageType.clean_up();
field_talkerPriorityStatus.clean_up();
field_token.clean_up();
field_talkerIdentity.clean_up();
field_uplinkAccessIndication.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__UplinkBusy__NW__MS::get_descriptor() const { return &PDU__RRM__UplinkBusy__NW__MS_descr_; }
PDU__RRM__UplinkBusy__NW__MS& PDU__RRM__UplinkBusy__NW__MS::operator=(const PDU__RRM__UplinkBusy__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_UplinkBusy_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.talkerPriorityStatus().is_bound()) field_talkerPriorityStatus = other_value.talkerPriorityStatus();
  else field_talkerPriorityStatus.clean_up();
  if (other_value.token().is_bound()) field_token = other_value.token();
  else field_token.clean_up();
  if (other_value.talkerIdentity().is_bound()) field_talkerIdentity = other_value.talkerIdentity();
  else field_talkerIdentity.clean_up();
  if (other_value.uplinkAccessIndication().is_bound()) field_uplinkAccessIndication = other_value.uplinkAccessIndication();
  else field_uplinkAccessIndication.clean_up();
}
return *this;
}

boolean PDU__RRM__UplinkBusy__NW__MS::operator==(const PDU__RRM__UplinkBusy__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_talkerPriorityStatus==other_value.field_talkerPriorityStatus
  && field_token==other_value.field_token
  && field_talkerIdentity==other_value.field_talkerIdentity
  && field_uplinkAccessIndication==other_value.field_uplinkAccessIndication;
}

boolean PDU__RRM__UplinkBusy__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (OPTIONAL_OMIT == field_talkerPriorityStatus.get_selection() || field_talkerPriorityStatus.is_bound())
  || (OPTIONAL_OMIT == field_token.get_selection() || field_token.is_bound())
  || (OPTIONAL_OMIT == field_talkerIdentity.get_selection() || field_talkerIdentity.is_bound())
  || (OPTIONAL_OMIT == field_uplinkAccessIndication.get_selection() || field_uplinkAccessIndication.is_bound());
}
boolean PDU__RRM__UplinkBusy__NW__MS::is_value() const
{
return field_messageType.is_value()
  && (OPTIONAL_OMIT == field_talkerPriorityStatus.get_selection() || field_talkerPriorityStatus.is_value())
  && (OPTIONAL_OMIT == field_token.get_selection() || field_token.is_value())
  && (OPTIONAL_OMIT == field_talkerIdentity.get_selection() || field_talkerIdentity.is_value())
  && (OPTIONAL_OMIT == field_uplinkAccessIndication.get_selection() || field_uplinkAccessIndication.is_value());
}
int PDU__RRM__UplinkBusy__NW__MS::size_of() const
{
  int ret_val = 1;
  if (field_talkerPriorityStatus.ispresent()) ret_val++;
  if (field_token.ispresent()) ret_val++;
  if (field_talkerIdentity.ispresent()) ret_val++;
  if (field_uplinkAccessIndication.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__UplinkBusy__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(", talkerPriorityStatus := ");
field_talkerPriorityStatus.log();
TTCN_Logger::log_event_str(", token := ");
field_token.log();
TTCN_Logger::log_event_str(", talkerIdentity := ");
field_talkerIdentity.log();
TTCN_Logger::log_event_str(", uplinkAccessIndication := ");
field_uplinkAccessIndication.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__UplinkBusy__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!talkerPriorityStatus().is_bound()) talkerPriorityStatus() = OMIT_VALUE;
else talkerPriorityStatus().set_implicit_omit();
if (!token().is_bound()) token() = OMIT_VALUE;
else token().set_implicit_omit();
if (!talkerIdentity().is_bound()) talkerIdentity() = OMIT_VALUE;
else talkerIdentity().set_implicit_omit();
if (!uplinkAccessIndication().is_bound()) uplinkAccessIndication() = OMIT_VALUE;
else uplinkAccessIndication().set_implicit_omit();
}

void PDU__RRM__UplinkBusy__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) talkerPriorityStatus().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) token().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) talkerIdentity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uplinkAccessIndication().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(), "talkerPriorityStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          talkerPriorityStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "token")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          token().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "talkerIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          talkerIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uplinkAccessIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uplinkAccessIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_UplinkBusy_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS");
  }
}

void PDU__RRM__UplinkBusy__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_talkerPriorityStatus.encode_text(text_buf);
field_token.encode_text(text_buf);
field_talkerIdentity.encode_text(text_buf);
field_uplinkAccessIndication.encode_text(text_buf);
}

void PDU__RRM__UplinkBusy__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_talkerPriorityStatus.decode_text(text_buf);
field_token.decode_text(text_buf);
field_talkerIdentity.decode_text(text_buf);
field_uplinkAccessIndication.decode_text(text_buf);
}

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

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

int PDU__RRM__UplinkBusy__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_talkerPriorityStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, TalkerPriorityStatus__TLV_descr_.raw->forceomit);
  decoded_field_length = field_talkerPriorityStatus().RAW_decode(TalkerPriorityStatus__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_talkerPriorityStatus = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_talkerPriorityStatus.ispresent() || field_talkerPriorityStatus().elementIdentifier() !=  os_41){
  field_talkerPriorityStatus=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_talkerPriorityStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_token = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, Token__TV_descr_.raw->forceomit);
  decoded_field_length = field_token().RAW_decode(Token__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_token = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_token.ispresent() || field_token().elementIdentifier() !=  os_42){
  field_token=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_token=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_talkerIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, TalkerIdentity__TLV_descr_.raw->forceomit);
  decoded_field_length = field_talkerIdentity().RAW_decode(TalkerIdentity__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_talkerIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_talkerIdentity.ispresent() || field_talkerIdentity().elementIdentifier() !=  os_43){
  field_talkerIdentity=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_talkerIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_uplinkAccessIndication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, UplinkAccessIndication__TV_descr_.raw->forceomit);
  decoded_field_length = field_uplinkAccessIndication().RAW_decode(UplinkAccessIndication__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_uplinkAccessIndication = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_uplinkAccessIndication.ispresent() || field_uplinkAccessIndication().elementIdentifier() !=  bs_2){
  field_uplinkAccessIndication=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_uplinkAccessIndication=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__UplinkBusy__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  if (field_talkerPriorityStatus.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TalkerPriorityStatus__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_token.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Token__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_talkerIdentity.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, TalkerIdentity__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_uplinkAccessIndication.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, UplinkAccessIndication__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]);
  if (field_talkerPriorityStatus.ispresent()) {
  encoded_length += field_talkerPriorityStatus().RAW_encode(TalkerPriorityStatus__TLV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_token.ispresent()) {
  encoded_length += field_token().RAW_encode(Token__TV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_talkerIdentity.ispresent()) {
  encoded_length += field_talkerIdentity().RAW_encode(TalkerIdentity__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_uplinkAccessIndication.ispresent()) {
  encoded_length += field_uplinkAccessIndication().RAW_encode(UplinkAccessIndication__TV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_talkerPriorityStatus.ispresent() && (!field_talkerPriorityStatus.ispresent() || field_talkerPriorityStatus().elementIdentifier() !=  os_41)) {
  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_41.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_token.ispresent() && (!field_token.ispresent() || field_token().elementIdentifier() !=  os_42)) {
  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_42.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_talkerIdentity.ispresent() && (!field_talkerIdentity.ispresent() || field_talkerIdentity().elementIdentifier() !=  os_43)) {
  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_43.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_uplinkAccessIndication.ispresent() && (!field_uplinkAccessIndication.ispresent() || field_uplinkAccessIndication().elementIdentifier() !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,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_2.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__UplinkBusy__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
TalkerPriorityStatus__TLV_template field_talkerPriorityStatus;
Token__TV_template field_token;
TalkerIdentity__TLV_template field_talkerIdentity;
UplinkAccessIndication__TV_template field_uplinkAccessIndication;
};

void PDU__RRM__UplinkBusy__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_talkerPriorityStatus = ANY_OR_OMIT;
single_value->field_token = ANY_OR_OMIT;
single_value->field_talkerIdentity = ANY_OR_OMIT;
single_value->field_uplinkAccessIndication = ANY_OR_OMIT;
}
}
}

void PDU__RRM__UplinkBusy__NW__MS_template::copy_value(const PDU__RRM__UplinkBusy__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.talkerPriorityStatus().is_bound()) {
  if (other_value.talkerPriorityStatus().ispresent()) single_value->field_talkerPriorityStatus = other_value.talkerPriorityStatus()();
  else single_value->field_talkerPriorityStatus = OMIT_VALUE;
} else {
  single_value->field_talkerPriorityStatus.clean_up();
}
if (other_value.token().is_bound()) {
  if (other_value.token().ispresent()) single_value->field_token = other_value.token()();
  else single_value->field_token = OMIT_VALUE;
} else {
  single_value->field_token.clean_up();
}
if (other_value.talkerIdentity().is_bound()) {
  if (other_value.talkerIdentity().ispresent()) single_value->field_talkerIdentity = other_value.talkerIdentity()();
  else single_value->field_talkerIdentity = OMIT_VALUE;
} else {
  single_value->field_talkerIdentity.clean_up();
}
if (other_value.uplinkAccessIndication().is_bound()) {
  if (other_value.uplinkAccessIndication().ispresent()) single_value->field_uplinkAccessIndication = other_value.uplinkAccessIndication()();
  else single_value->field_uplinkAccessIndication = OMIT_VALUE;
} else {
  single_value->field_uplinkAccessIndication.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__UplinkBusy__NW__MS_template::copy_template(const PDU__RRM__UplinkBusy__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.talkerPriorityStatus().get_selection()) {
single_value->field_talkerPriorityStatus = other_value.talkerPriorityStatus();
} else {
single_value->field_talkerPriorityStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.token().get_selection()) {
single_value->field_token = other_value.token();
} else {
single_value->field_token.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.talkerIdentity().get_selection()) {
single_value->field_talkerIdentity = other_value.talkerIdentity();
} else {
single_value->field_talkerIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uplinkAccessIndication().get_selection()) {
single_value->field_uplinkAccessIndication = other_value.uplinkAccessIndication();
} else {
single_value->field_uplinkAccessIndication.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__UplinkBusy__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__UplinkBusy__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__UplinkBusy__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_UplinkBusy_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__UplinkBusy__NW__MS_template::PDU__RRM__UplinkBusy__NW__MS_template()
{
}

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

PDU__RRM__UplinkBusy__NW__MS_template::PDU__RRM__UplinkBusy__NW__MS_template(const PDU__RRM__UplinkBusy__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__UplinkBusy__NW__MS_template::PDU__RRM__UplinkBusy__NW__MS_template(const OPTIONAL<PDU__RRM__UplinkBusy__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__UplinkBusy__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_UplinkBusy_NW_MS from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__UplinkBusy__NW__MS_template::match(const PDU__RRM__UplinkBusy__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.talkerPriorityStatus().is_bound()) return FALSE;
if((other_value.talkerPriorityStatus().ispresent() ? !single_value->field_talkerPriorityStatus.match((const TalkerPriorityStatus__TLV&)other_value.talkerPriorityStatus(), legacy) : !single_value->field_talkerPriorityStatus.match_omit(legacy)))return FALSE;
if(!other_value.token().is_bound()) return FALSE;
if((other_value.token().ispresent() ? !single_value->field_token.match((const Token__TV&)other_value.token(), legacy) : !single_value->field_token.match_omit(legacy)))return FALSE;
if(!other_value.talkerIdentity().is_bound()) return FALSE;
if((other_value.talkerIdentity().ispresent() ? !single_value->field_talkerIdentity.match((const TalkerIdentity__TLV&)other_value.talkerIdentity(), legacy) : !single_value->field_talkerIdentity.match_omit(legacy)))return FALSE;
if(!other_value.uplinkAccessIndication().is_bound()) return FALSE;
if((other_value.uplinkAccessIndication().ispresent() ? !single_value->field_uplinkAccessIndication.match((const UplinkAccessIndication__TV&)other_value.uplinkAccessIndication(), legacy) : !single_value->field_uplinkAccessIndication.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_UplinkBusy_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__UplinkBusy__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_talkerPriorityStatus.is_omit() || single_value->field_talkerPriorityStatus.is_bound())
 || (single_value->field_token.is_omit() || single_value->field_token.is_bound())
 || (single_value->field_talkerIdentity.is_omit() || single_value->field_talkerIdentity.is_bound())
 || (single_value->field_uplinkAccessIndication.is_omit() || single_value->field_uplinkAccessIndication.is_bound());
}

boolean PDU__RRM__UplinkBusy__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_talkerPriorityStatus.is_omit() || single_value->field_talkerPriorityStatus.is_value())
 && (single_value->field_token.is_omit() || single_value->field_token.is_value())
 && (single_value->field_talkerIdentity.is_omit() || single_value->field_talkerIdentity.is_value())
 && (single_value->field_uplinkAccessIndication.is_omit() || single_value->field_uplinkAccessIndication.is_value());
}

void PDU__RRM__UplinkBusy__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__UplinkBusy__NW__MS PDU__RRM__UplinkBusy__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_UplinkBusy_NW_MS.");
PDU__RRM__UplinkBusy__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_talkerPriorityStatus.is_omit()) ret_val.talkerPriorityStatus() = OMIT_VALUE;
else if (single_value->field_talkerPriorityStatus.is_bound()) {
ret_val.talkerPriorityStatus() = single_value->field_talkerPriorityStatus.valueof();
}
if (single_value->field_token.is_omit()) ret_val.token() = OMIT_VALUE;
else if (single_value->field_token.is_bound()) {
ret_val.token() = single_value->field_token.valueof();
}
if (single_value->field_talkerIdentity.is_omit()) ret_val.talkerIdentity() = OMIT_VALUE;
else if (single_value->field_talkerIdentity.is_bound()) {
ret_val.talkerIdentity() = single_value->field_talkerIdentity.valueof();
}
if (single_value->field_uplinkAccessIndication.is_omit()) ret_val.uplinkAccessIndication() = OMIT_VALUE;
else if (single_value->field_uplinkAccessIndication.is_bound()) {
ret_val.uplinkAccessIndication() = single_value->field_uplinkAccessIndication.valueof();
}
return ret_val;
}

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

PDU__RRM__UplinkBusy__NW__MS_template& PDU__RRM__UplinkBusy__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_UplinkBusy_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_UplinkBusy_NW_MS.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__UplinkBusy__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_UplinkBusy_NW_MS.");
return single_value->field_messageType;
}

TalkerPriorityStatus__TLV_template& PDU__RRM__UplinkBusy__NW__MS_template::talkerPriorityStatus()
{
set_specific();
return single_value->field_talkerPriorityStatus;
}

const TalkerPriorityStatus__TLV_template& PDU__RRM__UplinkBusy__NW__MS_template::talkerPriorityStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field talkerPriorityStatus of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS.");
return single_value->field_talkerPriorityStatus;
}

Token__TV_template& PDU__RRM__UplinkBusy__NW__MS_template::token()
{
set_specific();
return single_value->field_token;
}

const Token__TV_template& PDU__RRM__UplinkBusy__NW__MS_template::token() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field token of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS.");
return single_value->field_token;
}

TalkerIdentity__TLV_template& PDU__RRM__UplinkBusy__NW__MS_template::talkerIdentity()
{
set_specific();
return single_value->field_talkerIdentity;
}

const TalkerIdentity__TLV_template& PDU__RRM__UplinkBusy__NW__MS_template::talkerIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field talkerIdentity of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS.");
return single_value->field_talkerIdentity;
}

UplinkAccessIndication__TV_template& PDU__RRM__UplinkBusy__NW__MS_template::uplinkAccessIndication()
{
set_specific();
return single_value->field_uplinkAccessIndication;
}

const UplinkAccessIndication__TV_template& PDU__RRM__UplinkBusy__NW__MS_template::uplinkAccessIndication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uplinkAccessIndication of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS.");
return single_value->field_uplinkAccessIndication;
}

int PDU__RRM__UplinkBusy__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_talkerPriorityStatus.is_present()) ret_val++;
      if (single_value->field_token.is_present()) ret_val++;
      if (single_value->field_talkerIdentity.is_present()) ret_val++;
      if (single_value->field_uplinkAccessIndication.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_UplinkBusy_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_UplinkBusy_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_UplinkBusy_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_UplinkBusy_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_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_UplinkBusy_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS.");
  }
  return 0;
}

void PDU__RRM__UplinkBusy__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(", talkerPriorityStatus := ");
single_value->field_talkerPriorityStatus.log();
TTCN_Logger::log_event_str(", token := ");
single_value->field_token.log();
TTCN_Logger::log_event_str(", talkerIdentity := ");
single_value->field_talkerIdentity.log();
TTCN_Logger::log_event_str(", uplinkAccessIndication := ");
single_value->field_uplinkAccessIndication.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__UplinkBusy__NW__MS_template::log_match(const PDU__RRM__UplinkBusy__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.talkerPriorityStatus().ispresent()){
if(!single_value->field_talkerPriorityStatus.match(match_value.talkerPriorityStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".talkerPriorityStatus");
single_value->field_talkerPriorityStatus.log_match(match_value.talkerPriorityStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_talkerPriorityStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".talkerPriorityStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_talkerPriorityStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.token().ispresent()){
if(!single_value->field_token.match(match_value.token(), legacy)){
TTCN_Logger::log_logmatch_info(".token");
single_value->field_token.log_match(match_value.token(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_token.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".token := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_token.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.talkerIdentity().ispresent()){
if(!single_value->field_talkerIdentity.match(match_value.talkerIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".talkerIdentity");
single_value->field_talkerIdentity.log_match(match_value.talkerIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_talkerIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".talkerIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_talkerIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.uplinkAccessIndication().ispresent()){
if(!single_value->field_uplinkAccessIndication.match(match_value.uplinkAccessIndication(), legacy)){
TTCN_Logger::log_logmatch_info(".uplinkAccessIndication");
single_value->field_uplinkAccessIndication.log_match(match_value.uplinkAccessIndication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uplinkAccessIndication.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uplinkAccessIndication := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uplinkAccessIndication.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(", talkerPriorityStatus := ");
if (match_value.talkerPriorityStatus().ispresent()) {
single_value->field_talkerPriorityStatus.log_match(match_value.talkerPriorityStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_talkerPriorityStatus.log();
if (single_value->field_talkerPriorityStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", token := ");
if (match_value.token().ispresent()) {
single_value->field_token.log_match(match_value.token(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_token.log();
if (single_value->field_token.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", talkerIdentity := ");
if (match_value.talkerIdentity().ispresent()) {
single_value->field_talkerIdentity.log_match(match_value.talkerIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_talkerIdentity.log();
if (single_value->field_talkerIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", uplinkAccessIndication := ");
if (match_value.uplinkAccessIndication().ispresent()) {
single_value->field_uplinkAccessIndication.log_match(match_value.uplinkAccessIndication(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uplinkAccessIndication.log();
if (single_value->field_uplinkAccessIndication.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__UplinkBusy__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_talkerPriorityStatus.encode_text(text_buf);
single_value->field_token.encode_text(text_buf);
single_value->field_talkerIdentity.encode_text(text_buf);
single_value->field_uplinkAccessIndication.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_UplinkBusy_NW_MS.");
}
}

void PDU__RRM__UplinkBusy__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_talkerPriorityStatus.decode_text(text_buf);
single_value->field_token.decode_text(text_buf);
single_value->field_talkerIdentity.decode_text(text_buf);
single_value->field_uplinkAccessIndication.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__UplinkBusy__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_UplinkBusy_NW_MS.");
}
}

void PDU__RRM__UplinkBusy__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__UplinkBusy__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) talkerPriorityStatus().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) token().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) talkerIdentity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uplinkAccessIndication().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(), "talkerPriorityStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          talkerPriorityStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "token")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          token().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "talkerIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          talkerIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uplinkAccessIndication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uplinkAccessIndication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_UplinkBusy_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__UplinkBusy__NW__MS_template* precondition = new PDU__RRM__UplinkBusy__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__UplinkBusy__NW__MS_template* implied_template = new PDU__RRM__UplinkBusy__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__UplinkBusy__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__UplinkBusy__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_UplinkBusy_NW_MS");
single_value->field_talkerPriorityStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS");
single_value->field_token.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS");
single_value->field_talkerIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_UplinkBusy_NW_MS");
single_value->field_uplinkAccessIndication.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_UplinkBusy_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_UplinkBusy_NW_MS");
}

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

boolean PDU__RRM__UplinkBusy__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__UplinkRelease::PDU__RRM__UplinkRelease()
{
}

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

PDU__RRM__UplinkRelease::PDU__RRM__UplinkRelease(const PDU__RRM__UplinkRelease& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_UplinkRelease.");
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__UplinkRelease::clean_up()
{
field_messageType.clean_up();
field_rR__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__UplinkRelease::get_descriptor() const { return &PDU__RRM__UplinkRelease_descr_; }
PDU__RRM__UplinkRelease& PDU__RRM__UplinkRelease::operator=(const PDU__RRM__UplinkRelease& 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_UplinkRelease.");
  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__UplinkRelease::operator==(const PDU__RRM__UplinkRelease& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rR__Cause==other_value.field_rR__Cause;
}

boolean PDU__RRM__UplinkRelease::is_bound() const
{
return (field_messageType.is_bound())
  || (field_rR__Cause.is_bound());
}
boolean PDU__RRM__UplinkRelease::is_value() const
{
return field_messageType.is_value()
  && field_rR__Cause.is_value();
}
void PDU__RRM__UplinkRelease::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__UplinkRelease::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rR__Cause().is_bound()) rR__Cause().set_implicit_omit();
}

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

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

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

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

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

int PDU__RRM__UplinkRelease::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__UplinkRelease::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__UplinkRelease_template::single_value_struct {
BITSTRING_template field_messageType;
RR__Cause__V_template field_rR__Cause;
};

void PDU__RRM__UplinkRelease_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__UplinkRelease_template::copy_value(const PDU__RRM__UplinkRelease& 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__UplinkRelease_template::copy_template(const PDU__RRM__UplinkRelease_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__UplinkRelease_template[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__UplinkRelease_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__UplinkRelease_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_UplinkRelease.");
break;
}
set_selection(other_value);
}

PDU__RRM__UplinkRelease_template::PDU__RRM__UplinkRelease_template()
{
}

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

PDU__RRM__UplinkRelease_template::PDU__RRM__UplinkRelease_template(const PDU__RRM__UplinkRelease& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__UplinkRelease_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__UplinkRelease_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__UplinkRelease_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__UplinkRelease PDU__RRM__UplinkRelease_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_UplinkRelease.");
PDU__RRM__UplinkRelease 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__UplinkRelease_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_UplinkRelease.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__UplinkRelease_template[list_length];
}

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

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

const BITSTRING_template& PDU__RRM__UplinkRelease_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_UplinkRelease.");
return single_value->field_messageType;
}

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

const RR__Cause__V_template& PDU__RRM__UplinkRelease_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_UplinkRelease.");
return single_value->field_rR__Cause;
}

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

void PDU__RRM__UplinkRelease_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__UplinkRelease_template::log_match(const PDU__RRM__UplinkRelease& 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__UplinkRelease_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_UplinkRelease.");
}
}

void PDU__RRM__UplinkRelease_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__UplinkRelease_template[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_UplinkRelease.");
}
}

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

void PDU__RRM__UplinkRelease_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_UplinkRelease");
single_value->field_rR__Cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_UplinkRelease");
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_UplinkRelease");
}

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

boolean PDU__RRM__UplinkRelease_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__VGCS__UplinkGrant__NW__MS::PDU__RRM__VGCS__UplinkGrant__NW__MS()
{
}

PDU__RRM__VGCS__UplinkGrant__NW__MS::PDU__RRM__VGCS__UplinkGrant__NW__MS(const BITSTRING& par_messageType,
    const RequestReference__V& par_requestReference,
    const OCTETSTRING& par_timingAdvance)
  :   field_messageType(par_messageType),
  field_requestReference(par_requestReference),
  field_timingAdvance(par_timingAdvance)
{
}

PDU__RRM__VGCS__UplinkGrant__NW__MS::PDU__RRM__VGCS__UplinkGrant__NW__MS(const PDU__RRM__VGCS__UplinkGrant__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.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();
}

void PDU__RRM__VGCS__UplinkGrant__NW__MS::clean_up()
{
field_messageType.clean_up();
field_requestReference.clean_up();
field_timingAdvance.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__VGCS__UplinkGrant__NW__MS::get_descriptor() const { return &PDU__RRM__VGCS__UplinkGrant__NW__MS_descr_; }
PDU__RRM__VGCS__UplinkGrant__NW__MS& PDU__RRM__VGCS__UplinkGrant__NW__MS::operator=(const PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.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();
}
return *this;
}

boolean PDU__RRM__VGCS__UplinkGrant__NW__MS::operator==(const PDU__RRM__VGCS__UplinkGrant__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_requestReference==other_value.field_requestReference
  && field_timingAdvance==other_value.field_timingAdvance;
}

boolean PDU__RRM__VGCS__UplinkGrant__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_requestReference.is_bound())
  || (field_timingAdvance.is_bound());
}
boolean PDU__RRM__VGCS__UplinkGrant__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_requestReference.is_value()
  && field_timingAdvance.is_value();
}
void PDU__RRM__VGCS__UplinkGrant__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(", requestReference := ");
field_requestReference.log();
TTCN_Logger::log_event_str(", timingAdvance := ");
field_timingAdvance.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__VGCS__UplinkGrant__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (requestReference().is_bound()) requestReference().set_implicit_omit();
if (timingAdvance().is_bound()) timingAdvance().set_implicit_omit();
}

void PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_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) requestReference().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) timingAdvance().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(), "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++) if (!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_VGCS_UplinkGrant_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_NW_MS");
  }
}

void PDU__RRM__VGCS__UplinkGrant__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_requestReference.encode_text(text_buf);
field_timingAdvance.encode_text(text_buf);
}

void PDU__RRM__VGCS__UplinkGrant__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_requestReference.decode_text(text_buf);
field_timingAdvance.decode_text(text_buf);
}

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

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

int PDU__RRM__VGCS__UplinkGrant__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, 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_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_timingAdvance.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct PDU__RRM__VGCS__UplinkGrant__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
RequestReference__V_template field_requestReference;
OCTETSTRING_template field_timingAdvance;
};

void PDU__RRM__VGCS__UplinkGrant__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_requestReference = ANY_VALUE;
single_value->field_timingAdvance = ANY_VALUE;
}
}
}

void PDU__RRM__VGCS__UplinkGrant__NW__MS_template::copy_value(const PDU__RRM__VGCS__UplinkGrant__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.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();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__VGCS__UplinkGrant__NW__MS_template::copy_template(const PDU__RRM__VGCS__UplinkGrant__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.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();
}
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__VGCS__UplinkGrant__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__VGCS__UplinkGrant__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__VGCS__UplinkGrant__NW__MS_template::PDU__RRM__VGCS__UplinkGrant__NW__MS_template()
{
}

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

PDU__RRM__VGCS__UplinkGrant__NW__MS_template::PDU__RRM__VGCS__UplinkGrant__NW__MS_template(const PDU__RRM__VGCS__UplinkGrant__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__VGCS__UplinkGrant__NW__MS_template::PDU__RRM__VGCS__UplinkGrant__NW__MS_template(const OPTIONAL<PDU__RRM__VGCS__UplinkGrant__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_NW_MS from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__VGCS__UplinkGrant__NW__MS_template::match(const PDU__RRM__VGCS__UplinkGrant__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.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;
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_VGCS_UplinkGrant_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__VGCS__UplinkGrant__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_requestReference.is_bound()
 || single_value->field_timingAdvance.is_bound();
}

boolean PDU__RRM__VGCS__UplinkGrant__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_requestReference.is_value()
 && single_value->field_timingAdvance.is_value();
}

void PDU__RRM__VGCS__UplinkGrant__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__VGCS__UplinkGrant__NW__MS PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_NW_MS.");
PDU__RRM__VGCS__UplinkGrant__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.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();
}
return ret_val;
}

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

PDU__RRM__VGCS__UplinkGrant__NW__MS_template& PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_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_VGCS_UplinkGrant_NW_MS.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_NW_MS.");
return single_value->field_messageType;
}

RequestReference__V_template& PDU__RRM__VGCS__UplinkGrant__NW__MS_template::requestReference()
{
set_specific();
return single_value->field_requestReference;
}

const RequestReference__V_template& PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_NW_MS.");
return single_value->field_requestReference;
}

OCTETSTRING_template& PDU__RRM__VGCS__UplinkGrant__NW__MS_template::timingAdvance()
{
set_specific();
return single_value->field_timingAdvance;
}

const OCTETSTRING_template& PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_NW_MS.");
return single_value->field_timingAdvance;
}

int PDU__RRM__VGCS__UplinkGrant__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_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_VGCS_UplinkGrant_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_VGCS_UplinkGrant_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_VGCS_UplinkGrant_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_VGCS_UplinkGrant_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_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_VGCS_UplinkGrant_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_NW_MS.");
  }
  return 0;
}

void PDU__RRM__VGCS__UplinkGrant__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(", requestReference := ");
single_value->field_requestReference.log();
TTCN_Logger::log_event_str(", timingAdvance := ");
single_value->field_timingAdvance.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__VGCS__UplinkGrant__NW__MS_template::log_match(const PDU__RRM__VGCS__UplinkGrant__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_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);
}
}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(", 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(" }");
} 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__VGCS__UplinkGrant__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_requestReference.encode_text(text_buf);
single_value->field_timingAdvance.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_VGCS_UplinkGrant_NW_MS.");
}
}

void PDU__RRM__VGCS__UplinkGrant__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_requestReference.decode_text(text_buf);
single_value->field_timingAdvance.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__VGCS__UplinkGrant__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_VGCS_UplinkGrant_NW_MS.");
}
}

void PDU__RRM__VGCS__UplinkGrant__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__VGCS__UplinkGrant__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_VGCS_UplinkGrant_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) requestReference().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) timingAdvance().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(), "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++) if (!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_VGCS_UplinkGrant_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__VGCS__UplinkGrant__NW__MS_template* precondition = new PDU__RRM__VGCS__UplinkGrant__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__VGCS__UplinkGrant__NW__MS_template* implied_template = new PDU__RRM__VGCS__UplinkGrant__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__VGCS__UplinkGrant__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__VGCS__UplinkGrant__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_VGCS_UplinkGrant_NW_MS");
single_value->field_requestReference.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_NW_MS");
single_value->field_timingAdvance.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_VGCS_UplinkGrant_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_VGCS_UplinkGrant_NW_MS");
}

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

boolean PDU__RRM__VGCS__UplinkGrant__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__ApplicationInformation::PDU__RRM__ApplicationInformation()
{
}

PDU__RRM__ApplicationInformation::PDU__RRM__ApplicationInformation(const BITSTRING& par_messageType,
    const BITSTRING& par_aPDU__ID,
    const APDU__Flags__V& par_aPDU__Flags,
    const APDU__Data__LV& par_aPDU__Data)
  :   field_messageType(par_messageType),
  field_aPDU__ID(par_aPDU__ID),
  field_aPDU__Flags(par_aPDU__Flags),
  field_aPDU__Data(par_aPDU__Data)
{
}

PDU__RRM__ApplicationInformation::PDU__RRM__ApplicationInformation(const PDU__RRM__ApplicationInformation& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ApplicationInformation.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.aPDU__ID().is_bound()) field_aPDU__ID = other_value.aPDU__ID();
else field_aPDU__ID.clean_up();
if (other_value.aPDU__Flags().is_bound()) field_aPDU__Flags = other_value.aPDU__Flags();
else field_aPDU__Flags.clean_up();
if (other_value.aPDU__Data().is_bound()) field_aPDU__Data = other_value.aPDU__Data();
else field_aPDU__Data.clean_up();
}

void PDU__RRM__ApplicationInformation::clean_up()
{
field_messageType.clean_up();
field_aPDU__ID.clean_up();
field_aPDU__Flags.clean_up();
field_aPDU__Data.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ApplicationInformation::get_descriptor() const { return &PDU__RRM__ApplicationInformation_descr_; }
PDU__RRM__ApplicationInformation& PDU__RRM__ApplicationInformation::operator=(const PDU__RRM__ApplicationInformation& 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_ApplicationInformation.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.aPDU__ID().is_bound()) field_aPDU__ID = other_value.aPDU__ID();
  else field_aPDU__ID.clean_up();
  if (other_value.aPDU__Flags().is_bound()) field_aPDU__Flags = other_value.aPDU__Flags();
  else field_aPDU__Flags.clean_up();
  if (other_value.aPDU__Data().is_bound()) field_aPDU__Data = other_value.aPDU__Data();
  else field_aPDU__Data.clean_up();
}
return *this;
}

boolean PDU__RRM__ApplicationInformation::operator==(const PDU__RRM__ApplicationInformation& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_aPDU__ID==other_value.field_aPDU__ID
  && field_aPDU__Flags==other_value.field_aPDU__Flags
  && field_aPDU__Data==other_value.field_aPDU__Data;
}

boolean PDU__RRM__ApplicationInformation::is_bound() const
{
return (field_messageType.is_bound())
  || (field_aPDU__ID.is_bound())
  || (field_aPDU__Flags.is_bound())
  || (field_aPDU__Data.is_bound());
}
boolean PDU__RRM__ApplicationInformation::is_value() const
{
return field_messageType.is_value()
  && field_aPDU__ID.is_value()
  && field_aPDU__Flags.is_value()
  && field_aPDU__Data.is_value();
}
void PDU__RRM__ApplicationInformation::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(", aPDU_ID := ");
field_aPDU__ID.log();
TTCN_Logger::log_event_str(", aPDU_Flags := ");
field_aPDU__Flags.log();
TTCN_Logger::log_event_str(", aPDU_Data := ");
field_aPDU__Data.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ApplicationInformation::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (aPDU__ID().is_bound()) aPDU__ID().set_implicit_omit();
if (aPDU__Flags().is_bound()) aPDU__Flags().set_implicit_omit();
if (aPDU__Data().is_bound()) aPDU__Data().set_implicit_omit();
}

void PDU__RRM__ApplicationInformation::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_ApplicationInformation 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) aPDU__ID().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) aPDU__Flags().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) aPDU__Data().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(), "aPDU_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aPDU__ID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aPDU_Flags")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aPDU__Flags().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aPDU_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aPDU__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_ApplicationInformation: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ApplicationInformation");
  }
}

void PDU__RRM__ApplicationInformation::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_aPDU__ID.encode_text(text_buf);
field_aPDU__Flags.encode_text(text_buf);
field_aPDU__Data.encode_text(text_buf);
}

void PDU__RRM__ApplicationInformation::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_aPDU__ID.decode_text(text_buf);
field_aPDU__Flags.decode_text(text_buf);
field_aPDU__Data.decode_text(text_buf);
}

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

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

int PDU__RRM__ApplicationInformation::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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_aPDU__ID.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, APDU__Flags__V_descr_.raw->forceomit);
  decoded_field_length = field_aPDU__Flags.RAW_decode(APDU__Flags__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, APDU__Data__LV_descr_.raw->forceomit);
  decoded_field_length = field_aPDU__Data.RAW_decode(APDU__Data__LV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__ApplicationInformation::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, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, APDU__Flags__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, APDU__Data__LV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_aPDU__ID.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_aPDU__Flags.RAW_encode(APDU__Flags__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_aPDU__Data.RAW_encode(APDU__Data__LV_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ApplicationInformation_template::single_value_struct {
BITSTRING_template field_messageType;
BITSTRING_template field_aPDU__ID;
APDU__Flags__V_template field_aPDU__Flags;
APDU__Data__LV_template field_aPDU__Data;
};

void PDU__RRM__ApplicationInformation_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_aPDU__ID = ANY_VALUE;
single_value->field_aPDU__Flags = ANY_VALUE;
single_value->field_aPDU__Data = ANY_VALUE;
}
}
}

void PDU__RRM__ApplicationInformation_template::copy_value(const PDU__RRM__ApplicationInformation& 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.aPDU__ID().is_bound()) {
  single_value->field_aPDU__ID = other_value.aPDU__ID();
} else {
  single_value->field_aPDU__ID.clean_up();
}
if (other_value.aPDU__Flags().is_bound()) {
  single_value->field_aPDU__Flags = other_value.aPDU__Flags();
} else {
  single_value->field_aPDU__Flags.clean_up();
}
if (other_value.aPDU__Data().is_bound()) {
  single_value->field_aPDU__Data = other_value.aPDU__Data();
} else {
  single_value->field_aPDU__Data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ApplicationInformation_template::copy_template(const PDU__RRM__ApplicationInformation_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.aPDU__ID().get_selection()) {
single_value->field_aPDU__ID = other_value.aPDU__ID();
} else {
single_value->field_aPDU__ID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aPDU__Flags().get_selection()) {
single_value->field_aPDU__Flags = other_value.aPDU__Flags();
} else {
single_value->field_aPDU__Flags.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aPDU__Data().get_selection()) {
single_value->field_aPDU__Data = other_value.aPDU__Data();
} else {
single_value->field_aPDU__Data.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__ApplicationInformation_template[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__ApplicationInformation_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ApplicationInformation_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_ApplicationInformation.");
break;
}
set_selection(other_value);
}

PDU__RRM__ApplicationInformation_template::PDU__RRM__ApplicationInformation_template()
{
}

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

PDU__RRM__ApplicationInformation_template::PDU__RRM__ApplicationInformation_template(const PDU__RRM__ApplicationInformation& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__RRM__ApplicationInformation_template::match(const PDU__RRM__ApplicationInformation& 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.aPDU__ID().is_bound()) return FALSE;
if(!single_value->field_aPDU__ID.match(other_value.aPDU__ID(), legacy))return FALSE;
if(!other_value.aPDU__Flags().is_bound()) return FALSE;
if(!single_value->field_aPDU__Flags.match(other_value.aPDU__Flags(), legacy))return FALSE;
if(!other_value.aPDU__Data().is_bound()) return FALSE;
if(!single_value->field_aPDU__Data.match(other_value.aPDU__Data(), 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_ApplicationInformation.");
}
return FALSE;
}

boolean PDU__RRM__ApplicationInformation_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_aPDU__ID.is_bound()
 || single_value->field_aPDU__Flags.is_bound()
 || single_value->field_aPDU__Data.is_bound();
}

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

void PDU__RRM__ApplicationInformation_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__ApplicationInformation PDU__RRM__ApplicationInformation_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_ApplicationInformation.");
PDU__RRM__ApplicationInformation ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_aPDU__ID.is_bound()) {
ret_val.aPDU__ID() = single_value->field_aPDU__ID.valueof();
}
if (single_value->field_aPDU__Flags.is_bound()) {
ret_val.aPDU__Flags() = single_value->field_aPDU__Flags.valueof();
}
if (single_value->field_aPDU__Data.is_bound()) {
ret_val.aPDU__Data() = single_value->field_aPDU__Data.valueof();
}
return ret_val;
}

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

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

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

const BITSTRING_template& PDU__RRM__ApplicationInformation_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_ApplicationInformation.");
return single_value->field_messageType;
}

BITSTRING_template& PDU__RRM__ApplicationInformation_template::aPDU__ID()
{
set_specific();
return single_value->field_aPDU__ID;
}

const BITSTRING_template& PDU__RRM__ApplicationInformation_template::aPDU__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aPDU_ID of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ApplicationInformation.");
return single_value->field_aPDU__ID;
}

APDU__Flags__V_template& PDU__RRM__ApplicationInformation_template::aPDU__Flags()
{
set_specific();
return single_value->field_aPDU__Flags;
}

const APDU__Flags__V_template& PDU__RRM__ApplicationInformation_template::aPDU__Flags() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aPDU_Flags of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ApplicationInformation.");
return single_value->field_aPDU__Flags;
}

APDU__Data__LV_template& PDU__RRM__ApplicationInformation_template::aPDU__Data()
{
set_specific();
return single_value->field_aPDU__Data;
}

const APDU__Data__LV_template& PDU__RRM__ApplicationInformation_template::aPDU__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aPDU_Data of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ApplicationInformation.");
return single_value->field_aPDU__Data;
}

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

void PDU__RRM__ApplicationInformation_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(", aPDU_ID := ");
single_value->field_aPDU__ID.log();
TTCN_Logger::log_event_str(", aPDU_Flags := ");
single_value->field_aPDU__Flags.log();
TTCN_Logger::log_event_str(", aPDU_Data := ");
single_value->field_aPDU__Data.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__ApplicationInformation_template::log_match(const PDU__RRM__ApplicationInformation& 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_aPDU__ID.match(match_value.aPDU__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".aPDU_ID");
single_value->field_aPDU__ID.log_match(match_value.aPDU__ID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aPDU__Flags.match(match_value.aPDU__Flags(), legacy)){
TTCN_Logger::log_logmatch_info(".aPDU_Flags");
single_value->field_aPDU__Flags.log_match(match_value.aPDU__Flags(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aPDU__Data.match(match_value.aPDU__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".aPDU_Data");
single_value->field_aPDU__Data.log_match(match_value.aPDU__Data(), 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(", aPDU_ID := ");
single_value->field_aPDU__ID.log_match(match_value.aPDU__ID(), legacy);
TTCN_Logger::log_event_str(", aPDU_Flags := ");
single_value->field_aPDU__Flags.log_match(match_value.aPDU__Flags(), legacy);
TTCN_Logger::log_event_str(", aPDU_Data := ");
single_value->field_aPDU__Data.log_match(match_value.aPDU__Data(), 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__ApplicationInformation_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_aPDU__ID.encode_text(text_buf);
single_value->field_aPDU__Flags.encode_text(text_buf);
single_value->field_aPDU__Data.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_ApplicationInformation.");
}
}

void PDU__RRM__ApplicationInformation_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_aPDU__ID.decode_text(text_buf);
single_value->field_aPDU__Flags.decode_text(text_buf);
single_value->field_aPDU__Data.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__ApplicationInformation_template[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_ApplicationInformation.");
}
}

void PDU__RRM__ApplicationInformation_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__ApplicationInformation_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_ApplicationInformation 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) aPDU__ID().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) aPDU__Flags().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) aPDU__Data().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(), "aPDU_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aPDU__ID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aPDU_Flags")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aPDU__Flags().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aPDU_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aPDU__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_ApplicationInformation: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ApplicationInformation_template* precondition = new PDU__RRM__ApplicationInformation_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ApplicationInformation_template* implied_template = new PDU__RRM__ApplicationInformation_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ApplicationInformation_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ApplicationInformation");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ApplicationInformation_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_ApplicationInformation");
single_value->field_aPDU__ID.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ApplicationInformation");
single_value->field_aPDU__Flags.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ApplicationInformation");
single_value->field_aPDU__Data.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ApplicationInformation");
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_ApplicationInformation");
}

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

boolean PDU__RRM__ApplicationInformation_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__ServiceInformationMessage__MS__NW::PDU__RRM__ServiceInformationMessage__MS__NW()
{
}

PDU__RRM__ServiceInformationMessage__MS__NW::PDU__RRM__ServiceInformationMessage__MS__NW(const BITSTRING& par_messageType,
    const OCTETSTRING& par_tLLI,
    const MobileL3__GMM__SM__Types::RoutingAreaIdentificationV& par_routingAreaIdentification,
    const ServiceSupport__V& par_serviceSupport)
  :   field_messageType(par_messageType),
  field_tLLI(par_tLLI),
  field_routingAreaIdentification(par_routingAreaIdentification),
  field_serviceSupport(par_serviceSupport)
{
}

PDU__RRM__ServiceInformationMessage__MS__NW::PDU__RRM__ServiceInformationMessage__MS__NW(const PDU__RRM__ServiceInformationMessage__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_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.serviceSupport().is_bound()) field_serviceSupport = other_value.serviceSupport();
else field_serviceSupport.clean_up();
}

void PDU__RRM__ServiceInformationMessage__MS__NW::clean_up()
{
field_messageType.clean_up();
field_tLLI.clean_up();
field_routingAreaIdentification.clean_up();
field_serviceSupport.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ServiceInformationMessage__MS__NW::get_descriptor() const { return &PDU__RRM__ServiceInformationMessage__MS__NW_descr_; }
PDU__RRM__ServiceInformationMessage__MS__NW& PDU__RRM__ServiceInformationMessage__MS__NW::operator=(const PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_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.serviceSupport().is_bound()) field_serviceSupport = other_value.serviceSupport();
  else field_serviceSupport.clean_up();
}
return *this;
}

boolean PDU__RRM__ServiceInformationMessage__MS__NW::operator==(const PDU__RRM__ServiceInformationMessage__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_serviceSupport==other_value.field_serviceSupport;
}

boolean PDU__RRM__ServiceInformationMessage__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_tLLI.is_bound())
  || (field_routingAreaIdentification.is_bound())
  || (field_serviceSupport.is_bound());
}
boolean PDU__RRM__ServiceInformationMessage__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_tLLI.is_value()
  && field_routingAreaIdentification.is_value()
  && field_serviceSupport.is_value();
}
void PDU__RRM__ServiceInformationMessage__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(", serviceSupport := ");
field_serviceSupport.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ServiceInformationMessage__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 (serviceSupport().is_bound()) serviceSupport().set_implicit_omit();
}

void PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_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) 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) serviceSupport().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(), "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(), "serviceSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          serviceSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_ServiceInformationMessage_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_MS_NW");
  }
}

void PDU__RRM__ServiceInformationMessage__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_serviceSupport.encode_text(text_buf);
}

void PDU__RRM__ServiceInformationMessage__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_serviceSupport.decode_text(text_buf);
}

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

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

int PDU__RRM__ServiceInformationMessage__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, ServiceSupport__V_descr_.raw->forceomit);
  decoded_field_length = field_serviceSupport.RAW_decode(ServiceSupport__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__ServiceInformationMessage__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, 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, ServiceSupport__V_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_routingAreaIdentification.RAW_encode(MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_serviceSupport.RAW_encode(ServiceSupport__V_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ServiceInformationMessage__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
OCTETSTRING_template field_tLLI;
MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_template field_routingAreaIdentification;
ServiceSupport__V_template field_serviceSupport;
};

void PDU__RRM__ServiceInformationMessage__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_serviceSupport = ANY_VALUE;
}
}
}

void PDU__RRM__ServiceInformationMessage__MS__NW_template::copy_value(const PDU__RRM__ServiceInformationMessage__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.serviceSupport().is_bound()) {
  single_value->field_serviceSupport = other_value.serviceSupport();
} else {
  single_value->field_serviceSupport.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ServiceInformationMessage__MS__NW_template::copy_template(const PDU__RRM__ServiceInformationMessage__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.serviceSupport().get_selection()) {
single_value->field_serviceSupport = other_value.serviceSupport();
} else {
single_value->field_serviceSupport.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__ServiceInformationMessage__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__ServiceInformationMessage__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__ServiceInformationMessage__MS__NW_template::PDU__RRM__ServiceInformationMessage__MS__NW_template()
{
}

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

PDU__RRM__ServiceInformationMessage__MS__NW_template::PDU__RRM__ServiceInformationMessage__MS__NW_template(const PDU__RRM__ServiceInformationMessage__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__ServiceInformationMessage__MS__NW_template::PDU__RRM__ServiceInformationMessage__MS__NW_template(const OPTIONAL<PDU__RRM__ServiceInformationMessage__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_MS_NW from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean PDU__RRM__ServiceInformationMessage__MS__NW_template::match(const PDU__RRM__ServiceInformationMessage__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.serviceSupport().is_bound()) return FALSE;
if(!single_value->field_serviceSupport.match(other_value.serviceSupport(), 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_ServiceInformationMessage_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__ServiceInformationMessage__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_serviceSupport.is_bound();
}

boolean PDU__RRM__ServiceInformationMessage__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_serviceSupport.is_value();
}

void PDU__RRM__ServiceInformationMessage__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__ServiceInformationMessage__MS__NW PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_MS_NW.");
PDU__RRM__ServiceInformationMessage__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_serviceSupport.is_bound()) {
ret_val.serviceSupport() = single_value->field_serviceSupport.valueof();
}
return ret_val;
}

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

PDU__RRM__ServiceInformationMessage__MS__NW_template& PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_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_ServiceInformationMessage_MS_NW.");
return value_list.list_value[list_index];
}

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

const BITSTRING_template& PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_MS_NW.");
return single_value->field_messageType;
}

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

const OCTETSTRING_template& PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_MS_NW.");
return single_value->field_tLLI;
}

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

const MobileL3__GMM__SM__Types::RoutingAreaIdentificationV_template& PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_MS_NW.");
return single_value->field_routingAreaIdentification;
}

ServiceSupport__V_template& PDU__RRM__ServiceInformationMessage__MS__NW_template::serviceSupport()
{
set_specific();
return single_value->field_serviceSupport;
}

const ServiceSupport__V_template& PDU__RRM__ServiceInformationMessage__MS__NW_template::serviceSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field serviceSupport of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_MS_NW.");
return single_value->field_serviceSupport;
}

int PDU__RRM__ServiceInformationMessage__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_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_ServiceInformationMessage_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_ServiceInformationMessage_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_ServiceInformationMessage_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_ServiceInformationMessage_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_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_ServiceInformationMessage_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_MS_NW.");
  }
  return 0;
}

void PDU__RRM__ServiceInformationMessage__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(", serviceSupport := ");
single_value->field_serviceSupport.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__ServiceInformationMessage__MS__NW_template::log_match(const PDU__RRM__ServiceInformationMessage__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_serviceSupport.match(match_value.serviceSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".serviceSupport");
single_value->field_serviceSupport.log_match(match_value.serviceSupport(), 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(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", serviceSupport := ");
single_value->field_serviceSupport.log_match(match_value.serviceSupport(), 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__ServiceInformationMessage__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_serviceSupport.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_ServiceInformationMessage_MS_NW.");
}
}

void PDU__RRM__ServiceInformationMessage__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_serviceSupport.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__ServiceInformationMessage__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_ServiceInformationMessage_MS_NW.");
}
}

void PDU__RRM__ServiceInformationMessage__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__ServiceInformationMessage__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_ServiceInformationMessage_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) 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) serviceSupport().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(), "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(), "serviceSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          serviceSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_ServiceInformationMessage_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ServiceInformationMessage__MS__NW_template* precondition = new PDU__RRM__ServiceInformationMessage__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ServiceInformationMessage__MS__NW_template* implied_template = new PDU__RRM__ServiceInformationMessage__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ServiceInformationMessage__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ServiceInformationMessage__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_ServiceInformationMessage_MS_NW");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_MS_NW");
single_value->field_routingAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_MS_NW");
single_value->field_serviceSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ServiceInformationMessage_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_ServiceInformationMessage_MS_NW");
}

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

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

void PDU__RRM__MS__NW::copy_value(const PDU__RRM__MS__NW& other_value)
{
switch (other_value.union_selection) {
case ALT_cipheringModeComplete:
field_cipheringModeComplete = new PDU__RRM__CipheringModeComplete__MS__NW(*other_value.field_cipheringModeComplete);
break;
case ALT_configurationChangeAck:
field_configurationChangeAck = new PDU__RRM__ConfigurationChangeAck__MS__NW(*other_value.field_configurationChangeAck);
break;
case ALT_configurationChangeRej:
field_configurationChangeRej = new PDU__RRM__ConfigurationChangeRej__MS__NW(*other_value.field_configurationChangeRej);
break;
case ALT_assignmentComplete:
field_assignmentComplete = new PDU__RRM__AssignmentComplete__MS__NW(*other_value.field_assignmentComplete);
break;
case ALT_assignmentFailure:
field_assignmentFailure = new PDU__RRM__AssignmentFailure__MS__NW(*other_value.field_assignmentFailure);
break;
case ALT_handoverComplete:
field_handoverComplete = new PDU__RRM__HandoverComplete__MS__NW(*other_value.field_handoverComplete);
break;
case ALT_handoverFailure:
field_handoverFailure = new PDU__RRM__HandoverFailure__MS__NW(*other_value.field_handoverFailure);
break;
case ALT_partialReleaseComplete:
field_partialReleaseComplete = new PDU__RRM__PartialReleaseComplete__MS__NW(*other_value.field_partialReleaseComplete);
break;
case ALT_pagingResponse:
field_pagingResponse = new PDU__RRM__PagingResponse__MS__NW(*other_value.field_pagingResponse);
break;
case ALT_notificationResponse:
field_notificationResponse = new PDU__RRM__NotificationResponse__MS__NW(*other_value.field_notificationResponse);
break;
case ALT_rR__Status:
field_rR__Status = new PDU__RRM__RR__Status(*other_value.field_rR__Status);
break;
case ALT_channelModeModifyAck:
field_channelModeModifyAck = new PDU__RRM__ChannelModeModifyAck__MS__NW(*other_value.field_channelModeModifyAck);
break;
case ALT_classmarkChange:
field_classmarkChange = new PDU__RRM__ClassmarkChange__MS__NW(*other_value.field_classmarkChange);
break;
case ALT_gPRS__suspensionRequest:
field_gPRS__suspensionRequest = new PDU__RRM__GPRS__SuspensionRequest__MS__NW(*other_value.field_gPRS__suspensionRequest);
break;
case ALT_serviceInformationMessage:
field_serviceInformationMessage = new PDU__RRM__ServiceInformationMessage__MS__NW(*other_value.field_serviceInformationMessage);
break;
case ALT_uplinkRelease:
field_uplinkRelease = new PDU__RRM__UplinkRelease(*other_value.field_uplinkRelease);
break;
case ALT_talkerIndication:
field_talkerIndication = new PDU__RRM__TalkerIndication__MS__NW(*other_value.field_talkerIndication);
break;
case ALT_applicationInformation:
field_applicationInformation = new PDU__RRM__ApplicationInformation(*other_value.field_applicationInformation);
break;
case ALT_dTM__AssignmentFailure:
field_dTM__AssignmentFailure = new PDU__RRM__DTM__AssignmentFailure__MS__NW(*other_value.field_dTM__AssignmentFailure);
break;
case ALT_dTM__Request:
field_dTM__Request = new PDU__RRM__DTM__Request__MS__NW(*other_value.field_dTM__Request);
break;
case ALT_uTRAN__ClassmarkChange:
field_uTRAN__ClassmarkChange = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW(*other_value.field_uTRAN__ClassmarkChange);
break;
case ALT_cDMA2000__ClassmarkChange:
field_cDMA2000__ClassmarkChange = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW(*other_value.field_cDMA2000__ClassmarkChange);
break;
case ALT_gERAN__IU__ModeClassmarkChange:
field_gERAN__IU__ModeClassmarkChange = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW(*other_value.field_gERAN__IU__ModeClassmarkChange);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean PDU__RRM__MS__NW::operator==(const PDU__RRM__MS__NW& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_cipheringModeComplete:
return *field_cipheringModeComplete == *other_value.field_cipheringModeComplete;
case ALT_configurationChangeAck:
return *field_configurationChangeAck == *other_value.field_configurationChangeAck;
case ALT_configurationChangeRej:
return *field_configurationChangeRej == *other_value.field_configurationChangeRej;
case ALT_assignmentComplete:
return *field_assignmentComplete == *other_value.field_assignmentComplete;
case ALT_assignmentFailure:
return *field_assignmentFailure == *other_value.field_assignmentFailure;
case ALT_handoverComplete:
return *field_handoverComplete == *other_value.field_handoverComplete;
case ALT_handoverFailure:
return *field_handoverFailure == *other_value.field_handoverFailure;
case ALT_partialReleaseComplete:
return *field_partialReleaseComplete == *other_value.field_partialReleaseComplete;
case ALT_pagingResponse:
return *field_pagingResponse == *other_value.field_pagingResponse;
case ALT_notificationResponse:
return *field_notificationResponse == *other_value.field_notificationResponse;
case ALT_rR__Status:
return *field_rR__Status == *other_value.field_rR__Status;
case ALT_channelModeModifyAck:
return *field_channelModeModifyAck == *other_value.field_channelModeModifyAck;
case ALT_classmarkChange:
return *field_classmarkChange == *other_value.field_classmarkChange;
case ALT_gPRS__suspensionRequest:
return *field_gPRS__suspensionRequest == *other_value.field_gPRS__suspensionRequest;
case ALT_serviceInformationMessage:
return *field_serviceInformationMessage == *other_value.field_serviceInformationMessage;
case ALT_uplinkRelease:
return *field_uplinkRelease == *other_value.field_uplinkRelease;
case ALT_talkerIndication:
return *field_talkerIndication == *other_value.field_talkerIndication;
case ALT_applicationInformation:
return *field_applicationInformation == *other_value.field_applicationInformation;
case ALT_dTM__AssignmentFailure:
return *field_dTM__AssignmentFailure == *other_value.field_dTM__AssignmentFailure;
case ALT_dTM__Request:
return *field_dTM__Request == *other_value.field_dTM__Request;
case ALT_uTRAN__ClassmarkChange:
return *field_uTRAN__ClassmarkChange == *other_value.field_uTRAN__ClassmarkChange;
case ALT_cDMA2000__ClassmarkChange:
return *field_cDMA2000__ClassmarkChange == *other_value.field_cDMA2000__ClassmarkChange;
case ALT_gERAN__IU__ModeClassmarkChange:
return *field_gERAN__IU__ModeClassmarkChange == *other_value.field_gERAN__IU__ModeClassmarkChange;
default:
return FALSE;
}
}

PDU__RRM__CipheringModeComplete__MS__NW& PDU__RRM__MS__NW::cipheringModeComplete()
{
if (union_selection != ALT_cipheringModeComplete) {
clean_up();
field_cipheringModeComplete = new PDU__RRM__CipheringModeComplete__MS__NW;
union_selection = ALT_cipheringModeComplete;
}
return *field_cipheringModeComplete;
}

const PDU__RRM__CipheringModeComplete__MS__NW& PDU__RRM__MS__NW::cipheringModeComplete() const
{
if (union_selection != ALT_cipheringModeComplete) TTCN_error("Using non-selected field cipheringModeComplete in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_cipheringModeComplete;
}

PDU__RRM__ConfigurationChangeAck__MS__NW& PDU__RRM__MS__NW::configurationChangeAck()
{
if (union_selection != ALT_configurationChangeAck) {
clean_up();
field_configurationChangeAck = new PDU__RRM__ConfigurationChangeAck__MS__NW;
union_selection = ALT_configurationChangeAck;
}
return *field_configurationChangeAck;
}

const PDU__RRM__ConfigurationChangeAck__MS__NW& PDU__RRM__MS__NW::configurationChangeAck() const
{
if (union_selection != ALT_configurationChangeAck) TTCN_error("Using non-selected field configurationChangeAck in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_configurationChangeAck;
}

PDU__RRM__ConfigurationChangeRej__MS__NW& PDU__RRM__MS__NW::configurationChangeRej()
{
if (union_selection != ALT_configurationChangeRej) {
clean_up();
field_configurationChangeRej = new PDU__RRM__ConfigurationChangeRej__MS__NW;
union_selection = ALT_configurationChangeRej;
}
return *field_configurationChangeRej;
}

const PDU__RRM__ConfigurationChangeRej__MS__NW& PDU__RRM__MS__NW::configurationChangeRej() const
{
if (union_selection != ALT_configurationChangeRej) TTCN_error("Using non-selected field configurationChangeRej in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_configurationChangeRej;
}

PDU__RRM__AssignmentComplete__MS__NW& PDU__RRM__MS__NW::assignmentComplete()
{
if (union_selection != ALT_assignmentComplete) {
clean_up();
field_assignmentComplete = new PDU__RRM__AssignmentComplete__MS__NW;
union_selection = ALT_assignmentComplete;
}
return *field_assignmentComplete;
}

const PDU__RRM__AssignmentComplete__MS__NW& PDU__RRM__MS__NW::assignmentComplete() const
{
if (union_selection != ALT_assignmentComplete) TTCN_error("Using non-selected field assignmentComplete in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_assignmentComplete;
}

PDU__RRM__AssignmentFailure__MS__NW& PDU__RRM__MS__NW::assignmentFailure()
{
if (union_selection != ALT_assignmentFailure) {
clean_up();
field_assignmentFailure = new PDU__RRM__AssignmentFailure__MS__NW;
union_selection = ALT_assignmentFailure;
}
return *field_assignmentFailure;
}

const PDU__RRM__AssignmentFailure__MS__NW& PDU__RRM__MS__NW::assignmentFailure() const
{
if (union_selection != ALT_assignmentFailure) TTCN_error("Using non-selected field assignmentFailure in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_assignmentFailure;
}

PDU__RRM__HandoverComplete__MS__NW& PDU__RRM__MS__NW::handoverComplete()
{
if (union_selection != ALT_handoverComplete) {
clean_up();
field_handoverComplete = new PDU__RRM__HandoverComplete__MS__NW;
union_selection = ALT_handoverComplete;
}
return *field_handoverComplete;
}

const PDU__RRM__HandoverComplete__MS__NW& PDU__RRM__MS__NW::handoverComplete() const
{
if (union_selection != ALT_handoverComplete) TTCN_error("Using non-selected field handoverComplete in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_handoverComplete;
}

PDU__RRM__HandoverFailure__MS__NW& PDU__RRM__MS__NW::handoverFailure()
{
if (union_selection != ALT_handoverFailure) {
clean_up();
field_handoverFailure = new PDU__RRM__HandoverFailure__MS__NW;
union_selection = ALT_handoverFailure;
}
return *field_handoverFailure;
}

const PDU__RRM__HandoverFailure__MS__NW& PDU__RRM__MS__NW::handoverFailure() const
{
if (union_selection != ALT_handoverFailure) TTCN_error("Using non-selected field handoverFailure in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_handoverFailure;
}

PDU__RRM__PartialReleaseComplete__MS__NW& PDU__RRM__MS__NW::partialReleaseComplete()
{
if (union_selection != ALT_partialReleaseComplete) {
clean_up();
field_partialReleaseComplete = new PDU__RRM__PartialReleaseComplete__MS__NW;
union_selection = ALT_partialReleaseComplete;
}
return *field_partialReleaseComplete;
}

const PDU__RRM__PartialReleaseComplete__MS__NW& PDU__RRM__MS__NW::partialReleaseComplete() const
{
if (union_selection != ALT_partialReleaseComplete) TTCN_error("Using non-selected field partialReleaseComplete in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_partialReleaseComplete;
}

PDU__RRM__PagingResponse__MS__NW& PDU__RRM__MS__NW::pagingResponse()
{
if (union_selection != ALT_pagingResponse) {
clean_up();
field_pagingResponse = new PDU__RRM__PagingResponse__MS__NW;
union_selection = ALT_pagingResponse;
}
return *field_pagingResponse;
}

const PDU__RRM__PagingResponse__MS__NW& PDU__RRM__MS__NW::pagingResponse() const
{
if (union_selection != ALT_pagingResponse) TTCN_error("Using non-selected field pagingResponse in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_pagingResponse;
}

PDU__RRM__NotificationResponse__MS__NW& PDU__RRM__MS__NW::notificationResponse()
{
if (union_selection != ALT_notificationResponse) {
clean_up();
field_notificationResponse = new PDU__RRM__NotificationResponse__MS__NW;
union_selection = ALT_notificationResponse;
}
return *field_notificationResponse;
}

const PDU__RRM__NotificationResponse__MS__NW& PDU__RRM__MS__NW::notificationResponse() const
{
if (union_selection != ALT_notificationResponse) TTCN_error("Using non-selected field notificationResponse in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_notificationResponse;
}

PDU__RRM__RR__Status& PDU__RRM__MS__NW::rR__Status()
{
if (union_selection != ALT_rR__Status) {
clean_up();
field_rR__Status = new PDU__RRM__RR__Status;
union_selection = ALT_rR__Status;
}
return *field_rR__Status;
}

const PDU__RRM__RR__Status& PDU__RRM__MS__NW::rR__Status() const
{
if (union_selection != ALT_rR__Status) TTCN_error("Using non-selected field rR_Status in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_rR__Status;
}

PDU__RRM__ChannelModeModifyAck__MS__NW& PDU__RRM__MS__NW::channelModeModifyAck()
{
if (union_selection != ALT_channelModeModifyAck) {
clean_up();
field_channelModeModifyAck = new PDU__RRM__ChannelModeModifyAck__MS__NW;
union_selection = ALT_channelModeModifyAck;
}
return *field_channelModeModifyAck;
}

const PDU__RRM__ChannelModeModifyAck__MS__NW& PDU__RRM__MS__NW::channelModeModifyAck() const
{
if (union_selection != ALT_channelModeModifyAck) TTCN_error("Using non-selected field channelModeModifyAck in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_channelModeModifyAck;
}

PDU__RRM__ClassmarkChange__MS__NW& PDU__RRM__MS__NW::classmarkChange()
{
if (union_selection != ALT_classmarkChange) {
clean_up();
field_classmarkChange = new PDU__RRM__ClassmarkChange__MS__NW;
union_selection = ALT_classmarkChange;
}
return *field_classmarkChange;
}

const PDU__RRM__ClassmarkChange__MS__NW& PDU__RRM__MS__NW::classmarkChange() const
{
if (union_selection != ALT_classmarkChange) TTCN_error("Using non-selected field classmarkChange in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_classmarkChange;
}

PDU__RRM__GPRS__SuspensionRequest__MS__NW& PDU__RRM__MS__NW::gPRS__suspensionRequest()
{
if (union_selection != ALT_gPRS__suspensionRequest) {
clean_up();
field_gPRS__suspensionRequest = new PDU__RRM__GPRS__SuspensionRequest__MS__NW;
union_selection = ALT_gPRS__suspensionRequest;
}
return *field_gPRS__suspensionRequest;
}

const PDU__RRM__GPRS__SuspensionRequest__MS__NW& PDU__RRM__MS__NW::gPRS__suspensionRequest() const
{
if (union_selection != ALT_gPRS__suspensionRequest) TTCN_error("Using non-selected field gPRS_suspensionRequest in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_gPRS__suspensionRequest;
}

PDU__RRM__ServiceInformationMessage__MS__NW& PDU__RRM__MS__NW::serviceInformationMessage()
{
if (union_selection != ALT_serviceInformationMessage) {
clean_up();
field_serviceInformationMessage = new PDU__RRM__ServiceInformationMessage__MS__NW;
union_selection = ALT_serviceInformationMessage;
}
return *field_serviceInformationMessage;
}

const PDU__RRM__ServiceInformationMessage__MS__NW& PDU__RRM__MS__NW::serviceInformationMessage() const
{
if (union_selection != ALT_serviceInformationMessage) TTCN_error("Using non-selected field serviceInformationMessage in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_serviceInformationMessage;
}

PDU__RRM__UplinkRelease& PDU__RRM__MS__NW::uplinkRelease()
{
if (union_selection != ALT_uplinkRelease) {
clean_up();
field_uplinkRelease = new PDU__RRM__UplinkRelease;
union_selection = ALT_uplinkRelease;
}
return *field_uplinkRelease;
}

const PDU__RRM__UplinkRelease& PDU__RRM__MS__NW::uplinkRelease() const
{
if (union_selection != ALT_uplinkRelease) TTCN_error("Using non-selected field uplinkRelease in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_uplinkRelease;
}

PDU__RRM__TalkerIndication__MS__NW& PDU__RRM__MS__NW::talkerIndication()
{
if (union_selection != ALT_talkerIndication) {
clean_up();
field_talkerIndication = new PDU__RRM__TalkerIndication__MS__NW;
union_selection = ALT_talkerIndication;
}
return *field_talkerIndication;
}

const PDU__RRM__TalkerIndication__MS__NW& PDU__RRM__MS__NW::talkerIndication() const
{
if (union_selection != ALT_talkerIndication) TTCN_error("Using non-selected field talkerIndication in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_talkerIndication;
}

PDU__RRM__ApplicationInformation& PDU__RRM__MS__NW::applicationInformation()
{
if (union_selection != ALT_applicationInformation) {
clean_up();
field_applicationInformation = new PDU__RRM__ApplicationInformation;
union_selection = ALT_applicationInformation;
}
return *field_applicationInformation;
}

const PDU__RRM__ApplicationInformation& PDU__RRM__MS__NW::applicationInformation() const
{
if (union_selection != ALT_applicationInformation) TTCN_error("Using non-selected field applicationInformation in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_applicationInformation;
}

PDU__RRM__DTM__AssignmentFailure__MS__NW& PDU__RRM__MS__NW::dTM__AssignmentFailure()
{
if (union_selection != ALT_dTM__AssignmentFailure) {
clean_up();
field_dTM__AssignmentFailure = new PDU__RRM__DTM__AssignmentFailure__MS__NW;
union_selection = ALT_dTM__AssignmentFailure;
}
return *field_dTM__AssignmentFailure;
}

const PDU__RRM__DTM__AssignmentFailure__MS__NW& PDU__RRM__MS__NW::dTM__AssignmentFailure() const
{
if (union_selection != ALT_dTM__AssignmentFailure) TTCN_error("Using non-selected field dTM_AssignmentFailure in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_dTM__AssignmentFailure;
}

PDU__RRM__DTM__Request__MS__NW& PDU__RRM__MS__NW::dTM__Request()
{
if (union_selection != ALT_dTM__Request) {
clean_up();
field_dTM__Request = new PDU__RRM__DTM__Request__MS__NW;
union_selection = ALT_dTM__Request;
}
return *field_dTM__Request;
}

const PDU__RRM__DTM__Request__MS__NW& PDU__RRM__MS__NW::dTM__Request() const
{
if (union_selection != ALT_dTM__Request) TTCN_error("Using non-selected field dTM_Request in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_dTM__Request;
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW& PDU__RRM__MS__NW::uTRAN__ClassmarkChange()
{
if (union_selection != ALT_uTRAN__ClassmarkChange) {
clean_up();
field_uTRAN__ClassmarkChange = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW;
union_selection = ALT_uTRAN__ClassmarkChange;
}
return *field_uTRAN__ClassmarkChange;
}

const PDU__RRM__UTRAN__ClassmarkChange__MS__NW& PDU__RRM__MS__NW::uTRAN__ClassmarkChange() const
{
if (union_selection != ALT_uTRAN__ClassmarkChange) TTCN_error("Using non-selected field uTRAN_ClassmarkChange in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_uTRAN__ClassmarkChange;
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW& PDU__RRM__MS__NW::cDMA2000__ClassmarkChange()
{
if (union_selection != ALT_cDMA2000__ClassmarkChange) {
clean_up();
field_cDMA2000__ClassmarkChange = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW;
union_selection = ALT_cDMA2000__ClassmarkChange;
}
return *field_cDMA2000__ClassmarkChange;
}

const PDU__RRM__CDMA2000__ClassmarkChange__MS__NW& PDU__RRM__MS__NW::cDMA2000__ClassmarkChange() const
{
if (union_selection != ALT_cDMA2000__ClassmarkChange) TTCN_error("Using non-selected field cDMA2000_ClassmarkChange in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_cDMA2000__ClassmarkChange;
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW& PDU__RRM__MS__NW::gERAN__IU__ModeClassmarkChange()
{
if (union_selection != ALT_gERAN__IU__ModeClassmarkChange) {
clean_up();
field_gERAN__IU__ModeClassmarkChange = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW;
union_selection = ALT_gERAN__IU__ModeClassmarkChange;
}
return *field_gERAN__IU__ModeClassmarkChange;
}

const PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW& PDU__RRM__MS__NW::gERAN__IU__ModeClassmarkChange() const
{
if (union_selection != ALT_gERAN__IU__ModeClassmarkChange) TTCN_error("Using non-selected field gERAN_IU_ModeClassmarkChange in a value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *field_gERAN__IU__ModeClassmarkChange;
}

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

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

boolean PDU__RRM__MS__NW::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_cipheringModeComplete: return field_cipheringModeComplete->is_value();
case ALT_configurationChangeAck: return field_configurationChangeAck->is_value();
case ALT_configurationChangeRej: return field_configurationChangeRej->is_value();
case ALT_assignmentComplete: return field_assignmentComplete->is_value();
case ALT_assignmentFailure: return field_assignmentFailure->is_value();
case ALT_handoverComplete: return field_handoverComplete->is_value();
case ALT_handoverFailure: return field_handoverFailure->is_value();
case ALT_partialReleaseComplete: return field_partialReleaseComplete->is_value();
case ALT_pagingResponse: return field_pagingResponse->is_value();
case ALT_notificationResponse: return field_notificationResponse->is_value();
case ALT_rR__Status: return field_rR__Status->is_value();
case ALT_channelModeModifyAck: return field_channelModeModifyAck->is_value();
case ALT_classmarkChange: return field_classmarkChange->is_value();
case ALT_gPRS__suspensionRequest: return field_gPRS__suspensionRequest->is_value();
case ALT_serviceInformationMessage: return field_serviceInformationMessage->is_value();
case ALT_uplinkRelease: return field_uplinkRelease->is_value();
case ALT_talkerIndication: return field_talkerIndication->is_value();
case ALT_applicationInformation: return field_applicationInformation->is_value();
case ALT_dTM__AssignmentFailure: return field_dTM__AssignmentFailure->is_value();
case ALT_dTM__Request: return field_dTM__Request->is_value();
case ALT_uTRAN__ClassmarkChange: return field_uTRAN__ClassmarkChange->is_value();
case ALT_cDMA2000__ClassmarkChange: return field_cDMA2000__ClassmarkChange->is_value();
case ALT_gERAN__IU__ModeClassmarkChange: return field_gERAN__IU__ModeClassmarkChange->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void PDU__RRM__MS__NW::clean_up()
{
switch (union_selection) {
case ALT_cipheringModeComplete:
  delete field_cipheringModeComplete;
  break;
case ALT_configurationChangeAck:
  delete field_configurationChangeAck;
  break;
case ALT_configurationChangeRej:
  delete field_configurationChangeRej;
  break;
case ALT_assignmentComplete:
  delete field_assignmentComplete;
  break;
case ALT_assignmentFailure:
  delete field_assignmentFailure;
  break;
case ALT_handoverComplete:
  delete field_handoverComplete;
  break;
case ALT_handoverFailure:
  delete field_handoverFailure;
  break;
case ALT_partialReleaseComplete:
  delete field_partialReleaseComplete;
  break;
case ALT_pagingResponse:
  delete field_pagingResponse;
  break;
case ALT_notificationResponse:
  delete field_notificationResponse;
  break;
case ALT_rR__Status:
  delete field_rR__Status;
  break;
case ALT_channelModeModifyAck:
  delete field_channelModeModifyAck;
  break;
case ALT_classmarkChange:
  delete field_classmarkChange;
  break;
case ALT_gPRS__suspensionRequest:
  delete field_gPRS__suspensionRequest;
  break;
case ALT_serviceInformationMessage:
  delete field_serviceInformationMessage;
  break;
case ALT_uplinkRelease:
  delete field_uplinkRelease;
  break;
case ALT_talkerIndication:
  delete field_talkerIndication;
  break;
case ALT_applicationInformation:
  delete field_applicationInformation;
  break;
case ALT_dTM__AssignmentFailure:
  delete field_dTM__AssignmentFailure;
  break;
case ALT_dTM__Request:
  delete field_dTM__Request;
  break;
case ALT_uTRAN__ClassmarkChange:
  delete field_uTRAN__ClassmarkChange;
  break;
case ALT_cDMA2000__ClassmarkChange:
  delete field_cDMA2000__ClassmarkChange;
  break;
case ALT_gERAN__IU__ModeClassmarkChange:
  delete field_gERAN__IU__ModeClassmarkChange;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void PDU__RRM__MS__NW::log() const
{
switch (union_selection) {
case ALT_cipheringModeComplete:
TTCN_Logger::log_event_str("{ cipheringModeComplete := ");
field_cipheringModeComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_configurationChangeAck:
TTCN_Logger::log_event_str("{ configurationChangeAck := ");
field_configurationChangeAck->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_configurationChangeRej:
TTCN_Logger::log_event_str("{ configurationChangeRej := ");
field_configurationChangeRej->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_assignmentComplete:
TTCN_Logger::log_event_str("{ assignmentComplete := ");
field_assignmentComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_assignmentFailure:
TTCN_Logger::log_event_str("{ assignmentFailure := ");
field_assignmentFailure->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_handoverComplete:
TTCN_Logger::log_event_str("{ handoverComplete := ");
field_handoverComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_handoverFailure:
TTCN_Logger::log_event_str("{ handoverFailure := ");
field_handoverFailure->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_partialReleaseComplete:
TTCN_Logger::log_event_str("{ partialReleaseComplete := ");
field_partialReleaseComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_pagingResponse:
TTCN_Logger::log_event_str("{ pagingResponse := ");
field_pagingResponse->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_notificationResponse:
TTCN_Logger::log_event_str("{ notificationResponse := ");
field_notificationResponse->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rR__Status:
TTCN_Logger::log_event_str("{ rR_Status := ");
field_rR__Status->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_channelModeModifyAck:
TTCN_Logger::log_event_str("{ channelModeModifyAck := ");
field_channelModeModifyAck->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_classmarkChange:
TTCN_Logger::log_event_str("{ classmarkChange := ");
field_classmarkChange->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gPRS__suspensionRequest:
TTCN_Logger::log_event_str("{ gPRS_suspensionRequest := ");
field_gPRS__suspensionRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_serviceInformationMessage:
TTCN_Logger::log_event_str("{ serviceInformationMessage := ");
field_serviceInformationMessage->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_uplinkRelease:
TTCN_Logger::log_event_str("{ uplinkRelease := ");
field_uplinkRelease->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_talkerIndication:
TTCN_Logger::log_event_str("{ talkerIndication := ");
field_talkerIndication->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_applicationInformation:
TTCN_Logger::log_event_str("{ applicationInformation := ");
field_applicationInformation->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_dTM__AssignmentFailure:
TTCN_Logger::log_event_str("{ dTM_AssignmentFailure := ");
field_dTM__AssignmentFailure->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_dTM__Request:
TTCN_Logger::log_event_str("{ dTM_Request := ");
field_dTM__Request->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_uTRAN__ClassmarkChange:
TTCN_Logger::log_event_str("{ uTRAN_ClassmarkChange := ");
field_uTRAN__ClassmarkChange->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cDMA2000__ClassmarkChange:
TTCN_Logger::log_event_str("{ cDMA2000_ClassmarkChange := ");
field_cDMA2000__ClassmarkChange->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gERAN__IU__ModeClassmarkChange:
TTCN_Logger::log_event_str("{ gERAN_IU_ModeClassmarkChange := ");
field_gERAN__IU__ModeClassmarkChange->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void PDU__RRM__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "cipheringModeComplete")) {
    cipheringModeComplete().set_param(*mp_last);
    if (!cipheringModeComplete().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "configurationChangeAck")) {
    configurationChangeAck().set_param(*mp_last);
    if (!configurationChangeAck().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "configurationChangeRej")) {
    configurationChangeRej().set_param(*mp_last);
    if (!configurationChangeRej().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "assignmentComplete")) {
    assignmentComplete().set_param(*mp_last);
    if (!assignmentComplete().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "assignmentFailure")) {
    assignmentFailure().set_param(*mp_last);
    if (!assignmentFailure().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "handoverComplete")) {
    handoverComplete().set_param(*mp_last);
    if (!handoverComplete().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "handoverFailure")) {
    handoverFailure().set_param(*mp_last);
    if (!handoverFailure().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "partialReleaseComplete")) {
    partialReleaseComplete().set_param(*mp_last);
    if (!partialReleaseComplete().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "pagingResponse")) {
    pagingResponse().set_param(*mp_last);
    if (!pagingResponse().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "notificationResponse")) {
    notificationResponse().set_param(*mp_last);
    if (!notificationResponse().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rR_Status")) {
    rR__Status().set_param(*mp_last);
    if (!rR__Status().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "channelModeModifyAck")) {
    channelModeModifyAck().set_param(*mp_last);
    if (!channelModeModifyAck().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "classmarkChange")) {
    classmarkChange().set_param(*mp_last);
    if (!classmarkChange().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gPRS_suspensionRequest")) {
    gPRS__suspensionRequest().set_param(*mp_last);
    if (!gPRS__suspensionRequest().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "serviceInformationMessage")) {
    serviceInformationMessage().set_param(*mp_last);
    if (!serviceInformationMessage().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "uplinkRelease")) {
    uplinkRelease().set_param(*mp_last);
    if (!uplinkRelease().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "talkerIndication")) {
    talkerIndication().set_param(*mp_last);
    if (!talkerIndication().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "applicationInformation")) {
    applicationInformation().set_param(*mp_last);
    if (!applicationInformation().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "dTM_AssignmentFailure")) {
    dTM__AssignmentFailure().set_param(*mp_last);
    if (!dTM__AssignmentFailure().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "dTM_Request")) {
    dTM__Request().set_param(*mp_last);
    if (!dTM__Request().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "uTRAN_ClassmarkChange")) {
    uTRAN__ClassmarkChange().set_param(*mp_last);
    if (!uTRAN__ClassmarkChange().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cDMA2000_ClassmarkChange")) {
    cDMA2000__ClassmarkChange().set_param(*mp_last);
    if (!cDMA2000__ClassmarkChange().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gERAN_IU_ModeClassmarkChange")) {
    gERAN__IU__ModeClassmarkChange().set_param(*mp_last);
    if (!gERAN__IU__ModeClassmarkChange().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_RRM_Types.PDU_RRM_MS_NW.", last_name);
}

void PDU__RRM__MS__NW::set_implicit_omit()
{
switch (union_selection) {
case ALT_cipheringModeComplete:
field_cipheringModeComplete->set_implicit_omit(); break;
case ALT_configurationChangeAck:
field_configurationChangeAck->set_implicit_omit(); break;
case ALT_configurationChangeRej:
field_configurationChangeRej->set_implicit_omit(); break;
case ALT_assignmentComplete:
field_assignmentComplete->set_implicit_omit(); break;
case ALT_assignmentFailure:
field_assignmentFailure->set_implicit_omit(); break;
case ALT_handoverComplete:
field_handoverComplete->set_implicit_omit(); break;
case ALT_handoverFailure:
field_handoverFailure->set_implicit_omit(); break;
case ALT_partialReleaseComplete:
field_partialReleaseComplete->set_implicit_omit(); break;
case ALT_pagingResponse:
field_pagingResponse->set_implicit_omit(); break;
case ALT_notificationResponse:
field_notificationResponse->set_implicit_omit(); break;
case ALT_rR__Status:
field_rR__Status->set_implicit_omit(); break;
case ALT_channelModeModifyAck:
field_channelModeModifyAck->set_implicit_omit(); break;
case ALT_classmarkChange:
field_classmarkChange->set_implicit_omit(); break;
case ALT_gPRS__suspensionRequest:
field_gPRS__suspensionRequest->set_implicit_omit(); break;
case ALT_serviceInformationMessage:
field_serviceInformationMessage->set_implicit_omit(); break;
case ALT_uplinkRelease:
field_uplinkRelease->set_implicit_omit(); break;
case ALT_talkerIndication:
field_talkerIndication->set_implicit_omit(); break;
case ALT_applicationInformation:
field_applicationInformation->set_implicit_omit(); break;
case ALT_dTM__AssignmentFailure:
field_dTM__AssignmentFailure->set_implicit_omit(); break;
case ALT_dTM__Request:
field_dTM__Request->set_implicit_omit(); break;
case ALT_uTRAN__ClassmarkChange:
field_uTRAN__ClassmarkChange->set_implicit_omit(); break;
case ALT_cDMA2000__ClassmarkChange:
field_cDMA2000__ClassmarkChange->set_implicit_omit(); break;
case ALT_gERAN__IU__ModeClassmarkChange:
field_gERAN__IU__ModeClassmarkChange->set_implicit_omit(); break;
default: break;
}
}

void PDU__RRM__MS__NW::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_cipheringModeComplete:
field_cipheringModeComplete->encode_text(text_buf);
break;
case ALT_configurationChangeAck:
field_configurationChangeAck->encode_text(text_buf);
break;
case ALT_configurationChangeRej:
field_configurationChangeRej->encode_text(text_buf);
break;
case ALT_assignmentComplete:
field_assignmentComplete->encode_text(text_buf);
break;
case ALT_assignmentFailure:
field_assignmentFailure->encode_text(text_buf);
break;
case ALT_handoverComplete:
field_handoverComplete->encode_text(text_buf);
break;
case ALT_handoverFailure:
field_handoverFailure->encode_text(text_buf);
break;
case ALT_partialReleaseComplete:
field_partialReleaseComplete->encode_text(text_buf);
break;
case ALT_pagingResponse:
field_pagingResponse->encode_text(text_buf);
break;
case ALT_notificationResponse:
field_notificationResponse->encode_text(text_buf);
break;
case ALT_rR__Status:
field_rR__Status->encode_text(text_buf);
break;
case ALT_channelModeModifyAck:
field_channelModeModifyAck->encode_text(text_buf);
break;
case ALT_classmarkChange:
field_classmarkChange->encode_text(text_buf);
break;
case ALT_gPRS__suspensionRequest:
field_gPRS__suspensionRequest->encode_text(text_buf);
break;
case ALT_serviceInformationMessage:
field_serviceInformationMessage->encode_text(text_buf);
break;
case ALT_uplinkRelease:
field_uplinkRelease->encode_text(text_buf);
break;
case ALT_talkerIndication:
field_talkerIndication->encode_text(text_buf);
break;
case ALT_applicationInformation:
field_applicationInformation->encode_text(text_buf);
break;
case ALT_dTM__AssignmentFailure:
field_dTM__AssignmentFailure->encode_text(text_buf);
break;
case ALT_dTM__Request:
field_dTM__Request->encode_text(text_buf);
break;
case ALT_uTRAN__ClassmarkChange:
field_uTRAN__ClassmarkChange->encode_text(text_buf);
break;
case ALT_cDMA2000__ClassmarkChange:
field_cDMA2000__ClassmarkChange->encode_text(text_buf);
break;
case ALT_gERAN__IU__ModeClassmarkChange:
field_gERAN__IU__ModeClassmarkChange->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
}

void PDU__RRM__MS__NW::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_cipheringModeComplete:
cipheringModeComplete().decode_text(text_buf);
break;
case ALT_configurationChangeAck:
configurationChangeAck().decode_text(text_buf);
break;
case ALT_configurationChangeRej:
configurationChangeRej().decode_text(text_buf);
break;
case ALT_assignmentComplete:
assignmentComplete().decode_text(text_buf);
break;
case ALT_assignmentFailure:
assignmentFailure().decode_text(text_buf);
break;
case ALT_handoverComplete:
handoverComplete().decode_text(text_buf);
break;
case ALT_handoverFailure:
handoverFailure().decode_text(text_buf);
break;
case ALT_partialReleaseComplete:
partialReleaseComplete().decode_text(text_buf);
break;
case ALT_pagingResponse:
pagingResponse().decode_text(text_buf);
break;
case ALT_notificationResponse:
notificationResponse().decode_text(text_buf);
break;
case ALT_rR__Status:
rR__Status().decode_text(text_buf);
break;
case ALT_channelModeModifyAck:
channelModeModifyAck().decode_text(text_buf);
break;
case ALT_classmarkChange:
classmarkChange().decode_text(text_buf);
break;
case ALT_gPRS__suspensionRequest:
gPRS__suspensionRequest().decode_text(text_buf);
break;
case ALT_serviceInformationMessage:
serviceInformationMessage().decode_text(text_buf);
break;
case ALT_uplinkRelease:
uplinkRelease().decode_text(text_buf);
break;
case ALT_talkerIndication:
talkerIndication().decode_text(text_buf);
break;
case ALT_applicationInformation:
applicationInformation().decode_text(text_buf);
break;
case ALT_dTM__AssignmentFailure:
dTM__AssignmentFailure().decode_text(text_buf);
break;
case ALT_dTM__Request:
dTM__Request().decode_text(text_buf);
break;
case ALT_uTRAN__ClassmarkChange:
uTRAN__ClassmarkChange().decode_text(text_buf);
break;
case ALT_cDMA2000__ClassmarkChange:
cDMA2000__ClassmarkChange().decode_text(text_buf);
break;
case ALT_gERAN__IU__ModeClassmarkChange:
gERAN__IU__ModeClassmarkChange().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
}

void PDU__RRM__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(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

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

int PDU__RRM__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 sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, PDU__RRM__CipheringModeComplete__MS__NW_descr_.raw->forceomit);
      decoded_length = cipheringModeComplete().RAW_decode(PDU__RRM__CipheringModeComplete__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, PDU__RRM__ConfigurationChangeAck__MS__NW_descr_.raw->forceomit);
      decoded_length = configurationChangeAck().RAW_decode(PDU__RRM__ConfigurationChangeAck__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, PDU__RRM__ConfigurationChangeRej__MS__NW_descr_.raw->forceomit);
      decoded_length = configurationChangeRej().RAW_decode(PDU__RRM__ConfigurationChangeRej__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, PDU__RRM__AssignmentComplete__MS__NW_descr_.raw->forceomit);
      decoded_length = assignmentComplete().RAW_decode(PDU__RRM__AssignmentComplete__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, PDU__RRM__AssignmentFailure__MS__NW_descr_.raw->forceomit);
      decoded_length = assignmentFailure().RAW_decode(PDU__RRM__AssignmentFailure__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, PDU__RRM__HandoverComplete__MS__NW_descr_.raw->forceomit);
      decoded_length = handoverComplete().RAW_decode(PDU__RRM__HandoverComplete__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 6: {
      RAW_Force_Omit field_force_omit(6, force_omit, PDU__RRM__HandoverFailure__MS__NW_descr_.raw->forceomit);
      decoded_length = handoverFailure().RAW_decode(PDU__RRM__HandoverFailure__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 7: {
      RAW_Force_Omit field_force_omit(7, force_omit, PDU__RRM__PartialReleaseComplete__MS__NW_descr_.raw->forceomit);
      decoded_length = partialReleaseComplete().RAW_decode(PDU__RRM__PartialReleaseComplete__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 8: {
      RAW_Force_Omit field_force_omit(8, force_omit, PDU__RRM__PagingResponse__MS__NW_descr_.raw->forceomit);
      decoded_length = pagingResponse().RAW_decode(PDU__RRM__PagingResponse__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 9: {
      RAW_Force_Omit field_force_omit(9, force_omit, PDU__RRM__NotificationResponse__MS__NW_descr_.raw->forceomit);
      decoded_length = notificationResponse().RAW_decode(PDU__RRM__NotificationResponse__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 10: {
      RAW_Force_Omit field_force_omit(10, force_omit, PDU__RRM__RR__Status_descr_.raw->forceomit);
      decoded_length = rR__Status().RAW_decode(PDU__RRM__RR__Status_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 11: {
      RAW_Force_Omit field_force_omit(11, force_omit, PDU__RRM__ChannelModeModifyAck__MS__NW_descr_.raw->forceomit);
      decoded_length = channelModeModifyAck().RAW_decode(PDU__RRM__ChannelModeModifyAck__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 12: {
      RAW_Force_Omit field_force_omit(12, force_omit, PDU__RRM__ClassmarkChange__MS__NW_descr_.raw->forceomit);
      decoded_length = classmarkChange().RAW_decode(PDU__RRM__ClassmarkChange__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 13: {
      RAW_Force_Omit field_force_omit(13, force_omit, PDU__RRM__GPRS__SuspensionRequest__MS__NW_descr_.raw->forceomit);
      decoded_length = gPRS__suspensionRequest().RAW_decode(PDU__RRM__GPRS__SuspensionRequest__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 14: {
      RAW_Force_Omit field_force_omit(14, force_omit, PDU__RRM__ServiceInformationMessage__MS__NW_descr_.raw->forceomit);
      decoded_length = serviceInformationMessage().RAW_decode(PDU__RRM__ServiceInformationMessage__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 15: {
      RAW_Force_Omit field_force_omit(15, force_omit, PDU__RRM__UplinkRelease_descr_.raw->forceomit);
      decoded_length = uplinkRelease().RAW_decode(PDU__RRM__UplinkRelease_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 16: {
      RAW_Force_Omit field_force_omit(16, force_omit, PDU__RRM__TalkerIndication__MS__NW_descr_.raw->forceomit);
      decoded_length = talkerIndication().RAW_decode(PDU__RRM__TalkerIndication__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 17: {
      RAW_Force_Omit field_force_omit(17, force_omit, PDU__RRM__ApplicationInformation_descr_.raw->forceomit);
      decoded_length = applicationInformation().RAW_decode(PDU__RRM__ApplicationInformation_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 18: {
      RAW_Force_Omit field_force_omit(18, force_omit, PDU__RRM__DTM__AssignmentFailure__MS__NW_descr_.raw->forceomit);
      decoded_length = dTM__AssignmentFailure().RAW_decode(PDU__RRM__DTM__AssignmentFailure__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 19: {
      RAW_Force_Omit field_force_omit(19, force_omit, PDU__RRM__DTM__Request__MS__NW_descr_.raw->forceomit);
      decoded_length = dTM__Request().RAW_decode(PDU__RRM__DTM__Request__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 20: {
      RAW_Force_Omit field_force_omit(20, force_omit, PDU__RRM__UTRAN__ClassmarkChange__MS__NW_descr_.raw->forceomit);
      decoded_length = uTRAN__ClassmarkChange().RAW_decode(PDU__RRM__UTRAN__ClassmarkChange__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 21: {
      RAW_Force_Omit field_force_omit(21, force_omit, PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_descr_.raw->forceomit);
      decoded_length = cDMA2000__ClassmarkChange().RAW_decode(PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 22: {
      RAW_Force_Omit field_force_omit(22, force_omit, PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_descr_.raw->forceomit);
      decoded_length = gERAN__IU__ModeClassmarkChange().RAW_decode(PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
    boolean already_failed = FALSE;
    BITSTRING temporal_0;
    int decoded_0_length;
    already_failed = FALSE;
    if (!already_failed) {
      p_buf.set_pos_bit(starting_pos + 0);
      decoded_0_length = temporal_0.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, top_bit_ord, TRUE);
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_14) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, PDU__RRM__CipheringModeComplete__MS__NW_descr_.raw->forceomit);
          decoded_length = cipheringModeComplete().RAW_decode(PDU__RRM__CipheringModeComplete__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_cipheringModeComplete).messageType() ==  bs_14) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_15) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(1, force_omit, PDU__RRM__ConfigurationChangeAck__MS__NW_descr_.raw->forceomit);
          decoded_length = configurationChangeAck().RAW_decode(PDU__RRM__ConfigurationChangeAck__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_configurationChangeAck).messageType() ==  bs_15) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_16) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(2, force_omit, PDU__RRM__ConfigurationChangeRej__MS__NW_descr_.raw->forceomit);
          decoded_length = configurationChangeRej().RAW_decode(PDU__RRM__ConfigurationChangeRej__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_configurationChangeRej).messageType() ==  bs_16) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_17) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(3, force_omit, PDU__RRM__AssignmentComplete__MS__NW_descr_.raw->forceomit);
          decoded_length = assignmentComplete().RAW_decode(PDU__RRM__AssignmentComplete__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_assignmentComplete).messageType() ==  bs_17) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_18) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(4, force_omit, PDU__RRM__AssignmentFailure__MS__NW_descr_.raw->forceomit);
          decoded_length = assignmentFailure().RAW_decode(PDU__RRM__AssignmentFailure__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_assignmentFailure).messageType() ==  bs_18) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_19) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(5, force_omit, PDU__RRM__HandoverComplete__MS__NW_descr_.raw->forceomit);
          decoded_length = handoverComplete().RAW_decode(PDU__RRM__HandoverComplete__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_handoverComplete).messageType() ==  bs_19) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_20) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(6, force_omit, PDU__RRM__HandoverFailure__MS__NW_descr_.raw->forceomit);
          decoded_length = handoverFailure().RAW_decode(PDU__RRM__HandoverFailure__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_handoverFailure).messageType() ==  bs_20) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_21) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(7, force_omit, PDU__RRM__PartialReleaseComplete__MS__NW_descr_.raw->forceomit);
          decoded_length = partialReleaseComplete().RAW_decode(PDU__RRM__PartialReleaseComplete__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_partialReleaseComplete).messageType() ==  bs_21) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_22) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(8, force_omit, PDU__RRM__PagingResponse__MS__NW_descr_.raw->forceomit);
          decoded_length = pagingResponse().RAW_decode(PDU__RRM__PagingResponse__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_pagingResponse).messageType() ==  bs_22) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_23) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(9, force_omit, PDU__RRM__NotificationResponse__MS__NW_descr_.raw->forceomit);
          decoded_length = notificationResponse().RAW_decode(PDU__RRM__NotificationResponse__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_notificationResponse).messageType() ==  bs_23) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_24) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(10, force_omit, PDU__RRM__RR__Status_descr_.raw->forceomit);
          decoded_length = rR__Status().RAW_decode(PDU__RRM__RR__Status_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_rR__Status).messageType() ==  bs_24) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_25) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(11, force_omit, PDU__RRM__ChannelModeModifyAck__MS__NW_descr_.raw->forceomit);
          decoded_length = channelModeModifyAck().RAW_decode(PDU__RRM__ChannelModeModifyAck__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_channelModeModifyAck).messageType() ==  bs_25) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_26) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(12, force_omit, PDU__RRM__ClassmarkChange__MS__NW_descr_.raw->forceomit);
          decoded_length = classmarkChange().RAW_decode(PDU__RRM__ClassmarkChange__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_classmarkChange).messageType() ==  bs_26) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_27) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(13, force_omit, PDU__RRM__GPRS__SuspensionRequest__MS__NW_descr_.raw->forceomit);
          decoded_length = gPRS__suspensionRequest().RAW_decode(PDU__RRM__GPRS__SuspensionRequest__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_gPRS__suspensionRequest).messageType() ==  bs_27) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_28) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(14, force_omit, PDU__RRM__ServiceInformationMessage__MS__NW_descr_.raw->forceomit);
          decoded_length = serviceInformationMessage().RAW_decode(PDU__RRM__ServiceInformationMessage__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_serviceInformationMessage).messageType() ==  bs_28) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_29) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(15, force_omit, PDU__RRM__UplinkRelease_descr_.raw->forceomit);
          decoded_length = uplinkRelease().RAW_decode(PDU__RRM__UplinkRelease_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_uplinkRelease).messageType() ==  bs_29) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_30) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(16, force_omit, PDU__RRM__TalkerIndication__MS__NW_descr_.raw->forceomit);
          decoded_length = talkerIndication().RAW_decode(PDU__RRM__TalkerIndication__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_talkerIndication).messageType() ==  bs_30) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_31) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(17, force_omit, PDU__RRM__ApplicationInformation_descr_.raw->forceomit);
          decoded_length = applicationInformation().RAW_decode(PDU__RRM__ApplicationInformation_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_applicationInformation).messageType() ==  bs_31) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_32) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(18, force_omit, PDU__RRM__DTM__AssignmentFailure__MS__NW_descr_.raw->forceomit);
          decoded_length = dTM__AssignmentFailure().RAW_decode(PDU__RRM__DTM__AssignmentFailure__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_dTM__AssignmentFailure).messageType() ==  bs_32) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_33) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(19, force_omit, PDU__RRM__DTM__Request__MS__NW_descr_.raw->forceomit);
          decoded_length = dTM__Request().RAW_decode(PDU__RRM__DTM__Request__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_dTM__Request).messageType() ==  bs_33) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_34) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(20, force_omit, PDU__RRM__UTRAN__ClassmarkChange__MS__NW_descr_.raw->forceomit);
          decoded_length = uTRAN__ClassmarkChange().RAW_decode(PDU__RRM__UTRAN__ClassmarkChange__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_uTRAN__ClassmarkChange).messageType() ==  bs_34) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_35) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(21, force_omit, PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_descr_.raw->forceomit);
          decoded_length = cDMA2000__ClassmarkChange().RAW_decode(PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_cDMA2000__ClassmarkChange).messageType() ==  bs_35) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_36) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(22, force_omit, PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_descr_.raw->forceomit);
          decoded_length = gERAN__IU__ModeClassmarkChange().RAW_decode(PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_gERAN__IU__ModeClassmarkChange).messageType() ==  bs_36) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
 }
 clean_up();
 return -1;
}

int PDU__RRM__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 23;  myleaf.body.node.nodes = init_nodes_of_enc_tree(23);
  memset(myleaf.body.node.nodes, 0, 23 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_cipheringModeComplete:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, PDU__RRM__CipheringModeComplete__MS__NW_descr_.raw);
    encoded_length = field_cipheringModeComplete->RAW_encode(PDU__RRM__CipheringModeComplete__MS__NW_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &PDU__RRM__CipheringModeComplete__MS__NW_descr_;
    if ((*field_cipheringModeComplete).messageType() !=  bs_14) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_14.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_configurationChangeAck:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, PDU__RRM__ConfigurationChangeAck__MS__NW_descr_.raw);
    encoded_length = field_configurationChangeAck->RAW_encode(PDU__RRM__ConfigurationChangeAck__MS__NW_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &PDU__RRM__ConfigurationChangeAck__MS__NW_descr_;
    if ((*field_configurationChangeAck).messageType() !=  bs_15) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_15.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_configurationChangeRej:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, PDU__RRM__ConfigurationChangeRej__MS__NW_descr_.raw);
    encoded_length = field_configurationChangeRej->RAW_encode(PDU__RRM__ConfigurationChangeRej__MS__NW_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &PDU__RRM__ConfigurationChangeRej__MS__NW_descr_;
    if ((*field_configurationChangeRej).messageType() !=  bs_16) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_16.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_assignmentComplete:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, PDU__RRM__AssignmentComplete__MS__NW_descr_.raw);
    encoded_length = field_assignmentComplete->RAW_encode(PDU__RRM__AssignmentComplete__MS__NW_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &PDU__RRM__AssignmentComplete__MS__NW_descr_;
    if ((*field_assignmentComplete).messageType() !=  bs_17) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_17.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_assignmentFailure:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, PDU__RRM__AssignmentFailure__MS__NW_descr_.raw);
    encoded_length = field_assignmentFailure->RAW_encode(PDU__RRM__AssignmentFailure__MS__NW_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &PDU__RRM__AssignmentFailure__MS__NW_descr_;
    if ((*field_assignmentFailure).messageType() !=  bs_18) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_18.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_handoverComplete:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, PDU__RRM__HandoverComplete__MS__NW_descr_.raw);
    encoded_length = field_handoverComplete->RAW_encode(PDU__RRM__HandoverComplete__MS__NW_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &PDU__RRM__HandoverComplete__MS__NW_descr_;
    if ((*field_handoverComplete).messageType() !=  bs_19) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_19.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_handoverFailure:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, PDU__RRM__HandoverFailure__MS__NW_descr_.raw);
    encoded_length = field_handoverFailure->RAW_encode(PDU__RRM__HandoverFailure__MS__NW_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &PDU__RRM__HandoverFailure__MS__NW_descr_;
    if ((*field_handoverFailure).messageType() !=  bs_20) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_20.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_partialReleaseComplete:
    myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 7, PDU__RRM__PartialReleaseComplete__MS__NW_descr_.raw);
    encoded_length = field_partialReleaseComplete->RAW_encode(PDU__RRM__PartialReleaseComplete__MS__NW_descr_, *myleaf.body.node.nodes[7]);
    myleaf.body.node.nodes[7]->coding_descr = &PDU__RRM__PartialReleaseComplete__MS__NW_descr_;
    if ((*field_partialReleaseComplete).messageType() !=  bs_21) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_21.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_pagingResponse:
    myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 8, PDU__RRM__PagingResponse__MS__NW_descr_.raw);
    encoded_length = field_pagingResponse->RAW_encode(PDU__RRM__PagingResponse__MS__NW_descr_, *myleaf.body.node.nodes[8]);
    myleaf.body.node.nodes[8]->coding_descr = &PDU__RRM__PagingResponse__MS__NW_descr_;
    if ((*field_pagingResponse).messageType() !=  bs_22) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={8,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_22.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_notificationResponse:
    myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 9, PDU__RRM__NotificationResponse__MS__NW_descr_.raw);
    encoded_length = field_notificationResponse->RAW_encode(PDU__RRM__NotificationResponse__MS__NW_descr_, *myleaf.body.node.nodes[9]);
    myleaf.body.node.nodes[9]->coding_descr = &PDU__RRM__NotificationResponse__MS__NW_descr_;
    if ((*field_notificationResponse).messageType() !=  bs_23) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={9,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_23.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_rR__Status:
    myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 10, PDU__RRM__RR__Status_descr_.raw);
    encoded_length = field_rR__Status->RAW_encode(PDU__RRM__RR__Status_descr_, *myleaf.body.node.nodes[10]);
    myleaf.body.node.nodes[10]->coding_descr = &PDU__RRM__RR__Status_descr_;
    if ((*field_rR__Status).messageType() !=  bs_24) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={10,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_24.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_channelModeModifyAck:
    myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 11, PDU__RRM__ChannelModeModifyAck__MS__NW_descr_.raw);
    encoded_length = field_channelModeModifyAck->RAW_encode(PDU__RRM__ChannelModeModifyAck__MS__NW_descr_, *myleaf.body.node.nodes[11]);
    myleaf.body.node.nodes[11]->coding_descr = &PDU__RRM__ChannelModeModifyAck__MS__NW_descr_;
    if ((*field_channelModeModifyAck).messageType() !=  bs_25) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={11,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_25.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_classmarkChange:
    myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 12, PDU__RRM__ClassmarkChange__MS__NW_descr_.raw);
    encoded_length = field_classmarkChange->RAW_encode(PDU__RRM__ClassmarkChange__MS__NW_descr_, *myleaf.body.node.nodes[12]);
    myleaf.body.node.nodes[12]->coding_descr = &PDU__RRM__ClassmarkChange__MS__NW_descr_;
    if ((*field_classmarkChange).messageType() !=  bs_26) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={12,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_gPRS__suspensionRequest:
    myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 13, PDU__RRM__GPRS__SuspensionRequest__MS__NW_descr_.raw);
    encoded_length = field_gPRS__suspensionRequest->RAW_encode(PDU__RRM__GPRS__SuspensionRequest__MS__NW_descr_, *myleaf.body.node.nodes[13]);
    myleaf.body.node.nodes[13]->coding_descr = &PDU__RRM__GPRS__SuspensionRequest__MS__NW_descr_;
    if ((*field_gPRS__suspensionRequest).messageType() !=  bs_27) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={13,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_27.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_serviceInformationMessage:
    myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 14, PDU__RRM__ServiceInformationMessage__MS__NW_descr_.raw);
    encoded_length = field_serviceInformationMessage->RAW_encode(PDU__RRM__ServiceInformationMessage__MS__NW_descr_, *myleaf.body.node.nodes[14]);
    myleaf.body.node.nodes[14]->coding_descr = &PDU__RRM__ServiceInformationMessage__MS__NW_descr_;
    if ((*field_serviceInformationMessage).messageType() !=  bs_28) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={14,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_28.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_uplinkRelease:
    myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 15, PDU__RRM__UplinkRelease_descr_.raw);
    encoded_length = field_uplinkRelease->RAW_encode(PDU__RRM__UplinkRelease_descr_, *myleaf.body.node.nodes[15]);
    myleaf.body.node.nodes[15]->coding_descr = &PDU__RRM__UplinkRelease_descr_;
    if ((*field_uplinkRelease).messageType() !=  bs_29) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={15,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_29.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_talkerIndication:
    myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 16, PDU__RRM__TalkerIndication__MS__NW_descr_.raw);
    encoded_length = field_talkerIndication->RAW_encode(PDU__RRM__TalkerIndication__MS__NW_descr_, *myleaf.body.node.nodes[16]);
    myleaf.body.node.nodes[16]->coding_descr = &PDU__RRM__TalkerIndication__MS__NW_descr_;
    if ((*field_talkerIndication).messageType() !=  bs_30) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={16,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_30.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_applicationInformation:
    myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 17, PDU__RRM__ApplicationInformation_descr_.raw);
    encoded_length = field_applicationInformation->RAW_encode(PDU__RRM__ApplicationInformation_descr_, *myleaf.body.node.nodes[17]);
    myleaf.body.node.nodes[17]->coding_descr = &PDU__RRM__ApplicationInformation_descr_;
    if ((*field_applicationInformation).messageType() !=  bs_31) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={17,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_31.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_dTM__AssignmentFailure:
    myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 18, PDU__RRM__DTM__AssignmentFailure__MS__NW_descr_.raw);
    encoded_length = field_dTM__AssignmentFailure->RAW_encode(PDU__RRM__DTM__AssignmentFailure__MS__NW_descr_, *myleaf.body.node.nodes[18]);
    myleaf.body.node.nodes[18]->coding_descr = &PDU__RRM__DTM__AssignmentFailure__MS__NW_descr_;
    if ((*field_dTM__AssignmentFailure).messageType() !=  bs_32) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={18,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_32.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_dTM__Request:
    myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 19, PDU__RRM__DTM__Request__MS__NW_descr_.raw);
    encoded_length = field_dTM__Request->RAW_encode(PDU__RRM__DTM__Request__MS__NW_descr_, *myleaf.body.node.nodes[19]);
    myleaf.body.node.nodes[19]->coding_descr = &PDU__RRM__DTM__Request__MS__NW_descr_;
    if ((*field_dTM__Request).messageType() !=  bs_33) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_33.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_uTRAN__ClassmarkChange:
    myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 20, PDU__RRM__UTRAN__ClassmarkChange__MS__NW_descr_.raw);
    encoded_length = field_uTRAN__ClassmarkChange->RAW_encode(PDU__RRM__UTRAN__ClassmarkChange__MS__NW_descr_, *myleaf.body.node.nodes[20]);
    myleaf.body.node.nodes[20]->coding_descr = &PDU__RRM__UTRAN__ClassmarkChange__MS__NW_descr_;
    if ((*field_uTRAN__ClassmarkChange).messageType() !=  bs_34) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={20,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_34.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_cDMA2000__ClassmarkChange:
    myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 21, PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_descr_.raw);
    encoded_length = field_cDMA2000__ClassmarkChange->RAW_encode(PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_descr_, *myleaf.body.node.nodes[21]);
    myleaf.body.node.nodes[21]->coding_descr = &PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_descr_;
    if ((*field_cDMA2000__ClassmarkChange).messageType() !=  bs_35) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={21,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_35.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_gERAN__IU__ModeClassmarkChange:
    myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 22, PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_descr_.raw);
    encoded_length = field_gERAN__IU__ModeClassmarkChange->RAW_encode(PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_descr_, *myleaf.body.node.nodes[22]);
    myleaf.body.node.nodes[22]->coding_descr = &PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_descr_;
    if ((*field_gERAN__IU__ModeClassmarkChange).messageType() !=  bs_36) {
  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){
   bs_36.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void PDU__RRM__MS__NW_template::copy_value(const PDU__RRM__MS__NW& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
single_value.field_cipheringModeComplete = new PDU__RRM__CipheringModeComplete__MS__NW_template(other_value.cipheringModeComplete());
break;
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
single_value.field_configurationChangeAck = new PDU__RRM__ConfigurationChangeAck__MS__NW_template(other_value.configurationChangeAck());
break;
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
single_value.field_configurationChangeRej = new PDU__RRM__ConfigurationChangeRej__MS__NW_template(other_value.configurationChangeRej());
break;
case PDU__RRM__MS__NW::ALT_assignmentComplete:
single_value.field_assignmentComplete = new PDU__RRM__AssignmentComplete__MS__NW_template(other_value.assignmentComplete());
break;
case PDU__RRM__MS__NW::ALT_assignmentFailure:
single_value.field_assignmentFailure = new PDU__RRM__AssignmentFailure__MS__NW_template(other_value.assignmentFailure());
break;
case PDU__RRM__MS__NW::ALT_handoverComplete:
single_value.field_handoverComplete = new PDU__RRM__HandoverComplete__MS__NW_template(other_value.handoverComplete());
break;
case PDU__RRM__MS__NW::ALT_handoverFailure:
single_value.field_handoverFailure = new PDU__RRM__HandoverFailure__MS__NW_template(other_value.handoverFailure());
break;
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
single_value.field_partialReleaseComplete = new PDU__RRM__PartialReleaseComplete__MS__NW_template(other_value.partialReleaseComplete());
break;
case PDU__RRM__MS__NW::ALT_pagingResponse:
single_value.field_pagingResponse = new PDU__RRM__PagingResponse__MS__NW_template(other_value.pagingResponse());
break;
case PDU__RRM__MS__NW::ALT_notificationResponse:
single_value.field_notificationResponse = new PDU__RRM__NotificationResponse__MS__NW_template(other_value.notificationResponse());
break;
case PDU__RRM__MS__NW::ALT_rR__Status:
single_value.field_rR__Status = new PDU__RRM__RR__Status_template(other_value.rR__Status());
break;
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
single_value.field_channelModeModifyAck = new PDU__RRM__ChannelModeModifyAck__MS__NW_template(other_value.channelModeModifyAck());
break;
case PDU__RRM__MS__NW::ALT_classmarkChange:
single_value.field_classmarkChange = new PDU__RRM__ClassmarkChange__MS__NW_template(other_value.classmarkChange());
break;
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
single_value.field_gPRS__suspensionRequest = new PDU__RRM__GPRS__SuspensionRequest__MS__NW_template(other_value.gPRS__suspensionRequest());
break;
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
single_value.field_serviceInformationMessage = new PDU__RRM__ServiceInformationMessage__MS__NW_template(other_value.serviceInformationMessage());
break;
case PDU__RRM__MS__NW::ALT_uplinkRelease:
single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template(other_value.uplinkRelease());
break;
case PDU__RRM__MS__NW::ALT_talkerIndication:
single_value.field_talkerIndication = new PDU__RRM__TalkerIndication__MS__NW_template(other_value.talkerIndication());
break;
case PDU__RRM__MS__NW::ALT_applicationInformation:
single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template(other_value.applicationInformation());
break;
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
single_value.field_dTM__AssignmentFailure = new PDU__RRM__DTM__AssignmentFailure__MS__NW_template(other_value.dTM__AssignmentFailure());
break;
case PDU__RRM__MS__NW::ALT_dTM__Request:
single_value.field_dTM__Request = new PDU__RRM__DTM__Request__MS__NW_template(other_value.dTM__Request());
break;
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
single_value.field_uTRAN__ClassmarkChange = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(other_value.uTRAN__ClassmarkChange());
break;
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
single_value.field_cDMA2000__ClassmarkChange = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(other_value.cDMA2000__ClassmarkChange());
break;
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
single_value.field_gERAN__IU__ModeClassmarkChange = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(other_value.gERAN__IU__ModeClassmarkChange());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__MS__NW_template::copy_template(const PDU__RRM__MS__NW_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
single_value.field_cipheringModeComplete = new PDU__RRM__CipheringModeComplete__MS__NW_template(*other_value.single_value.field_cipheringModeComplete);
break;
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
single_value.field_configurationChangeAck = new PDU__RRM__ConfigurationChangeAck__MS__NW_template(*other_value.single_value.field_configurationChangeAck);
break;
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
single_value.field_configurationChangeRej = new PDU__RRM__ConfigurationChangeRej__MS__NW_template(*other_value.single_value.field_configurationChangeRej);
break;
case PDU__RRM__MS__NW::ALT_assignmentComplete:
single_value.field_assignmentComplete = new PDU__RRM__AssignmentComplete__MS__NW_template(*other_value.single_value.field_assignmentComplete);
break;
case PDU__RRM__MS__NW::ALT_assignmentFailure:
single_value.field_assignmentFailure = new PDU__RRM__AssignmentFailure__MS__NW_template(*other_value.single_value.field_assignmentFailure);
break;
case PDU__RRM__MS__NW::ALT_handoverComplete:
single_value.field_handoverComplete = new PDU__RRM__HandoverComplete__MS__NW_template(*other_value.single_value.field_handoverComplete);
break;
case PDU__RRM__MS__NW::ALT_handoverFailure:
single_value.field_handoverFailure = new PDU__RRM__HandoverFailure__MS__NW_template(*other_value.single_value.field_handoverFailure);
break;
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
single_value.field_partialReleaseComplete = new PDU__RRM__PartialReleaseComplete__MS__NW_template(*other_value.single_value.field_partialReleaseComplete);
break;
case PDU__RRM__MS__NW::ALT_pagingResponse:
single_value.field_pagingResponse = new PDU__RRM__PagingResponse__MS__NW_template(*other_value.single_value.field_pagingResponse);
break;
case PDU__RRM__MS__NW::ALT_notificationResponse:
single_value.field_notificationResponse = new PDU__RRM__NotificationResponse__MS__NW_template(*other_value.single_value.field_notificationResponse);
break;
case PDU__RRM__MS__NW::ALT_rR__Status:
single_value.field_rR__Status = new PDU__RRM__RR__Status_template(*other_value.single_value.field_rR__Status);
break;
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
single_value.field_channelModeModifyAck = new PDU__RRM__ChannelModeModifyAck__MS__NW_template(*other_value.single_value.field_channelModeModifyAck);
break;
case PDU__RRM__MS__NW::ALT_classmarkChange:
single_value.field_classmarkChange = new PDU__RRM__ClassmarkChange__MS__NW_template(*other_value.single_value.field_classmarkChange);
break;
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
single_value.field_gPRS__suspensionRequest = new PDU__RRM__GPRS__SuspensionRequest__MS__NW_template(*other_value.single_value.field_gPRS__suspensionRequest);
break;
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
single_value.field_serviceInformationMessage = new PDU__RRM__ServiceInformationMessage__MS__NW_template(*other_value.single_value.field_serviceInformationMessage);
break;
case PDU__RRM__MS__NW::ALT_uplinkRelease:
single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template(*other_value.single_value.field_uplinkRelease);
break;
case PDU__RRM__MS__NW::ALT_talkerIndication:
single_value.field_talkerIndication = new PDU__RRM__TalkerIndication__MS__NW_template(*other_value.single_value.field_talkerIndication);
break;
case PDU__RRM__MS__NW::ALT_applicationInformation:
single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template(*other_value.single_value.field_applicationInformation);
break;
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
single_value.field_dTM__AssignmentFailure = new PDU__RRM__DTM__AssignmentFailure__MS__NW_template(*other_value.single_value.field_dTM__AssignmentFailure);
break;
case PDU__RRM__MS__NW::ALT_dTM__Request:
single_value.field_dTM__Request = new PDU__RRM__DTM__Request__MS__NW_template(*other_value.single_value.field_dTM__Request);
break;
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
single_value.field_uTRAN__ClassmarkChange = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(*other_value.single_value.field_uTRAN__ClassmarkChange);
break;
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
single_value.field_cDMA2000__ClassmarkChange = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(*other_value.single_value.field_cDMA2000__ClassmarkChange);
break;
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
single_value.field_gERAN__IU__ModeClassmarkChange = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(*other_value.single_value.field_gERAN__IU__ModeClassmarkChange);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
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__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__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__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 template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
set_selection(other_value);
}

PDU__RRM__MS__NW_template::PDU__RRM__MS__NW_template()
{
}

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

PDU__RRM__MS__NW_template::PDU__RRM__MS__NW_template(const PDU__RRM__MS__NW& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void PDU__RRM__MS__NW_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
delete single_value.field_cipheringModeComplete;
break;
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
delete single_value.field_configurationChangeAck;
break;
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
delete single_value.field_configurationChangeRej;
break;
case PDU__RRM__MS__NW::ALT_assignmentComplete:
delete single_value.field_assignmentComplete;
break;
case PDU__RRM__MS__NW::ALT_assignmentFailure:
delete single_value.field_assignmentFailure;
break;
case PDU__RRM__MS__NW::ALT_handoverComplete:
delete single_value.field_handoverComplete;
break;
case PDU__RRM__MS__NW::ALT_handoverFailure:
delete single_value.field_handoverFailure;
break;
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
delete single_value.field_partialReleaseComplete;
break;
case PDU__RRM__MS__NW::ALT_pagingResponse:
delete single_value.field_pagingResponse;
break;
case PDU__RRM__MS__NW::ALT_notificationResponse:
delete single_value.field_notificationResponse;
break;
case PDU__RRM__MS__NW::ALT_rR__Status:
delete single_value.field_rR__Status;
break;
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
delete single_value.field_channelModeModifyAck;
break;
case PDU__RRM__MS__NW::ALT_classmarkChange:
delete single_value.field_classmarkChange;
break;
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
delete single_value.field_gPRS__suspensionRequest;
break;
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
delete single_value.field_serviceInformationMessage;
break;
case PDU__RRM__MS__NW::ALT_uplinkRelease:
delete single_value.field_uplinkRelease;
break;
case PDU__RRM__MS__NW::ALT_talkerIndication:
delete single_value.field_talkerIndication;
break;
case PDU__RRM__MS__NW::ALT_applicationInformation:
delete single_value.field_applicationInformation;
break;
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
delete single_value.field_dTM__AssignmentFailure;
break;
case PDU__RRM__MS__NW::ALT_dTM__Request:
delete single_value.field_dTM__Request;
break;
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
delete single_value.field_uTRAN__ClassmarkChange;
break;
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
delete single_value.field_cDMA2000__ClassmarkChange;
break;
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
delete single_value.field_gERAN__IU__ModeClassmarkChange;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

PDU__RRM__MS__NW_template& PDU__RRM__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__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 union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
return *this;
}

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

boolean PDU__RRM__MS__NW_template::match(const PDU__RRM__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:
{
PDU__RRM__MS__NW::union_selection_type value_selection = other_value.get_selection();
if (value_selection == PDU__RRM__MS__NW::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
return single_value.field_cipheringModeComplete->match(other_value.cipheringModeComplete(), legacy);
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
return single_value.field_configurationChangeAck->match(other_value.configurationChangeAck(), legacy);
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
return single_value.field_configurationChangeRej->match(other_value.configurationChangeRej(), legacy);
case PDU__RRM__MS__NW::ALT_assignmentComplete:
return single_value.field_assignmentComplete->match(other_value.assignmentComplete(), legacy);
case PDU__RRM__MS__NW::ALT_assignmentFailure:
return single_value.field_assignmentFailure->match(other_value.assignmentFailure(), legacy);
case PDU__RRM__MS__NW::ALT_handoverComplete:
return single_value.field_handoverComplete->match(other_value.handoverComplete(), legacy);
case PDU__RRM__MS__NW::ALT_handoverFailure:
return single_value.field_handoverFailure->match(other_value.handoverFailure(), legacy);
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
return single_value.field_partialReleaseComplete->match(other_value.partialReleaseComplete(), legacy);
case PDU__RRM__MS__NW::ALT_pagingResponse:
return single_value.field_pagingResponse->match(other_value.pagingResponse(), legacy);
case PDU__RRM__MS__NW::ALT_notificationResponse:
return single_value.field_notificationResponse->match(other_value.notificationResponse(), legacy);
case PDU__RRM__MS__NW::ALT_rR__Status:
return single_value.field_rR__Status->match(other_value.rR__Status(), legacy);
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
return single_value.field_channelModeModifyAck->match(other_value.channelModeModifyAck(), legacy);
case PDU__RRM__MS__NW::ALT_classmarkChange:
return single_value.field_classmarkChange->match(other_value.classmarkChange(), legacy);
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
return single_value.field_gPRS__suspensionRequest->match(other_value.gPRS__suspensionRequest(), legacy);
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
return single_value.field_serviceInformationMessage->match(other_value.serviceInformationMessage(), legacy);
case PDU__RRM__MS__NW::ALT_uplinkRelease:
return single_value.field_uplinkRelease->match(other_value.uplinkRelease(), legacy);
case PDU__RRM__MS__NW::ALT_talkerIndication:
return single_value.field_talkerIndication->match(other_value.talkerIndication(), legacy);
case PDU__RRM__MS__NW::ALT_applicationInformation:
return single_value.field_applicationInformation->match(other_value.applicationInformation(), legacy);
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
return single_value.field_dTM__AssignmentFailure->match(other_value.dTM__AssignmentFailure(), legacy);
case PDU__RRM__MS__NW::ALT_dTM__Request:
return single_value.field_dTM__Request->match(other_value.dTM__Request(), legacy);
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
return single_value.field_uTRAN__ClassmarkChange->match(other_value.uTRAN__ClassmarkChange(), legacy);
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
return single_value.field_cDMA2000__ClassmarkChange->match(other_value.cDMA2000__ClassmarkChange(), legacy);
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
return single_value.field_gERAN__IU__ModeClassmarkChange->match(other_value.gERAN__IU__ModeClassmarkChange(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__MS__NW_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
return single_value.field_cipheringModeComplete->is_value();
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
return single_value.field_configurationChangeAck->is_value();
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
return single_value.field_configurationChangeRej->is_value();
case PDU__RRM__MS__NW::ALT_assignmentComplete:
return single_value.field_assignmentComplete->is_value();
case PDU__RRM__MS__NW::ALT_assignmentFailure:
return single_value.field_assignmentFailure->is_value();
case PDU__RRM__MS__NW::ALT_handoverComplete:
return single_value.field_handoverComplete->is_value();
case PDU__RRM__MS__NW::ALT_handoverFailure:
return single_value.field_handoverFailure->is_value();
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
return single_value.field_partialReleaseComplete->is_value();
case PDU__RRM__MS__NW::ALT_pagingResponse:
return single_value.field_pagingResponse->is_value();
case PDU__RRM__MS__NW::ALT_notificationResponse:
return single_value.field_notificationResponse->is_value();
case PDU__RRM__MS__NW::ALT_rR__Status:
return single_value.field_rR__Status->is_value();
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
return single_value.field_channelModeModifyAck->is_value();
case PDU__RRM__MS__NW::ALT_classmarkChange:
return single_value.field_classmarkChange->is_value();
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
return single_value.field_gPRS__suspensionRequest->is_value();
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
return single_value.field_serviceInformationMessage->is_value();
case PDU__RRM__MS__NW::ALT_uplinkRelease:
return single_value.field_uplinkRelease->is_value();
case PDU__RRM__MS__NW::ALT_talkerIndication:
return single_value.field_talkerIndication->is_value();
case PDU__RRM__MS__NW::ALT_applicationInformation:
return single_value.field_applicationInformation->is_value();
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
return single_value.field_dTM__AssignmentFailure->is_value();
case PDU__RRM__MS__NW::ALT_dTM__Request:
return single_value.field_dTM__Request->is_value();
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
return single_value.field_uTRAN__ClassmarkChange->is_value();
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
return single_value.field_cDMA2000__ClassmarkChange->is_value();
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
return single_value.field_gERAN__IU__ModeClassmarkChange->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
}

PDU__RRM__MS__NW PDU__RRM__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 union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
PDU__RRM__MS__NW ret_val;
switch (single_value.union_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
ret_val.cipheringModeComplete() = single_value.field_cipheringModeComplete->valueof();
break;
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
ret_val.configurationChangeAck() = single_value.field_configurationChangeAck->valueof();
break;
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
ret_val.configurationChangeRej() = single_value.field_configurationChangeRej->valueof();
break;
case PDU__RRM__MS__NW::ALT_assignmentComplete:
ret_val.assignmentComplete() = single_value.field_assignmentComplete->valueof();
break;
case PDU__RRM__MS__NW::ALT_assignmentFailure:
ret_val.assignmentFailure() = single_value.field_assignmentFailure->valueof();
break;
case PDU__RRM__MS__NW::ALT_handoverComplete:
ret_val.handoverComplete() = single_value.field_handoverComplete->valueof();
break;
case PDU__RRM__MS__NW::ALT_handoverFailure:
ret_val.handoverFailure() = single_value.field_handoverFailure->valueof();
break;
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
ret_val.partialReleaseComplete() = single_value.field_partialReleaseComplete->valueof();
break;
case PDU__RRM__MS__NW::ALT_pagingResponse:
ret_val.pagingResponse() = single_value.field_pagingResponse->valueof();
break;
case PDU__RRM__MS__NW::ALT_notificationResponse:
ret_val.notificationResponse() = single_value.field_notificationResponse->valueof();
break;
case PDU__RRM__MS__NW::ALT_rR__Status:
ret_val.rR__Status() = single_value.field_rR__Status->valueof();
break;
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
ret_val.channelModeModifyAck() = single_value.field_channelModeModifyAck->valueof();
break;
case PDU__RRM__MS__NW::ALT_classmarkChange:
ret_val.classmarkChange() = single_value.field_classmarkChange->valueof();
break;
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
ret_val.gPRS__suspensionRequest() = single_value.field_gPRS__suspensionRequest->valueof();
break;
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
ret_val.serviceInformationMessage() = single_value.field_serviceInformationMessage->valueof();
break;
case PDU__RRM__MS__NW::ALT_uplinkRelease:
ret_val.uplinkRelease() = single_value.field_uplinkRelease->valueof();
break;
case PDU__RRM__MS__NW::ALT_talkerIndication:
ret_val.talkerIndication() = single_value.field_talkerIndication->valueof();
break;
case PDU__RRM__MS__NW::ALT_applicationInformation:
ret_val.applicationInformation() = single_value.field_applicationInformation->valueof();
break;
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
ret_val.dTM__AssignmentFailure() = single_value.field_dTM__AssignmentFailure->valueof();
break;
case PDU__RRM__MS__NW::ALT_dTM__Request:
ret_val.dTM__Request() = single_value.field_dTM__Request->valueof();
break;
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
ret_val.uTRAN__ClassmarkChange() = single_value.field_uTRAN__ClassmarkChange->valueof();
break;
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
ret_val.cDMA2000__ClassmarkChange() = single_value.field_cDMA2000__ClassmarkChange->valueof();
break;
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
ret_val.gERAN__IU__ModeClassmarkChange() = single_value.field_gERAN__IU__ModeClassmarkChange->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
return ret_val;
}

PDU__RRM__MS__NW_template& PDU__RRM__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("Internal error: Accessing a list element of a non-list template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return value_list.list_value[list_index];
}
void PDU__RRM__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 ("Internal error: Setting an invalid list for a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__MS__NW_template[list_length];
}

PDU__RRM__CipheringModeComplete__MS__NW_template& PDU__RRM__MS__NW_template::cipheringModeComplete()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_cipheringModeComplete) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cipheringModeComplete = new PDU__RRM__CipheringModeComplete__MS__NW_template(ANY_VALUE);
else single_value.field_cipheringModeComplete = new PDU__RRM__CipheringModeComplete__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_cipheringModeComplete;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cipheringModeComplete;
}

const PDU__RRM__CipheringModeComplete__MS__NW_template& PDU__RRM__MS__NW_template::cipheringModeComplete() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cipheringModeComplete in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_cipheringModeComplete) TTCN_error("Accessing non-selected field cipheringModeComplete in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_cipheringModeComplete;
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template& PDU__RRM__MS__NW_template::configurationChangeAck()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_configurationChangeAck) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_configurationChangeAck = new PDU__RRM__ConfigurationChangeAck__MS__NW_template(ANY_VALUE);
else single_value.field_configurationChangeAck = new PDU__RRM__ConfigurationChangeAck__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_configurationChangeAck;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_configurationChangeAck;
}

const PDU__RRM__ConfigurationChangeAck__MS__NW_template& PDU__RRM__MS__NW_template::configurationChangeAck() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field configurationChangeAck in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_configurationChangeAck) TTCN_error("Accessing non-selected field configurationChangeAck in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_configurationChangeAck;
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template& PDU__RRM__MS__NW_template::configurationChangeRej()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_configurationChangeRej) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_configurationChangeRej = new PDU__RRM__ConfigurationChangeRej__MS__NW_template(ANY_VALUE);
else single_value.field_configurationChangeRej = new PDU__RRM__ConfigurationChangeRej__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_configurationChangeRej;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_configurationChangeRej;
}

const PDU__RRM__ConfigurationChangeRej__MS__NW_template& PDU__RRM__MS__NW_template::configurationChangeRej() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field configurationChangeRej in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_configurationChangeRej) TTCN_error("Accessing non-selected field configurationChangeRej in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_configurationChangeRej;
}

PDU__RRM__AssignmentComplete__MS__NW_template& PDU__RRM__MS__NW_template::assignmentComplete()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_assignmentComplete) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_assignmentComplete = new PDU__RRM__AssignmentComplete__MS__NW_template(ANY_VALUE);
else single_value.field_assignmentComplete = new PDU__RRM__AssignmentComplete__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_assignmentComplete;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_assignmentComplete;
}

const PDU__RRM__AssignmentComplete__MS__NW_template& PDU__RRM__MS__NW_template::assignmentComplete() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field assignmentComplete in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_assignmentComplete) TTCN_error("Accessing non-selected field assignmentComplete in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_assignmentComplete;
}

PDU__RRM__AssignmentFailure__MS__NW_template& PDU__RRM__MS__NW_template::assignmentFailure()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_assignmentFailure) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_assignmentFailure = new PDU__RRM__AssignmentFailure__MS__NW_template(ANY_VALUE);
else single_value.field_assignmentFailure = new PDU__RRM__AssignmentFailure__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_assignmentFailure;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_assignmentFailure;
}

const PDU__RRM__AssignmentFailure__MS__NW_template& PDU__RRM__MS__NW_template::assignmentFailure() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field assignmentFailure in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_assignmentFailure) TTCN_error("Accessing non-selected field assignmentFailure in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_assignmentFailure;
}

PDU__RRM__HandoverComplete__MS__NW_template& PDU__RRM__MS__NW_template::handoverComplete()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_handoverComplete) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_handoverComplete = new PDU__RRM__HandoverComplete__MS__NW_template(ANY_VALUE);
else single_value.field_handoverComplete = new PDU__RRM__HandoverComplete__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_handoverComplete;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_handoverComplete;
}

const PDU__RRM__HandoverComplete__MS__NW_template& PDU__RRM__MS__NW_template::handoverComplete() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field handoverComplete in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_handoverComplete) TTCN_error("Accessing non-selected field handoverComplete in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_handoverComplete;
}

PDU__RRM__HandoverFailure__MS__NW_template& PDU__RRM__MS__NW_template::handoverFailure()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_handoverFailure) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_handoverFailure = new PDU__RRM__HandoverFailure__MS__NW_template(ANY_VALUE);
else single_value.field_handoverFailure = new PDU__RRM__HandoverFailure__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_handoverFailure;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_handoverFailure;
}

const PDU__RRM__HandoverFailure__MS__NW_template& PDU__RRM__MS__NW_template::handoverFailure() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field handoverFailure in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_handoverFailure) TTCN_error("Accessing non-selected field handoverFailure in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_handoverFailure;
}

PDU__RRM__PartialReleaseComplete__MS__NW_template& PDU__RRM__MS__NW_template::partialReleaseComplete()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_partialReleaseComplete) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_partialReleaseComplete = new PDU__RRM__PartialReleaseComplete__MS__NW_template(ANY_VALUE);
else single_value.field_partialReleaseComplete = new PDU__RRM__PartialReleaseComplete__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_partialReleaseComplete;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_partialReleaseComplete;
}

const PDU__RRM__PartialReleaseComplete__MS__NW_template& PDU__RRM__MS__NW_template::partialReleaseComplete() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field partialReleaseComplete in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_partialReleaseComplete) TTCN_error("Accessing non-selected field partialReleaseComplete in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_partialReleaseComplete;
}

PDU__RRM__PagingResponse__MS__NW_template& PDU__RRM__MS__NW_template::pagingResponse()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_pagingResponse) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_pagingResponse = new PDU__RRM__PagingResponse__MS__NW_template(ANY_VALUE);
else single_value.field_pagingResponse = new PDU__RRM__PagingResponse__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_pagingResponse;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_pagingResponse;
}

const PDU__RRM__PagingResponse__MS__NW_template& PDU__RRM__MS__NW_template::pagingResponse() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pagingResponse in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_pagingResponse) TTCN_error("Accessing non-selected field pagingResponse in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_pagingResponse;
}

PDU__RRM__NotificationResponse__MS__NW_template& PDU__RRM__MS__NW_template::notificationResponse()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_notificationResponse) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_notificationResponse = new PDU__RRM__NotificationResponse__MS__NW_template(ANY_VALUE);
else single_value.field_notificationResponse = new PDU__RRM__NotificationResponse__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_notificationResponse;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_notificationResponse;
}

const PDU__RRM__NotificationResponse__MS__NW_template& PDU__RRM__MS__NW_template::notificationResponse() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field notificationResponse in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_notificationResponse) TTCN_error("Accessing non-selected field notificationResponse in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_notificationResponse;
}

PDU__RRM__RR__Status_template& PDU__RRM__MS__NW_template::rR__Status()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_rR__Status) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rR__Status = new PDU__RRM__RR__Status_template(ANY_VALUE);
else single_value.field_rR__Status = new PDU__RRM__RR__Status_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_rR__Status;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rR__Status;
}

const PDU__RRM__RR__Status_template& PDU__RRM__MS__NW_template::rR__Status() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rR_Status in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_rR__Status) TTCN_error("Accessing non-selected field rR_Status in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_rR__Status;
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template& PDU__RRM__MS__NW_template::channelModeModifyAck()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_channelModeModifyAck) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_channelModeModifyAck = new PDU__RRM__ChannelModeModifyAck__MS__NW_template(ANY_VALUE);
else single_value.field_channelModeModifyAck = new PDU__RRM__ChannelModeModifyAck__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_channelModeModifyAck;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_channelModeModifyAck;
}

const PDU__RRM__ChannelModeModifyAck__MS__NW_template& PDU__RRM__MS__NW_template::channelModeModifyAck() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field channelModeModifyAck in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_channelModeModifyAck) TTCN_error("Accessing non-selected field channelModeModifyAck in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_channelModeModifyAck;
}

PDU__RRM__ClassmarkChange__MS__NW_template& PDU__RRM__MS__NW_template::classmarkChange()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_classmarkChange) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_classmarkChange = new PDU__RRM__ClassmarkChange__MS__NW_template(ANY_VALUE);
else single_value.field_classmarkChange = new PDU__RRM__ClassmarkChange__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_classmarkChange;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_classmarkChange;
}

const PDU__RRM__ClassmarkChange__MS__NW_template& PDU__RRM__MS__NW_template::classmarkChange() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field classmarkChange in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_classmarkChange) TTCN_error("Accessing non-selected field classmarkChange in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_classmarkChange;
}

PDU__RRM__GPRS__SuspensionRequest__MS__NW_template& PDU__RRM__MS__NW_template::gPRS__suspensionRequest()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gPRS__suspensionRequest = new PDU__RRM__GPRS__SuspensionRequest__MS__NW_template(ANY_VALUE);
else single_value.field_gPRS__suspensionRequest = new PDU__RRM__GPRS__SuspensionRequest__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gPRS__suspensionRequest;
}

const PDU__RRM__GPRS__SuspensionRequest__MS__NW_template& PDU__RRM__MS__NW_template::gPRS__suspensionRequest() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gPRS_suspensionRequest in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest) TTCN_error("Accessing non-selected field gPRS_suspensionRequest in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_gPRS__suspensionRequest;
}

PDU__RRM__ServiceInformationMessage__MS__NW_template& PDU__RRM__MS__NW_template::serviceInformationMessage()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_serviceInformationMessage) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_serviceInformationMessage = new PDU__RRM__ServiceInformationMessage__MS__NW_template(ANY_VALUE);
else single_value.field_serviceInformationMessage = new PDU__RRM__ServiceInformationMessage__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_serviceInformationMessage;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_serviceInformationMessage;
}

const PDU__RRM__ServiceInformationMessage__MS__NW_template& PDU__RRM__MS__NW_template::serviceInformationMessage() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field serviceInformationMessage in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_serviceInformationMessage) TTCN_error("Accessing non-selected field serviceInformationMessage in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_serviceInformationMessage;
}

PDU__RRM__UplinkRelease_template& PDU__RRM__MS__NW_template::uplinkRelease()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_uplinkRelease) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template(ANY_VALUE);
else single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_uplinkRelease;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_uplinkRelease;
}

const PDU__RRM__UplinkRelease_template& PDU__RRM__MS__NW_template::uplinkRelease() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field uplinkRelease in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_uplinkRelease) TTCN_error("Accessing non-selected field uplinkRelease in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_uplinkRelease;
}

PDU__RRM__TalkerIndication__MS__NW_template& PDU__RRM__MS__NW_template::talkerIndication()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_talkerIndication) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_talkerIndication = new PDU__RRM__TalkerIndication__MS__NW_template(ANY_VALUE);
else single_value.field_talkerIndication = new PDU__RRM__TalkerIndication__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_talkerIndication;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_talkerIndication;
}

const PDU__RRM__TalkerIndication__MS__NW_template& PDU__RRM__MS__NW_template::talkerIndication() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field talkerIndication in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_talkerIndication) TTCN_error("Accessing non-selected field talkerIndication in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_talkerIndication;
}

PDU__RRM__ApplicationInformation_template& PDU__RRM__MS__NW_template::applicationInformation()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_applicationInformation) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template(ANY_VALUE);
else single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_applicationInformation;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_applicationInformation;
}

const PDU__RRM__ApplicationInformation_template& PDU__RRM__MS__NW_template::applicationInformation() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field applicationInformation in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_applicationInformation) TTCN_error("Accessing non-selected field applicationInformation in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_applicationInformation;
}

PDU__RRM__DTM__AssignmentFailure__MS__NW_template& PDU__RRM__MS__NW_template::dTM__AssignmentFailure()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_dTM__AssignmentFailure = new PDU__RRM__DTM__AssignmentFailure__MS__NW_template(ANY_VALUE);
else single_value.field_dTM__AssignmentFailure = new PDU__RRM__DTM__AssignmentFailure__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_dTM__AssignmentFailure;
}

const PDU__RRM__DTM__AssignmentFailure__MS__NW_template& PDU__RRM__MS__NW_template::dTM__AssignmentFailure() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTM_AssignmentFailure in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure) TTCN_error("Accessing non-selected field dTM_AssignmentFailure in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_dTM__AssignmentFailure;
}

PDU__RRM__DTM__Request__MS__NW_template& PDU__RRM__MS__NW_template::dTM__Request()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_dTM__Request) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_dTM__Request = new PDU__RRM__DTM__Request__MS__NW_template(ANY_VALUE);
else single_value.field_dTM__Request = new PDU__RRM__DTM__Request__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_dTM__Request;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_dTM__Request;
}

const PDU__RRM__DTM__Request__MS__NW_template& PDU__RRM__MS__NW_template::dTM__Request() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTM_Request in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_dTM__Request) TTCN_error("Accessing non-selected field dTM_Request in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_dTM__Request;
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template& PDU__RRM__MS__NW_template::uTRAN__ClassmarkChange()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_uTRAN__ClassmarkChange = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(ANY_VALUE);
else single_value.field_uTRAN__ClassmarkChange = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_uTRAN__ClassmarkChange;
}

const PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template& PDU__RRM__MS__NW_template::uTRAN__ClassmarkChange() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field uTRAN_ClassmarkChange in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange) TTCN_error("Accessing non-selected field uTRAN_ClassmarkChange in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_uTRAN__ClassmarkChange;
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template& PDU__RRM__MS__NW_template::cDMA2000__ClassmarkChange()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cDMA2000__ClassmarkChange = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(ANY_VALUE);
else single_value.field_cDMA2000__ClassmarkChange = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cDMA2000__ClassmarkChange;
}

const PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template& PDU__RRM__MS__NW_template::cDMA2000__ClassmarkChange() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cDMA2000_ClassmarkChange in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange) TTCN_error("Accessing non-selected field cDMA2000_ClassmarkChange in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_cDMA2000__ClassmarkChange;
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template& PDU__RRM__MS__NW_template::gERAN__IU__ModeClassmarkChange()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gERAN__IU__ModeClassmarkChange = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(ANY_VALUE);
else single_value.field_gERAN__IU__ModeClassmarkChange = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template;
single_value.union_selection = PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gERAN__IU__ModeClassmarkChange;
}

const PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template& PDU__RRM__MS__NW_template::gERAN__IU__ModeClassmarkChange() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gERAN_IU_ModeClassmarkChange in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
if (single_value.union_selection != PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange) TTCN_error("Accessing non-selected field gERAN_IU_ModeClassmarkChange in a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
return *single_value.field_gERAN__IU__ModeClassmarkChange;
}

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

void PDU__RRM__MS__NW_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
TTCN_Logger::log_event_str("{ cipheringModeComplete := ");
single_value.field_cipheringModeComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
TTCN_Logger::log_event_str("{ configurationChangeAck := ");
single_value.field_configurationChangeAck->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
TTCN_Logger::log_event_str("{ configurationChangeRej := ");
single_value.field_configurationChangeRej->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_assignmentComplete:
TTCN_Logger::log_event_str("{ assignmentComplete := ");
single_value.field_assignmentComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_assignmentFailure:
TTCN_Logger::log_event_str("{ assignmentFailure := ");
single_value.field_assignmentFailure->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_handoverComplete:
TTCN_Logger::log_event_str("{ handoverComplete := ");
single_value.field_handoverComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_handoverFailure:
TTCN_Logger::log_event_str("{ handoverFailure := ");
single_value.field_handoverFailure->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
TTCN_Logger::log_event_str("{ partialReleaseComplete := ");
single_value.field_partialReleaseComplete->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_pagingResponse:
TTCN_Logger::log_event_str("{ pagingResponse := ");
single_value.field_pagingResponse->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_notificationResponse:
TTCN_Logger::log_event_str("{ notificationResponse := ");
single_value.field_notificationResponse->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_rR__Status:
TTCN_Logger::log_event_str("{ rR_Status := ");
single_value.field_rR__Status->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
TTCN_Logger::log_event_str("{ channelModeModifyAck := ");
single_value.field_channelModeModifyAck->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_classmarkChange:
TTCN_Logger::log_event_str("{ classmarkChange := ");
single_value.field_classmarkChange->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
TTCN_Logger::log_event_str("{ gPRS_suspensionRequest := ");
single_value.field_gPRS__suspensionRequest->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
TTCN_Logger::log_event_str("{ serviceInformationMessage := ");
single_value.field_serviceInformationMessage->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_uplinkRelease:
TTCN_Logger::log_event_str("{ uplinkRelease := ");
single_value.field_uplinkRelease->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_talkerIndication:
TTCN_Logger::log_event_str("{ talkerIndication := ");
single_value.field_talkerIndication->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_applicationInformation:
TTCN_Logger::log_event_str("{ applicationInformation := ");
single_value.field_applicationInformation->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
TTCN_Logger::log_event_str("{ dTM_AssignmentFailure := ");
single_value.field_dTM__AssignmentFailure->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_dTM__Request:
TTCN_Logger::log_event_str("{ dTM_Request := ");
single_value.field_dTM__Request->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
TTCN_Logger::log_event_str("{ uTRAN_ClassmarkChange := ");
single_value.field_uTRAN__ClassmarkChange->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
TTCN_Logger::log_event_str("{ cDMA2000_ClassmarkChange := ");
single_value.field_cDMA2000__ClassmarkChange->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
TTCN_Logger::log_event_str("{ gERAN_IU_ModeClassmarkChange := ");
single_value.field_gERAN__IU__ModeClassmarkChange->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__RRM__MS__NW_template::log_match(const PDU__RRM__MS__NW& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cipheringModeComplete");
single_value.field_cipheringModeComplete->log_match(match_value.cipheringModeComplete(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cipheringModeComplete := ");
single_value.field_cipheringModeComplete->log_match(match_value.cipheringModeComplete(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".configurationChangeAck");
single_value.field_configurationChangeAck->log_match(match_value.configurationChangeAck(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ configurationChangeAck := ");
single_value.field_configurationChangeAck->log_match(match_value.configurationChangeAck(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".configurationChangeRej");
single_value.field_configurationChangeRej->log_match(match_value.configurationChangeRej(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ configurationChangeRej := ");
single_value.field_configurationChangeRej->log_match(match_value.configurationChangeRej(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_assignmentComplete:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".assignmentComplete");
single_value.field_assignmentComplete->log_match(match_value.assignmentComplete(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ assignmentComplete := ");
single_value.field_assignmentComplete->log_match(match_value.assignmentComplete(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_assignmentFailure:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".assignmentFailure");
single_value.field_assignmentFailure->log_match(match_value.assignmentFailure(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ assignmentFailure := ");
single_value.field_assignmentFailure->log_match(match_value.assignmentFailure(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_handoverComplete:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".handoverComplete");
single_value.field_handoverComplete->log_match(match_value.handoverComplete(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ handoverComplete := ");
single_value.field_handoverComplete->log_match(match_value.handoverComplete(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_handoverFailure:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".handoverFailure");
single_value.field_handoverFailure->log_match(match_value.handoverFailure(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ handoverFailure := ");
single_value.field_handoverFailure->log_match(match_value.handoverFailure(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".partialReleaseComplete");
single_value.field_partialReleaseComplete->log_match(match_value.partialReleaseComplete(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ partialReleaseComplete := ");
single_value.field_partialReleaseComplete->log_match(match_value.partialReleaseComplete(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_pagingResponse:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".pagingResponse");
single_value.field_pagingResponse->log_match(match_value.pagingResponse(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ pagingResponse := ");
single_value.field_pagingResponse->log_match(match_value.pagingResponse(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_notificationResponse:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".notificationResponse");
single_value.field_notificationResponse->log_match(match_value.notificationResponse(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ notificationResponse := ");
single_value.field_notificationResponse->log_match(match_value.notificationResponse(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_rR__Status:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rR_Status");
single_value.field_rR__Status->log_match(match_value.rR__Status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rR_Status := ");
single_value.field_rR__Status->log_match(match_value.rR__Status(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".channelModeModifyAck");
single_value.field_channelModeModifyAck->log_match(match_value.channelModeModifyAck(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ channelModeModifyAck := ");
single_value.field_channelModeModifyAck->log_match(match_value.channelModeModifyAck(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_classmarkChange:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".classmarkChange");
single_value.field_classmarkChange->log_match(match_value.classmarkChange(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ classmarkChange := ");
single_value.field_classmarkChange->log_match(match_value.classmarkChange(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gPRS_suspensionRequest");
single_value.field_gPRS__suspensionRequest->log_match(match_value.gPRS__suspensionRequest(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gPRS_suspensionRequest := ");
single_value.field_gPRS__suspensionRequest->log_match(match_value.gPRS__suspensionRequest(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".serviceInformationMessage");
single_value.field_serviceInformationMessage->log_match(match_value.serviceInformationMessage(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ serviceInformationMessage := ");
single_value.field_serviceInformationMessage->log_match(match_value.serviceInformationMessage(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_uplinkRelease:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".uplinkRelease");
single_value.field_uplinkRelease->log_match(match_value.uplinkRelease(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ uplinkRelease := ");
single_value.field_uplinkRelease->log_match(match_value.uplinkRelease(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_talkerIndication:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".talkerIndication");
single_value.field_talkerIndication->log_match(match_value.talkerIndication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ talkerIndication := ");
single_value.field_talkerIndication->log_match(match_value.talkerIndication(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_applicationInformation:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".applicationInformation");
single_value.field_applicationInformation->log_match(match_value.applicationInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ applicationInformation := ");
single_value.field_applicationInformation->log_match(match_value.applicationInformation(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".dTM_AssignmentFailure");
single_value.field_dTM__AssignmentFailure->log_match(match_value.dTM__AssignmentFailure(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ dTM_AssignmentFailure := ");
single_value.field_dTM__AssignmentFailure->log_match(match_value.dTM__AssignmentFailure(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_dTM__Request:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".dTM_Request");
single_value.field_dTM__Request->log_match(match_value.dTM__Request(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ dTM_Request := ");
single_value.field_dTM__Request->log_match(match_value.dTM__Request(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".uTRAN_ClassmarkChange");
single_value.field_uTRAN__ClassmarkChange->log_match(match_value.uTRAN__ClassmarkChange(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ uTRAN_ClassmarkChange := ");
single_value.field_uTRAN__ClassmarkChange->log_match(match_value.uTRAN__ClassmarkChange(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cDMA2000_ClassmarkChange");
single_value.field_cDMA2000__ClassmarkChange->log_match(match_value.cDMA2000__ClassmarkChange(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cDMA2000_ClassmarkChange := ");
single_value.field_cDMA2000__ClassmarkChange->log_match(match_value.cDMA2000__ClassmarkChange(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gERAN_IU_ModeClassmarkChange");
single_value.field_gERAN__IU__ModeClassmarkChange->log_match(match_value.gERAN__IU__ModeClassmarkChange(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gERAN_IU_ModeClassmarkChange := ");
single_value.field_gERAN__IU__ModeClassmarkChange->log_match(match_value.gERAN__IU__ModeClassmarkChange(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__RRM__MS__NW_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
single_value.field_cipheringModeComplete->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
single_value.field_configurationChangeAck->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
single_value.field_configurationChangeRej->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_assignmentComplete:
single_value.field_assignmentComplete->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_assignmentFailure:
single_value.field_assignmentFailure->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_handoverComplete:
single_value.field_handoverComplete->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_handoverFailure:
single_value.field_handoverFailure->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
single_value.field_partialReleaseComplete->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_pagingResponse:
single_value.field_pagingResponse->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_notificationResponse:
single_value.field_notificationResponse->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_rR__Status:
single_value.field_rR__Status->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
single_value.field_channelModeModifyAck->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_classmarkChange:
single_value.field_classmarkChange->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
single_value.field_gPRS__suspensionRequest->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
single_value.field_serviceInformationMessage->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_uplinkRelease:
single_value.field_uplinkRelease->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_talkerIndication:
single_value.field_talkerIndication->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_applicationInformation:
single_value.field_applicationInformation->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
single_value.field_dTM__AssignmentFailure->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_dTM__Request:
single_value.field_dTM__Request->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
single_value.field_uTRAN__ClassmarkChange->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
single_value.field_cDMA2000__ClassmarkChange->encode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
single_value.field_gERAN__IU__ModeClassmarkChange->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
}

void PDU__RRM__MS__NW_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = PDU__RRM__MS__NW::UNBOUND_VALUE;
PDU__RRM__MS__NW::union_selection_type new_selection = (PDU__RRM__MS__NW::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
single_value.field_cipheringModeComplete = new PDU__RRM__CipheringModeComplete__MS__NW_template;
single_value.field_cipheringModeComplete->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
single_value.field_configurationChangeAck = new PDU__RRM__ConfigurationChangeAck__MS__NW_template;
single_value.field_configurationChangeAck->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
single_value.field_configurationChangeRej = new PDU__RRM__ConfigurationChangeRej__MS__NW_template;
single_value.field_configurationChangeRej->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_assignmentComplete:
single_value.field_assignmentComplete = new PDU__RRM__AssignmentComplete__MS__NW_template;
single_value.field_assignmentComplete->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_assignmentFailure:
single_value.field_assignmentFailure = new PDU__RRM__AssignmentFailure__MS__NW_template;
single_value.field_assignmentFailure->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_handoverComplete:
single_value.field_handoverComplete = new PDU__RRM__HandoverComplete__MS__NW_template;
single_value.field_handoverComplete->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_handoverFailure:
single_value.field_handoverFailure = new PDU__RRM__HandoverFailure__MS__NW_template;
single_value.field_handoverFailure->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
single_value.field_partialReleaseComplete = new PDU__RRM__PartialReleaseComplete__MS__NW_template;
single_value.field_partialReleaseComplete->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_pagingResponse:
single_value.field_pagingResponse = new PDU__RRM__PagingResponse__MS__NW_template;
single_value.field_pagingResponse->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_notificationResponse:
single_value.field_notificationResponse = new PDU__RRM__NotificationResponse__MS__NW_template;
single_value.field_notificationResponse->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_rR__Status:
single_value.field_rR__Status = new PDU__RRM__RR__Status_template;
single_value.field_rR__Status->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
single_value.field_channelModeModifyAck = new PDU__RRM__ChannelModeModifyAck__MS__NW_template;
single_value.field_channelModeModifyAck->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_classmarkChange:
single_value.field_classmarkChange = new PDU__RRM__ClassmarkChange__MS__NW_template;
single_value.field_classmarkChange->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
single_value.field_gPRS__suspensionRequest = new PDU__RRM__GPRS__SuspensionRequest__MS__NW_template;
single_value.field_gPRS__suspensionRequest->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
single_value.field_serviceInformationMessage = new PDU__RRM__ServiceInformationMessage__MS__NW_template;
single_value.field_serviceInformationMessage->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_uplinkRelease:
single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template;
single_value.field_uplinkRelease->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_talkerIndication:
single_value.field_talkerIndication = new PDU__RRM__TalkerIndication__MS__NW_template;
single_value.field_talkerIndication->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_applicationInformation:
single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template;
single_value.field_applicationInformation->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
single_value.field_dTM__AssignmentFailure = new PDU__RRM__DTM__AssignmentFailure__MS__NW_template;
single_value.field_dTM__AssignmentFailure->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_dTM__Request:
single_value.field_dTM__Request = new PDU__RRM__DTM__Request__MS__NW_template;
single_value.field_dTM__Request->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
single_value.field_uTRAN__ClassmarkChange = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template;
single_value.field_uTRAN__ClassmarkChange->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
single_value.field_cDMA2000__ClassmarkChange = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template;
single_value.field_cDMA2000__ClassmarkChange->decode_text(text_buf);
break;
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
single_value.field_gERAN__IU__ModeClassmarkChange = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template;
single_value.field_gERAN__IU__ModeClassmarkChange->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__RRM__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: Unrecognized selector was received in a template of type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
}

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

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

void PDU__RRM__MS__NW_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_RRM_Types.PDU_RRM_MS_NW'");
    }
    if (strcmp("cipheringModeComplete", param_field) == 0) {
      cipheringModeComplete().set_param(param);
      return;
    } else if (strcmp("configurationChangeAck", param_field) == 0) {
      configurationChangeAck().set_param(param);
      return;
    } else if (strcmp("configurationChangeRej", param_field) == 0) {
      configurationChangeRej().set_param(param);
      return;
    } else if (strcmp("assignmentComplete", param_field) == 0) {
      assignmentComplete().set_param(param);
      return;
    } else if (strcmp("assignmentFailure", param_field) == 0) {
      assignmentFailure().set_param(param);
      return;
    } else if (strcmp("handoverComplete", param_field) == 0) {
      handoverComplete().set_param(param);
      return;
    } else if (strcmp("handoverFailure", param_field) == 0) {
      handoverFailure().set_param(param);
      return;
    } else if (strcmp("partialReleaseComplete", param_field) == 0) {
      partialReleaseComplete().set_param(param);
      return;
    } else if (strcmp("pagingResponse", param_field) == 0) {
      pagingResponse().set_param(param);
      return;
    } else if (strcmp("notificationResponse", param_field) == 0) {
      notificationResponse().set_param(param);
      return;
    } else if (strcmp("rR_Status", param_field) == 0) {
      rR__Status().set_param(param);
      return;
    } else if (strcmp("channelModeModifyAck", param_field) == 0) {
      channelModeModifyAck().set_param(param);
      return;
    } else if (strcmp("classmarkChange", param_field) == 0) {
      classmarkChange().set_param(param);
      return;
    } else if (strcmp("gPRS_suspensionRequest", param_field) == 0) {
      gPRS__suspensionRequest().set_param(param);
      return;
    } else if (strcmp("serviceInformationMessage", param_field) == 0) {
      serviceInformationMessage().set_param(param);
      return;
    } else if (strcmp("uplinkRelease", param_field) == 0) {
      uplinkRelease().set_param(param);
      return;
    } else if (strcmp("talkerIndication", param_field) == 0) {
      talkerIndication().set_param(param);
      return;
    } else if (strcmp("applicationInformation", param_field) == 0) {
      applicationInformation().set_param(param);
      return;
    } else if (strcmp("dTM_AssignmentFailure", param_field) == 0) {
      dTM__AssignmentFailure().set_param(param);
      return;
    } else if (strcmp("dTM_Request", param_field) == 0) {
      dTM__Request().set_param(param);
      return;
    } else if (strcmp("uTRAN_ClassmarkChange", param_field) == 0) {
      uTRAN__ClassmarkChange().set_param(param);
      return;
    } else if (strcmp("cDMA2000_ClassmarkChange", param_field) == 0) {
      cDMA2000__ClassmarkChange().set_param(param);
      return;
    } else if (strcmp("gERAN_IU_ModeClassmarkChange", param_field) == 0) {
      gERAN__IU__ModeClassmarkChange().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_RRM_Types.PDU_RRM_MS_NW'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__RRM__MS__NW_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "cipheringModeComplete")) {
      cipheringModeComplete().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "configurationChangeAck")) {
      configurationChangeAck().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "configurationChangeRej")) {
      configurationChangeRej().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "assignmentComplete")) {
      assignmentComplete().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "assignmentFailure")) {
      assignmentFailure().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "handoverComplete")) {
      handoverComplete().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "handoverFailure")) {
      handoverFailure().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "partialReleaseComplete")) {
      partialReleaseComplete().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "pagingResponse")) {
      pagingResponse().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "notificationResponse")) {
      notificationResponse().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rR_Status")) {
      rR__Status().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "channelModeModifyAck")) {
      channelModeModifyAck().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "classmarkChange")) {
      classmarkChange().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gPRS_suspensionRequest")) {
      gPRS__suspensionRequest().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "serviceInformationMessage")) {
      serviceInformationMessage().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "uplinkRelease")) {
      uplinkRelease().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "talkerIndication")) {
      talkerIndication().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "applicationInformation")) {
      applicationInformation().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "dTM_AssignmentFailure")) {
      dTM__AssignmentFailure().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "dTM_Request")) {
      dTM__Request().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "uTRAN_ClassmarkChange")) {
      uTRAN__ClassmarkChange().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cDMA2000_ClassmarkChange")) {
      cDMA2000__ClassmarkChange().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "gERAN_IU_ModeClassmarkChange")) {
      gERAN__IU__ModeClassmarkChange().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_RRM_Types.PDU_RRM_MS_NW.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__MS__NW_template* precondition = new PDU__RRM__MS__NW_template;
    precondition->set_param(*m_p->get_elem(0));
    PDU__RRM__MS__NW_template* implied_template = new PDU__RRM__MS__NW_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PDU__RRM__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__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;
switch (single_value.union_selection) {
case PDU__RRM__MS__NW::ALT_cipheringModeComplete:
single_value.field_cipheringModeComplete->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_configurationChangeAck:
single_value.field_configurationChangeAck->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_configurationChangeRej:
single_value.field_configurationChangeRej->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_assignmentComplete:
single_value.field_assignmentComplete->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_assignmentFailure:
single_value.field_assignmentFailure->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_handoverComplete:
single_value.field_handoverComplete->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_handoverFailure:
single_value.field_handoverFailure->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_partialReleaseComplete:
single_value.field_partialReleaseComplete->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_pagingResponse:
single_value.field_pagingResponse->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_notificationResponse:
single_value.field_notificationResponse->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_rR__Status:
single_value.field_rR__Status->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_channelModeModifyAck:
single_value.field_channelModeModifyAck->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_classmarkChange:
single_value.field_classmarkChange->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_gPRS__suspensionRequest:
single_value.field_gPRS__suspensionRequest->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_serviceInformationMessage:
single_value.field_serviceInformationMessage->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_uplinkRelease:
single_value.field_uplinkRelease->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_talkerIndication:
single_value.field_talkerIndication->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_applicationInformation:
single_value.field_applicationInformation->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_dTM__AssignmentFailure:
single_value.field_dTM__AssignmentFailure->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_dTM__Request:
single_value.field_dTM__Request->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_uTRAN__ClassmarkChange:
single_value.field_uTRAN__ClassmarkChange->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_cDMA2000__ClassmarkChange:
single_value.field_cDMA2000__ClassmarkChange->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
case PDU__RRM__MS__NW::ALT_gERAN__IU__ModeClassmarkChange:
single_value.field_gERAN__IU__ModeClassmarkChange->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_MS_NW");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_RRM_Types.PDU_RRM_MS_NW.");
}
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_MS_NW");
}

void PDU__RRM__NW__MS::copy_value(const PDU__RRM__NW__MS& other_value)
{
switch (other_value.union_selection) {
case ALT_additionalAssignment:
field_additionalAssignment = new PDU__RRM__AdditionalAssignment__NW__MS(*other_value.field_additionalAssignment);
break;
case ALT_immediatePacketAssignment:
field_immediatePacketAssignment = new PDU__RRM__ImmediatePacketAssignment__NW__MS(*other_value.field_immediatePacketAssignment);
break;
case ALT_cipheringModeCommand:
field_cipheringModeCommand = new PDU__RRM__CipheringModeCommand__NW__MS(*other_value.field_cipheringModeCommand);
break;
case ALT_configurationChangeCommand:
field_configurationChangeCommand = new PDU__RRM__ConfigurationChangeCommand__NW__MS(*other_value.field_configurationChangeCommand);
break;
case ALT_assignmentCommand:
field_assignmentCommand = new PDU__RRM__AssignmentCommand__NW__MS(*other_value.field_assignmentCommand);
break;
case ALT_handoverCommand:
field_handoverCommand = new PDU__RRM__HandoverCommand__NW__MS(*other_value.field_handoverCommand);
break;
case ALT_physicalInformation:
field_physicalInformation = new PDU__RRM__PhysicalInformation__NW__MS(*other_value.field_physicalInformation);
break;
case ALT_channelRelease:
field_channelRelease = new PDU__RRM__ChannelRelease__NW__MS(*other_value.field_channelRelease);
break;
case ALT_partialRelease:
field_partialRelease = new PDU__RRM__PartialRelease__NW__MS(*other_value.field_partialRelease);
break;
case ALT_pagingReq__Type1:
field_pagingReq__Type1 = new PDU__RRM__PagingReq__Type1__NW__MS(*other_value.field_pagingReq__Type1);
break;
case ALT_pagingReq__Type2:
field_pagingReq__Type2 = new PDU__RRM__PagingReq__Type2__NW__MS(*other_value.field_pagingReq__Type2);
break;
case ALT_pagingReq__Type3:
field_pagingReq__Type3 = new PDU__RRM__PagingReq__Type3__NW__MS(*other_value.field_pagingReq__Type3);
break;
case ALT_channelModeModify:
field_channelModeModify = new PDU__RRM__ChannelModeModify__NW__MS(*other_value.field_channelModeModify);
break;
case ALT_rR__Status:
field_rR__Status = new PDU__RRM__RR__Status(*other_value.field_rR__Status);
break;
case ALT_frequency__Redefinition:
field_frequency__Redefinition = new PDU__RRM__Frequency__Redefinition__NW__MS(*other_value.field_frequency__Redefinition);
break;
case ALT_classmarkEnquiry:
field_classmarkEnquiry = new PDU__RRM__ClassmarkEnquiry__NW__MS(*other_value.field_classmarkEnquiry);
break;
case ALT_mBMS__Announcement:
field_mBMS__Announcement = new MBMS__Announcement__NW__MS(*other_value.field_mBMS__Announcement);
break;
case ALT_vGCS__UplinkGrant:
field_vGCS__UplinkGrant = new PDU__RRM__VGCS__UplinkGrant__NW__MS(*other_value.field_vGCS__UplinkGrant);
break;
case ALT_uplinkRelease:
field_uplinkRelease = new PDU__RRM__UplinkRelease(*other_value.field_uplinkRelease);
break;
case ALT_uplinkBusy:
field_uplinkBusy = new PDU__RRM__UplinkBusy__NW__MS(*other_value.field_uplinkBusy);
break;
case ALT_applicationInformation:
field_applicationInformation = new PDU__RRM__ApplicationInformation(*other_value.field_applicationInformation);
break;
case ALT_dTM__AssignmentCommand:
field_dTM__AssignmentCommand = new PDU__RRM__DTM__AssignmentCommand__NW__MS(*other_value.field_dTM__AssignmentCommand);
break;
case ALT_dTM__Information:
field_dTM__Information = new PDU__RRM__DTM__Information__NW__MS(*other_value.field_dTM__Information);
break;
case ALT_dTM__Reject:
field_dTM__Reject = new PDU__RRM__DTM__Reject__NW__MS(*other_value.field_dTM__Reject);
break;
case ALT_packetNotification:
field_packetNotification = new PDU__RRM__PacketNotification__NW__MS(*other_value.field_packetNotification);
break;
case ALT_interSystemToUTRAN__HandoverCommand:
field_interSystemToUTRAN__HandoverCommand = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS(*other_value.field_interSystemToUTRAN__HandoverCommand);
break;
case ALT_interSystemToCDMA2000HandoverCommand:
field_interSystemToCDMA2000HandoverCommand = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS(*other_value.field_interSystemToCDMA2000HandoverCommand);
break;
case ALT_interSystemToEUTRAN__HandoverCommand:
field_interSystemToEUTRAN__HandoverCommand = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS(*other_value.field_interSystemToEUTRAN__HandoverCommand);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean PDU__RRM__NW__MS::operator==(const PDU__RRM__NW__MS& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_additionalAssignment:
return *field_additionalAssignment == *other_value.field_additionalAssignment;
case ALT_immediatePacketAssignment:
return *field_immediatePacketAssignment == *other_value.field_immediatePacketAssignment;
case ALT_cipheringModeCommand:
return *field_cipheringModeCommand == *other_value.field_cipheringModeCommand;
case ALT_configurationChangeCommand:
return *field_configurationChangeCommand == *other_value.field_configurationChangeCommand;
case ALT_assignmentCommand:
return *field_assignmentCommand == *other_value.field_assignmentCommand;
case ALT_handoverCommand:
return *field_handoverCommand == *other_value.field_handoverCommand;
case ALT_physicalInformation:
return *field_physicalInformation == *other_value.field_physicalInformation;
case ALT_channelRelease:
return *field_channelRelease == *other_value.field_channelRelease;
case ALT_partialRelease:
return *field_partialRelease == *other_value.field_partialRelease;
case ALT_pagingReq__Type1:
return *field_pagingReq__Type1 == *other_value.field_pagingReq__Type1;
case ALT_pagingReq__Type2:
return *field_pagingReq__Type2 == *other_value.field_pagingReq__Type2;
case ALT_pagingReq__Type3:
return *field_pagingReq__Type3 == *other_value.field_pagingReq__Type3;
case ALT_channelModeModify:
return *field_channelModeModify == *other_value.field_channelModeModify;
case ALT_rR__Status:
return *field_rR__Status == *other_value.field_rR__Status;
case ALT_frequency__Redefinition:
return *field_frequency__Redefinition == *other_value.field_frequency__Redefinition;
case ALT_classmarkEnquiry:
return *field_classmarkEnquiry == *other_value.field_classmarkEnquiry;
case ALT_mBMS__Announcement:
return *field_mBMS__Announcement == *other_value.field_mBMS__Announcement;
case ALT_vGCS__UplinkGrant:
return *field_vGCS__UplinkGrant == *other_value.field_vGCS__UplinkGrant;
case ALT_uplinkRelease:
return *field_uplinkRelease == *other_value.field_uplinkRelease;
case ALT_uplinkBusy:
return *field_uplinkBusy == *other_value.field_uplinkBusy;
case ALT_applicationInformation:
return *field_applicationInformation == *other_value.field_applicationInformation;
case ALT_dTM__AssignmentCommand:
return *field_dTM__AssignmentCommand == *other_value.field_dTM__AssignmentCommand;
case ALT_dTM__Information:
return *field_dTM__Information == *other_value.field_dTM__Information;
case ALT_dTM__Reject:
return *field_dTM__Reject == *other_value.field_dTM__Reject;
case ALT_packetNotification:
return *field_packetNotification == *other_value.field_packetNotification;
case ALT_interSystemToUTRAN__HandoverCommand:
return *field_interSystemToUTRAN__HandoverCommand == *other_value.field_interSystemToUTRAN__HandoverCommand;
case ALT_interSystemToCDMA2000HandoverCommand:
return *field_interSystemToCDMA2000HandoverCommand == *other_value.field_interSystemToCDMA2000HandoverCommand;
case ALT_interSystemToEUTRAN__HandoverCommand:
return *field_interSystemToEUTRAN__HandoverCommand == *other_value.field_interSystemToEUTRAN__HandoverCommand;
default:
return FALSE;
}
}

PDU__RRM__AdditionalAssignment__NW__MS& PDU__RRM__NW__MS::additionalAssignment()
{
if (union_selection != ALT_additionalAssignment) {
clean_up();
field_additionalAssignment = new PDU__RRM__AdditionalAssignment__NW__MS;
union_selection = ALT_additionalAssignment;
}
return *field_additionalAssignment;
}

const PDU__RRM__AdditionalAssignment__NW__MS& PDU__RRM__NW__MS::additionalAssignment() const
{
if (union_selection != ALT_additionalAssignment) TTCN_error("Using non-selected field additionalAssignment in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_additionalAssignment;
}

PDU__RRM__ImmediatePacketAssignment__NW__MS& PDU__RRM__NW__MS::immediatePacketAssignment()
{
if (union_selection != ALT_immediatePacketAssignment) {
clean_up();
field_immediatePacketAssignment = new PDU__RRM__ImmediatePacketAssignment__NW__MS;
union_selection = ALT_immediatePacketAssignment;
}
return *field_immediatePacketAssignment;
}

const PDU__RRM__ImmediatePacketAssignment__NW__MS& PDU__RRM__NW__MS::immediatePacketAssignment() const
{
if (union_selection != ALT_immediatePacketAssignment) TTCN_error("Using non-selected field immediatePacketAssignment in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_immediatePacketAssignment;
}

PDU__RRM__CipheringModeCommand__NW__MS& PDU__RRM__NW__MS::cipheringModeCommand()
{
if (union_selection != ALT_cipheringModeCommand) {
clean_up();
field_cipheringModeCommand = new PDU__RRM__CipheringModeCommand__NW__MS;
union_selection = ALT_cipheringModeCommand;
}
return *field_cipheringModeCommand;
}

const PDU__RRM__CipheringModeCommand__NW__MS& PDU__RRM__NW__MS::cipheringModeCommand() const
{
if (union_selection != ALT_cipheringModeCommand) TTCN_error("Using non-selected field cipheringModeCommand in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_cipheringModeCommand;
}

PDU__RRM__ConfigurationChangeCommand__NW__MS& PDU__RRM__NW__MS::configurationChangeCommand()
{
if (union_selection != ALT_configurationChangeCommand) {
clean_up();
field_configurationChangeCommand = new PDU__RRM__ConfigurationChangeCommand__NW__MS;
union_selection = ALT_configurationChangeCommand;
}
return *field_configurationChangeCommand;
}

const PDU__RRM__ConfigurationChangeCommand__NW__MS& PDU__RRM__NW__MS::configurationChangeCommand() const
{
if (union_selection != ALT_configurationChangeCommand) TTCN_error("Using non-selected field configurationChangeCommand in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_configurationChangeCommand;
}

PDU__RRM__AssignmentCommand__NW__MS& PDU__RRM__NW__MS::assignmentCommand()
{
if (union_selection != ALT_assignmentCommand) {
clean_up();
field_assignmentCommand = new PDU__RRM__AssignmentCommand__NW__MS;
union_selection = ALT_assignmentCommand;
}
return *field_assignmentCommand;
}

const PDU__RRM__AssignmentCommand__NW__MS& PDU__RRM__NW__MS::assignmentCommand() const
{
if (union_selection != ALT_assignmentCommand) TTCN_error("Using non-selected field assignmentCommand in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_assignmentCommand;
}

PDU__RRM__HandoverCommand__NW__MS& PDU__RRM__NW__MS::handoverCommand()
{
if (union_selection != ALT_handoverCommand) {
clean_up();
field_handoverCommand = new PDU__RRM__HandoverCommand__NW__MS;
union_selection = ALT_handoverCommand;
}
return *field_handoverCommand;
}

const PDU__RRM__HandoverCommand__NW__MS& PDU__RRM__NW__MS::handoverCommand() const
{
if (union_selection != ALT_handoverCommand) TTCN_error("Using non-selected field handoverCommand in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_handoverCommand;
}

PDU__RRM__PhysicalInformation__NW__MS& PDU__RRM__NW__MS::physicalInformation()
{
if (union_selection != ALT_physicalInformation) {
clean_up();
field_physicalInformation = new PDU__RRM__PhysicalInformation__NW__MS;
union_selection = ALT_physicalInformation;
}
return *field_physicalInformation;
}

const PDU__RRM__PhysicalInformation__NW__MS& PDU__RRM__NW__MS::physicalInformation() const
{
if (union_selection != ALT_physicalInformation) TTCN_error("Using non-selected field physicalInformation in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_physicalInformation;
}

PDU__RRM__ChannelRelease__NW__MS& PDU__RRM__NW__MS::channelRelease()
{
if (union_selection != ALT_channelRelease) {
clean_up();
field_channelRelease = new PDU__RRM__ChannelRelease__NW__MS;
union_selection = ALT_channelRelease;
}
return *field_channelRelease;
}

const PDU__RRM__ChannelRelease__NW__MS& PDU__RRM__NW__MS::channelRelease() const
{
if (union_selection != ALT_channelRelease) TTCN_error("Using non-selected field channelRelease in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_channelRelease;
}

PDU__RRM__PartialRelease__NW__MS& PDU__RRM__NW__MS::partialRelease()
{
if (union_selection != ALT_partialRelease) {
clean_up();
field_partialRelease = new PDU__RRM__PartialRelease__NW__MS;
union_selection = ALT_partialRelease;
}
return *field_partialRelease;
}

const PDU__RRM__PartialRelease__NW__MS& PDU__RRM__NW__MS::partialRelease() const
{
if (union_selection != ALT_partialRelease) TTCN_error("Using non-selected field partialRelease in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_partialRelease;
}

PDU__RRM__PagingReq__Type1__NW__MS& PDU__RRM__NW__MS::pagingReq__Type1()
{
if (union_selection != ALT_pagingReq__Type1) {
clean_up();
field_pagingReq__Type1 = new PDU__RRM__PagingReq__Type1__NW__MS;
union_selection = ALT_pagingReq__Type1;
}
return *field_pagingReq__Type1;
}

const PDU__RRM__PagingReq__Type1__NW__MS& PDU__RRM__NW__MS::pagingReq__Type1() const
{
if (union_selection != ALT_pagingReq__Type1) TTCN_error("Using non-selected field pagingReq_Type1 in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_pagingReq__Type1;
}

PDU__RRM__PagingReq__Type2__NW__MS& PDU__RRM__NW__MS::pagingReq__Type2()
{
if (union_selection != ALT_pagingReq__Type2) {
clean_up();
field_pagingReq__Type2 = new PDU__RRM__PagingReq__Type2__NW__MS;
union_selection = ALT_pagingReq__Type2;
}
return *field_pagingReq__Type2;
}

const PDU__RRM__PagingReq__Type2__NW__MS& PDU__RRM__NW__MS::pagingReq__Type2() const
{
if (union_selection != ALT_pagingReq__Type2) TTCN_error("Using non-selected field pagingReq_Type2 in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_pagingReq__Type2;
}

PDU__RRM__PagingReq__Type3__NW__MS& PDU__RRM__NW__MS::pagingReq__Type3()
{
if (union_selection != ALT_pagingReq__Type3) {
clean_up();
field_pagingReq__Type3 = new PDU__RRM__PagingReq__Type3__NW__MS;
union_selection = ALT_pagingReq__Type3;
}
return *field_pagingReq__Type3;
}

const PDU__RRM__PagingReq__Type3__NW__MS& PDU__RRM__NW__MS::pagingReq__Type3() const
{
if (union_selection != ALT_pagingReq__Type3) TTCN_error("Using non-selected field pagingReq_Type3 in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_pagingReq__Type3;
}

PDU__RRM__ChannelModeModify__NW__MS& PDU__RRM__NW__MS::channelModeModify()
{
if (union_selection != ALT_channelModeModify) {
clean_up();
field_channelModeModify = new PDU__RRM__ChannelModeModify__NW__MS;
union_selection = ALT_channelModeModify;
}
return *field_channelModeModify;
}

const PDU__RRM__ChannelModeModify__NW__MS& PDU__RRM__NW__MS::channelModeModify() const
{
if (union_selection != ALT_channelModeModify) TTCN_error("Using non-selected field channelModeModify in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_channelModeModify;
}

PDU__RRM__RR__Status& PDU__RRM__NW__MS::rR__Status()
{
if (union_selection != ALT_rR__Status) {
clean_up();
field_rR__Status = new PDU__RRM__RR__Status;
union_selection = ALT_rR__Status;
}
return *field_rR__Status;
}

const PDU__RRM__RR__Status& PDU__RRM__NW__MS::rR__Status() const
{
if (union_selection != ALT_rR__Status) TTCN_error("Using non-selected field rR_Status in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_rR__Status;
}

PDU__RRM__Frequency__Redefinition__NW__MS& PDU__RRM__NW__MS::frequency__Redefinition()
{
if (union_selection != ALT_frequency__Redefinition) {
clean_up();
field_frequency__Redefinition = new PDU__RRM__Frequency__Redefinition__NW__MS;
union_selection = ALT_frequency__Redefinition;
}
return *field_frequency__Redefinition;
}

const PDU__RRM__Frequency__Redefinition__NW__MS& PDU__RRM__NW__MS::frequency__Redefinition() const
{
if (union_selection != ALT_frequency__Redefinition) TTCN_error("Using non-selected field frequency_Redefinition in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_frequency__Redefinition;
}

PDU__RRM__ClassmarkEnquiry__NW__MS& PDU__RRM__NW__MS::classmarkEnquiry()
{
if (union_selection != ALT_classmarkEnquiry) {
clean_up();
field_classmarkEnquiry = new PDU__RRM__ClassmarkEnquiry__NW__MS;
union_selection = ALT_classmarkEnquiry;
}
return *field_classmarkEnquiry;
}

const PDU__RRM__ClassmarkEnquiry__NW__MS& PDU__RRM__NW__MS::classmarkEnquiry() const
{
if (union_selection != ALT_classmarkEnquiry) TTCN_error("Using non-selected field classmarkEnquiry in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_classmarkEnquiry;
}

MBMS__Announcement__NW__MS& PDU__RRM__NW__MS::mBMS__Announcement()
{
if (union_selection != ALT_mBMS__Announcement) {
clean_up();
field_mBMS__Announcement = new MBMS__Announcement__NW__MS;
union_selection = ALT_mBMS__Announcement;
}
return *field_mBMS__Announcement;
}

const MBMS__Announcement__NW__MS& PDU__RRM__NW__MS::mBMS__Announcement() const
{
if (union_selection != ALT_mBMS__Announcement) TTCN_error("Using non-selected field mBMS_Announcement in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_mBMS__Announcement;
}

PDU__RRM__VGCS__UplinkGrant__NW__MS& PDU__RRM__NW__MS::vGCS__UplinkGrant()
{
if (union_selection != ALT_vGCS__UplinkGrant) {
clean_up();
field_vGCS__UplinkGrant = new PDU__RRM__VGCS__UplinkGrant__NW__MS;
union_selection = ALT_vGCS__UplinkGrant;
}
return *field_vGCS__UplinkGrant;
}

const PDU__RRM__VGCS__UplinkGrant__NW__MS& PDU__RRM__NW__MS::vGCS__UplinkGrant() const
{
if (union_selection != ALT_vGCS__UplinkGrant) TTCN_error("Using non-selected field vGCS_UplinkGrant in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_vGCS__UplinkGrant;
}

PDU__RRM__UplinkRelease& PDU__RRM__NW__MS::uplinkRelease()
{
if (union_selection != ALT_uplinkRelease) {
clean_up();
field_uplinkRelease = new PDU__RRM__UplinkRelease;
union_selection = ALT_uplinkRelease;
}
return *field_uplinkRelease;
}

const PDU__RRM__UplinkRelease& PDU__RRM__NW__MS::uplinkRelease() const
{
if (union_selection != ALT_uplinkRelease) TTCN_error("Using non-selected field uplinkRelease in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_uplinkRelease;
}

PDU__RRM__UplinkBusy__NW__MS& PDU__RRM__NW__MS::uplinkBusy()
{
if (union_selection != ALT_uplinkBusy) {
clean_up();
field_uplinkBusy = new PDU__RRM__UplinkBusy__NW__MS;
union_selection = ALT_uplinkBusy;
}
return *field_uplinkBusy;
}

const PDU__RRM__UplinkBusy__NW__MS& PDU__RRM__NW__MS::uplinkBusy() const
{
if (union_selection != ALT_uplinkBusy) TTCN_error("Using non-selected field uplinkBusy in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_uplinkBusy;
}

PDU__RRM__ApplicationInformation& PDU__RRM__NW__MS::applicationInformation()
{
if (union_selection != ALT_applicationInformation) {
clean_up();
field_applicationInformation = new PDU__RRM__ApplicationInformation;
union_selection = ALT_applicationInformation;
}
return *field_applicationInformation;
}

const PDU__RRM__ApplicationInformation& PDU__RRM__NW__MS::applicationInformation() const
{
if (union_selection != ALT_applicationInformation) TTCN_error("Using non-selected field applicationInformation in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_applicationInformation;
}

PDU__RRM__DTM__AssignmentCommand__NW__MS& PDU__RRM__NW__MS::dTM__AssignmentCommand()
{
if (union_selection != ALT_dTM__AssignmentCommand) {
clean_up();
field_dTM__AssignmentCommand = new PDU__RRM__DTM__AssignmentCommand__NW__MS;
union_selection = ALT_dTM__AssignmentCommand;
}
return *field_dTM__AssignmentCommand;
}

const PDU__RRM__DTM__AssignmentCommand__NW__MS& PDU__RRM__NW__MS::dTM__AssignmentCommand() const
{
if (union_selection != ALT_dTM__AssignmentCommand) TTCN_error("Using non-selected field dTM_AssignmentCommand in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_dTM__AssignmentCommand;
}

PDU__RRM__DTM__Information__NW__MS& PDU__RRM__NW__MS::dTM__Information()
{
if (union_selection != ALT_dTM__Information) {
clean_up();
field_dTM__Information = new PDU__RRM__DTM__Information__NW__MS;
union_selection = ALT_dTM__Information;
}
return *field_dTM__Information;
}

const PDU__RRM__DTM__Information__NW__MS& PDU__RRM__NW__MS::dTM__Information() const
{
if (union_selection != ALT_dTM__Information) TTCN_error("Using non-selected field dTM_Information in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_dTM__Information;
}

PDU__RRM__DTM__Reject__NW__MS& PDU__RRM__NW__MS::dTM__Reject()
{
if (union_selection != ALT_dTM__Reject) {
clean_up();
field_dTM__Reject = new PDU__RRM__DTM__Reject__NW__MS;
union_selection = ALT_dTM__Reject;
}
return *field_dTM__Reject;
}

const PDU__RRM__DTM__Reject__NW__MS& PDU__RRM__NW__MS::dTM__Reject() const
{
if (union_selection != ALT_dTM__Reject) TTCN_error("Using non-selected field dTM_Reject in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_dTM__Reject;
}

PDU__RRM__PacketNotification__NW__MS& PDU__RRM__NW__MS::packetNotification()
{
if (union_selection != ALT_packetNotification) {
clean_up();
field_packetNotification = new PDU__RRM__PacketNotification__NW__MS;
union_selection = ALT_packetNotification;
}
return *field_packetNotification;
}

const PDU__RRM__PacketNotification__NW__MS& PDU__RRM__NW__MS::packetNotification() const
{
if (union_selection != ALT_packetNotification) TTCN_error("Using non-selected field packetNotification in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_packetNotification;
}

PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS& PDU__RRM__NW__MS::interSystemToUTRAN__HandoverCommand()
{
if (union_selection != ALT_interSystemToUTRAN__HandoverCommand) {
clean_up();
field_interSystemToUTRAN__HandoverCommand = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS;
union_selection = ALT_interSystemToUTRAN__HandoverCommand;
}
return *field_interSystemToUTRAN__HandoverCommand;
}

const PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS& PDU__RRM__NW__MS::interSystemToUTRAN__HandoverCommand() const
{
if (union_selection != ALT_interSystemToUTRAN__HandoverCommand) TTCN_error("Using non-selected field interSystemToUTRAN_HandoverCommand in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_interSystemToUTRAN__HandoverCommand;
}

PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS& PDU__RRM__NW__MS::interSystemToCDMA2000HandoverCommand()
{
if (union_selection != ALT_interSystemToCDMA2000HandoverCommand) {
clean_up();
field_interSystemToCDMA2000HandoverCommand = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS;
union_selection = ALT_interSystemToCDMA2000HandoverCommand;
}
return *field_interSystemToCDMA2000HandoverCommand;
}

const PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS& PDU__RRM__NW__MS::interSystemToCDMA2000HandoverCommand() const
{
if (union_selection != ALT_interSystemToCDMA2000HandoverCommand) TTCN_error("Using non-selected field interSystemToCDMA2000HandoverCommand in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_interSystemToCDMA2000HandoverCommand;
}

PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS& PDU__RRM__NW__MS::interSystemToEUTRAN__HandoverCommand()
{
if (union_selection != ALT_interSystemToEUTRAN__HandoverCommand) {
clean_up();
field_interSystemToEUTRAN__HandoverCommand = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS;
union_selection = ALT_interSystemToEUTRAN__HandoverCommand;
}
return *field_interSystemToEUTRAN__HandoverCommand;
}

const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS& PDU__RRM__NW__MS::interSystemToEUTRAN__HandoverCommand() const
{
if (union_selection != ALT_interSystemToEUTRAN__HandoverCommand) TTCN_error("Using non-selected field interSystemToEUTRAN_HandoverCommand in a value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *field_interSystemToEUTRAN__HandoverCommand;
}

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

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

boolean PDU__RRM__NW__MS::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_additionalAssignment: return field_additionalAssignment->is_value();
case ALT_immediatePacketAssignment: return field_immediatePacketAssignment->is_value();
case ALT_cipheringModeCommand: return field_cipheringModeCommand->is_value();
case ALT_configurationChangeCommand: return field_configurationChangeCommand->is_value();
case ALT_assignmentCommand: return field_assignmentCommand->is_value();
case ALT_handoverCommand: return field_handoverCommand->is_value();
case ALT_physicalInformation: return field_physicalInformation->is_value();
case ALT_channelRelease: return field_channelRelease->is_value();
case ALT_partialRelease: return field_partialRelease->is_value();
case ALT_pagingReq__Type1: return field_pagingReq__Type1->is_value();
case ALT_pagingReq__Type2: return field_pagingReq__Type2->is_value();
case ALT_pagingReq__Type3: return field_pagingReq__Type3->is_value();
case ALT_channelModeModify: return field_channelModeModify->is_value();
case ALT_rR__Status: return field_rR__Status->is_value();
case ALT_frequency__Redefinition: return field_frequency__Redefinition->is_value();
case ALT_classmarkEnquiry: return field_classmarkEnquiry->is_value();
case ALT_mBMS__Announcement: return field_mBMS__Announcement->is_value();
case ALT_vGCS__UplinkGrant: return field_vGCS__UplinkGrant->is_value();
case ALT_uplinkRelease: return field_uplinkRelease->is_value();
case ALT_uplinkBusy: return field_uplinkBusy->is_value();
case ALT_applicationInformation: return field_applicationInformation->is_value();
case ALT_dTM__AssignmentCommand: return field_dTM__AssignmentCommand->is_value();
case ALT_dTM__Information: return field_dTM__Information->is_value();
case ALT_dTM__Reject: return field_dTM__Reject->is_value();
case ALT_packetNotification: return field_packetNotification->is_value();
case ALT_interSystemToUTRAN__HandoverCommand: return field_interSystemToUTRAN__HandoverCommand->is_value();
case ALT_interSystemToCDMA2000HandoverCommand: return field_interSystemToCDMA2000HandoverCommand->is_value();
case ALT_interSystemToEUTRAN__HandoverCommand: return field_interSystemToEUTRAN__HandoverCommand->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void PDU__RRM__NW__MS::clean_up()
{
switch (union_selection) {
case ALT_additionalAssignment:
  delete field_additionalAssignment;
  break;
case ALT_immediatePacketAssignment:
  delete field_immediatePacketAssignment;
  break;
case ALT_cipheringModeCommand:
  delete field_cipheringModeCommand;
  break;
case ALT_configurationChangeCommand:
  delete field_configurationChangeCommand;
  break;
case ALT_assignmentCommand:
  delete field_assignmentCommand;
  break;
case ALT_handoverCommand:
  delete field_handoverCommand;
  break;
case ALT_physicalInformation:
  delete field_physicalInformation;
  break;
case ALT_channelRelease:
  delete field_channelRelease;
  break;
case ALT_partialRelease:
  delete field_partialRelease;
  break;
case ALT_pagingReq__Type1:
  delete field_pagingReq__Type1;
  break;
case ALT_pagingReq__Type2:
  delete field_pagingReq__Type2;
  break;
case ALT_pagingReq__Type3:
  delete field_pagingReq__Type3;
  break;
case ALT_channelModeModify:
  delete field_channelModeModify;
  break;
case ALT_rR__Status:
  delete field_rR__Status;
  break;
case ALT_frequency__Redefinition:
  delete field_frequency__Redefinition;
  break;
case ALT_classmarkEnquiry:
  delete field_classmarkEnquiry;
  break;
case ALT_mBMS__Announcement:
  delete field_mBMS__Announcement;
  break;
case ALT_vGCS__UplinkGrant:
  delete field_vGCS__UplinkGrant;
  break;
case ALT_uplinkRelease:
  delete field_uplinkRelease;
  break;
case ALT_uplinkBusy:
  delete field_uplinkBusy;
  break;
case ALT_applicationInformation:
  delete field_applicationInformation;
  break;
case ALT_dTM__AssignmentCommand:
  delete field_dTM__AssignmentCommand;
  break;
case ALT_dTM__Information:
  delete field_dTM__Information;
  break;
case ALT_dTM__Reject:
  delete field_dTM__Reject;
  break;
case ALT_packetNotification:
  delete field_packetNotification;
  break;
case ALT_interSystemToUTRAN__HandoverCommand:
  delete field_interSystemToUTRAN__HandoverCommand;
  break;
case ALT_interSystemToCDMA2000HandoverCommand:
  delete field_interSystemToCDMA2000HandoverCommand;
  break;
case ALT_interSystemToEUTRAN__HandoverCommand:
  delete field_interSystemToEUTRAN__HandoverCommand;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void PDU__RRM__NW__MS::log() const
{
switch (union_selection) {
case ALT_additionalAssignment:
TTCN_Logger::log_event_str("{ additionalAssignment := ");
field_additionalAssignment->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_immediatePacketAssignment:
TTCN_Logger::log_event_str("{ immediatePacketAssignment := ");
field_immediatePacketAssignment->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_cipheringModeCommand:
TTCN_Logger::log_event_str("{ cipheringModeCommand := ");
field_cipheringModeCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_configurationChangeCommand:
TTCN_Logger::log_event_str("{ configurationChangeCommand := ");
field_configurationChangeCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_assignmentCommand:
TTCN_Logger::log_event_str("{ assignmentCommand := ");
field_assignmentCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_handoverCommand:
TTCN_Logger::log_event_str("{ handoverCommand := ");
field_handoverCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_physicalInformation:
TTCN_Logger::log_event_str("{ physicalInformation := ");
field_physicalInformation->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_channelRelease:
TTCN_Logger::log_event_str("{ channelRelease := ");
field_channelRelease->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_partialRelease:
TTCN_Logger::log_event_str("{ partialRelease := ");
field_partialRelease->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_pagingReq__Type1:
TTCN_Logger::log_event_str("{ pagingReq_Type1 := ");
field_pagingReq__Type1->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_pagingReq__Type2:
TTCN_Logger::log_event_str("{ pagingReq_Type2 := ");
field_pagingReq__Type2->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_pagingReq__Type3:
TTCN_Logger::log_event_str("{ pagingReq_Type3 := ");
field_pagingReq__Type3->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_channelModeModify:
TTCN_Logger::log_event_str("{ channelModeModify := ");
field_channelModeModify->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rR__Status:
TTCN_Logger::log_event_str("{ rR_Status := ");
field_rR__Status->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_frequency__Redefinition:
TTCN_Logger::log_event_str("{ frequency_Redefinition := ");
field_frequency__Redefinition->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_classmarkEnquiry:
TTCN_Logger::log_event_str("{ classmarkEnquiry := ");
field_classmarkEnquiry->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mBMS__Announcement:
TTCN_Logger::log_event_str("{ mBMS_Announcement := ");
field_mBMS__Announcement->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_vGCS__UplinkGrant:
TTCN_Logger::log_event_str("{ vGCS_UplinkGrant := ");
field_vGCS__UplinkGrant->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_uplinkRelease:
TTCN_Logger::log_event_str("{ uplinkRelease := ");
field_uplinkRelease->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_uplinkBusy:
TTCN_Logger::log_event_str("{ uplinkBusy := ");
field_uplinkBusy->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_applicationInformation:
TTCN_Logger::log_event_str("{ applicationInformation := ");
field_applicationInformation->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_dTM__AssignmentCommand:
TTCN_Logger::log_event_str("{ dTM_AssignmentCommand := ");
field_dTM__AssignmentCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_dTM__Information:
TTCN_Logger::log_event_str("{ dTM_Information := ");
field_dTM__Information->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_dTM__Reject:
TTCN_Logger::log_event_str("{ dTM_Reject := ");
field_dTM__Reject->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_packetNotification:
TTCN_Logger::log_event_str("{ packetNotification := ");
field_packetNotification->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_interSystemToUTRAN__HandoverCommand:
TTCN_Logger::log_event_str("{ interSystemToUTRAN_HandoverCommand := ");
field_interSystemToUTRAN__HandoverCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_interSystemToCDMA2000HandoverCommand:
TTCN_Logger::log_event_str("{ interSystemToCDMA2000HandoverCommand := ");
field_interSystemToCDMA2000HandoverCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_interSystemToEUTRAN__HandoverCommand:
TTCN_Logger::log_event_str("{ interSystemToEUTRAN_HandoverCommand := ");
field_interSystemToEUTRAN__HandoverCommand->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void PDU__RRM__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "additionalAssignment")) {
    additionalAssignment().set_param(*mp_last);
    if (!additionalAssignment().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "immediatePacketAssignment")) {
    immediatePacketAssignment().set_param(*mp_last);
    if (!immediatePacketAssignment().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "cipheringModeCommand")) {
    cipheringModeCommand().set_param(*mp_last);
    if (!cipheringModeCommand().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "configurationChangeCommand")) {
    configurationChangeCommand().set_param(*mp_last);
    if (!configurationChangeCommand().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "assignmentCommand")) {
    assignmentCommand().set_param(*mp_last);
    if (!assignmentCommand().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "handoverCommand")) {
    handoverCommand().set_param(*mp_last);
    if (!handoverCommand().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "physicalInformation")) {
    physicalInformation().set_param(*mp_last);
    if (!physicalInformation().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "channelRelease")) {
    channelRelease().set_param(*mp_last);
    if (!channelRelease().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "partialRelease")) {
    partialRelease().set_param(*mp_last);
    if (!partialRelease().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "pagingReq_Type1")) {
    pagingReq__Type1().set_param(*mp_last);
    if (!pagingReq__Type1().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "pagingReq_Type2")) {
    pagingReq__Type2().set_param(*mp_last);
    if (!pagingReq__Type2().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "pagingReq_Type3")) {
    pagingReq__Type3().set_param(*mp_last);
    if (!pagingReq__Type3().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "channelModeModify")) {
    channelModeModify().set_param(*mp_last);
    if (!channelModeModify().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rR_Status")) {
    rR__Status().set_param(*mp_last);
    if (!rR__Status().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "frequency_Redefinition")) {
    frequency__Redefinition().set_param(*mp_last);
    if (!frequency__Redefinition().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "classmarkEnquiry")) {
    classmarkEnquiry().set_param(*mp_last);
    if (!classmarkEnquiry().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mBMS_Announcement")) {
    mBMS__Announcement().set_param(*mp_last);
    if (!mBMS__Announcement().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "vGCS_UplinkGrant")) {
    vGCS__UplinkGrant().set_param(*mp_last);
    if (!vGCS__UplinkGrant().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "uplinkRelease")) {
    uplinkRelease().set_param(*mp_last);
    if (!uplinkRelease().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "uplinkBusy")) {
    uplinkBusy().set_param(*mp_last);
    if (!uplinkBusy().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "applicationInformation")) {
    applicationInformation().set_param(*mp_last);
    if (!applicationInformation().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "dTM_AssignmentCommand")) {
    dTM__AssignmentCommand().set_param(*mp_last);
    if (!dTM__AssignmentCommand().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "dTM_Information")) {
    dTM__Information().set_param(*mp_last);
    if (!dTM__Information().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "dTM_Reject")) {
    dTM__Reject().set_param(*mp_last);
    if (!dTM__Reject().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "packetNotification")) {
    packetNotification().set_param(*mp_last);
    if (!packetNotification().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "interSystemToUTRAN_HandoverCommand")) {
    interSystemToUTRAN__HandoverCommand().set_param(*mp_last);
    if (!interSystemToUTRAN__HandoverCommand().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "interSystemToCDMA2000HandoverCommand")) {
    interSystemToCDMA2000HandoverCommand().set_param(*mp_last);
    if (!interSystemToCDMA2000HandoverCommand().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "interSystemToEUTRAN_HandoverCommand")) {
    interSystemToEUTRAN__HandoverCommand().set_param(*mp_last);
    if (!interSystemToEUTRAN__HandoverCommand().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_RRM_Types.PDU_RRM_NW_MS.", last_name);
}

void PDU__RRM__NW__MS::set_implicit_omit()
{
switch (union_selection) {
case ALT_additionalAssignment:
field_additionalAssignment->set_implicit_omit(); break;
case ALT_immediatePacketAssignment:
field_immediatePacketAssignment->set_implicit_omit(); break;
case ALT_cipheringModeCommand:
field_cipheringModeCommand->set_implicit_omit(); break;
case ALT_configurationChangeCommand:
field_configurationChangeCommand->set_implicit_omit(); break;
case ALT_assignmentCommand:
field_assignmentCommand->set_implicit_omit(); break;
case ALT_handoverCommand:
field_handoverCommand->set_implicit_omit(); break;
case ALT_physicalInformation:
field_physicalInformation->set_implicit_omit(); break;
case ALT_channelRelease:
field_channelRelease->set_implicit_omit(); break;
case ALT_partialRelease:
field_partialRelease->set_implicit_omit(); break;
case ALT_pagingReq__Type1:
field_pagingReq__Type1->set_implicit_omit(); break;
case ALT_pagingReq__Type2:
field_pagingReq__Type2->set_implicit_omit(); break;
case ALT_pagingReq__Type3:
field_pagingReq__Type3->set_implicit_omit(); break;
case ALT_channelModeModify:
field_channelModeModify->set_implicit_omit(); break;
case ALT_rR__Status:
field_rR__Status->set_implicit_omit(); break;
case ALT_frequency__Redefinition:
field_frequency__Redefinition->set_implicit_omit(); break;
case ALT_classmarkEnquiry:
field_classmarkEnquiry->set_implicit_omit(); break;
case ALT_mBMS__Announcement:
field_mBMS__Announcement->set_implicit_omit(); break;
case ALT_vGCS__UplinkGrant:
field_vGCS__UplinkGrant->set_implicit_omit(); break;
case ALT_uplinkRelease:
field_uplinkRelease->set_implicit_omit(); break;
case ALT_uplinkBusy:
field_uplinkBusy->set_implicit_omit(); break;
case ALT_applicationInformation:
field_applicationInformation->set_implicit_omit(); break;
case ALT_dTM__AssignmentCommand:
field_dTM__AssignmentCommand->set_implicit_omit(); break;
case ALT_dTM__Information:
field_dTM__Information->set_implicit_omit(); break;
case ALT_dTM__Reject:
field_dTM__Reject->set_implicit_omit(); break;
case ALT_packetNotification:
field_packetNotification->set_implicit_omit(); break;
case ALT_interSystemToUTRAN__HandoverCommand:
field_interSystemToUTRAN__HandoverCommand->set_implicit_omit(); break;
case ALT_interSystemToCDMA2000HandoverCommand:
field_interSystemToCDMA2000HandoverCommand->set_implicit_omit(); break;
case ALT_interSystemToEUTRAN__HandoverCommand:
field_interSystemToEUTRAN__HandoverCommand->set_implicit_omit(); break;
default: break;
}
}

void PDU__RRM__NW__MS::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_additionalAssignment:
field_additionalAssignment->encode_text(text_buf);
break;
case ALT_immediatePacketAssignment:
field_immediatePacketAssignment->encode_text(text_buf);
break;
case ALT_cipheringModeCommand:
field_cipheringModeCommand->encode_text(text_buf);
break;
case ALT_configurationChangeCommand:
field_configurationChangeCommand->encode_text(text_buf);
break;
case ALT_assignmentCommand:
field_assignmentCommand->encode_text(text_buf);
break;
case ALT_handoverCommand:
field_handoverCommand->encode_text(text_buf);
break;
case ALT_physicalInformation:
field_physicalInformation->encode_text(text_buf);
break;
case ALT_channelRelease:
field_channelRelease->encode_text(text_buf);
break;
case ALT_partialRelease:
field_partialRelease->encode_text(text_buf);
break;
case ALT_pagingReq__Type1:
field_pagingReq__Type1->encode_text(text_buf);
break;
case ALT_pagingReq__Type2:
field_pagingReq__Type2->encode_text(text_buf);
break;
case ALT_pagingReq__Type3:
field_pagingReq__Type3->encode_text(text_buf);
break;
case ALT_channelModeModify:
field_channelModeModify->encode_text(text_buf);
break;
case ALT_rR__Status:
field_rR__Status->encode_text(text_buf);
break;
case ALT_frequency__Redefinition:
field_frequency__Redefinition->encode_text(text_buf);
break;
case ALT_classmarkEnquiry:
field_classmarkEnquiry->encode_text(text_buf);
break;
case ALT_mBMS__Announcement:
field_mBMS__Announcement->encode_text(text_buf);
break;
case ALT_vGCS__UplinkGrant:
field_vGCS__UplinkGrant->encode_text(text_buf);
break;
case ALT_uplinkRelease:
field_uplinkRelease->encode_text(text_buf);
break;
case ALT_uplinkBusy:
field_uplinkBusy->encode_text(text_buf);
break;
case ALT_applicationInformation:
field_applicationInformation->encode_text(text_buf);
break;
case ALT_dTM__AssignmentCommand:
field_dTM__AssignmentCommand->encode_text(text_buf);
break;
case ALT_dTM__Information:
field_dTM__Information->encode_text(text_buf);
break;
case ALT_dTM__Reject:
field_dTM__Reject->encode_text(text_buf);
break;
case ALT_packetNotification:
field_packetNotification->encode_text(text_buf);
break;
case ALT_interSystemToUTRAN__HandoverCommand:
field_interSystemToUTRAN__HandoverCommand->encode_text(text_buf);
break;
case ALT_interSystemToCDMA2000HandoverCommand:
field_interSystemToCDMA2000HandoverCommand->encode_text(text_buf);
break;
case ALT_interSystemToEUTRAN__HandoverCommand:
field_interSystemToEUTRAN__HandoverCommand->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
}

void PDU__RRM__NW__MS::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_additionalAssignment:
additionalAssignment().decode_text(text_buf);
break;
case ALT_immediatePacketAssignment:
immediatePacketAssignment().decode_text(text_buf);
break;
case ALT_cipheringModeCommand:
cipheringModeCommand().decode_text(text_buf);
break;
case ALT_configurationChangeCommand:
configurationChangeCommand().decode_text(text_buf);
break;
case ALT_assignmentCommand:
assignmentCommand().decode_text(text_buf);
break;
case ALT_handoverCommand:
handoverCommand().decode_text(text_buf);
break;
case ALT_physicalInformation:
physicalInformation().decode_text(text_buf);
break;
case ALT_channelRelease:
channelRelease().decode_text(text_buf);
break;
case ALT_partialRelease:
partialRelease().decode_text(text_buf);
break;
case ALT_pagingReq__Type1:
pagingReq__Type1().decode_text(text_buf);
break;
case ALT_pagingReq__Type2:
pagingReq__Type2().decode_text(text_buf);
break;
case ALT_pagingReq__Type3:
pagingReq__Type3().decode_text(text_buf);
break;
case ALT_channelModeModify:
channelModeModify().decode_text(text_buf);
break;
case ALT_rR__Status:
rR__Status().decode_text(text_buf);
break;
case ALT_frequency__Redefinition:
frequency__Redefinition().decode_text(text_buf);
break;
case ALT_classmarkEnquiry:
classmarkEnquiry().decode_text(text_buf);
break;
case ALT_mBMS__Announcement:
mBMS__Announcement().decode_text(text_buf);
break;
case ALT_vGCS__UplinkGrant:
vGCS__UplinkGrant().decode_text(text_buf);
break;
case ALT_uplinkRelease:
uplinkRelease().decode_text(text_buf);
break;
case ALT_uplinkBusy:
uplinkBusy().decode_text(text_buf);
break;
case ALT_applicationInformation:
applicationInformation().decode_text(text_buf);
break;
case ALT_dTM__AssignmentCommand:
dTM__AssignmentCommand().decode_text(text_buf);
break;
case ALT_dTM__Information:
dTM__Information().decode_text(text_buf);
break;
case ALT_dTM__Reject:
dTM__Reject().decode_text(text_buf);
break;
case ALT_packetNotification:
packetNotification().decode_text(text_buf);
break;
case ALT_interSystemToUTRAN__HandoverCommand:
interSystemToUTRAN__HandoverCommand().decode_text(text_buf);
break;
case ALT_interSystemToCDMA2000HandoverCommand:
interSystemToCDMA2000HandoverCommand().decode_text(text_buf);
break;
case ALT_interSystemToEUTRAN__HandoverCommand:
interSystemToEUTRAN__HandoverCommand().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
}

void PDU__RRM__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(TRUE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

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

int PDU__RRM__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 sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, PDU__RRM__AdditionalAssignment__NW__MS_descr_.raw->forceomit);
      decoded_length = additionalAssignment().RAW_decode(PDU__RRM__AdditionalAssignment__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, PDU__RRM__ImmediatePacketAssignment__NW__MS_descr_.raw->forceomit);
      decoded_length = immediatePacketAssignment().RAW_decode(PDU__RRM__ImmediatePacketAssignment__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, PDU__RRM__CipheringModeCommand__NW__MS_descr_.raw->forceomit);
      decoded_length = cipheringModeCommand().RAW_decode(PDU__RRM__CipheringModeCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, PDU__RRM__ConfigurationChangeCommand__NW__MS_descr_.raw->forceomit);
      decoded_length = configurationChangeCommand().RAW_decode(PDU__RRM__ConfigurationChangeCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, PDU__RRM__AssignmentCommand__NW__MS_descr_.raw->forceomit);
      decoded_length = assignmentCommand().RAW_decode(PDU__RRM__AssignmentCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, PDU__RRM__HandoverCommand__NW__MS_descr_.raw->forceomit);
      decoded_length = handoverCommand().RAW_decode(PDU__RRM__HandoverCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 6: {
      RAW_Force_Omit field_force_omit(6, force_omit, PDU__RRM__PhysicalInformation__NW__MS_descr_.raw->forceomit);
      decoded_length = physicalInformation().RAW_decode(PDU__RRM__PhysicalInformation__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 7: {
      RAW_Force_Omit field_force_omit(7, force_omit, PDU__RRM__ChannelRelease__NW__MS_descr_.raw->forceomit);
      decoded_length = channelRelease().RAW_decode(PDU__RRM__ChannelRelease__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 8: {
      RAW_Force_Omit field_force_omit(8, force_omit, PDU__RRM__PartialRelease__NW__MS_descr_.raw->forceomit);
      decoded_length = partialRelease().RAW_decode(PDU__RRM__PartialRelease__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 9: {
      RAW_Force_Omit field_force_omit(9, force_omit, PDU__RRM__PagingReq__Type1__NW__MS_descr_.raw->forceomit);
      decoded_length = pagingReq__Type1().RAW_decode(PDU__RRM__PagingReq__Type1__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 10: {
      RAW_Force_Omit field_force_omit(10, force_omit, PDU__RRM__PagingReq__Type2__NW__MS_descr_.raw->forceomit);
      decoded_length = pagingReq__Type2().RAW_decode(PDU__RRM__PagingReq__Type2__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 11: {
      RAW_Force_Omit field_force_omit(11, force_omit, PDU__RRM__PagingReq__Type3__NW__MS_descr_.raw->forceomit);
      decoded_length = pagingReq__Type3().RAW_decode(PDU__RRM__PagingReq__Type3__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 12: {
      RAW_Force_Omit field_force_omit(12, force_omit, PDU__RRM__ChannelModeModify__NW__MS_descr_.raw->forceomit);
      decoded_length = channelModeModify().RAW_decode(PDU__RRM__ChannelModeModify__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 13: {
      RAW_Force_Omit field_force_omit(13, force_omit, PDU__RRM__RR__Status_descr_.raw->forceomit);
      decoded_length = rR__Status().RAW_decode(PDU__RRM__RR__Status_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 14: {
      RAW_Force_Omit field_force_omit(14, force_omit, PDU__RRM__Frequency__Redefinition__NW__MS_descr_.raw->forceomit);
      decoded_length = frequency__Redefinition().RAW_decode(PDU__RRM__Frequency__Redefinition__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 15: {
      RAW_Force_Omit field_force_omit(15, force_omit, PDU__RRM__ClassmarkEnquiry__NW__MS_descr_.raw->forceomit);
      decoded_length = classmarkEnquiry().RAW_decode(PDU__RRM__ClassmarkEnquiry__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 16: {
      RAW_Force_Omit field_force_omit(16, force_omit, MBMS__Announcement__NW__MS_descr_.raw->forceomit);
      decoded_length = mBMS__Announcement().RAW_decode(MBMS__Announcement__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 17: {
      RAW_Force_Omit field_force_omit(17, force_omit, PDU__RRM__VGCS__UplinkGrant__NW__MS_descr_.raw->forceomit);
      decoded_length = vGCS__UplinkGrant().RAW_decode(PDU__RRM__VGCS__UplinkGrant__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 18: {
      RAW_Force_Omit field_force_omit(18, force_omit, PDU__RRM__UplinkRelease_descr_.raw->forceomit);
      decoded_length = uplinkRelease().RAW_decode(PDU__RRM__UplinkRelease_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 19: {
      RAW_Force_Omit field_force_omit(19, force_omit, PDU__RRM__UplinkBusy__NW__MS_descr_.raw->forceomit);
      decoded_length = uplinkBusy().RAW_decode(PDU__RRM__UplinkBusy__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 20: {
      RAW_Force_Omit field_force_omit(20, force_omit, PDU__RRM__ApplicationInformation_descr_.raw->forceomit);
      decoded_length = applicationInformation().RAW_decode(PDU__RRM__ApplicationInformation_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 21: {
      RAW_Force_Omit field_force_omit(21, force_omit, PDU__RRM__DTM__AssignmentCommand__NW__MS_descr_.raw->forceomit);
      decoded_length = dTM__AssignmentCommand().RAW_decode(PDU__RRM__DTM__AssignmentCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 22: {
      RAW_Force_Omit field_force_omit(22, force_omit, PDU__RRM__DTM__Information__NW__MS_descr_.raw->forceomit);
      decoded_length = dTM__Information().RAW_decode(PDU__RRM__DTM__Information__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 23: {
      RAW_Force_Omit field_force_omit(23, force_omit, PDU__RRM__DTM__Reject__NW__MS_descr_.raw->forceomit);
      decoded_length = dTM__Reject().RAW_decode(PDU__RRM__DTM__Reject__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 24: {
      RAW_Force_Omit field_force_omit(24, force_omit, PDU__RRM__PacketNotification__NW__MS_descr_.raw->forceomit);
      decoded_length = packetNotification().RAW_decode(PDU__RRM__PacketNotification__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 25: {
      RAW_Force_Omit field_force_omit(25, force_omit, PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_descr_.raw->forceomit);
      decoded_length = interSystemToUTRAN__HandoverCommand().RAW_decode(PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 26: {
      RAW_Force_Omit field_force_omit(26, force_omit, PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_descr_.raw->forceomit);
      decoded_length = interSystemToCDMA2000HandoverCommand().RAW_decode(PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 27: {
      RAW_Force_Omit field_force_omit(27, force_omit, PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_descr_.raw->forceomit);
      decoded_length = interSystemToEUTRAN__HandoverCommand().RAW_decode(PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
    boolean already_failed = FALSE;
    BITSTRING temporal_0;
    int decoded_0_length;
    already_failed = FALSE;
    if (!already_failed) {
      p_buf.set_pos_bit(starting_pos + 0);
      decoded_0_length = temporal_0.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, top_bit_ord, TRUE);
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_37) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(0, force_omit, PDU__RRM__AdditionalAssignment__NW__MS_descr_.raw->forceomit);
          decoded_length = additionalAssignment().RAW_decode(PDU__RRM__AdditionalAssignment__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_additionalAssignment).messageType() ==  bs_37) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_38) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(1, force_omit, PDU__RRM__ImmediatePacketAssignment__NW__MS_descr_.raw->forceomit);
          decoded_length = immediatePacketAssignment().RAW_decode(PDU__RRM__ImmediatePacketAssignment__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_immediatePacketAssignment).messageType() ==  bs_38) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_39) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(2, force_omit, PDU__RRM__CipheringModeCommand__NW__MS_descr_.raw->forceomit);
          decoded_length = cipheringModeCommand().RAW_decode(PDU__RRM__CipheringModeCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_cipheringModeCommand).messageType() ==  bs_39) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_40) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(3, force_omit, PDU__RRM__ConfigurationChangeCommand__NW__MS_descr_.raw->forceomit);
          decoded_length = configurationChangeCommand().RAW_decode(PDU__RRM__ConfigurationChangeCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_configurationChangeCommand).messageType() ==  bs_40) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_41) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(4, force_omit, PDU__RRM__AssignmentCommand__NW__MS_descr_.raw->forceomit);
          decoded_length = assignmentCommand().RAW_decode(PDU__RRM__AssignmentCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_assignmentCommand).messageType() ==  bs_41) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_42) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(5, force_omit, PDU__RRM__HandoverCommand__NW__MS_descr_.raw->forceomit);
          decoded_length = handoverCommand().RAW_decode(PDU__RRM__HandoverCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_handoverCommand).messageType() ==  bs_42) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_43) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(6, force_omit, PDU__RRM__PhysicalInformation__NW__MS_descr_.raw->forceomit);
          decoded_length = physicalInformation().RAW_decode(PDU__RRM__PhysicalInformation__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_physicalInformation).messageType() ==  bs_43) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_44) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(7, force_omit, PDU__RRM__ChannelRelease__NW__MS_descr_.raw->forceomit);
          decoded_length = channelRelease().RAW_decode(PDU__RRM__ChannelRelease__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_channelRelease).messageType() ==  bs_44) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_45) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(8, force_omit, PDU__RRM__PartialRelease__NW__MS_descr_.raw->forceomit);
          decoded_length = partialRelease().RAW_decode(PDU__RRM__PartialRelease__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_partialRelease).messageType() ==  bs_45) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_46) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(9, force_omit, PDU__RRM__PagingReq__Type1__NW__MS_descr_.raw->forceomit);
          decoded_length = pagingReq__Type1().RAW_decode(PDU__RRM__PagingReq__Type1__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_pagingReq__Type1).messageType() ==  bs_46) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_47) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(10, force_omit, PDU__RRM__PagingReq__Type2__NW__MS_descr_.raw->forceomit);
          decoded_length = pagingReq__Type2().RAW_decode(PDU__RRM__PagingReq__Type2__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_pagingReq__Type2).messageType() ==  bs_47) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_48) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(11, force_omit, PDU__RRM__PagingReq__Type3__NW__MS_descr_.raw->forceomit);
          decoded_length = pagingReq__Type3().RAW_decode(PDU__RRM__PagingReq__Type3__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_pagingReq__Type3).messageType() ==  bs_48) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_49) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(12, force_omit, PDU__RRM__ChannelModeModify__NW__MS_descr_.raw->forceomit);
          decoded_length = channelModeModify().RAW_decode(PDU__RRM__ChannelModeModify__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_channelModeModify).messageType() ==  bs_49) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_24) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(13, force_omit, PDU__RRM__RR__Status_descr_.raw->forceomit);
          decoded_length = rR__Status().RAW_decode(PDU__RRM__RR__Status_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_rR__Status).messageType() ==  bs_24) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_50) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(14, force_omit, PDU__RRM__Frequency__Redefinition__NW__MS_descr_.raw->forceomit);
          decoded_length = frequency__Redefinition().RAW_decode(PDU__RRM__Frequency__Redefinition__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_frequency__Redefinition).messageType() ==  bs_50) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_51) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(15, force_omit, PDU__RRM__ClassmarkEnquiry__NW__MS_descr_.raw->forceomit);
          decoded_length = classmarkEnquiry().RAW_decode(PDU__RRM__ClassmarkEnquiry__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_classmarkEnquiry).messageType() ==  bs_51) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_26) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(16, force_omit, MBMS__Announcement__NW__MS_descr_.raw->forceomit);
          decoded_length = mBMS__Announcement().RAW_decode(MBMS__Announcement__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_mBMS__Announcement).messageType() ==  bs_26) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_52) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(17, force_omit, PDU__RRM__VGCS__UplinkGrant__NW__MS_descr_.raw->forceomit);
          decoded_length = vGCS__UplinkGrant().RAW_decode(PDU__RRM__VGCS__UplinkGrant__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_vGCS__UplinkGrant).messageType() ==  bs_52) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_29) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(18, force_omit, PDU__RRM__UplinkRelease_descr_.raw->forceomit);
          decoded_length = uplinkRelease().RAW_decode(PDU__RRM__UplinkRelease_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_uplinkRelease).messageType() ==  bs_29) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_53) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(19, force_omit, PDU__RRM__UplinkBusy__NW__MS_descr_.raw->forceomit);
          decoded_length = uplinkBusy().RAW_decode(PDU__RRM__UplinkBusy__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_uplinkBusy).messageType() ==  bs_53) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_31) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(20, force_omit, PDU__RRM__ApplicationInformation_descr_.raw->forceomit);
          decoded_length = applicationInformation().RAW_decode(PDU__RRM__ApplicationInformation_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_applicationInformation).messageType() ==  bs_31) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_54) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(21, force_omit, PDU__RRM__DTM__AssignmentCommand__NW__MS_descr_.raw->forceomit);
          decoded_length = dTM__AssignmentCommand().RAW_decode(PDU__RRM__DTM__AssignmentCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_dTM__AssignmentCommand).messageType() ==  bs_54) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_55) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(22, force_omit, PDU__RRM__DTM__Information__NW__MS_descr_.raw->forceomit);
          decoded_length = dTM__Information().RAW_decode(PDU__RRM__DTM__Information__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_dTM__Information).messageType() ==  bs_55) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_56) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(23, force_omit, PDU__RRM__DTM__Reject__NW__MS_descr_.raw->forceomit);
          decoded_length = dTM__Reject().RAW_decode(PDU__RRM__DTM__Reject__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_dTM__Reject).messageType() ==  bs_56) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_57) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(24, force_omit, PDU__RRM__PacketNotification__NW__MS_descr_.raw->forceomit);
          decoded_length = packetNotification().RAW_decode(PDU__RRM__PacketNotification__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_packetNotification).messageType() ==  bs_57) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_58) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(25, force_omit, PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_descr_.raw->forceomit);
          decoded_length = interSystemToUTRAN__HandoverCommand().RAW_decode(PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_interSystemToUTRAN__HandoverCommand).messageType() ==  bs_58) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_59) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(26, force_omit, PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_descr_.raw->forceomit);
          decoded_length = interSystemToCDMA2000HandoverCommand().RAW_decode(PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_interSystemToCDMA2000HandoverCommand).messageType() ==  bs_59) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
    already_failed = FALSE;
    if (!already_failed) {
      if (decoded_0_length > 0) {
        if (temporal_0 ==  bs_60) {
          p_buf.set_pos_bit(starting_pos);
          RAW_Force_Omit field_force_omit(27, force_omit, PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_descr_.raw->forceomit);
          decoded_length = interSystemToEUTRAN__HandoverCommand().RAW_decode(PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_force_omit);
          if (decoded_length > 0) {
             if ((*field_interSystemToEUTRAN__HandoverCommand).messageType() ==  bs_60) {
               return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
             }else already_failed = TRUE;
          }
        }
      }
    }
 }
 clean_up();
 return -1;
}

int PDU__RRM__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 28;  myleaf.body.node.nodes = init_nodes_of_enc_tree(28);
  memset(myleaf.body.node.nodes, 0, 28 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_additionalAssignment:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, PDU__RRM__AdditionalAssignment__NW__MS_descr_.raw);
    encoded_length = field_additionalAssignment->RAW_encode(PDU__RRM__AdditionalAssignment__NW__MS_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &PDU__RRM__AdditionalAssignment__NW__MS_descr_;
    if ((*field_additionalAssignment).messageType() !=  bs_37) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_37.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_immediatePacketAssignment:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, PDU__RRM__ImmediatePacketAssignment__NW__MS_descr_.raw);
    encoded_length = field_immediatePacketAssignment->RAW_encode(PDU__RRM__ImmediatePacketAssignment__NW__MS_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &PDU__RRM__ImmediatePacketAssignment__NW__MS_descr_;
    if ((*field_immediatePacketAssignment).messageType() !=  bs_38) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_38.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_cipheringModeCommand:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, PDU__RRM__CipheringModeCommand__NW__MS_descr_.raw);
    encoded_length = field_cipheringModeCommand->RAW_encode(PDU__RRM__CipheringModeCommand__NW__MS_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &PDU__RRM__CipheringModeCommand__NW__MS_descr_;
    if ((*field_cipheringModeCommand).messageType() !=  bs_39) {
  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_39.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_configurationChangeCommand:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, PDU__RRM__ConfigurationChangeCommand__NW__MS_descr_.raw);
    encoded_length = field_configurationChangeCommand->RAW_encode(PDU__RRM__ConfigurationChangeCommand__NW__MS_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &PDU__RRM__ConfigurationChangeCommand__NW__MS_descr_;
    if ((*field_configurationChangeCommand).messageType() !=  bs_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){
   bs_40.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_assignmentCommand:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, PDU__RRM__AssignmentCommand__NW__MS_descr_.raw);
    encoded_length = field_assignmentCommand->RAW_encode(PDU__RRM__AssignmentCommand__NW__MS_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &PDU__RRM__AssignmentCommand__NW__MS_descr_;
    if ((*field_assignmentCommand).messageType() !=  bs_41) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_41.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_handoverCommand:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, PDU__RRM__HandoverCommand__NW__MS_descr_.raw);
    encoded_length = field_handoverCommand->RAW_encode(PDU__RRM__HandoverCommand__NW__MS_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &PDU__RRM__HandoverCommand__NW__MS_descr_;
    if ((*field_handoverCommand).messageType() !=  bs_42) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_42.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_physicalInformation:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, PDU__RRM__PhysicalInformation__NW__MS_descr_.raw);
    encoded_length = field_physicalInformation->RAW_encode(PDU__RRM__PhysicalInformation__NW__MS_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &PDU__RRM__PhysicalInformation__NW__MS_descr_;
    if ((*field_physicalInformation).messageType() !=  bs_43) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_43.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_channelRelease:
    myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 7, PDU__RRM__ChannelRelease__NW__MS_descr_.raw);
    encoded_length = field_channelRelease->RAW_encode(PDU__RRM__ChannelRelease__NW__MS_descr_, *myleaf.body.node.nodes[7]);
    myleaf.body.node.nodes[7]->coding_descr = &PDU__RRM__ChannelRelease__NW__MS_descr_;
    if ((*field_channelRelease).messageType() !=  bs_44) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_44.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_partialRelease:
    myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 8, PDU__RRM__PartialRelease__NW__MS_descr_.raw);
    encoded_length = field_partialRelease->RAW_encode(PDU__RRM__PartialRelease__NW__MS_descr_, *myleaf.body.node.nodes[8]);
    myleaf.body.node.nodes[8]->coding_descr = &PDU__RRM__PartialRelease__NW__MS_descr_;
    if ((*field_partialRelease).messageType() !=  bs_45) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={8,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_45.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_pagingReq__Type1:
    myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 9, PDU__RRM__PagingReq__Type1__NW__MS_descr_.raw);
    encoded_length = field_pagingReq__Type1->RAW_encode(PDU__RRM__PagingReq__Type1__NW__MS_descr_, *myleaf.body.node.nodes[9]);
    myleaf.body.node.nodes[9]->coding_descr = &PDU__RRM__PagingReq__Type1__NW__MS_descr_;
    if ((*field_pagingReq__Type1).messageType() !=  bs_46) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={9,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_46.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_pagingReq__Type2:
    myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 10, PDU__RRM__PagingReq__Type2__NW__MS_descr_.raw);
    encoded_length = field_pagingReq__Type2->RAW_encode(PDU__RRM__PagingReq__Type2__NW__MS_descr_, *myleaf.body.node.nodes[10]);
    myleaf.body.node.nodes[10]->coding_descr = &PDU__RRM__PagingReq__Type2__NW__MS_descr_;
    if ((*field_pagingReq__Type2).messageType() !=  bs_47) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={10,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_47.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_pagingReq__Type3:
    myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 11, PDU__RRM__PagingReq__Type3__NW__MS_descr_.raw);
    encoded_length = field_pagingReq__Type3->RAW_encode(PDU__RRM__PagingReq__Type3__NW__MS_descr_, *myleaf.body.node.nodes[11]);
    myleaf.body.node.nodes[11]->coding_descr = &PDU__RRM__PagingReq__Type3__NW__MS_descr_;
    if ((*field_pagingReq__Type3).messageType() !=  bs_48) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={11,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_48.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_channelModeModify:
    myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 12, PDU__RRM__ChannelModeModify__NW__MS_descr_.raw);
    encoded_length = field_channelModeModify->RAW_encode(PDU__RRM__ChannelModeModify__NW__MS_descr_, *myleaf.body.node.nodes[12]);
    myleaf.body.node.nodes[12]->coding_descr = &PDU__RRM__ChannelModeModify__NW__MS_descr_;
    if ((*field_channelModeModify).messageType() !=  bs_49) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={12,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_49.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_rR__Status:
    myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 13, PDU__RRM__RR__Status_descr_.raw);
    encoded_length = field_rR__Status->RAW_encode(PDU__RRM__RR__Status_descr_, *myleaf.body.node.nodes[13]);
    myleaf.body.node.nodes[13]->coding_descr = &PDU__RRM__RR__Status_descr_;
    if ((*field_rR__Status).messageType() !=  bs_24) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={13,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_24.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_frequency__Redefinition:
    myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 14, PDU__RRM__Frequency__Redefinition__NW__MS_descr_.raw);
    encoded_length = field_frequency__Redefinition->RAW_encode(PDU__RRM__Frequency__Redefinition__NW__MS_descr_, *myleaf.body.node.nodes[14]);
    myleaf.body.node.nodes[14]->coding_descr = &PDU__RRM__Frequency__Redefinition__NW__MS_descr_;
    if ((*field_frequency__Redefinition).messageType() !=  bs_50) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={14,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_50.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_classmarkEnquiry:
    myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 15, PDU__RRM__ClassmarkEnquiry__NW__MS_descr_.raw);
    encoded_length = field_classmarkEnquiry->RAW_encode(PDU__RRM__ClassmarkEnquiry__NW__MS_descr_, *myleaf.body.node.nodes[15]);
    myleaf.body.node.nodes[15]->coding_descr = &PDU__RRM__ClassmarkEnquiry__NW__MS_descr_;
    if ((*field_classmarkEnquiry).messageType() !=  bs_51) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={15,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_51.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_mBMS__Announcement:
    myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 16, MBMS__Announcement__NW__MS_descr_.raw);
    encoded_length = field_mBMS__Announcement->RAW_encode(MBMS__Announcement__NW__MS_descr_, *myleaf.body.node.nodes[16]);
    myleaf.body.node.nodes[16]->coding_descr = &MBMS__Announcement__NW__MS_descr_;
    if ((*field_mBMS__Announcement).messageType() !=  bs_26) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={16,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_vGCS__UplinkGrant:
    myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 17, PDU__RRM__VGCS__UplinkGrant__NW__MS_descr_.raw);
    encoded_length = field_vGCS__UplinkGrant->RAW_encode(PDU__RRM__VGCS__UplinkGrant__NW__MS_descr_, *myleaf.body.node.nodes[17]);
    myleaf.body.node.nodes[17]->coding_descr = &PDU__RRM__VGCS__UplinkGrant__NW__MS_descr_;
    if ((*field_vGCS__UplinkGrant).messageType() !=  bs_52) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={17,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_52.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_uplinkRelease:
    myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 18, PDU__RRM__UplinkRelease_descr_.raw);
    encoded_length = field_uplinkRelease->RAW_encode(PDU__RRM__UplinkRelease_descr_, *myleaf.body.node.nodes[18]);
    myleaf.body.node.nodes[18]->coding_descr = &PDU__RRM__UplinkRelease_descr_;
    if ((*field_uplinkRelease).messageType() !=  bs_29) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={18,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_29.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_uplinkBusy:
    myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 19, PDU__RRM__UplinkBusy__NW__MS_descr_.raw);
    encoded_length = field_uplinkBusy->RAW_encode(PDU__RRM__UplinkBusy__NW__MS_descr_, *myleaf.body.node.nodes[19]);
    myleaf.body.node.nodes[19]->coding_descr = &PDU__RRM__UplinkBusy__NW__MS_descr_;
    if ((*field_uplinkBusy).messageType() !=  bs_53) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_53.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_applicationInformation:
    myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 20, PDU__RRM__ApplicationInformation_descr_.raw);
    encoded_length = field_applicationInformation->RAW_encode(PDU__RRM__ApplicationInformation_descr_, *myleaf.body.node.nodes[20]);
    myleaf.body.node.nodes[20]->coding_descr = &PDU__RRM__ApplicationInformation_descr_;
    if ((*field_applicationInformation).messageType() !=  bs_31) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={20,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_31.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_dTM__AssignmentCommand:
    myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 21, PDU__RRM__DTM__AssignmentCommand__NW__MS_descr_.raw);
    encoded_length = field_dTM__AssignmentCommand->RAW_encode(PDU__RRM__DTM__AssignmentCommand__NW__MS_descr_, *myleaf.body.node.nodes[21]);
    myleaf.body.node.nodes[21]->coding_descr = &PDU__RRM__DTM__AssignmentCommand__NW__MS_descr_;
    if ((*field_dTM__AssignmentCommand).messageType() !=  bs_54) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={21,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_54.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_dTM__Information:
    myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 22, PDU__RRM__DTM__Information__NW__MS_descr_.raw);
    encoded_length = field_dTM__Information->RAW_encode(PDU__RRM__DTM__Information__NW__MS_descr_, *myleaf.body.node.nodes[22]);
    myleaf.body.node.nodes[22]->coding_descr = &PDU__RRM__DTM__Information__NW__MS_descr_;
    if ((*field_dTM__Information).messageType() !=  bs_55) {
  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){
   bs_55.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_dTM__Reject:
    myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 23, PDU__RRM__DTM__Reject__NW__MS_descr_.raw);
    encoded_length = field_dTM__Reject->RAW_encode(PDU__RRM__DTM__Reject__NW__MS_descr_, *myleaf.body.node.nodes[23]);
    myleaf.body.node.nodes[23]->coding_descr = &PDU__RRM__DTM__Reject__NW__MS_descr_;
    if ((*field_dTM__Reject).messageType() !=  bs_56) {
  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){
   bs_56.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_packetNotification:
    myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 24, PDU__RRM__PacketNotification__NW__MS_descr_.raw);
    encoded_length = field_packetNotification->RAW_encode(PDU__RRM__PacketNotification__NW__MS_descr_, *myleaf.body.node.nodes[24]);
    myleaf.body.node.nodes[24]->coding_descr = &PDU__RRM__PacketNotification__NW__MS_descr_;
    if ((*field_packetNotification).messageType() !=  bs_57) {
  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){
   bs_57.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_interSystemToUTRAN__HandoverCommand:
    myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 25, PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_descr_.raw);
    encoded_length = field_interSystemToUTRAN__HandoverCommand->RAW_encode(PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_descr_, *myleaf.body.node.nodes[25]);
    myleaf.body.node.nodes[25]->coding_descr = &PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_descr_;
    if ((*field_interSystemToUTRAN__HandoverCommand).messageType() !=  bs_58) {
  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){
   bs_58.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_interSystemToCDMA2000HandoverCommand:
    myleaf.body.node.nodes[26] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 26, PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_descr_.raw);
    encoded_length = field_interSystemToCDMA2000HandoverCommand->RAW_encode(PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_descr_, *myleaf.body.node.nodes[26]);
    myleaf.body.node.nodes[26]->coding_descr = &PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_descr_;
    if ((*field_interSystemToCDMA2000HandoverCommand).messageType() !=  bs_59) {
  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){
   bs_59.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  case ALT_interSystemToEUTRAN__HandoverCommand:
    myleaf.body.node.nodes[27] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 27, PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_descr_.raw);
    encoded_length = field_interSystemToEUTRAN__HandoverCommand->RAW_encode(PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_descr_, *myleaf.body.node.nodes[27]);
    myleaf.body.node.nodes[27]->coding_descr = &PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_descr_;
    if ((*field_interSystemToEUTRAN__HandoverCommand).messageType() !=  bs_60) {
  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){
   bs_60.RAW_encode(General__Types::BIT8_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
    }
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void PDU__RRM__NW__MS_template::copy_value(const PDU__RRM__NW__MS& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
single_value.field_additionalAssignment = new PDU__RRM__AdditionalAssignment__NW__MS_template(other_value.additionalAssignment());
break;
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
single_value.field_immediatePacketAssignment = new PDU__RRM__ImmediatePacketAssignment__NW__MS_template(other_value.immediatePacketAssignment());
break;
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
single_value.field_cipheringModeCommand = new PDU__RRM__CipheringModeCommand__NW__MS_template(other_value.cipheringModeCommand());
break;
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
single_value.field_configurationChangeCommand = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template(other_value.configurationChangeCommand());
break;
case PDU__RRM__NW__MS::ALT_assignmentCommand:
single_value.field_assignmentCommand = new PDU__RRM__AssignmentCommand__NW__MS_template(other_value.assignmentCommand());
break;
case PDU__RRM__NW__MS::ALT_handoverCommand:
single_value.field_handoverCommand = new PDU__RRM__HandoverCommand__NW__MS_template(other_value.handoverCommand());
break;
case PDU__RRM__NW__MS::ALT_physicalInformation:
single_value.field_physicalInformation = new PDU__RRM__PhysicalInformation__NW__MS_template(other_value.physicalInformation());
break;
case PDU__RRM__NW__MS::ALT_channelRelease:
single_value.field_channelRelease = new PDU__RRM__ChannelRelease__NW__MS_template(other_value.channelRelease());
break;
case PDU__RRM__NW__MS::ALT_partialRelease:
single_value.field_partialRelease = new PDU__RRM__PartialRelease__NW__MS_template(other_value.partialRelease());
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
single_value.field_pagingReq__Type1 = new PDU__RRM__PagingReq__Type1__NW__MS_template(other_value.pagingReq__Type1());
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
single_value.field_pagingReq__Type2 = new PDU__RRM__PagingReq__Type2__NW__MS_template(other_value.pagingReq__Type2());
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
single_value.field_pagingReq__Type3 = new PDU__RRM__PagingReq__Type3__NW__MS_template(other_value.pagingReq__Type3());
break;
case PDU__RRM__NW__MS::ALT_channelModeModify:
single_value.field_channelModeModify = new PDU__RRM__ChannelModeModify__NW__MS_template(other_value.channelModeModify());
break;
case PDU__RRM__NW__MS::ALT_rR__Status:
single_value.field_rR__Status = new PDU__RRM__RR__Status_template(other_value.rR__Status());
break;
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
single_value.field_frequency__Redefinition = new PDU__RRM__Frequency__Redefinition__NW__MS_template(other_value.frequency__Redefinition());
break;
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
single_value.field_classmarkEnquiry = new PDU__RRM__ClassmarkEnquiry__NW__MS_template(other_value.classmarkEnquiry());
break;
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
single_value.field_mBMS__Announcement = new MBMS__Announcement__NW__MS_template(other_value.mBMS__Announcement());
break;
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
single_value.field_vGCS__UplinkGrant = new PDU__RRM__VGCS__UplinkGrant__NW__MS_template(other_value.vGCS__UplinkGrant());
break;
case PDU__RRM__NW__MS::ALT_uplinkRelease:
single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template(other_value.uplinkRelease());
break;
case PDU__RRM__NW__MS::ALT_uplinkBusy:
single_value.field_uplinkBusy = new PDU__RRM__UplinkBusy__NW__MS_template(other_value.uplinkBusy());
break;
case PDU__RRM__NW__MS::ALT_applicationInformation:
single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template(other_value.applicationInformation());
break;
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
single_value.field_dTM__AssignmentCommand = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template(other_value.dTM__AssignmentCommand());
break;
case PDU__RRM__NW__MS::ALT_dTM__Information:
single_value.field_dTM__Information = new PDU__RRM__DTM__Information__NW__MS_template(other_value.dTM__Information());
break;
case PDU__RRM__NW__MS::ALT_dTM__Reject:
single_value.field_dTM__Reject = new PDU__RRM__DTM__Reject__NW__MS_template(other_value.dTM__Reject());
break;
case PDU__RRM__NW__MS::ALT_packetNotification:
single_value.field_packetNotification = new PDU__RRM__PacketNotification__NW__MS_template(other_value.packetNotification());
break;
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
single_value.field_interSystemToUTRAN__HandoverCommand = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template(other_value.interSystemToUTRAN__HandoverCommand());
break;
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
single_value.field_interSystemToCDMA2000HandoverCommand = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template(other_value.interSystemToCDMA2000HandoverCommand());
break;
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
single_value.field_interSystemToEUTRAN__HandoverCommand = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template(other_value.interSystemToEUTRAN__HandoverCommand());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__NW__MS_template::copy_template(const PDU__RRM__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
single_value.field_additionalAssignment = new PDU__RRM__AdditionalAssignment__NW__MS_template(*other_value.single_value.field_additionalAssignment);
break;
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
single_value.field_immediatePacketAssignment = new PDU__RRM__ImmediatePacketAssignment__NW__MS_template(*other_value.single_value.field_immediatePacketAssignment);
break;
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
single_value.field_cipheringModeCommand = new PDU__RRM__CipheringModeCommand__NW__MS_template(*other_value.single_value.field_cipheringModeCommand);
break;
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
single_value.field_configurationChangeCommand = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template(*other_value.single_value.field_configurationChangeCommand);
break;
case PDU__RRM__NW__MS::ALT_assignmentCommand:
single_value.field_assignmentCommand = new PDU__RRM__AssignmentCommand__NW__MS_template(*other_value.single_value.field_assignmentCommand);
break;
case PDU__RRM__NW__MS::ALT_handoverCommand:
single_value.field_handoverCommand = new PDU__RRM__HandoverCommand__NW__MS_template(*other_value.single_value.field_handoverCommand);
break;
case PDU__RRM__NW__MS::ALT_physicalInformation:
single_value.field_physicalInformation = new PDU__RRM__PhysicalInformation__NW__MS_template(*other_value.single_value.field_physicalInformation);
break;
case PDU__RRM__NW__MS::ALT_channelRelease:
single_value.field_channelRelease = new PDU__RRM__ChannelRelease__NW__MS_template(*other_value.single_value.field_channelRelease);
break;
case PDU__RRM__NW__MS::ALT_partialRelease:
single_value.field_partialRelease = new PDU__RRM__PartialRelease__NW__MS_template(*other_value.single_value.field_partialRelease);
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
single_value.field_pagingReq__Type1 = new PDU__RRM__PagingReq__Type1__NW__MS_template(*other_value.single_value.field_pagingReq__Type1);
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
single_value.field_pagingReq__Type2 = new PDU__RRM__PagingReq__Type2__NW__MS_template(*other_value.single_value.field_pagingReq__Type2);
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
single_value.field_pagingReq__Type3 = new PDU__RRM__PagingReq__Type3__NW__MS_template(*other_value.single_value.field_pagingReq__Type3);
break;
case PDU__RRM__NW__MS::ALT_channelModeModify:
single_value.field_channelModeModify = new PDU__RRM__ChannelModeModify__NW__MS_template(*other_value.single_value.field_channelModeModify);
break;
case PDU__RRM__NW__MS::ALT_rR__Status:
single_value.field_rR__Status = new PDU__RRM__RR__Status_template(*other_value.single_value.field_rR__Status);
break;
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
single_value.field_frequency__Redefinition = new PDU__RRM__Frequency__Redefinition__NW__MS_template(*other_value.single_value.field_frequency__Redefinition);
break;
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
single_value.field_classmarkEnquiry = new PDU__RRM__ClassmarkEnquiry__NW__MS_template(*other_value.single_value.field_classmarkEnquiry);
break;
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
single_value.field_mBMS__Announcement = new MBMS__Announcement__NW__MS_template(*other_value.single_value.field_mBMS__Announcement);
break;
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
single_value.field_vGCS__UplinkGrant = new PDU__RRM__VGCS__UplinkGrant__NW__MS_template(*other_value.single_value.field_vGCS__UplinkGrant);
break;
case PDU__RRM__NW__MS::ALT_uplinkRelease:
single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template(*other_value.single_value.field_uplinkRelease);
break;
case PDU__RRM__NW__MS::ALT_uplinkBusy:
single_value.field_uplinkBusy = new PDU__RRM__UplinkBusy__NW__MS_template(*other_value.single_value.field_uplinkBusy);
break;
case PDU__RRM__NW__MS::ALT_applicationInformation:
single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template(*other_value.single_value.field_applicationInformation);
break;
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
single_value.field_dTM__AssignmentCommand = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template(*other_value.single_value.field_dTM__AssignmentCommand);
break;
case PDU__RRM__NW__MS::ALT_dTM__Information:
single_value.field_dTM__Information = new PDU__RRM__DTM__Information__NW__MS_template(*other_value.single_value.field_dTM__Information);
break;
case PDU__RRM__NW__MS::ALT_dTM__Reject:
single_value.field_dTM__Reject = new PDU__RRM__DTM__Reject__NW__MS_template(*other_value.single_value.field_dTM__Reject);
break;
case PDU__RRM__NW__MS::ALT_packetNotification:
single_value.field_packetNotification = new PDU__RRM__PacketNotification__NW__MS_template(*other_value.single_value.field_packetNotification);
break;
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
single_value.field_interSystemToUTRAN__HandoverCommand = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template(*other_value.single_value.field_interSystemToUTRAN__HandoverCommand);
break;
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
single_value.field_interSystemToCDMA2000HandoverCommand = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template(*other_value.single_value.field_interSystemToCDMA2000HandoverCommand);
break;
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
single_value.field_interSystemToEUTRAN__HandoverCommand = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template(*other_value.single_value.field_interSystemToEUTRAN__HandoverCommand);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
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__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__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__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 template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
set_selection(other_value);
}

PDU__RRM__NW__MS_template::PDU__RRM__NW__MS_template()
{
}

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

PDU__RRM__NW__MS_template::PDU__RRM__NW__MS_template(const PDU__RRM__NW__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void PDU__RRM__NW__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
delete single_value.field_additionalAssignment;
break;
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
delete single_value.field_immediatePacketAssignment;
break;
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
delete single_value.field_cipheringModeCommand;
break;
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
delete single_value.field_configurationChangeCommand;
break;
case PDU__RRM__NW__MS::ALT_assignmentCommand:
delete single_value.field_assignmentCommand;
break;
case PDU__RRM__NW__MS::ALT_handoverCommand:
delete single_value.field_handoverCommand;
break;
case PDU__RRM__NW__MS::ALT_physicalInformation:
delete single_value.field_physicalInformation;
break;
case PDU__RRM__NW__MS::ALT_channelRelease:
delete single_value.field_channelRelease;
break;
case PDU__RRM__NW__MS::ALT_partialRelease:
delete single_value.field_partialRelease;
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
delete single_value.field_pagingReq__Type1;
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
delete single_value.field_pagingReq__Type2;
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
delete single_value.field_pagingReq__Type3;
break;
case PDU__RRM__NW__MS::ALT_channelModeModify:
delete single_value.field_channelModeModify;
break;
case PDU__RRM__NW__MS::ALT_rR__Status:
delete single_value.field_rR__Status;
break;
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
delete single_value.field_frequency__Redefinition;
break;
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
delete single_value.field_classmarkEnquiry;
break;
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
delete single_value.field_mBMS__Announcement;
break;
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
delete single_value.field_vGCS__UplinkGrant;
break;
case PDU__RRM__NW__MS::ALT_uplinkRelease:
delete single_value.field_uplinkRelease;
break;
case PDU__RRM__NW__MS::ALT_uplinkBusy:
delete single_value.field_uplinkBusy;
break;
case PDU__RRM__NW__MS::ALT_applicationInformation:
delete single_value.field_applicationInformation;
break;
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
delete single_value.field_dTM__AssignmentCommand;
break;
case PDU__RRM__NW__MS::ALT_dTM__Information:
delete single_value.field_dTM__Information;
break;
case PDU__RRM__NW__MS::ALT_dTM__Reject:
delete single_value.field_dTM__Reject;
break;
case PDU__RRM__NW__MS::ALT_packetNotification:
delete single_value.field_packetNotification;
break;
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
delete single_value.field_interSystemToUTRAN__HandoverCommand;
break;
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
delete single_value.field_interSystemToCDMA2000HandoverCommand;
break;
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
delete single_value.field_interSystemToEUTRAN__HandoverCommand;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

PDU__RRM__NW__MS_template& PDU__RRM__NW__MS_template::operator=(const OPTIONAL<PDU__RRM__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__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 union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
return *this;
}

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

boolean PDU__RRM__NW__MS_template::match(const PDU__RRM__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:
{
PDU__RRM__NW__MS::union_selection_type value_selection = other_value.get_selection();
if (value_selection == PDU__RRM__NW__MS::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
return single_value.field_additionalAssignment->match(other_value.additionalAssignment(), legacy);
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
return single_value.field_immediatePacketAssignment->match(other_value.immediatePacketAssignment(), legacy);
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
return single_value.field_cipheringModeCommand->match(other_value.cipheringModeCommand(), legacy);
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
return single_value.field_configurationChangeCommand->match(other_value.configurationChangeCommand(), legacy);
case PDU__RRM__NW__MS::ALT_assignmentCommand:
return single_value.field_assignmentCommand->match(other_value.assignmentCommand(), legacy);
case PDU__RRM__NW__MS::ALT_handoverCommand:
return single_value.field_handoverCommand->match(other_value.handoverCommand(), legacy);
case PDU__RRM__NW__MS::ALT_physicalInformation:
return single_value.field_physicalInformation->match(other_value.physicalInformation(), legacy);
case PDU__RRM__NW__MS::ALT_channelRelease:
return single_value.field_channelRelease->match(other_value.channelRelease(), legacy);
case PDU__RRM__NW__MS::ALT_partialRelease:
return single_value.field_partialRelease->match(other_value.partialRelease(), legacy);
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
return single_value.field_pagingReq__Type1->match(other_value.pagingReq__Type1(), legacy);
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
return single_value.field_pagingReq__Type2->match(other_value.pagingReq__Type2(), legacy);
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
return single_value.field_pagingReq__Type3->match(other_value.pagingReq__Type3(), legacy);
case PDU__RRM__NW__MS::ALT_channelModeModify:
return single_value.field_channelModeModify->match(other_value.channelModeModify(), legacy);
case PDU__RRM__NW__MS::ALT_rR__Status:
return single_value.field_rR__Status->match(other_value.rR__Status(), legacy);
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
return single_value.field_frequency__Redefinition->match(other_value.frequency__Redefinition(), legacy);
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
return single_value.field_classmarkEnquiry->match(other_value.classmarkEnquiry(), legacy);
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
return single_value.field_mBMS__Announcement->match(other_value.mBMS__Announcement(), legacy);
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
return single_value.field_vGCS__UplinkGrant->match(other_value.vGCS__UplinkGrant(), legacy);
case PDU__RRM__NW__MS::ALT_uplinkRelease:
return single_value.field_uplinkRelease->match(other_value.uplinkRelease(), legacy);
case PDU__RRM__NW__MS::ALT_uplinkBusy:
return single_value.field_uplinkBusy->match(other_value.uplinkBusy(), legacy);
case PDU__RRM__NW__MS::ALT_applicationInformation:
return single_value.field_applicationInformation->match(other_value.applicationInformation(), legacy);
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
return single_value.field_dTM__AssignmentCommand->match(other_value.dTM__AssignmentCommand(), legacy);
case PDU__RRM__NW__MS::ALT_dTM__Information:
return single_value.field_dTM__Information->match(other_value.dTM__Information(), legacy);
case PDU__RRM__NW__MS::ALT_dTM__Reject:
return single_value.field_dTM__Reject->match(other_value.dTM__Reject(), legacy);
case PDU__RRM__NW__MS::ALT_packetNotification:
return single_value.field_packetNotification->match(other_value.packetNotification(), legacy);
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
return single_value.field_interSystemToUTRAN__HandoverCommand->match(other_value.interSystemToUTRAN__HandoverCommand(), legacy);
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
return single_value.field_interSystemToCDMA2000HandoverCommand->match(other_value.interSystemToCDMA2000HandoverCommand(), legacy);
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
return single_value.field_interSystemToEUTRAN__HandoverCommand->match(other_value.interSystemToEUTRAN__HandoverCommand(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__NW__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
return single_value.field_additionalAssignment->is_value();
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
return single_value.field_immediatePacketAssignment->is_value();
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
return single_value.field_cipheringModeCommand->is_value();
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
return single_value.field_configurationChangeCommand->is_value();
case PDU__RRM__NW__MS::ALT_assignmentCommand:
return single_value.field_assignmentCommand->is_value();
case PDU__RRM__NW__MS::ALT_handoverCommand:
return single_value.field_handoverCommand->is_value();
case PDU__RRM__NW__MS::ALT_physicalInformation:
return single_value.field_physicalInformation->is_value();
case PDU__RRM__NW__MS::ALT_channelRelease:
return single_value.field_channelRelease->is_value();
case PDU__RRM__NW__MS::ALT_partialRelease:
return single_value.field_partialRelease->is_value();
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
return single_value.field_pagingReq__Type1->is_value();
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
return single_value.field_pagingReq__Type2->is_value();
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
return single_value.field_pagingReq__Type3->is_value();
case PDU__RRM__NW__MS::ALT_channelModeModify:
return single_value.field_channelModeModify->is_value();
case PDU__RRM__NW__MS::ALT_rR__Status:
return single_value.field_rR__Status->is_value();
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
return single_value.field_frequency__Redefinition->is_value();
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
return single_value.field_classmarkEnquiry->is_value();
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
return single_value.field_mBMS__Announcement->is_value();
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
return single_value.field_vGCS__UplinkGrant->is_value();
case PDU__RRM__NW__MS::ALT_uplinkRelease:
return single_value.field_uplinkRelease->is_value();
case PDU__RRM__NW__MS::ALT_uplinkBusy:
return single_value.field_uplinkBusy->is_value();
case PDU__RRM__NW__MS::ALT_applicationInformation:
return single_value.field_applicationInformation->is_value();
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
return single_value.field_dTM__AssignmentCommand->is_value();
case PDU__RRM__NW__MS::ALT_dTM__Information:
return single_value.field_dTM__Information->is_value();
case PDU__RRM__NW__MS::ALT_dTM__Reject:
return single_value.field_dTM__Reject->is_value();
case PDU__RRM__NW__MS::ALT_packetNotification:
return single_value.field_packetNotification->is_value();
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
return single_value.field_interSystemToUTRAN__HandoverCommand->is_value();
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
return single_value.field_interSystemToCDMA2000HandoverCommand->is_value();
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
return single_value.field_interSystemToEUTRAN__HandoverCommand->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
}

PDU__RRM__NW__MS PDU__RRM__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 union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
PDU__RRM__NW__MS ret_val;
switch (single_value.union_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
ret_val.additionalAssignment() = single_value.field_additionalAssignment->valueof();
break;
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
ret_val.immediatePacketAssignment() = single_value.field_immediatePacketAssignment->valueof();
break;
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
ret_val.cipheringModeCommand() = single_value.field_cipheringModeCommand->valueof();
break;
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
ret_val.configurationChangeCommand() = single_value.field_configurationChangeCommand->valueof();
break;
case PDU__RRM__NW__MS::ALT_assignmentCommand:
ret_val.assignmentCommand() = single_value.field_assignmentCommand->valueof();
break;
case PDU__RRM__NW__MS::ALT_handoverCommand:
ret_val.handoverCommand() = single_value.field_handoverCommand->valueof();
break;
case PDU__RRM__NW__MS::ALT_physicalInformation:
ret_val.physicalInformation() = single_value.field_physicalInformation->valueof();
break;
case PDU__RRM__NW__MS::ALT_channelRelease:
ret_val.channelRelease() = single_value.field_channelRelease->valueof();
break;
case PDU__RRM__NW__MS::ALT_partialRelease:
ret_val.partialRelease() = single_value.field_partialRelease->valueof();
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
ret_val.pagingReq__Type1() = single_value.field_pagingReq__Type1->valueof();
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
ret_val.pagingReq__Type2() = single_value.field_pagingReq__Type2->valueof();
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
ret_val.pagingReq__Type3() = single_value.field_pagingReq__Type3->valueof();
break;
case PDU__RRM__NW__MS::ALT_channelModeModify:
ret_val.channelModeModify() = single_value.field_channelModeModify->valueof();
break;
case PDU__RRM__NW__MS::ALT_rR__Status:
ret_val.rR__Status() = single_value.field_rR__Status->valueof();
break;
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
ret_val.frequency__Redefinition() = single_value.field_frequency__Redefinition->valueof();
break;
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
ret_val.classmarkEnquiry() = single_value.field_classmarkEnquiry->valueof();
break;
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
ret_val.mBMS__Announcement() = single_value.field_mBMS__Announcement->valueof();
break;
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
ret_val.vGCS__UplinkGrant() = single_value.field_vGCS__UplinkGrant->valueof();
break;
case PDU__RRM__NW__MS::ALT_uplinkRelease:
ret_val.uplinkRelease() = single_value.field_uplinkRelease->valueof();
break;
case PDU__RRM__NW__MS::ALT_uplinkBusy:
ret_val.uplinkBusy() = single_value.field_uplinkBusy->valueof();
break;
case PDU__RRM__NW__MS::ALT_applicationInformation:
ret_val.applicationInformation() = single_value.field_applicationInformation->valueof();
break;
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
ret_val.dTM__AssignmentCommand() = single_value.field_dTM__AssignmentCommand->valueof();
break;
case PDU__RRM__NW__MS::ALT_dTM__Information:
ret_val.dTM__Information() = single_value.field_dTM__Information->valueof();
break;
case PDU__RRM__NW__MS::ALT_dTM__Reject:
ret_val.dTM__Reject() = single_value.field_dTM__Reject->valueof();
break;
case PDU__RRM__NW__MS::ALT_packetNotification:
ret_val.packetNotification() = single_value.field_packetNotification->valueof();
break;
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
ret_val.interSystemToUTRAN__HandoverCommand() = single_value.field_interSystemToUTRAN__HandoverCommand->valueof();
break;
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
ret_val.interSystemToCDMA2000HandoverCommand() = single_value.field_interSystemToCDMA2000HandoverCommand->valueof();
break;
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
ret_val.interSystemToEUTRAN__HandoverCommand() = single_value.field_interSystemToEUTRAN__HandoverCommand->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
return ret_val;
}

PDU__RRM__NW__MS_template& PDU__RRM__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("Internal error: Accessing a list element of a non-list template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return value_list.list_value[list_index];
}
void PDU__RRM__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 ("Internal error: Setting an invalid list for a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__NW__MS_template[list_length];
}

PDU__RRM__AdditionalAssignment__NW__MS_template& PDU__RRM__NW__MS_template::additionalAssignment()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_additionalAssignment) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_additionalAssignment = new PDU__RRM__AdditionalAssignment__NW__MS_template(ANY_VALUE);
else single_value.field_additionalAssignment = new PDU__RRM__AdditionalAssignment__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_additionalAssignment;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_additionalAssignment;
}

const PDU__RRM__AdditionalAssignment__NW__MS_template& PDU__RRM__NW__MS_template::additionalAssignment() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field additionalAssignment in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_additionalAssignment) TTCN_error("Accessing non-selected field additionalAssignment in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_additionalAssignment;
}

PDU__RRM__ImmediatePacketAssignment__NW__MS_template& PDU__RRM__NW__MS_template::immediatePacketAssignment()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_immediatePacketAssignment) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_immediatePacketAssignment = new PDU__RRM__ImmediatePacketAssignment__NW__MS_template(ANY_VALUE);
else single_value.field_immediatePacketAssignment = new PDU__RRM__ImmediatePacketAssignment__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_immediatePacketAssignment;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_immediatePacketAssignment;
}

const PDU__RRM__ImmediatePacketAssignment__NW__MS_template& PDU__RRM__NW__MS_template::immediatePacketAssignment() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field immediatePacketAssignment in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_immediatePacketAssignment) TTCN_error("Accessing non-selected field immediatePacketAssignment in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_immediatePacketAssignment;
}

PDU__RRM__CipheringModeCommand__NW__MS_template& PDU__RRM__NW__MS_template::cipheringModeCommand()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_cipheringModeCommand) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cipheringModeCommand = new PDU__RRM__CipheringModeCommand__NW__MS_template(ANY_VALUE);
else single_value.field_cipheringModeCommand = new PDU__RRM__CipheringModeCommand__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_cipheringModeCommand;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cipheringModeCommand;
}

const PDU__RRM__CipheringModeCommand__NW__MS_template& PDU__RRM__NW__MS_template::cipheringModeCommand() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cipheringModeCommand in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_cipheringModeCommand) TTCN_error("Accessing non-selected field cipheringModeCommand in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_cipheringModeCommand;
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template& PDU__RRM__NW__MS_template::configurationChangeCommand()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_configurationChangeCommand) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_configurationChangeCommand = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template(ANY_VALUE);
else single_value.field_configurationChangeCommand = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_configurationChangeCommand;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_configurationChangeCommand;
}

const PDU__RRM__ConfigurationChangeCommand__NW__MS_template& PDU__RRM__NW__MS_template::configurationChangeCommand() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field configurationChangeCommand in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_configurationChangeCommand) TTCN_error("Accessing non-selected field configurationChangeCommand in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_configurationChangeCommand;
}

PDU__RRM__AssignmentCommand__NW__MS_template& PDU__RRM__NW__MS_template::assignmentCommand()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_assignmentCommand) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_assignmentCommand = new PDU__RRM__AssignmentCommand__NW__MS_template(ANY_VALUE);
else single_value.field_assignmentCommand = new PDU__RRM__AssignmentCommand__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_assignmentCommand;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_assignmentCommand;
}

const PDU__RRM__AssignmentCommand__NW__MS_template& PDU__RRM__NW__MS_template::assignmentCommand() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field assignmentCommand in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_assignmentCommand) TTCN_error("Accessing non-selected field assignmentCommand in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_assignmentCommand;
}

PDU__RRM__HandoverCommand__NW__MS_template& PDU__RRM__NW__MS_template::handoverCommand()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_handoverCommand) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_handoverCommand = new PDU__RRM__HandoverCommand__NW__MS_template(ANY_VALUE);
else single_value.field_handoverCommand = new PDU__RRM__HandoverCommand__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_handoverCommand;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_handoverCommand;
}

const PDU__RRM__HandoverCommand__NW__MS_template& PDU__RRM__NW__MS_template::handoverCommand() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field handoverCommand in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_handoverCommand) TTCN_error("Accessing non-selected field handoverCommand in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_handoverCommand;
}

PDU__RRM__PhysicalInformation__NW__MS_template& PDU__RRM__NW__MS_template::physicalInformation()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_physicalInformation) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_physicalInformation = new PDU__RRM__PhysicalInformation__NW__MS_template(ANY_VALUE);
else single_value.field_physicalInformation = new PDU__RRM__PhysicalInformation__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_physicalInformation;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_physicalInformation;
}

const PDU__RRM__PhysicalInformation__NW__MS_template& PDU__RRM__NW__MS_template::physicalInformation() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field physicalInformation in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_physicalInformation) TTCN_error("Accessing non-selected field physicalInformation in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_physicalInformation;
}

PDU__RRM__ChannelRelease__NW__MS_template& PDU__RRM__NW__MS_template::channelRelease()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_channelRelease) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_channelRelease = new PDU__RRM__ChannelRelease__NW__MS_template(ANY_VALUE);
else single_value.field_channelRelease = new PDU__RRM__ChannelRelease__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_channelRelease;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_channelRelease;
}

const PDU__RRM__ChannelRelease__NW__MS_template& PDU__RRM__NW__MS_template::channelRelease() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field channelRelease in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_channelRelease) TTCN_error("Accessing non-selected field channelRelease in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_channelRelease;
}

PDU__RRM__PartialRelease__NW__MS_template& PDU__RRM__NW__MS_template::partialRelease()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_partialRelease) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_partialRelease = new PDU__RRM__PartialRelease__NW__MS_template(ANY_VALUE);
else single_value.field_partialRelease = new PDU__RRM__PartialRelease__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_partialRelease;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_partialRelease;
}

const PDU__RRM__PartialRelease__NW__MS_template& PDU__RRM__NW__MS_template::partialRelease() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field partialRelease in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_partialRelease) TTCN_error("Accessing non-selected field partialRelease in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_partialRelease;
}

PDU__RRM__PagingReq__Type1__NW__MS_template& PDU__RRM__NW__MS_template::pagingReq__Type1()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_pagingReq__Type1) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_pagingReq__Type1 = new PDU__RRM__PagingReq__Type1__NW__MS_template(ANY_VALUE);
else single_value.field_pagingReq__Type1 = new PDU__RRM__PagingReq__Type1__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_pagingReq__Type1;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_pagingReq__Type1;
}

const PDU__RRM__PagingReq__Type1__NW__MS_template& PDU__RRM__NW__MS_template::pagingReq__Type1() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pagingReq_Type1 in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_pagingReq__Type1) TTCN_error("Accessing non-selected field pagingReq_Type1 in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_pagingReq__Type1;
}

PDU__RRM__PagingReq__Type2__NW__MS_template& PDU__RRM__NW__MS_template::pagingReq__Type2()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_pagingReq__Type2) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_pagingReq__Type2 = new PDU__RRM__PagingReq__Type2__NW__MS_template(ANY_VALUE);
else single_value.field_pagingReq__Type2 = new PDU__RRM__PagingReq__Type2__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_pagingReq__Type2;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_pagingReq__Type2;
}

const PDU__RRM__PagingReq__Type2__NW__MS_template& PDU__RRM__NW__MS_template::pagingReq__Type2() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pagingReq_Type2 in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_pagingReq__Type2) TTCN_error("Accessing non-selected field pagingReq_Type2 in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_pagingReq__Type2;
}

PDU__RRM__PagingReq__Type3__NW__MS_template& PDU__RRM__NW__MS_template::pagingReq__Type3()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_pagingReq__Type3) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_pagingReq__Type3 = new PDU__RRM__PagingReq__Type3__NW__MS_template(ANY_VALUE);
else single_value.field_pagingReq__Type3 = new PDU__RRM__PagingReq__Type3__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_pagingReq__Type3;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_pagingReq__Type3;
}

const PDU__RRM__PagingReq__Type3__NW__MS_template& PDU__RRM__NW__MS_template::pagingReq__Type3() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pagingReq_Type3 in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_pagingReq__Type3) TTCN_error("Accessing non-selected field pagingReq_Type3 in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_pagingReq__Type3;
}

PDU__RRM__ChannelModeModify__NW__MS_template& PDU__RRM__NW__MS_template::channelModeModify()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_channelModeModify) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_channelModeModify = new PDU__RRM__ChannelModeModify__NW__MS_template(ANY_VALUE);
else single_value.field_channelModeModify = new PDU__RRM__ChannelModeModify__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_channelModeModify;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_channelModeModify;
}

const PDU__RRM__ChannelModeModify__NW__MS_template& PDU__RRM__NW__MS_template::channelModeModify() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field channelModeModify in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_channelModeModify) TTCN_error("Accessing non-selected field channelModeModify in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_channelModeModify;
}

PDU__RRM__RR__Status_template& PDU__RRM__NW__MS_template::rR__Status()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_rR__Status) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rR__Status = new PDU__RRM__RR__Status_template(ANY_VALUE);
else single_value.field_rR__Status = new PDU__RRM__RR__Status_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_rR__Status;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rR__Status;
}

const PDU__RRM__RR__Status_template& PDU__RRM__NW__MS_template::rR__Status() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rR_Status in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_rR__Status) TTCN_error("Accessing non-selected field rR_Status in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_rR__Status;
}

PDU__RRM__Frequency__Redefinition__NW__MS_template& PDU__RRM__NW__MS_template::frequency__Redefinition()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_frequency__Redefinition) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_frequency__Redefinition = new PDU__RRM__Frequency__Redefinition__NW__MS_template(ANY_VALUE);
else single_value.field_frequency__Redefinition = new PDU__RRM__Frequency__Redefinition__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_frequency__Redefinition;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_frequency__Redefinition;
}

const PDU__RRM__Frequency__Redefinition__NW__MS_template& PDU__RRM__NW__MS_template::frequency__Redefinition() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field frequency_Redefinition in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_frequency__Redefinition) TTCN_error("Accessing non-selected field frequency_Redefinition in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_frequency__Redefinition;
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template& PDU__RRM__NW__MS_template::classmarkEnquiry()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_classmarkEnquiry) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_classmarkEnquiry = new PDU__RRM__ClassmarkEnquiry__NW__MS_template(ANY_VALUE);
else single_value.field_classmarkEnquiry = new PDU__RRM__ClassmarkEnquiry__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_classmarkEnquiry;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_classmarkEnquiry;
}

const PDU__RRM__ClassmarkEnquiry__NW__MS_template& PDU__RRM__NW__MS_template::classmarkEnquiry() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field classmarkEnquiry in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_classmarkEnquiry) TTCN_error("Accessing non-selected field classmarkEnquiry in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_classmarkEnquiry;
}

MBMS__Announcement__NW__MS_template& PDU__RRM__NW__MS_template::mBMS__Announcement()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_mBMS__Announcement) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mBMS__Announcement = new MBMS__Announcement__NW__MS_template(ANY_VALUE);
else single_value.field_mBMS__Announcement = new MBMS__Announcement__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_mBMS__Announcement;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mBMS__Announcement;
}

const MBMS__Announcement__NW__MS_template& PDU__RRM__NW__MS_template::mBMS__Announcement() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mBMS_Announcement in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_mBMS__Announcement) TTCN_error("Accessing non-selected field mBMS_Announcement in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_mBMS__Announcement;
}

PDU__RRM__VGCS__UplinkGrant__NW__MS_template& PDU__RRM__NW__MS_template::vGCS__UplinkGrant()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_vGCS__UplinkGrant = new PDU__RRM__VGCS__UplinkGrant__NW__MS_template(ANY_VALUE);
else single_value.field_vGCS__UplinkGrant = new PDU__RRM__VGCS__UplinkGrant__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_vGCS__UplinkGrant;
}

const PDU__RRM__VGCS__UplinkGrant__NW__MS_template& PDU__RRM__NW__MS_template::vGCS__UplinkGrant() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field vGCS_UplinkGrant in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant) TTCN_error("Accessing non-selected field vGCS_UplinkGrant in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_vGCS__UplinkGrant;
}

PDU__RRM__UplinkRelease_template& PDU__RRM__NW__MS_template::uplinkRelease()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_uplinkRelease) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template(ANY_VALUE);
else single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_uplinkRelease;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_uplinkRelease;
}

const PDU__RRM__UplinkRelease_template& PDU__RRM__NW__MS_template::uplinkRelease() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field uplinkRelease in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_uplinkRelease) TTCN_error("Accessing non-selected field uplinkRelease in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_uplinkRelease;
}

PDU__RRM__UplinkBusy__NW__MS_template& PDU__RRM__NW__MS_template::uplinkBusy()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_uplinkBusy) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_uplinkBusy = new PDU__RRM__UplinkBusy__NW__MS_template(ANY_VALUE);
else single_value.field_uplinkBusy = new PDU__RRM__UplinkBusy__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_uplinkBusy;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_uplinkBusy;
}

const PDU__RRM__UplinkBusy__NW__MS_template& PDU__RRM__NW__MS_template::uplinkBusy() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field uplinkBusy in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_uplinkBusy) TTCN_error("Accessing non-selected field uplinkBusy in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_uplinkBusy;
}

PDU__RRM__ApplicationInformation_template& PDU__RRM__NW__MS_template::applicationInformation()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_applicationInformation) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template(ANY_VALUE);
else single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_applicationInformation;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_applicationInformation;
}

const PDU__RRM__ApplicationInformation_template& PDU__RRM__NW__MS_template::applicationInformation() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field applicationInformation in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_applicationInformation) TTCN_error("Accessing non-selected field applicationInformation in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_applicationInformation;
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template& PDU__RRM__NW__MS_template::dTM__AssignmentCommand()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_dTM__AssignmentCommand = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template(ANY_VALUE);
else single_value.field_dTM__AssignmentCommand = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_dTM__AssignmentCommand;
}

const PDU__RRM__DTM__AssignmentCommand__NW__MS_template& PDU__RRM__NW__MS_template::dTM__AssignmentCommand() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTM_AssignmentCommand in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand) TTCN_error("Accessing non-selected field dTM_AssignmentCommand in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_dTM__AssignmentCommand;
}

PDU__RRM__DTM__Information__NW__MS_template& PDU__RRM__NW__MS_template::dTM__Information()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_dTM__Information) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_dTM__Information = new PDU__RRM__DTM__Information__NW__MS_template(ANY_VALUE);
else single_value.field_dTM__Information = new PDU__RRM__DTM__Information__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_dTM__Information;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_dTM__Information;
}

const PDU__RRM__DTM__Information__NW__MS_template& PDU__RRM__NW__MS_template::dTM__Information() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTM_Information in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_dTM__Information) TTCN_error("Accessing non-selected field dTM_Information in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_dTM__Information;
}

PDU__RRM__DTM__Reject__NW__MS_template& PDU__RRM__NW__MS_template::dTM__Reject()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_dTM__Reject) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_dTM__Reject = new PDU__RRM__DTM__Reject__NW__MS_template(ANY_VALUE);
else single_value.field_dTM__Reject = new PDU__RRM__DTM__Reject__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_dTM__Reject;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_dTM__Reject;
}

const PDU__RRM__DTM__Reject__NW__MS_template& PDU__RRM__NW__MS_template::dTM__Reject() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTM_Reject in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_dTM__Reject) TTCN_error("Accessing non-selected field dTM_Reject in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_dTM__Reject;
}

PDU__RRM__PacketNotification__NW__MS_template& PDU__RRM__NW__MS_template::packetNotification()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_packetNotification) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_packetNotification = new PDU__RRM__PacketNotification__NW__MS_template(ANY_VALUE);
else single_value.field_packetNotification = new PDU__RRM__PacketNotification__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_packetNotification;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_packetNotification;
}

const PDU__RRM__PacketNotification__NW__MS_template& PDU__RRM__NW__MS_template::packetNotification() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field packetNotification in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_packetNotification) TTCN_error("Accessing non-selected field packetNotification in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_packetNotification;
}

PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template& PDU__RRM__NW__MS_template::interSystemToUTRAN__HandoverCommand()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_interSystemToUTRAN__HandoverCommand = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template(ANY_VALUE);
else single_value.field_interSystemToUTRAN__HandoverCommand = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_interSystemToUTRAN__HandoverCommand;
}

const PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template& PDU__RRM__NW__MS_template::interSystemToUTRAN__HandoverCommand() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field interSystemToUTRAN_HandoverCommand in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand) TTCN_error("Accessing non-selected field interSystemToUTRAN_HandoverCommand in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_interSystemToUTRAN__HandoverCommand;
}

PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template& PDU__RRM__NW__MS_template::interSystemToCDMA2000HandoverCommand()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_interSystemToCDMA2000HandoverCommand = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template(ANY_VALUE);
else single_value.field_interSystemToCDMA2000HandoverCommand = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_interSystemToCDMA2000HandoverCommand;
}

const PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template& PDU__RRM__NW__MS_template::interSystemToCDMA2000HandoverCommand() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field interSystemToCDMA2000HandoverCommand in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand) TTCN_error("Accessing non-selected field interSystemToCDMA2000HandoverCommand in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_interSystemToCDMA2000HandoverCommand;
}

PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template& PDU__RRM__NW__MS_template::interSystemToEUTRAN__HandoverCommand()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_interSystemToEUTRAN__HandoverCommand = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template(ANY_VALUE);
else single_value.field_interSystemToEUTRAN__HandoverCommand = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template;
single_value.union_selection = PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_interSystemToEUTRAN__HandoverCommand;
}

const PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template& PDU__RRM__NW__MS_template::interSystemToEUTRAN__HandoverCommand() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field interSystemToEUTRAN_HandoverCommand in a non-specific template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
if (single_value.union_selection != PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand) TTCN_error("Accessing non-selected field interSystemToEUTRAN_HandoverCommand in a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
return *single_value.field_interSystemToEUTRAN__HandoverCommand;
}

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

void PDU__RRM__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
TTCN_Logger::log_event_str("{ additionalAssignment := ");
single_value.field_additionalAssignment->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
TTCN_Logger::log_event_str("{ immediatePacketAssignment := ");
single_value.field_immediatePacketAssignment->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
TTCN_Logger::log_event_str("{ cipheringModeCommand := ");
single_value.field_cipheringModeCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
TTCN_Logger::log_event_str("{ configurationChangeCommand := ");
single_value.field_configurationChangeCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_assignmentCommand:
TTCN_Logger::log_event_str("{ assignmentCommand := ");
single_value.field_assignmentCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_handoverCommand:
TTCN_Logger::log_event_str("{ handoverCommand := ");
single_value.field_handoverCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_physicalInformation:
TTCN_Logger::log_event_str("{ physicalInformation := ");
single_value.field_physicalInformation->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_channelRelease:
TTCN_Logger::log_event_str("{ channelRelease := ");
single_value.field_channelRelease->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_partialRelease:
TTCN_Logger::log_event_str("{ partialRelease := ");
single_value.field_partialRelease->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
TTCN_Logger::log_event_str("{ pagingReq_Type1 := ");
single_value.field_pagingReq__Type1->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
TTCN_Logger::log_event_str("{ pagingReq_Type2 := ");
single_value.field_pagingReq__Type2->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
TTCN_Logger::log_event_str("{ pagingReq_Type3 := ");
single_value.field_pagingReq__Type3->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_channelModeModify:
TTCN_Logger::log_event_str("{ channelModeModify := ");
single_value.field_channelModeModify->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_rR__Status:
TTCN_Logger::log_event_str("{ rR_Status := ");
single_value.field_rR__Status->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
TTCN_Logger::log_event_str("{ frequency_Redefinition := ");
single_value.field_frequency__Redefinition->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
TTCN_Logger::log_event_str("{ classmarkEnquiry := ");
single_value.field_classmarkEnquiry->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
TTCN_Logger::log_event_str("{ mBMS_Announcement := ");
single_value.field_mBMS__Announcement->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
TTCN_Logger::log_event_str("{ vGCS_UplinkGrant := ");
single_value.field_vGCS__UplinkGrant->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_uplinkRelease:
TTCN_Logger::log_event_str("{ uplinkRelease := ");
single_value.field_uplinkRelease->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_uplinkBusy:
TTCN_Logger::log_event_str("{ uplinkBusy := ");
single_value.field_uplinkBusy->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_applicationInformation:
TTCN_Logger::log_event_str("{ applicationInformation := ");
single_value.field_applicationInformation->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
TTCN_Logger::log_event_str("{ dTM_AssignmentCommand := ");
single_value.field_dTM__AssignmentCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_dTM__Information:
TTCN_Logger::log_event_str("{ dTM_Information := ");
single_value.field_dTM__Information->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_dTM__Reject:
TTCN_Logger::log_event_str("{ dTM_Reject := ");
single_value.field_dTM__Reject->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_packetNotification:
TTCN_Logger::log_event_str("{ packetNotification := ");
single_value.field_packetNotification->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
TTCN_Logger::log_event_str("{ interSystemToUTRAN_HandoverCommand := ");
single_value.field_interSystemToUTRAN__HandoverCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
TTCN_Logger::log_event_str("{ interSystemToCDMA2000HandoverCommand := ");
single_value.field_interSystemToCDMA2000HandoverCommand->log();
TTCN_Logger::log_event_str(" }");
break;
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
TTCN_Logger::log_event_str("{ interSystemToEUTRAN_HandoverCommand := ");
single_value.field_interSystemToEUTRAN__HandoverCommand->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__RRM__NW__MS_template::log_match(const PDU__RRM__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".additionalAssignment");
single_value.field_additionalAssignment->log_match(match_value.additionalAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ additionalAssignment := ");
single_value.field_additionalAssignment->log_match(match_value.additionalAssignment(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".immediatePacketAssignment");
single_value.field_immediatePacketAssignment->log_match(match_value.immediatePacketAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ immediatePacketAssignment := ");
single_value.field_immediatePacketAssignment->log_match(match_value.immediatePacketAssignment(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cipheringModeCommand");
single_value.field_cipheringModeCommand->log_match(match_value.cipheringModeCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cipheringModeCommand := ");
single_value.field_cipheringModeCommand->log_match(match_value.cipheringModeCommand(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".configurationChangeCommand");
single_value.field_configurationChangeCommand->log_match(match_value.configurationChangeCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ configurationChangeCommand := ");
single_value.field_configurationChangeCommand->log_match(match_value.configurationChangeCommand(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_assignmentCommand:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".assignmentCommand");
single_value.field_assignmentCommand->log_match(match_value.assignmentCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ assignmentCommand := ");
single_value.field_assignmentCommand->log_match(match_value.assignmentCommand(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_handoverCommand:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".handoverCommand");
single_value.field_handoverCommand->log_match(match_value.handoverCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ handoverCommand := ");
single_value.field_handoverCommand->log_match(match_value.handoverCommand(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_physicalInformation:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".physicalInformation");
single_value.field_physicalInformation->log_match(match_value.physicalInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ physicalInformation := ");
single_value.field_physicalInformation->log_match(match_value.physicalInformation(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_channelRelease:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".channelRelease");
single_value.field_channelRelease->log_match(match_value.channelRelease(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ channelRelease := ");
single_value.field_channelRelease->log_match(match_value.channelRelease(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_partialRelease:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".partialRelease");
single_value.field_partialRelease->log_match(match_value.partialRelease(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ partialRelease := ");
single_value.field_partialRelease->log_match(match_value.partialRelease(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".pagingReq_Type1");
single_value.field_pagingReq__Type1->log_match(match_value.pagingReq__Type1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ pagingReq_Type1 := ");
single_value.field_pagingReq__Type1->log_match(match_value.pagingReq__Type1(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".pagingReq_Type2");
single_value.field_pagingReq__Type2->log_match(match_value.pagingReq__Type2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ pagingReq_Type2 := ");
single_value.field_pagingReq__Type2->log_match(match_value.pagingReq__Type2(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".pagingReq_Type3");
single_value.field_pagingReq__Type3->log_match(match_value.pagingReq__Type3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ pagingReq_Type3 := ");
single_value.field_pagingReq__Type3->log_match(match_value.pagingReq__Type3(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_channelModeModify:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".channelModeModify");
single_value.field_channelModeModify->log_match(match_value.channelModeModify(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ channelModeModify := ");
single_value.field_channelModeModify->log_match(match_value.channelModeModify(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_rR__Status:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rR_Status");
single_value.field_rR__Status->log_match(match_value.rR__Status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rR_Status := ");
single_value.field_rR__Status->log_match(match_value.rR__Status(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".frequency_Redefinition");
single_value.field_frequency__Redefinition->log_match(match_value.frequency__Redefinition(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ frequency_Redefinition := ");
single_value.field_frequency__Redefinition->log_match(match_value.frequency__Redefinition(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".classmarkEnquiry");
single_value.field_classmarkEnquiry->log_match(match_value.classmarkEnquiry(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ classmarkEnquiry := ");
single_value.field_classmarkEnquiry->log_match(match_value.classmarkEnquiry(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mBMS_Announcement");
single_value.field_mBMS__Announcement->log_match(match_value.mBMS__Announcement(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mBMS_Announcement := ");
single_value.field_mBMS__Announcement->log_match(match_value.mBMS__Announcement(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".vGCS_UplinkGrant");
single_value.field_vGCS__UplinkGrant->log_match(match_value.vGCS__UplinkGrant(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ vGCS_UplinkGrant := ");
single_value.field_vGCS__UplinkGrant->log_match(match_value.vGCS__UplinkGrant(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_uplinkRelease:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".uplinkRelease");
single_value.field_uplinkRelease->log_match(match_value.uplinkRelease(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ uplinkRelease := ");
single_value.field_uplinkRelease->log_match(match_value.uplinkRelease(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_uplinkBusy:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".uplinkBusy");
single_value.field_uplinkBusy->log_match(match_value.uplinkBusy(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ uplinkBusy := ");
single_value.field_uplinkBusy->log_match(match_value.uplinkBusy(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_applicationInformation:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".applicationInformation");
single_value.field_applicationInformation->log_match(match_value.applicationInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ applicationInformation := ");
single_value.field_applicationInformation->log_match(match_value.applicationInformation(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".dTM_AssignmentCommand");
single_value.field_dTM__AssignmentCommand->log_match(match_value.dTM__AssignmentCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ dTM_AssignmentCommand := ");
single_value.field_dTM__AssignmentCommand->log_match(match_value.dTM__AssignmentCommand(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_dTM__Information:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".dTM_Information");
single_value.field_dTM__Information->log_match(match_value.dTM__Information(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ dTM_Information := ");
single_value.field_dTM__Information->log_match(match_value.dTM__Information(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_dTM__Reject:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".dTM_Reject");
single_value.field_dTM__Reject->log_match(match_value.dTM__Reject(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ dTM_Reject := ");
single_value.field_dTM__Reject->log_match(match_value.dTM__Reject(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_packetNotification:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".packetNotification");
single_value.field_packetNotification->log_match(match_value.packetNotification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ packetNotification := ");
single_value.field_packetNotification->log_match(match_value.packetNotification(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".interSystemToUTRAN_HandoverCommand");
single_value.field_interSystemToUTRAN__HandoverCommand->log_match(match_value.interSystemToUTRAN__HandoverCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ interSystemToUTRAN_HandoverCommand := ");
single_value.field_interSystemToUTRAN__HandoverCommand->log_match(match_value.interSystemToUTRAN__HandoverCommand(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".interSystemToCDMA2000HandoverCommand");
single_value.field_interSystemToCDMA2000HandoverCommand->log_match(match_value.interSystemToCDMA2000HandoverCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ interSystemToCDMA2000HandoverCommand := ");
single_value.field_interSystemToCDMA2000HandoverCommand->log_match(match_value.interSystemToCDMA2000HandoverCommand(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".interSystemToEUTRAN_HandoverCommand");
single_value.field_interSystemToEUTRAN__HandoverCommand->log_match(match_value.interSystemToEUTRAN__HandoverCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ interSystemToEUTRAN_HandoverCommand := ");
single_value.field_interSystemToEUTRAN__HandoverCommand->log_match(match_value.interSystemToEUTRAN__HandoverCommand(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__RRM__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
single_value.field_additionalAssignment->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
single_value.field_immediatePacketAssignment->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
single_value.field_cipheringModeCommand->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
single_value.field_configurationChangeCommand->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_assignmentCommand:
single_value.field_assignmentCommand->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_handoverCommand:
single_value.field_handoverCommand->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_physicalInformation:
single_value.field_physicalInformation->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_channelRelease:
single_value.field_channelRelease->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_partialRelease:
single_value.field_partialRelease->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
single_value.field_pagingReq__Type1->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
single_value.field_pagingReq__Type2->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
single_value.field_pagingReq__Type3->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_channelModeModify:
single_value.field_channelModeModify->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_rR__Status:
single_value.field_rR__Status->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
single_value.field_frequency__Redefinition->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
single_value.field_classmarkEnquiry->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
single_value.field_mBMS__Announcement->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
single_value.field_vGCS__UplinkGrant->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_uplinkRelease:
single_value.field_uplinkRelease->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_uplinkBusy:
single_value.field_uplinkBusy->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_applicationInformation:
single_value.field_applicationInformation->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
single_value.field_dTM__AssignmentCommand->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_dTM__Information:
single_value.field_dTM__Information->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_dTM__Reject:
single_value.field_dTM__Reject->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_packetNotification:
single_value.field_packetNotification->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
single_value.field_interSystemToUTRAN__HandoverCommand->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
single_value.field_interSystemToCDMA2000HandoverCommand->encode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
single_value.field_interSystemToEUTRAN__HandoverCommand->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
}

void PDU__RRM__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = PDU__RRM__NW__MS::UNBOUND_VALUE;
PDU__RRM__NW__MS::union_selection_type new_selection = (PDU__RRM__NW__MS::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
single_value.field_additionalAssignment = new PDU__RRM__AdditionalAssignment__NW__MS_template;
single_value.field_additionalAssignment->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
single_value.field_immediatePacketAssignment = new PDU__RRM__ImmediatePacketAssignment__NW__MS_template;
single_value.field_immediatePacketAssignment->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
single_value.field_cipheringModeCommand = new PDU__RRM__CipheringModeCommand__NW__MS_template;
single_value.field_cipheringModeCommand->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
single_value.field_configurationChangeCommand = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template;
single_value.field_configurationChangeCommand->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_assignmentCommand:
single_value.field_assignmentCommand = new PDU__RRM__AssignmentCommand__NW__MS_template;
single_value.field_assignmentCommand->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_handoverCommand:
single_value.field_handoverCommand = new PDU__RRM__HandoverCommand__NW__MS_template;
single_value.field_handoverCommand->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_physicalInformation:
single_value.field_physicalInformation = new PDU__RRM__PhysicalInformation__NW__MS_template;
single_value.field_physicalInformation->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_channelRelease:
single_value.field_channelRelease = new PDU__RRM__ChannelRelease__NW__MS_template;
single_value.field_channelRelease->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_partialRelease:
single_value.field_partialRelease = new PDU__RRM__PartialRelease__NW__MS_template;
single_value.field_partialRelease->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
single_value.field_pagingReq__Type1 = new PDU__RRM__PagingReq__Type1__NW__MS_template;
single_value.field_pagingReq__Type1->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
single_value.field_pagingReq__Type2 = new PDU__RRM__PagingReq__Type2__NW__MS_template;
single_value.field_pagingReq__Type2->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
single_value.field_pagingReq__Type3 = new PDU__RRM__PagingReq__Type3__NW__MS_template;
single_value.field_pagingReq__Type3->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_channelModeModify:
single_value.field_channelModeModify = new PDU__RRM__ChannelModeModify__NW__MS_template;
single_value.field_channelModeModify->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_rR__Status:
single_value.field_rR__Status = new PDU__RRM__RR__Status_template;
single_value.field_rR__Status->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
single_value.field_frequency__Redefinition = new PDU__RRM__Frequency__Redefinition__NW__MS_template;
single_value.field_frequency__Redefinition->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
single_value.field_classmarkEnquiry = new PDU__RRM__ClassmarkEnquiry__NW__MS_template;
single_value.field_classmarkEnquiry->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
single_value.field_mBMS__Announcement = new MBMS__Announcement__NW__MS_template;
single_value.field_mBMS__Announcement->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
single_value.field_vGCS__UplinkGrant = new PDU__RRM__VGCS__UplinkGrant__NW__MS_template;
single_value.field_vGCS__UplinkGrant->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_uplinkRelease:
single_value.field_uplinkRelease = new PDU__RRM__UplinkRelease_template;
single_value.field_uplinkRelease->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_uplinkBusy:
single_value.field_uplinkBusy = new PDU__RRM__UplinkBusy__NW__MS_template;
single_value.field_uplinkBusy->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_applicationInformation:
single_value.field_applicationInformation = new PDU__RRM__ApplicationInformation_template;
single_value.field_applicationInformation->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
single_value.field_dTM__AssignmentCommand = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template;
single_value.field_dTM__AssignmentCommand->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_dTM__Information:
single_value.field_dTM__Information = new PDU__RRM__DTM__Information__NW__MS_template;
single_value.field_dTM__Information->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_dTM__Reject:
single_value.field_dTM__Reject = new PDU__RRM__DTM__Reject__NW__MS_template;
single_value.field_dTM__Reject->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_packetNotification:
single_value.field_packetNotification = new PDU__RRM__PacketNotification__NW__MS_template;
single_value.field_packetNotification->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
single_value.field_interSystemToUTRAN__HandoverCommand = new PDU__RRM__InterSystemToUTRAN__HandoverCommand__NW__MS_template;
single_value.field_interSystemToUTRAN__HandoverCommand->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
single_value.field_interSystemToCDMA2000HandoverCommand = new PDU__RRM__InterSystemToCDMA2000HandoverCommand__NW__MS_template;
single_value.field_interSystemToCDMA2000HandoverCommand->decode_text(text_buf);
break;
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
single_value.field_interSystemToEUTRAN__HandoverCommand = new PDU__RRM__InterSystemToEUTRAN__HandoverCommand__NW__MS_template;
single_value.field_interSystemToEUTRAN__HandoverCommand->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__RRM__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: Unrecognized selector was received in a template of type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
}

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

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

void PDU__RRM__NW__MS_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_RRM_Types.PDU_RRM_NW_MS'");
    }
    if (strcmp("additionalAssignment", param_field) == 0) {
      additionalAssignment().set_param(param);
      return;
    } else if (strcmp("immediatePacketAssignment", param_field) == 0) {
      immediatePacketAssignment().set_param(param);
      return;
    } else if (strcmp("cipheringModeCommand", param_field) == 0) {
      cipheringModeCommand().set_param(param);
      return;
    } else if (strcmp("configurationChangeCommand", param_field) == 0) {
      configurationChangeCommand().set_param(param);
      return;
    } else if (strcmp("assignmentCommand", param_field) == 0) {
      assignmentCommand().set_param(param);
      return;
    } else if (strcmp("handoverCommand", param_field) == 0) {
      handoverCommand().set_param(param);
      return;
    } else if (strcmp("physicalInformation", param_field) == 0) {
      physicalInformation().set_param(param);
      return;
    } else if (strcmp("channelRelease", param_field) == 0) {
      channelRelease().set_param(param);
      return;
    } else if (strcmp("partialRelease", param_field) == 0) {
      partialRelease().set_param(param);
      return;
    } else if (strcmp("pagingReq_Type1", param_field) == 0) {
      pagingReq__Type1().set_param(param);
      return;
    } else if (strcmp("pagingReq_Type2", param_field) == 0) {
      pagingReq__Type2().set_param(param);
      return;
    } else if (strcmp("pagingReq_Type3", param_field) == 0) {
      pagingReq__Type3().set_param(param);
      return;
    } else if (strcmp("channelModeModify", param_field) == 0) {
      channelModeModify().set_param(param);
      return;
    } else if (strcmp("rR_Status", param_field) == 0) {
      rR__Status().set_param(param);
      return;
    } else if (strcmp("frequency_Redefinition", param_field) == 0) {
      frequency__Redefinition().set_param(param);
      return;
    } else if (strcmp("classmarkEnquiry", param_field) == 0) {
      classmarkEnquiry().set_param(param);
      return;
    } else if (strcmp("mBMS_Announcement", param_field) == 0) {
      mBMS__Announcement().set_param(param);
      return;
    } else if (strcmp("vGCS_UplinkGrant", param_field) == 0) {
      vGCS__UplinkGrant().set_param(param);
      return;
    } else if (strcmp("uplinkRelease", param_field) == 0) {
      uplinkRelease().set_param(param);
      return;
    } else if (strcmp("uplinkBusy", param_field) == 0) {
      uplinkBusy().set_param(param);
      return;
    } else if (strcmp("applicationInformation", param_field) == 0) {
      applicationInformation().set_param(param);
      return;
    } else if (strcmp("dTM_AssignmentCommand", param_field) == 0) {
      dTM__AssignmentCommand().set_param(param);
      return;
    } else if (strcmp("dTM_Information", param_field) == 0) {
      dTM__Information().set_param(param);
      return;
    } else if (strcmp("dTM_Reject", param_field) == 0) {
      dTM__Reject().set_param(param);
      return;
    } else if (strcmp("packetNotification", param_field) == 0) {
      packetNotification().set_param(param);
      return;
    } else if (strcmp("interSystemToUTRAN_HandoverCommand", param_field) == 0) {
      interSystemToUTRAN__HandoverCommand().set_param(param);
      return;
    } else if (strcmp("interSystemToCDMA2000HandoverCommand", param_field) == 0) {
      interSystemToCDMA2000HandoverCommand().set_param(param);
      return;
    } else if (strcmp("interSystemToEUTRAN_HandoverCommand", param_field) == 0) {
      interSystemToEUTRAN__HandoverCommand().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_RRM_Types.PDU_RRM_NW_MS'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__RRM__NW__MS_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "additionalAssignment")) {
      additionalAssignment().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "immediatePacketAssignment")) {
      immediatePacketAssignment().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "cipheringModeCommand")) {
      cipheringModeCommand().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "configurationChangeCommand")) {
      configurationChangeCommand().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "assignmentCommand")) {
      assignmentCommand().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "handoverCommand")) {
      handoverCommand().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "physicalInformation")) {
      physicalInformation().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "channelRelease")) {
      channelRelease().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "partialRelease")) {
      partialRelease().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "pagingReq_Type1")) {
      pagingReq__Type1().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "pagingReq_Type2")) {
      pagingReq__Type2().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "pagingReq_Type3")) {
      pagingReq__Type3().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "channelModeModify")) {
      channelModeModify().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rR_Status")) {
      rR__Status().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "frequency_Redefinition")) {
      frequency__Redefinition().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "classmarkEnquiry")) {
      classmarkEnquiry().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mBMS_Announcement")) {
      mBMS__Announcement().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "vGCS_UplinkGrant")) {
      vGCS__UplinkGrant().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "uplinkRelease")) {
      uplinkRelease().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "uplinkBusy")) {
      uplinkBusy().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "applicationInformation")) {
      applicationInformation().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "dTM_AssignmentCommand")) {
      dTM__AssignmentCommand().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "dTM_Information")) {
      dTM__Information().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "dTM_Reject")) {
      dTM__Reject().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "packetNotification")) {
      packetNotification().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "interSystemToUTRAN_HandoverCommand")) {
      interSystemToUTRAN__HandoverCommand().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "interSystemToCDMA2000HandoverCommand")) {
      interSystemToCDMA2000HandoverCommand().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "interSystemToEUTRAN_HandoverCommand")) {
      interSystemToEUTRAN__HandoverCommand().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_RRM_Types.PDU_RRM_NW_MS.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__NW__MS_template* precondition = new PDU__RRM__NW__MS_template;
    precondition->set_param(*m_p->get_elem(0));
    PDU__RRM__NW__MS_template* implied_template = new PDU__RRM__NW__MS_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = PDU__RRM__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__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;
switch (single_value.union_selection) {
case PDU__RRM__NW__MS::ALT_additionalAssignment:
single_value.field_additionalAssignment->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_immediatePacketAssignment:
single_value.field_immediatePacketAssignment->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_cipheringModeCommand:
single_value.field_cipheringModeCommand->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_configurationChangeCommand:
single_value.field_configurationChangeCommand->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_assignmentCommand:
single_value.field_assignmentCommand->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_handoverCommand:
single_value.field_handoverCommand->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_physicalInformation:
single_value.field_physicalInformation->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_channelRelease:
single_value.field_channelRelease->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_partialRelease:
single_value.field_partialRelease->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_pagingReq__Type1:
single_value.field_pagingReq__Type1->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_pagingReq__Type2:
single_value.field_pagingReq__Type2->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_pagingReq__Type3:
single_value.field_pagingReq__Type3->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_channelModeModify:
single_value.field_channelModeModify->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_rR__Status:
single_value.field_rR__Status->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_frequency__Redefinition:
single_value.field_frequency__Redefinition->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_classmarkEnquiry:
single_value.field_classmarkEnquiry->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_mBMS__Announcement:
single_value.field_mBMS__Announcement->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_vGCS__UplinkGrant:
single_value.field_vGCS__UplinkGrant->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_uplinkRelease:
single_value.field_uplinkRelease->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_uplinkBusy:
single_value.field_uplinkBusy->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_applicationInformation:
single_value.field_applicationInformation->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_dTM__AssignmentCommand:
single_value.field_dTM__AssignmentCommand->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_dTM__Information:
single_value.field_dTM__Information->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_dTM__Reject:
single_value.field_dTM__Reject->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_packetNotification:
single_value.field_packetNotification->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_interSystemToUTRAN__HandoverCommand:
single_value.field_interSystemToUTRAN__HandoverCommand->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_interSystemToCDMA2000HandoverCommand:
single_value.field_interSystemToCDMA2000HandoverCommand->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
case PDU__RRM__NW__MS::ALT_interSystemToEUTRAN__HandoverCommand:
single_value.field_interSystemToEUTRAN__HandoverCommand->check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_NW_MS");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_RRM_Types.PDU_RRM_NW_MS.");
}
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_NW_MS");
}


/* Bodies of functions, altsteps and testcases */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


} /* end of namespace */
