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

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

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

/* Including header files */

#include "MobileL3_RRM_Types.hh"

namespace MobileL3__RRM__Types {

/* Member functions of C++ classes */

SynchronizationIndication__TV::SynchronizationIndication__TV()
{
}

SynchronizationIndication__TV::SynchronizationIndication__TV(const BITSTRING& par_sI,
    const BITSTRING& par_rOT,
    const BITSTRING& par_nCI,
    const BITSTRING& par_elementIdentifier)
  :   field_sI(par_sI),
  field_rOT(par_rOT),
  field_nCI(par_nCI),
  field_elementIdentifier(par_elementIdentifier)
{
}

SynchronizationIndication__TV::SynchronizationIndication__TV(const SynchronizationIndication__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.SynchronizationIndication_TV.");
if (other_value.sI().is_bound()) field_sI = other_value.sI();
else field_sI.clean_up();
if (other_value.rOT().is_bound()) field_rOT = other_value.rOT();
else field_rOT.clean_up();
if (other_value.nCI().is_bound()) field_nCI = other_value.nCI();
else field_nCI.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void SynchronizationIndication__TV::clean_up()
{
field_sI.clean_up();
field_rOT.clean_up();
field_nCI.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* SynchronizationIndication__TV::get_descriptor() const { return &SynchronizationIndication__TV_descr_; }
SynchronizationIndication__TV& SynchronizationIndication__TV::operator=(const SynchronizationIndication__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.SynchronizationIndication_TV.");
  if (other_value.sI().is_bound()) field_sI = other_value.sI();
  else field_sI.clean_up();
  if (other_value.rOT().is_bound()) field_rOT = other_value.rOT();
  else field_rOT.clean_up();
  if (other_value.nCI().is_bound()) field_nCI = other_value.nCI();
  else field_nCI.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean SynchronizationIndication__TV::operator==(const SynchronizationIndication__TV& other_value) const
{
return field_sI==other_value.field_sI
  && field_rOT==other_value.field_rOT
  && field_nCI==other_value.field_nCI
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean SynchronizationIndication__TV::is_bound() const
{
return (field_sI.is_bound())
  || (field_rOT.is_bound())
  || (field_nCI.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean SynchronizationIndication__TV::is_value() const
{
return field_sI.is_value()
  && field_rOT.is_value()
  && field_nCI.is_value()
  && field_elementIdentifier.is_value();
}
void SynchronizationIndication__TV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ sI := ");
field_sI.log();
TTCN_Logger::log_event_str(", rOT := ");
field_rOT.log();
TTCN_Logger::log_event_str(", nCI := ");
field_nCI.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void SynchronizationIndication__TV::set_implicit_omit()
{
if (sI().is_bound()) sI().set_implicit_omit();
if (rOT().is_bound()) rOT().set_implicit_omit();
if (nCI().is_bound()) nCI().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void SynchronizationIndication__TV::encode_text(Text_Buf& text_buf) const
{
field_sI.encode_text(text_buf);
field_rOT.encode_text(text_buf);
field_nCI.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void SynchronizationIndication__TV::decode_text(Text_Buf& text_buf)
{
field_sI.decode_text(text_buf);
field_rOT.decode_text(text_buf);
field_nCI.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

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

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

int SynchronizationIndication__TV::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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_sI.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_rOT.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_nCI.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SynchronizationIndication__TV::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::BIT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  encoded_length += field_sI.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rOT.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_nCI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct SynchronizationIndication__TV_template::single_value_struct {
BITSTRING_template field_sI;
BITSTRING_template field_rOT;
BITSTRING_template field_nCI;
BITSTRING_template field_elementIdentifier;
};

void SynchronizationIndication__TV_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_sI = ANY_VALUE;
single_value->field_rOT = ANY_VALUE;
single_value->field_nCI = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void SynchronizationIndication__TV_template::copy_value(const SynchronizationIndication__TV& other_value)
{
single_value = new single_value_struct;
if (other_value.sI().is_bound()) {
  single_value->field_sI = other_value.sI();
} else {
  single_value->field_sI.clean_up();
}
if (other_value.rOT().is_bound()) {
  single_value->field_rOT = other_value.rOT();
} else {
  single_value->field_rOT.clean_up();
}
if (other_value.nCI().is_bound()) {
  single_value->field_nCI = other_value.nCI();
} else {
  single_value->field_nCI.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

SynchronizationIndication__TV_template::SynchronizationIndication__TV_template()
{
}

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

SynchronizationIndication__TV_template::SynchronizationIndication__TV_template(const SynchronizationIndication__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SynchronizationIndication__TV_template::match(const SynchronizationIndication__TV& 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.sI().is_bound()) return FALSE;
if(!single_value->field_sI.match(other_value.sI(), legacy))return FALSE;
if(!other_value.rOT().is_bound()) return FALSE;
if(!single_value->field_rOT.match(other_value.rOT(), legacy))return FALSE;
if(!other_value.nCI().is_bound()) return FALSE;
if(!single_value->field_nCI.match(other_value.nCI(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.SynchronizationIndication_TV.");
}
return FALSE;
}

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

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

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

SynchronizationIndication__TV SynchronizationIndication__TV_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.SynchronizationIndication_TV.");
SynchronizationIndication__TV ret_val;
if (single_value->field_sI.is_bound()) {
ret_val.sI() = single_value->field_sI.valueof();
}
if (single_value->field_rOT.is_bound()) {
ret_val.rOT() = single_value->field_rOT.valueof();
}
if (single_value->field_nCI.is_bound()) {
ret_val.nCI() = single_value->field_nCI.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& SynchronizationIndication__TV_template::sI()
{
set_specific();
return single_value->field_sI;
}

const BITSTRING_template& SynchronizationIndication__TV_template::sI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI of a non-specific template of type @MobileL3_RRM_Types.SynchronizationIndication_TV.");
return single_value->field_sI;
}

BITSTRING_template& SynchronizationIndication__TV_template::rOT()
{
set_specific();
return single_value->field_rOT;
}

const BITSTRING_template& SynchronizationIndication__TV_template::rOT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rOT of a non-specific template of type @MobileL3_RRM_Types.SynchronizationIndication_TV.");
return single_value->field_rOT;
}

BITSTRING_template& SynchronizationIndication__TV_template::nCI()
{
set_specific();
return single_value->field_nCI;
}

const BITSTRING_template& SynchronizationIndication__TV_template::nCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nCI of a non-specific template of type @MobileL3_RRM_Types.SynchronizationIndication_TV.");
return single_value->field_nCI;
}

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

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

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

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

void SynchronizationIndication__TV_template::log_match(const SynchronizationIndication__TV& 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_sI.match(match_value.sI(), legacy)){
TTCN_Logger::log_logmatch_info(".sI");
single_value->field_sI.log_match(match_value.sI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rOT.match(match_value.rOT(), legacy)){
TTCN_Logger::log_logmatch_info(".rOT");
single_value->field_rOT.log_match(match_value.rOT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nCI.match(match_value.nCI(), legacy)){
TTCN_Logger::log_logmatch_info(".nCI");
single_value->field_nCI.log_match(match_value.nCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ sI := ");
single_value->field_sI.log_match(match_value.sI(), legacy);
TTCN_Logger::log_event_str(", rOT := ");
single_value->field_rOT.log_match(match_value.rOT(), legacy);
TTCN_Logger::log_event_str(", nCI := ");
single_value->field_nCI.log_match(match_value.nCI(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SynchronizationIndication__TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (sI().is_bound()) sI().set_implicit_omit();
if (rOT().is_bound()) rOT().set_implicit_omit();
if (nCI().is_bound()) nCI().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void SynchronizationIndication__TV_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_sI.decode_text(text_buf);
single_value->field_rOT.decode_text(text_buf);
single_value->field_nCI.decode_text(text_buf);
single_value->field_elementIdentifier.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SynchronizationIndication__TV_template[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.SynchronizationIndication_TV.");
}
}

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

void SynchronizationIndication__TV_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_sI.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.SynchronizationIndication_TV");
single_value->field_rOT.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.SynchronizationIndication_TV");
single_value->field_nCI.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.SynchronizationIndication_TV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.SynchronizationIndication_TV");
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.SynchronizationIndication_TV");
}

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

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

TimingAdvance__TV::TimingAdvance__TV()
{
}

TimingAdvance__TV::TimingAdvance__TV(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_valuePart)
  :   field_elementIdentifier(par_elementIdentifier),
  field_valuePart(par_valuePart)
{
}

TimingAdvance__TV::TimingAdvance__TV(const TimingAdvance__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.TimingAdvance_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
else field_valuePart.clean_up();
}

void TimingAdvance__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_valuePart.clean_up();
}

const TTCN_Typedescriptor_t* TimingAdvance__TV::get_descriptor() const { return &TimingAdvance__TV_descr_; }
TimingAdvance__TV& TimingAdvance__TV::operator=(const TimingAdvance__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.TimingAdvance_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.valuePart().is_bound()) field_valuePart = other_value.valuePart();
  else field_valuePart.clean_up();
}
return *this;
}

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

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

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

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

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

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

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

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

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

struct TimingAdvance__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_valuePart;
};

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

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

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

TimingAdvance__TV_template::TimingAdvance__TV_template()
{
}

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

TimingAdvance__TV_template::TimingAdvance__TV_template(const TimingAdvance__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TimingAdvance__TV_template::match(const TimingAdvance__TV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.valuePart().is_bound()) return FALSE;
if(!single_value->field_valuePart.match(other_value.valuePart(), 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.TimingAdvance_TV.");
}
return FALSE;
}

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

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

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

TimingAdvance__TV TimingAdvance__TV_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.TimingAdvance_TV.");
TimingAdvance__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_valuePart.is_bound()) {
ret_val.valuePart() = single_value->field_valuePart.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& TimingAdvance__TV_template::valuePart()
{
set_specific();
return single_value->field_valuePart;
}

const OCTETSTRING_template& TimingAdvance__TV_template::valuePart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valuePart of a non-specific template of type @MobileL3_RRM_Types.TimingAdvance_TV.");
return single_value->field_valuePart;
}

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

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

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

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

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

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

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

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

TMSIP__TMSI__TV::TMSIP__TMSI__TV()
{
}

TMSIP__TMSI__TV::TMSIP__TMSI__TV(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_octet2__5)
  :   field_elementIdentifier(par_elementIdentifier),
  field_octet2__5(par_octet2__5)
{
}

TMSIP__TMSI__TV::TMSIP__TMSI__TV(const TMSIP__TMSI__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.TMSIP_TMSI_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.octet2__5().is_bound()) field_octet2__5 = other_value.octet2__5();
else field_octet2__5.clean_up();
}

void TMSIP__TMSI__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_octet2__5.clean_up();
}

const TTCN_Typedescriptor_t* TMSIP__TMSI__TV::get_descriptor() const { return &TMSIP__TMSI__TV_descr_; }
TMSIP__TMSI__TV& TMSIP__TMSI__TV::operator=(const TMSIP__TMSI__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.TMSIP_TMSI_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.octet2__5().is_bound()) field_octet2__5 = other_value.octet2__5();
  else field_octet2__5.clean_up();
}
return *this;
}

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

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

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

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

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

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

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

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

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

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

struct TMSIP__TMSI__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_octet2__5;
};

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

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

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

TMSIP__TMSI__TV_template::TMSIP__TMSI__TV_template()
{
}

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

TMSIP__TMSI__TV_template::TMSIP__TMSI__TV_template(const TMSIP__TMSI__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TMSIP__TMSI__TV_template::match(const TMSIP__TMSI__TV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.octet2__5().is_bound()) return FALSE;
if(!single_value->field_octet2__5.match(other_value.octet2__5(), 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.TMSIP_TMSI_TV.");
}
return FALSE;
}

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

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

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

TMSIP__TMSI__TV TMSIP__TMSI__TV_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.TMSIP_TMSI_TV.");
TMSIP__TMSI__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_octet2__5.is_bound()) {
ret_val.octet2__5() = single_value->field_octet2__5.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& TMSIP__TMSI__TV_template::octet2__5()
{
set_specific();
return single_value->field_octet2__5;
}

const OCTETSTRING_template& TMSIP__TMSI__TV_template::octet2__5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field octet2_5 of a non-specific template of type @MobileL3_RRM_Types.TMSIP_TMSI_TV.");
return single_value->field_octet2__5;
}

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

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

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

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

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

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

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

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

VGCS__TargetModeIndication__TLV::VGCS__TargetModeIndication__TLV()
{
}

VGCS__TargetModeIndication__TLV::VGCS__TargetModeIndication__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_spare3__2,
    const BITSTRING& par_groupCipherKeyNumber,
    const BITSTRING& par_targetMode)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_spare3__2(par_spare3__2),
  field_groupCipherKeyNumber(par_groupCipherKeyNumber),
  field_targetMode(par_targetMode)
{
}

VGCS__TargetModeIndication__TLV::VGCS__TargetModeIndication__TLV(const VGCS__TargetModeIndication__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.spare3__2().is_bound()) field_spare3__2 = other_value.spare3__2();
else field_spare3__2.clean_up();
if (other_value.groupCipherKeyNumber().is_bound()) field_groupCipherKeyNumber = other_value.groupCipherKeyNumber();
else field_groupCipherKeyNumber.clean_up();
if (other_value.targetMode().is_bound()) field_targetMode = other_value.targetMode();
else field_targetMode.clean_up();
}

void VGCS__TargetModeIndication__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_spare3__2.clean_up();
field_groupCipherKeyNumber.clean_up();
field_targetMode.clean_up();
}

const TTCN_Typedescriptor_t* VGCS__TargetModeIndication__TLV::get_descriptor() const { return &VGCS__TargetModeIndication__TLV_descr_; }
VGCS__TargetModeIndication__TLV& VGCS__TargetModeIndication__TLV::operator=(const VGCS__TargetModeIndication__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.spare3__2().is_bound()) field_spare3__2 = other_value.spare3__2();
  else field_spare3__2.clean_up();
  if (other_value.groupCipherKeyNumber().is_bound()) field_groupCipherKeyNumber = other_value.groupCipherKeyNumber();
  else field_groupCipherKeyNumber.clean_up();
  if (other_value.targetMode().is_bound()) field_targetMode = other_value.targetMode();
  else field_targetMode.clean_up();
}
return *this;
}

boolean VGCS__TargetModeIndication__TLV::operator==(const VGCS__TargetModeIndication__TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_spare3__2==other_value.field_spare3__2
  && field_groupCipherKeyNumber==other_value.field_groupCipherKeyNumber
  && field_targetMode==other_value.field_targetMode;
}

boolean VGCS__TargetModeIndication__TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_spare3__2.is_bound())
  || (field_groupCipherKeyNumber.is_bound())
  || (field_targetMode.is_bound());
}
boolean VGCS__TargetModeIndication__TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_spare3__2.is_value()
  && field_groupCipherKeyNumber.is_value()
  && field_targetMode.is_value();
}
void VGCS__TargetModeIndication__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare3_2 := ");
field_spare3__2.log();
TTCN_Logger::log_event_str(", groupCipherKeyNumber := ");
field_groupCipherKeyNumber.log();
TTCN_Logger::log_event_str(", targetMode := ");
field_targetMode.log();
TTCN_Logger::log_event_str(" }");
}

void VGCS__TargetModeIndication__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare3__2().is_bound()) spare3__2().set_implicit_omit();
if (groupCipherKeyNumber().is_bound()) groupCipherKeyNumber().set_implicit_omit();
if (targetMode().is_bound()) targetMode().set_implicit_omit();
}

void VGCS__TargetModeIndication__TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare3__2().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) groupCipherKeyNumber().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) targetMode().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare3_2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare3__2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "groupCipherKeyNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          groupCipherKeyNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "targetMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          targetMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.VGCS_TargetModeIndication_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV");
  }
}

void VGCS__TargetModeIndication__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_spare3__2.encode_text(text_buf);
field_groupCipherKeyNumber.encode_text(text_buf);
field_targetMode.encode_text(text_buf);
}

void VGCS__TargetModeIndication__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_spare3__2.decode_text(text_buf);
field_groupCipherKeyNumber.decode_text(text_buf);
field_targetMode.decode_text(text_buf);
}

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

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

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

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

struct VGCS__TargetModeIndication__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_spare3__2;
BITSTRING_template field_groupCipherKeyNumber;
BITSTRING_template field_targetMode;
};

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

void VGCS__TargetModeIndication__TLV_template::copy_value(const VGCS__TargetModeIndication__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.spare3__2().is_bound()) {
  single_value->field_spare3__2 = other_value.spare3__2();
} else {
  single_value->field_spare3__2.clean_up();
}
if (other_value.groupCipherKeyNumber().is_bound()) {
  single_value->field_groupCipherKeyNumber = other_value.groupCipherKeyNumber();
} else {
  single_value->field_groupCipherKeyNumber.clean_up();
}
if (other_value.targetMode().is_bound()) {
  single_value->field_targetMode = other_value.targetMode();
} else {
  single_value->field_targetMode.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

VGCS__TargetModeIndication__TLV_template::VGCS__TargetModeIndication__TLV_template()
{
}

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

VGCS__TargetModeIndication__TLV_template::VGCS__TargetModeIndication__TLV_template(const VGCS__TargetModeIndication__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean VGCS__TargetModeIndication__TLV_template::match(const VGCS__TargetModeIndication__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.spare3__2().is_bound()) return FALSE;
if(!single_value->field_spare3__2.match(other_value.spare3__2(), legacy))return FALSE;
if(!other_value.groupCipherKeyNumber().is_bound()) return FALSE;
if(!single_value->field_groupCipherKeyNumber.match(other_value.groupCipherKeyNumber(), legacy))return FALSE;
if(!other_value.targetMode().is_bound()) return FALSE;
if(!single_value->field_targetMode.match(other_value.targetMode(), 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.VGCS_TargetModeIndication_TLV.");
}
return FALSE;
}

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

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

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

VGCS__TargetModeIndication__TLV VGCS__TargetModeIndication__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV.");
VGCS__TargetModeIndication__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_spare3__2.is_bound()) {
ret_val.spare3__2() = single_value->field_spare3__2.valueof();
}
if (single_value->field_groupCipherKeyNumber.is_bound()) {
ret_val.groupCipherKeyNumber() = single_value->field_groupCipherKeyNumber.valueof();
}
if (single_value->field_targetMode.is_bound()) {
ret_val.targetMode() = single_value->field_targetMode.valueof();
}
return ret_val;
}

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

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

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

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

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

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

BITSTRING_template& VGCS__TargetModeIndication__TLV_template::spare3__2()
{
set_specific();
return single_value->field_spare3__2;
}

const BITSTRING_template& VGCS__TargetModeIndication__TLV_template::spare3__2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare3_2 of a non-specific template of type @MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV.");
return single_value->field_spare3__2;
}

BITSTRING_template& VGCS__TargetModeIndication__TLV_template::groupCipherKeyNumber()
{
set_specific();
return single_value->field_groupCipherKeyNumber;
}

const BITSTRING_template& VGCS__TargetModeIndication__TLV_template::groupCipherKeyNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field groupCipherKeyNumber of a non-specific template of type @MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV.");
return single_value->field_groupCipherKeyNumber;
}

BITSTRING_template& VGCS__TargetModeIndication__TLV_template::targetMode()
{
set_specific();
return single_value->field_targetMode;
}

const BITSTRING_template& VGCS__TargetModeIndication__TLV_template::targetMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field targetMode of a non-specific template of type @MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV.");
return single_value->field_targetMode;
}

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

void VGCS__TargetModeIndication__TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare3_2 := ");
single_value->field_spare3__2.log();
TTCN_Logger::log_event_str(", groupCipherKeyNumber := ");
single_value->field_groupCipherKeyNumber.log();
TTCN_Logger::log_event_str(", targetMode := ");
single_value->field_targetMode.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 VGCS__TargetModeIndication__TLV_template::log_match(const VGCS__TargetModeIndication__TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare3__2.match(match_value.spare3__2(), legacy)){
TTCN_Logger::log_logmatch_info(".spare3_2");
single_value->field_spare3__2.log_match(match_value.spare3__2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_groupCipherKeyNumber.match(match_value.groupCipherKeyNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".groupCipherKeyNumber");
single_value->field_groupCipherKeyNumber.log_match(match_value.groupCipherKeyNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_targetMode.match(match_value.targetMode(), legacy)){
TTCN_Logger::log_logmatch_info(".targetMode");
single_value->field_targetMode.log_match(match_value.targetMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", spare3_2 := ");
single_value->field_spare3__2.log_match(match_value.spare3__2(), legacy);
TTCN_Logger::log_event_str(", groupCipherKeyNumber := ");
single_value->field_groupCipherKeyNumber.log_match(match_value.groupCipherKeyNumber(), legacy);
TTCN_Logger::log_event_str(", targetMode := ");
single_value->field_targetMode.log_match(match_value.targetMode(), 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 VGCS__TargetModeIndication__TLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare3__2().is_bound()) spare3__2().set_implicit_omit();
if (groupCipherKeyNumber().is_bound()) groupCipherKeyNumber().set_implicit_omit();
if (targetMode().is_bound()) targetMode().set_implicit_omit();
}

void VGCS__TargetModeIndication__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_spare3__2.encode_text(text_buf);
single_value->field_groupCipherKeyNumber.encode_text(text_buf);
single_value->field_targetMode.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.VGCS_TargetModeIndication_TLV.");
}
}

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

void VGCS__TargetModeIndication__TLV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    VGCS__TargetModeIndication__TLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare3__2().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) groupCipherKeyNumber().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) targetMode().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare3_2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare3__2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "groupCipherKeyNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          groupCipherKeyNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "targetMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          targetMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.VGCS_TargetModeIndication_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    VGCS__TargetModeIndication__TLV_template* precondition = new VGCS__TargetModeIndication__TLV_template;
    precondition->set_param(*param.get_elem(0));
    VGCS__TargetModeIndication__TLV_template* implied_template = new VGCS__TargetModeIndication__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = VGCS__TargetModeIndication__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.VGCS_TargetModeIndication_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

VGCS__Ciphering__Parameters__TLV::VGCS__Ciphering__Parameters__TLV()
{
}

VGCS__Ciphering__Parameters__TLV::VGCS__Ciphering__Parameters__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_cellGlobalCount,
    const BITSTRING& par_b22__Count,
    const BITSTRING& par_cELL__Ind,
    const BITSTRING& par_lAC__Ind,
    const BITSTRING& par_rAND__Ind,
    const BITSTRING& par_spare,
    const OPTIONAL< OCTETSTRING >& par_cellIdentity,
    const OPTIONAL< OCTETSTRING >& par_lAI,
    const OPTIONAL< HEXSTRING >& par_vSTK__RAND,
    const OPTIONAL< BITSTRING >& par_spare2)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_cellGlobalCount(par_cellGlobalCount),
  field_b22__Count(par_b22__Count),
  field_cELL__Ind(par_cELL__Ind),
  field_lAC__Ind(par_lAC__Ind),
  field_rAND__Ind(par_rAND__Ind),
  field_spare(par_spare),
  field_cellIdentity(par_cellIdentity),
  field_lAI(par_lAI),
  field_vSTK__RAND(par_vSTK__RAND),
  field_spare2(par_spare2)
{
}

VGCS__Ciphering__Parameters__TLV::VGCS__Ciphering__Parameters__TLV(const VGCS__Ciphering__Parameters__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.cellGlobalCount().is_bound()) field_cellGlobalCount = other_value.cellGlobalCount();
else field_cellGlobalCount.clean_up();
if (other_value.b22__Count().is_bound()) field_b22__Count = other_value.b22__Count();
else field_b22__Count.clean_up();
if (other_value.cELL__Ind().is_bound()) field_cELL__Ind = other_value.cELL__Ind();
else field_cELL__Ind.clean_up();
if (other_value.lAC__Ind().is_bound()) field_lAC__Ind = other_value.lAC__Ind();
else field_lAC__Ind.clean_up();
if (other_value.rAND__Ind().is_bound()) field_rAND__Ind = other_value.rAND__Ind();
else field_rAND__Ind.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.cellIdentity().is_bound()) field_cellIdentity = other_value.cellIdentity();
else field_cellIdentity.clean_up();
if (other_value.lAI().is_bound()) field_lAI = other_value.lAI();
else field_lAI.clean_up();
if (other_value.vSTK__RAND().is_bound()) field_vSTK__RAND = other_value.vSTK__RAND();
else field_vSTK__RAND.clean_up();
if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
else field_spare2.clean_up();
}

void VGCS__Ciphering__Parameters__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_cellGlobalCount.clean_up();
field_b22__Count.clean_up();
field_cELL__Ind.clean_up();
field_lAC__Ind.clean_up();
field_rAND__Ind.clean_up();
field_spare.clean_up();
field_cellIdentity.clean_up();
field_lAI.clean_up();
field_vSTK__RAND.clean_up();
field_spare2.clean_up();
}

const TTCN_Typedescriptor_t* VGCS__Ciphering__Parameters__TLV::get_descriptor() const { return &VGCS__Ciphering__Parameters__TLV_descr_; }
VGCS__Ciphering__Parameters__TLV& VGCS__Ciphering__Parameters__TLV::operator=(const VGCS__Ciphering__Parameters__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.cellGlobalCount().is_bound()) field_cellGlobalCount = other_value.cellGlobalCount();
  else field_cellGlobalCount.clean_up();
  if (other_value.b22__Count().is_bound()) field_b22__Count = other_value.b22__Count();
  else field_b22__Count.clean_up();
  if (other_value.cELL__Ind().is_bound()) field_cELL__Ind = other_value.cELL__Ind();
  else field_cELL__Ind.clean_up();
  if (other_value.lAC__Ind().is_bound()) field_lAC__Ind = other_value.lAC__Ind();
  else field_lAC__Ind.clean_up();
  if (other_value.rAND__Ind().is_bound()) field_rAND__Ind = other_value.rAND__Ind();
  else field_rAND__Ind.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.cellIdentity().is_bound()) field_cellIdentity = other_value.cellIdentity();
  else field_cellIdentity.clean_up();
  if (other_value.lAI().is_bound()) field_lAI = other_value.lAI();
  else field_lAI.clean_up();
  if (other_value.vSTK__RAND().is_bound()) field_vSTK__RAND = other_value.vSTK__RAND();
  else field_vSTK__RAND.clean_up();
  if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
  else field_spare2.clean_up();
}
return *this;
}

boolean VGCS__Ciphering__Parameters__TLV::operator==(const VGCS__Ciphering__Parameters__TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_cellGlobalCount==other_value.field_cellGlobalCount
  && field_b22__Count==other_value.field_b22__Count
  && field_cELL__Ind==other_value.field_cELL__Ind
  && field_lAC__Ind==other_value.field_lAC__Ind
  && field_rAND__Ind==other_value.field_rAND__Ind
  && field_spare==other_value.field_spare
  && field_cellIdentity==other_value.field_cellIdentity
  && field_lAI==other_value.field_lAI
  && field_vSTK__RAND==other_value.field_vSTK__RAND
  && field_spare2==other_value.field_spare2;
}

boolean VGCS__Ciphering__Parameters__TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_cellGlobalCount.is_bound())
  || (field_b22__Count.is_bound())
  || (field_cELL__Ind.is_bound())
  || (field_lAC__Ind.is_bound())
  || (field_rAND__Ind.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_cellIdentity.get_selection() || field_cellIdentity.is_bound())
  || (OPTIONAL_OMIT == field_lAI.get_selection() || field_lAI.is_bound())
  || (OPTIONAL_OMIT == field_vSTK__RAND.get_selection() || field_vSTK__RAND.is_bound())
  || (OPTIONAL_OMIT == field_spare2.get_selection() || field_spare2.is_bound());
}
boolean VGCS__Ciphering__Parameters__TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_cellGlobalCount.is_value()
  && field_b22__Count.is_value()
  && field_cELL__Ind.is_value()
  && field_lAC__Ind.is_value()
  && field_rAND__Ind.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_cellIdentity.get_selection() || field_cellIdentity.is_value())
  && (OPTIONAL_OMIT == field_lAI.get_selection() || field_lAI.is_value())
  && (OPTIONAL_OMIT == field_vSTK__RAND.get_selection() || field_vSTK__RAND.is_value())
  && (OPTIONAL_OMIT == field_spare2.get_selection() || field_spare2.is_value());
}
int VGCS__Ciphering__Parameters__TLV::size_of() const
{
  int ret_val = 8;
  if (field_cellIdentity.ispresent()) ret_val++;
  if (field_lAI.ispresent()) ret_val++;
  if (field_vSTK__RAND.ispresent()) ret_val++;
  if (field_spare2.ispresent()) ret_val++;
  return ret_val;
}

void VGCS__Ciphering__Parameters__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", cellGlobalCount := ");
field_cellGlobalCount.log();
TTCN_Logger::log_event_str(", b22_Count := ");
field_b22__Count.log();
TTCN_Logger::log_event_str(", cELL_Ind := ");
field_cELL__Ind.log();
TTCN_Logger::log_event_str(", lAC_Ind := ");
field_lAC__Ind.log();
TTCN_Logger::log_event_str(", rAND_Ind := ");
field_rAND__Ind.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", cellIdentity := ");
field_cellIdentity.log();
TTCN_Logger::log_event_str(", lAI := ");
field_lAI.log();
TTCN_Logger::log_event_str(", vSTK_RAND := ");
field_vSTK__RAND.log();
TTCN_Logger::log_event_str(", spare2 := ");
field_spare2.log();
TTCN_Logger::log_event_str(" }");
}

void VGCS__Ciphering__Parameters__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (cellGlobalCount().is_bound()) cellGlobalCount().set_implicit_omit();
if (b22__Count().is_bound()) b22__Count().set_implicit_omit();
if (cELL__Ind().is_bound()) cELL__Ind().set_implicit_omit();
if (lAC__Ind().is_bound()) lAC__Ind().set_implicit_omit();
if (rAND__Ind().is_bound()) rAND__Ind().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!cellIdentity().is_bound()) cellIdentity() = OMIT_VALUE;
else cellIdentity().set_implicit_omit();
if (!lAI().is_bound()) lAI() = OMIT_VALUE;
else lAI().set_implicit_omit();
if (!vSTK__RAND().is_bound()) vSTK__RAND() = OMIT_VALUE;
else vSTK__RAND().set_implicit_omit();
if (!spare2().is_bound()) spare2() = OMIT_VALUE;
else spare2().set_implicit_omit();
}

void VGCS__Ciphering__Parameters__TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (12<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cellGlobalCount().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) b22__Count().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cELL__Ind().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lAC__Ind().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rAND__Ind().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) cellIdentity().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) lAI().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) vSTK__RAND().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) spare2().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellGlobalCount")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellGlobalCount().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "b22_Count")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          b22__Count().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cELL_Ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cELL__Ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lAC_Ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lAC__Ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rAND_Ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rAND__Ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lAI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lAI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vSTK_RAND")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vSTK__RAND().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.VGCS_Ciphering_Parameters_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
  }
}

void VGCS__Ciphering__Parameters__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_cellGlobalCount.encode_text(text_buf);
field_b22__Count.encode_text(text_buf);
field_cELL__Ind.encode_text(text_buf);
field_lAC__Ind.encode_text(text_buf);
field_rAND__Ind.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_cellIdentity.encode_text(text_buf);
field_lAI.encode_text(text_buf);
field_vSTK__RAND.encode_text(text_buf);
field_spare2.encode_text(text_buf);
}

void VGCS__Ciphering__Parameters__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_cellGlobalCount.decode_text(text_buf);
field_b22__Count.decode_text(text_buf);
field_cELL__Ind.decode_text(text_buf);
field_lAC__Ind.decode_text(text_buf);
field_rAND__Ind.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_cellIdentity.decode_text(text_buf);
field_lAI.decode_text(text_buf);
field_vSTK__RAND.decode_text(text_buf);
field_spare2.decode_text(text_buf);
}

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

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

int VGCS__Ciphering__Parameters__TLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, VGCS__Ciphering__Parameters__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(VGCS__Ciphering__Parameters__TLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(VGCS__Ciphering__Parameters__TLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_cellGlobalCount.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_b22__Count.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cELL__Ind.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_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());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_lAC__Ind.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_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());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_rAND__Ind.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_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());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), 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());
  value_of_length_field1 -= decoded_field_length;
  if (limit > 0 && value_of_length_field1 > 0 && field_cELL__Ind ==  bs_0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_cellIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, VGCS__Ciphering__Parameters__TLV_cellIdentity_descr_.raw->forceomit);
  decoded_field_length = field_cellIdentity().RAW_decode(VGCS__Ciphering__Parameters__TLV_cellIdentity_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_cellIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  }
  }
  }
  else field_cellIdentity=OMIT_VALUE;
  if (limit > 0 && value_of_length_field1 > 0 && field_lAC__Ind ==  bs_0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_lAI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, VGCS__Ciphering__Parameters__TLV_lAI_descr_.raw->forceomit);
  decoded_field_length = field_lAI().RAW_decode(VGCS__Ciphering__Parameters__TLV_lAI_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_lAI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  }
  }
  }
  else field_lAI=OMIT_VALUE;
  if (limit > 0 && value_of_length_field1 > 0 && field_rAND__Ind ==  bs_0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_vSTK__RAND = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, VGCS__Ciphering__Parameters__TLV_vSTK__RAND_descr_.raw->forceomit);
  decoded_field_length = field_vSTK__RAND().RAW_decode(VGCS__Ciphering__Parameters__TLV_vSTK__RAND_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_vSTK__RAND = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  }
  }
  }
  else field_vSTK__RAND=OMIT_VALUE;
  if (limit > 0 && value_of_length_field1 > 0 && field_rAND__Ind ==  bs_0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_spare2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, VGCS__Ciphering__Parameters__TLV_spare2_descr_.raw->forceomit);
  decoded_field_length = field_spare2().RAW_decode(VGCS__Ciphering__Parameters__TLV_spare2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_spare2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  }
  }
  }
  else field_spare2=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int VGCS__Ciphering__Parameters__TLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, VGCS__Ciphering__Parameters__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT2_descr_.raw);
  if (field_cellIdentity.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, VGCS__Ciphering__Parameters__TLV_cellIdentity_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_lAI.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, VGCS__Ciphering__Parameters__TLV_lAI_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_vSTK__RAND.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, VGCS__Ciphering__Parameters__TLV_vSTK__RAND_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_spare2.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, VGCS__Ciphering__Parameters__TLV_spare2_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &VGCS__Ciphering__Parameters__TLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 10;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(10);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  if (field_cellIdentity.ispresent()) {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[6].level = myleaf.body.node.nodes[8]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[6].pos = myleaf.body.node.nodes[8]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[6].level = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[6].pos = 0;
  }
  if (field_lAI.ispresent()) {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[7].level = myleaf.body.node.nodes[9]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[7].pos = myleaf.body.node.nodes[9]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[7].level = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[7].pos = 0;
  }
  if (field_vSTK__RAND.ispresent()) {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[8].level = myleaf.body.node.nodes[10]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[8].pos = myleaf.body.node.nodes[10]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[8].level = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[8].pos = 0;
  }
  if (field_spare2.ispresent()) {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[9].level = myleaf.body.node.nodes[11]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[9].pos = myleaf.body.node.nodes[11]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[9].level = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[9].pos = 0;
  }
  encoded_length += field_cellGlobalCount.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_b22__Count.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_cELL__Ind.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_lAC__Ind.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_rAND__Ind.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[7]);
  if (field_cellIdentity.ispresent()) {
  encoded_length += field_cellIdentity().RAW_encode(VGCS__Ciphering__Parameters__TLV_cellIdentity_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_lAI.ispresent()) {
  encoded_length += field_lAI().RAW_encode(VGCS__Ciphering__Parameters__TLV_lAI_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_vSTK__RAND.ispresent()) {
  encoded_length += field_vSTK__RAND().RAW_encode(VGCS__Ciphering__Parameters__TLV_vSTK__RAND_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_spare2.ispresent()) {
  encoded_length += field_spare2().RAW_encode(VGCS__Ciphering__Parameters__TLV_spare2_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_cellIdentity.ispresent() && (field_cELL__Ind !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={4};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*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_lAI.ispresent() && (field_lAC__Ind !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={5};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*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_vSTK__RAND.ispresent() && (field_rAND__Ind !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={6};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*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_spare2.ispresent() && (field_rAND__Ind !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={6};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*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 VGCS__Ciphering__Parameters__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_cellGlobalCount;
BITSTRING_template field_b22__Count;
BITSTRING_template field_cELL__Ind;
BITSTRING_template field_lAC__Ind;
BITSTRING_template field_rAND__Ind;
BITSTRING_template field_spare;
OCTETSTRING_template field_cellIdentity;
OCTETSTRING_template field_lAI;
HEXSTRING_template field_vSTK__RAND;
BITSTRING_template field_spare2;
};

void VGCS__Ciphering__Parameters__TLV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_cellGlobalCount = ANY_VALUE;
single_value->field_b22__Count = ANY_VALUE;
single_value->field_cELL__Ind = ANY_VALUE;
single_value->field_lAC__Ind = ANY_VALUE;
single_value->field_rAND__Ind = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_cellIdentity = ANY_OR_OMIT;
single_value->field_lAI = ANY_OR_OMIT;
single_value->field_vSTK__RAND = ANY_OR_OMIT;
single_value->field_spare2 = ANY_OR_OMIT;
}
}
}

void VGCS__Ciphering__Parameters__TLV_template::copy_value(const VGCS__Ciphering__Parameters__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.cellGlobalCount().is_bound()) {
  single_value->field_cellGlobalCount = other_value.cellGlobalCount();
} else {
  single_value->field_cellGlobalCount.clean_up();
}
if (other_value.b22__Count().is_bound()) {
  single_value->field_b22__Count = other_value.b22__Count();
} else {
  single_value->field_b22__Count.clean_up();
}
if (other_value.cELL__Ind().is_bound()) {
  single_value->field_cELL__Ind = other_value.cELL__Ind();
} else {
  single_value->field_cELL__Ind.clean_up();
}
if (other_value.lAC__Ind().is_bound()) {
  single_value->field_lAC__Ind = other_value.lAC__Ind();
} else {
  single_value->field_lAC__Ind.clean_up();
}
if (other_value.rAND__Ind().is_bound()) {
  single_value->field_rAND__Ind = other_value.rAND__Ind();
} else {
  single_value->field_rAND__Ind.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.cellIdentity().is_bound()) {
  if (other_value.cellIdentity().ispresent()) single_value->field_cellIdentity = other_value.cellIdentity()();
  else single_value->field_cellIdentity = OMIT_VALUE;
} else {
  single_value->field_cellIdentity.clean_up();
}
if (other_value.lAI().is_bound()) {
  if (other_value.lAI().ispresent()) single_value->field_lAI = other_value.lAI()();
  else single_value->field_lAI = OMIT_VALUE;
} else {
  single_value->field_lAI.clean_up();
}
if (other_value.vSTK__RAND().is_bound()) {
  if (other_value.vSTK__RAND().ispresent()) single_value->field_vSTK__RAND = other_value.vSTK__RAND()();
  else single_value->field_vSTK__RAND = OMIT_VALUE;
} else {
  single_value->field_vSTK__RAND.clean_up();
}
if (other_value.spare2().is_bound()) {
  if (other_value.spare2().ispresent()) single_value->field_spare2 = other_value.spare2()();
  else single_value->field_spare2 = OMIT_VALUE;
} else {
  single_value->field_spare2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void VGCS__Ciphering__Parameters__TLV_template::copy_template(const VGCS__Ciphering__Parameters__TLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellGlobalCount().get_selection()) {
single_value->field_cellGlobalCount = other_value.cellGlobalCount();
} else {
single_value->field_cellGlobalCount.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.b22__Count().get_selection()) {
single_value->field_b22__Count = other_value.b22__Count();
} else {
single_value->field_b22__Count.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cELL__Ind().get_selection()) {
single_value->field_cELL__Ind = other_value.cELL__Ind();
} else {
single_value->field_cELL__Ind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lAC__Ind().get_selection()) {
single_value->field_lAC__Ind = other_value.lAC__Ind();
} else {
single_value->field_lAC__Ind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rAND__Ind().get_selection()) {
single_value->field_rAND__Ind = other_value.rAND__Ind();
} else {
single_value->field_rAND__Ind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellIdentity().get_selection()) {
single_value->field_cellIdentity = other_value.cellIdentity();
} else {
single_value->field_cellIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lAI().get_selection()) {
single_value->field_lAI = other_value.lAI();
} else {
single_value->field_lAI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vSTK__RAND().get_selection()) {
single_value->field_vSTK__RAND = other_value.vSTK__RAND();
} else {
single_value->field_vSTK__RAND.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare2().get_selection()) {
single_value->field_spare2 = other_value.spare2();
} else {
single_value->field_spare2.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 VGCS__Ciphering__Parameters__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new VGCS__Ciphering__Parameters__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new VGCS__Ciphering__Parameters__TLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
break;
}
set_selection(other_value);
}

VGCS__Ciphering__Parameters__TLV_template::VGCS__Ciphering__Parameters__TLV_template()
{
}

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

VGCS__Ciphering__Parameters__TLV_template::VGCS__Ciphering__Parameters__TLV_template(const VGCS__Ciphering__Parameters__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean VGCS__Ciphering__Parameters__TLV_template::match(const VGCS__Ciphering__Parameters__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.cellGlobalCount().is_bound()) return FALSE;
if(!single_value->field_cellGlobalCount.match(other_value.cellGlobalCount(), legacy))return FALSE;
if(!other_value.b22__Count().is_bound()) return FALSE;
if(!single_value->field_b22__Count.match(other_value.b22__Count(), legacy))return FALSE;
if(!other_value.cELL__Ind().is_bound()) return FALSE;
if(!single_value->field_cELL__Ind.match(other_value.cELL__Ind(), legacy))return FALSE;
if(!other_value.lAC__Ind().is_bound()) return FALSE;
if(!single_value->field_lAC__Ind.match(other_value.lAC__Ind(), legacy))return FALSE;
if(!other_value.rAND__Ind().is_bound()) return FALSE;
if(!single_value->field_rAND__Ind.match(other_value.rAND__Ind(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.cellIdentity().is_bound()) return FALSE;
if((other_value.cellIdentity().ispresent() ? !single_value->field_cellIdentity.match((const OCTETSTRING&)other_value.cellIdentity(), legacy) : !single_value->field_cellIdentity.match_omit(legacy)))return FALSE;
if(!other_value.lAI().is_bound()) return FALSE;
if((other_value.lAI().ispresent() ? !single_value->field_lAI.match((const OCTETSTRING&)other_value.lAI(), legacy) : !single_value->field_lAI.match_omit(legacy)))return FALSE;
if(!other_value.vSTK__RAND().is_bound()) return FALSE;
if((other_value.vSTK__RAND().ispresent() ? !single_value->field_vSTK__RAND.match((const HEXSTRING&)other_value.vSTK__RAND(), legacy) : !single_value->field_vSTK__RAND.match_omit(legacy)))return FALSE;
if(!other_value.spare2().is_bound()) return FALSE;
if((other_value.spare2().ispresent() ? !single_value->field_spare2.match((const BITSTRING&)other_value.spare2(), legacy) : !single_value->field_spare2.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.VGCS_Ciphering_Parameters_TLV.");
}
return FALSE;
}

boolean VGCS__Ciphering__Parameters__TLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_cellGlobalCount.is_bound()
 || single_value->field_b22__Count.is_bound()
 || single_value->field_cELL__Ind.is_bound()
 || single_value->field_lAC__Ind.is_bound()
 || single_value->field_rAND__Ind.is_bound()
 || single_value->field_spare.is_bound()
 || (single_value->field_cellIdentity.is_omit() || single_value->field_cellIdentity.is_bound())
 || (single_value->field_lAI.is_omit() || single_value->field_lAI.is_bound())
 || (single_value->field_vSTK__RAND.is_omit() || single_value->field_vSTK__RAND.is_bound())
 || (single_value->field_spare2.is_omit() || single_value->field_spare2.is_bound());
}

boolean VGCS__Ciphering__Parameters__TLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_cellGlobalCount.is_value()
 && single_value->field_b22__Count.is_value()
 && single_value->field_cELL__Ind.is_value()
 && single_value->field_lAC__Ind.is_value()
 && single_value->field_rAND__Ind.is_value()
 && single_value->field_spare.is_value()
 && (single_value->field_cellIdentity.is_omit() || single_value->field_cellIdentity.is_value())
 && (single_value->field_lAI.is_omit() || single_value->field_lAI.is_value())
 && (single_value->field_vSTK__RAND.is_omit() || single_value->field_vSTK__RAND.is_value())
 && (single_value->field_spare2.is_omit() || single_value->field_spare2.is_value());
}

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

VGCS__Ciphering__Parameters__TLV VGCS__Ciphering__Parameters__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
VGCS__Ciphering__Parameters__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_cellGlobalCount.is_bound()) {
ret_val.cellGlobalCount() = single_value->field_cellGlobalCount.valueof();
}
if (single_value->field_b22__Count.is_bound()) {
ret_val.b22__Count() = single_value->field_b22__Count.valueof();
}
if (single_value->field_cELL__Ind.is_bound()) {
ret_val.cELL__Ind() = single_value->field_cELL__Ind.valueof();
}
if (single_value->field_lAC__Ind.is_bound()) {
ret_val.lAC__Ind() = single_value->field_lAC__Ind.valueof();
}
if (single_value->field_rAND__Ind.is_bound()) {
ret_val.rAND__Ind() = single_value->field_rAND__Ind.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_cellIdentity.is_omit()) ret_val.cellIdentity() = OMIT_VALUE;
else if (single_value->field_cellIdentity.is_bound()) {
ret_val.cellIdentity() = single_value->field_cellIdentity.valueof();
}
if (single_value->field_lAI.is_omit()) ret_val.lAI() = OMIT_VALUE;
else if (single_value->field_lAI.is_bound()) {
ret_val.lAI() = single_value->field_lAI.valueof();
}
if (single_value->field_vSTK__RAND.is_omit()) ret_val.vSTK__RAND() = OMIT_VALUE;
else if (single_value->field_vSTK__RAND.is_bound()) {
ret_val.vSTK__RAND() = single_value->field_vSTK__RAND.valueof();
}
if (single_value->field_spare2.is_omit()) ret_val.spare2() = OMIT_VALUE;
else if (single_value->field_spare2.is_bound()) {
ret_val.spare2() = single_value->field_spare2.valueof();
}
return ret_val;
}

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

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

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

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

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

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

BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::cellGlobalCount()
{
set_specific();
return single_value->field_cellGlobalCount;
}

const BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::cellGlobalCount() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellGlobalCount of a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
return single_value->field_cellGlobalCount;
}

BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::b22__Count()
{
set_specific();
return single_value->field_b22__Count;
}

const BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::b22__Count() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field b22_Count of a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
return single_value->field_b22__Count;
}

BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::cELL__Ind()
{
set_specific();
return single_value->field_cELL__Ind;
}

const BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::cELL__Ind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cELL_Ind of a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
return single_value->field_cELL__Ind;
}

BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::lAC__Ind()
{
set_specific();
return single_value->field_lAC__Ind;
}

const BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::lAC__Ind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lAC_Ind of a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
return single_value->field_lAC__Ind;
}

BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::rAND__Ind()
{
set_specific();
return single_value->field_rAND__Ind;
}

const BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::rAND__Ind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rAND_Ind of a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
return single_value->field_rAND__Ind;
}

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

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

OCTETSTRING_template& VGCS__Ciphering__Parameters__TLV_template::cellIdentity()
{
set_specific();
return single_value->field_cellIdentity;
}

const OCTETSTRING_template& VGCS__Ciphering__Parameters__TLV_template::cellIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellIdentity of a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
return single_value->field_cellIdentity;
}

OCTETSTRING_template& VGCS__Ciphering__Parameters__TLV_template::lAI()
{
set_specific();
return single_value->field_lAI;
}

const OCTETSTRING_template& VGCS__Ciphering__Parameters__TLV_template::lAI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lAI of a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
return single_value->field_lAI;
}

HEXSTRING_template& VGCS__Ciphering__Parameters__TLV_template::vSTK__RAND()
{
set_specific();
return single_value->field_vSTK__RAND;
}

const HEXSTRING_template& VGCS__Ciphering__Parameters__TLV_template::vSTK__RAND() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vSTK_RAND of a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
return single_value->field_vSTK__RAND;
}

BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::spare2()
{
set_specific();
return single_value->field_spare2;
}

const BITSTRING_template& VGCS__Ciphering__Parameters__TLV_template::spare2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare2 of a non-specific template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
return single_value->field_spare2;
}

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

void VGCS__Ciphering__Parameters__TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", cellGlobalCount := ");
single_value->field_cellGlobalCount.log();
TTCN_Logger::log_event_str(", b22_Count := ");
single_value->field_b22__Count.log();
TTCN_Logger::log_event_str(", cELL_Ind := ");
single_value->field_cELL__Ind.log();
TTCN_Logger::log_event_str(", lAC_Ind := ");
single_value->field_lAC__Ind.log();
TTCN_Logger::log_event_str(", rAND_Ind := ");
single_value->field_rAND__Ind.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", cellIdentity := ");
single_value->field_cellIdentity.log();
TTCN_Logger::log_event_str(", lAI := ");
single_value->field_lAI.log();
TTCN_Logger::log_event_str(", vSTK_RAND := ");
single_value->field_vSTK__RAND.log();
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.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 VGCS__Ciphering__Parameters__TLV_template::log_match(const VGCS__Ciphering__Parameters__TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cellGlobalCount.match(match_value.cellGlobalCount(), legacy)){
TTCN_Logger::log_logmatch_info(".cellGlobalCount");
single_value->field_cellGlobalCount.log_match(match_value.cellGlobalCount(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_b22__Count.match(match_value.b22__Count(), legacy)){
TTCN_Logger::log_logmatch_info(".b22_Count");
single_value->field_b22__Count.log_match(match_value.b22__Count(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cELL__Ind.match(match_value.cELL__Ind(), legacy)){
TTCN_Logger::log_logmatch_info(".cELL_Ind");
single_value->field_cELL__Ind.log_match(match_value.cELL__Ind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lAC__Ind.match(match_value.lAC__Ind(), legacy)){
TTCN_Logger::log_logmatch_info(".lAC_Ind");
single_value->field_lAC__Ind.log_match(match_value.lAC__Ind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rAND__Ind.match(match_value.rAND__Ind(), legacy)){
TTCN_Logger::log_logmatch_info(".rAND_Ind");
single_value->field_rAND__Ind.log_match(match_value.rAND__Ind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cellIdentity().ispresent()){
if(!single_value->field_cellIdentity.match(match_value.cellIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".cellIdentity");
single_value->field_cellIdentity.log_match(match_value.cellIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lAI().ispresent()){
if(!single_value->field_lAI.match(match_value.lAI(), legacy)){
TTCN_Logger::log_logmatch_info(".lAI");
single_value->field_lAI.log_match(match_value.lAI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lAI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lAI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lAI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.vSTK__RAND().ispresent()){
if(!single_value->field_vSTK__RAND.match(match_value.vSTK__RAND(), legacy)){
TTCN_Logger::log_logmatch_info(".vSTK_RAND");
single_value->field_vSTK__RAND.log_match(match_value.vSTK__RAND(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_vSTK__RAND.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".vSTK_RAND := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_vSTK__RAND.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.spare2().ispresent()){
if(!single_value->field_spare2.match(match_value.spare2(), legacy)){
TTCN_Logger::log_logmatch_info(".spare2");
single_value->field_spare2.log_match(match_value.spare2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_spare2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".spare2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_spare2.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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", cellGlobalCount := ");
single_value->field_cellGlobalCount.log_match(match_value.cellGlobalCount(), legacy);
TTCN_Logger::log_event_str(", b22_Count := ");
single_value->field_b22__Count.log_match(match_value.b22__Count(), legacy);
TTCN_Logger::log_event_str(", cELL_Ind := ");
single_value->field_cELL__Ind.log_match(match_value.cELL__Ind(), legacy);
TTCN_Logger::log_event_str(", lAC_Ind := ");
single_value->field_lAC__Ind.log_match(match_value.lAC__Ind(), legacy);
TTCN_Logger::log_event_str(", rAND_Ind := ");
single_value->field_rAND__Ind.log_match(match_value.rAND__Ind(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", cellIdentity := ");
if (match_value.cellIdentity().ispresent()) {
single_value->field_cellIdentity.log_match(match_value.cellIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellIdentity.log();
if (single_value->field_cellIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lAI := ");
if (match_value.lAI().ispresent()) {
single_value->field_lAI.log_match(match_value.lAI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lAI.log();
if (single_value->field_lAI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", vSTK_RAND := ");
if (match_value.vSTK__RAND().ispresent()) {
single_value->field_vSTK__RAND.log_match(match_value.vSTK__RAND(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_vSTK__RAND.log();
if (single_value->field_vSTK__RAND.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", spare2 := ");
if (match_value.spare2().ispresent()) {
single_value->field_spare2.log_match(match_value.spare2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_spare2.log();
if (single_value->field_spare2.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 VGCS__Ciphering__Parameters__TLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (cellGlobalCount().is_bound()) cellGlobalCount().set_implicit_omit();
if (b22__Count().is_bound()) b22__Count().set_implicit_omit();
if (cELL__Ind().is_bound()) cELL__Ind().set_implicit_omit();
if (lAC__Ind().is_bound()) lAC__Ind().set_implicit_omit();
if (rAND__Ind().is_bound()) rAND__Ind().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!cellIdentity().is_bound()) cellIdentity() = OMIT_VALUE;
else cellIdentity().set_implicit_omit();
if (!lAI().is_bound()) lAI() = OMIT_VALUE;
else lAI().set_implicit_omit();
if (!vSTK__RAND().is_bound()) vSTK__RAND() = OMIT_VALUE;
else vSTK__RAND().set_implicit_omit();
if (!spare2().is_bound()) spare2() = OMIT_VALUE;
else spare2().set_implicit_omit();
}

void VGCS__Ciphering__Parameters__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_cellGlobalCount.encode_text(text_buf);
single_value->field_b22__Count.encode_text(text_buf);
single_value->field_cELL__Ind.encode_text(text_buf);
single_value->field_lAC__Ind.encode_text(text_buf);
single_value->field_rAND__Ind.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_cellIdentity.encode_text(text_buf);
single_value->field_lAI.encode_text(text_buf);
single_value->field_vSTK__RAND.encode_text(text_buf);
single_value->field_spare2.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.VGCS_Ciphering_Parameters_TLV.");
}
}

void VGCS__Ciphering__Parameters__TLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_cellGlobalCount.decode_text(text_buf);
single_value->field_b22__Count.decode_text(text_buf);
single_value->field_cELL__Ind.decode_text(text_buf);
single_value->field_lAC__Ind.decode_text(text_buf);
single_value->field_rAND__Ind.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_cellIdentity.decode_text(text_buf);
single_value->field_lAI.decode_text(text_buf);
single_value->field_vSTK__RAND.decode_text(text_buf);
single_value->field_spare2.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 VGCS__Ciphering__Parameters__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV.");
}
}

void VGCS__Ciphering__Parameters__TLV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    VGCS__Ciphering__Parameters__TLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (12<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cellGlobalCount().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) b22__Count().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cELL__Ind().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lAC__Ind().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rAND__Ind().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) cellIdentity().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) lAI().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) vSTK__RAND().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) spare2().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellGlobalCount")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellGlobalCount().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "b22_Count")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          b22__Count().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cELL_Ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cELL__Ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lAC_Ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lAC__Ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rAND_Ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rAND__Ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lAI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lAI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vSTK_RAND")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vSTK__RAND().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.VGCS_Ciphering_Parameters_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    VGCS__Ciphering__Parameters__TLV_template* precondition = new VGCS__Ciphering__Parameters__TLV_template;
    precondition->set_param(*param.get_elem(0));
    VGCS__Ciphering__Parameters__TLV_template* implied_template = new VGCS__Ciphering__Parameters__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = VGCS__Ciphering__Parameters__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void VGCS__Ciphering__Parameters__TLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_cellGlobalCount.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_b22__Count.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_cELL__Ind.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_lAC__Ind.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_rAND__Ind.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_cellIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_lAI.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_vSTK__RAND.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
single_value->field_spare2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.VGCS_Ciphering_Parameters_TLV");
}

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

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

WaitIndication__V::WaitIndication__V()
{
}

WaitIndication__V::WaitIndication__V(const INTEGER& par_t3122__3142TimeoutValue)
  :   field_t3122__3142TimeoutValue(par_t3122__3142TimeoutValue)
{
}

WaitIndication__V::WaitIndication__V(const WaitIndication__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.WaitIndication_V.");
if (other_value.t3122__3142TimeoutValue().is_bound()) field_t3122__3142TimeoutValue = other_value.t3122__3142TimeoutValue();
else field_t3122__3142TimeoutValue.clean_up();
}

void WaitIndication__V::clean_up()
{
field_t3122__3142TimeoutValue.clean_up();
}

const TTCN_Typedescriptor_t* WaitIndication__V::get_descriptor() const { return &WaitIndication__V_descr_; }
WaitIndication__V& WaitIndication__V::operator=(const WaitIndication__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.WaitIndication_V.");
  if (other_value.t3122__3142TimeoutValue().is_bound()) field_t3122__3142TimeoutValue = other_value.t3122__3142TimeoutValue();
  else field_t3122__3142TimeoutValue.clean_up();
}
return *this;
}

boolean WaitIndication__V::operator==(const WaitIndication__V& other_value) const
{
return field_t3122__3142TimeoutValue==other_value.field_t3122__3142TimeoutValue;
}

boolean WaitIndication__V::is_bound() const
{
return (field_t3122__3142TimeoutValue.is_bound());
}
boolean WaitIndication__V::is_value() const
{
return field_t3122__3142TimeoutValue.is_value();
}
void WaitIndication__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ t3122_3142TimeoutValue := ");
field_t3122__3142TimeoutValue.log();
TTCN_Logger::log_event_str(" }");
}

void WaitIndication__V::set_implicit_omit()
{
if (t3122__3142TimeoutValue().is_bound()) t3122__3142TimeoutValue().set_implicit_omit();
}

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

void WaitIndication__V::encode_text(Text_Buf& text_buf) const
{
field_t3122__3142TimeoutValue.encode_text(text_buf);
}

void WaitIndication__V::decode_text(Text_Buf& text_buf)
{
field_t3122__3142TimeoutValue.decode_text(text_buf);
}

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

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

int WaitIndication__V::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, INTEGER_descr_.raw->forceomit);
  decoded_field_length = field_t3122__3142TimeoutValue.RAW_decode(INTEGER_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 WaitIndication__V::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, INTEGER_descr_.raw);
  encoded_length += field_t3122__3142TimeoutValue.RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct WaitIndication__V_template::single_value_struct {
INTEGER_template field_t3122__3142TimeoutValue;
};

void WaitIndication__V_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_t3122__3142TimeoutValue = ANY_VALUE;
}
}
}

void WaitIndication__V_template::copy_value(const WaitIndication__V& other_value)
{
single_value = new single_value_struct;
if (other_value.t3122__3142TimeoutValue().is_bound()) {
  single_value->field_t3122__3142TimeoutValue = other_value.t3122__3142TimeoutValue();
} else {
  single_value->field_t3122__3142TimeoutValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void WaitIndication__V_template::copy_template(const WaitIndication__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.t3122__3142TimeoutValue().get_selection()) {
single_value->field_t3122__3142TimeoutValue = other_value.t3122__3142TimeoutValue();
} else {
single_value->field_t3122__3142TimeoutValue.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 WaitIndication__V_template[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 WaitIndication__V_template(*other_value.implication_.precondition);
implication_.implied_template = new WaitIndication__V_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.WaitIndication_V.");
break;
}
set_selection(other_value);
}

WaitIndication__V_template::WaitIndication__V_template()
{
}

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

WaitIndication__V_template::WaitIndication__V_template(const WaitIndication__V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean WaitIndication__V_template::match(const WaitIndication__V& 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.t3122__3142TimeoutValue().is_bound()) return FALSE;
if(!single_value->field_t3122__3142TimeoutValue.match(other_value.t3122__3142TimeoutValue(), 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.WaitIndication_V.");
}
return FALSE;
}

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

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

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

WaitIndication__V WaitIndication__V_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.WaitIndication_V.");
WaitIndication__V ret_val;
if (single_value->field_t3122__3142TimeoutValue.is_bound()) {
ret_val.t3122__3142TimeoutValue() = single_value->field_t3122__3142TimeoutValue.valueof();
}
return ret_val;
}

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

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

INTEGER_template& WaitIndication__V_template::t3122__3142TimeoutValue()
{
set_specific();
return single_value->field_t3122__3142TimeoutValue;
}

const INTEGER_template& WaitIndication__V_template::t3122__3142TimeoutValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3122_3142TimeoutValue of a non-specific template of type @MobileL3_RRM_Types.WaitIndication_V.");
return single_value->field_t3122__3142TimeoutValue;
}

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

void WaitIndication__V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ t3122_3142TimeoutValue := ");
single_value->field_t3122__3142TimeoutValue.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 WaitIndication__V_template::log_match(const WaitIndication__V& 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_t3122__3142TimeoutValue.match(match_value.t3122__3142TimeoutValue(), legacy)){
TTCN_Logger::log_logmatch_info(".t3122_3142TimeoutValue");
single_value->field_t3122__3142TimeoutValue.log_match(match_value.t3122__3142TimeoutValue(), 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("{ t3122_3142TimeoutValue := ");
single_value->field_t3122__3142TimeoutValue.log_match(match_value.t3122__3142TimeoutValue(), 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 WaitIndication__V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (t3122__3142TimeoutValue().is_bound()) t3122__3142TimeoutValue().set_implicit_omit();
}

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

void WaitIndication__V_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_t3122__3142TimeoutValue.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 WaitIndication__V_template[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.WaitIndication_V.");
}
}

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

void WaitIndication__V_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_t3122__3142TimeoutValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.WaitIndication_V");
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.WaitIndication_V");
}

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

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

APDU__Flags__V::APDU__Flags__V()
{
}

APDU__Flags__V::APDU__Flags__V(const BITSTRING& par_lastSeg,
    const BITSTRING& par_firstSeg,
    const BITSTRING& par_cR,
    const BITSTRING& par_spare)
  :   field_lastSeg(par_lastSeg),
  field_firstSeg(par_firstSeg),
  field_cR(par_cR),
  field_spare(par_spare)
{
}

APDU__Flags__V::APDU__Flags__V(const APDU__Flags__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.APDU_Flags_V.");
if (other_value.lastSeg().is_bound()) field_lastSeg = other_value.lastSeg();
else field_lastSeg.clean_up();
if (other_value.firstSeg().is_bound()) field_firstSeg = other_value.firstSeg();
else field_firstSeg.clean_up();
if (other_value.cR().is_bound()) field_cR = other_value.cR();
else field_cR.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void APDU__Flags__V::clean_up()
{
field_lastSeg.clean_up();
field_firstSeg.clean_up();
field_cR.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* APDU__Flags__V::get_descriptor() const { return &APDU__Flags__V_descr_; }
APDU__Flags__V& APDU__Flags__V::operator=(const APDU__Flags__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.APDU_Flags_V.");
  if (other_value.lastSeg().is_bound()) field_lastSeg = other_value.lastSeg();
  else field_lastSeg.clean_up();
  if (other_value.firstSeg().is_bound()) field_firstSeg = other_value.firstSeg();
  else field_firstSeg.clean_up();
  if (other_value.cR().is_bound()) field_cR = other_value.cR();
  else field_cR.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean APDU__Flags__V::operator==(const APDU__Flags__V& other_value) const
{
return field_lastSeg==other_value.field_lastSeg
  && field_firstSeg==other_value.field_firstSeg
  && field_cR==other_value.field_cR
  && field_spare==other_value.field_spare;
}

boolean APDU__Flags__V::is_bound() const
{
return (field_lastSeg.is_bound())
  || (field_firstSeg.is_bound())
  || (field_cR.is_bound())
  || (field_spare.is_bound());
}
boolean APDU__Flags__V::is_value() const
{
return field_lastSeg.is_value()
  && field_firstSeg.is_value()
  && field_cR.is_value()
  && field_spare.is_value();
}
void APDU__Flags__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lastSeg := ");
field_lastSeg.log();
TTCN_Logger::log_event_str(", firstSeg := ");
field_firstSeg.log();
TTCN_Logger::log_event_str(", cR := ");
field_cR.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void APDU__Flags__V::set_implicit_omit()
{
if (lastSeg().is_bound()) lastSeg().set_implicit_omit();
if (firstSeg().is_bound()) firstSeg().set_implicit_omit();
if (cR().is_bound()) cR().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void APDU__Flags__V::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.APDU_Flags_V 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) lastSeg().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) firstSeg().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cR().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lastSeg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lastSeg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "firstSeg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          firstSeg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.APDU_Flags_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.APDU_Flags_V");
  }
}

void APDU__Flags__V::encode_text(Text_Buf& text_buf) const
{
field_lastSeg.encode_text(text_buf);
field_firstSeg.encode_text(text_buf);
field_cR.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void APDU__Flags__V::decode_text(Text_Buf& text_buf)
{
field_lastSeg.decode_text(text_buf);
field_firstSeg.decode_text(text_buf);
field_cR.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int APDU__Flags__V::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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_lastSeg.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_firstSeg.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cR.RAW_decode(General__Types::BIT1_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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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 APDU__Flags__V::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  encoded_length += field_lastSeg.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_firstSeg.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cR.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct APDU__Flags__V_template::single_value_struct {
BITSTRING_template field_lastSeg;
BITSTRING_template field_firstSeg;
BITSTRING_template field_cR;
BITSTRING_template field_spare;
};

void APDU__Flags__V_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_lastSeg = ANY_VALUE;
single_value->field_firstSeg = ANY_VALUE;
single_value->field_cR = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void APDU__Flags__V_template::copy_value(const APDU__Flags__V& other_value)
{
single_value = new single_value_struct;
if (other_value.lastSeg().is_bound()) {
  single_value->field_lastSeg = other_value.lastSeg();
} else {
  single_value->field_lastSeg.clean_up();
}
if (other_value.firstSeg().is_bound()) {
  single_value->field_firstSeg = other_value.firstSeg();
} else {
  single_value->field_firstSeg.clean_up();
}
if (other_value.cR().is_bound()) {
  single_value->field_cR = other_value.cR();
} else {
  single_value->field_cR.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void APDU__Flags__V_template::copy_template(const APDU__Flags__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lastSeg().get_selection()) {
single_value->field_lastSeg = other_value.lastSeg();
} else {
single_value->field_lastSeg.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.firstSeg().get_selection()) {
single_value->field_firstSeg = other_value.firstSeg();
} else {
single_value->field_firstSeg.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cR().get_selection()) {
single_value->field_cR = other_value.cR();
} else {
single_value->field_cR.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new APDU__Flags__V_template[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 APDU__Flags__V_template(*other_value.implication_.precondition);
implication_.implied_template = new APDU__Flags__V_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.APDU_Flags_V.");
break;
}
set_selection(other_value);
}

APDU__Flags__V_template::APDU__Flags__V_template()
{
}

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

APDU__Flags__V_template::APDU__Flags__V_template(const APDU__Flags__V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean APDU__Flags__V_template::match(const APDU__Flags__V& 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.lastSeg().is_bound()) return FALSE;
if(!single_value->field_lastSeg.match(other_value.lastSeg(), legacy))return FALSE;
if(!other_value.firstSeg().is_bound()) return FALSE;
if(!single_value->field_firstSeg.match(other_value.firstSeg(), legacy))return FALSE;
if(!other_value.cR().is_bound()) return FALSE;
if(!single_value->field_cR.match(other_value.cR(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.APDU_Flags_V.");
}
return FALSE;
}

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

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

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

APDU__Flags__V APDU__Flags__V_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.APDU_Flags_V.");
APDU__Flags__V ret_val;
if (single_value->field_lastSeg.is_bound()) {
ret_val.lastSeg() = single_value->field_lastSeg.valueof();
}
if (single_value->field_firstSeg.is_bound()) {
ret_val.firstSeg() = single_value->field_firstSeg.valueof();
}
if (single_value->field_cR.is_bound()) {
ret_val.cR() = single_value->field_cR.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& APDU__Flags__V_template::lastSeg()
{
set_specific();
return single_value->field_lastSeg;
}

const BITSTRING_template& APDU__Flags__V_template::lastSeg() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lastSeg of a non-specific template of type @MobileL3_RRM_Types.APDU_Flags_V.");
return single_value->field_lastSeg;
}

BITSTRING_template& APDU__Flags__V_template::firstSeg()
{
set_specific();
return single_value->field_firstSeg;
}

const BITSTRING_template& APDU__Flags__V_template::firstSeg() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field firstSeg of a non-specific template of type @MobileL3_RRM_Types.APDU_Flags_V.");
return single_value->field_firstSeg;
}

BITSTRING_template& APDU__Flags__V_template::cR()
{
set_specific();
return single_value->field_cR;
}

const BITSTRING_template& APDU__Flags__V_template::cR() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cR of a non-specific template of type @MobileL3_RRM_Types.APDU_Flags_V.");
return single_value->field_cR;
}

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

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

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

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

void APDU__Flags__V_template::log_match(const APDU__Flags__V& 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_lastSeg.match(match_value.lastSeg(), legacy)){
TTCN_Logger::log_logmatch_info(".lastSeg");
single_value->field_lastSeg.log_match(match_value.lastSeg(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_firstSeg.match(match_value.firstSeg(), legacy)){
TTCN_Logger::log_logmatch_info(".firstSeg");
single_value->field_firstSeg.log_match(match_value.firstSeg(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cR.match(match_value.cR(), legacy)){
TTCN_Logger::log_logmatch_info(".cR");
single_value->field_cR.log_match(match_value.cR(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lastSeg := ");
single_value->field_lastSeg.log_match(match_value.lastSeg(), legacy);
TTCN_Logger::log_event_str(", firstSeg := ");
single_value->field_firstSeg.log_match(match_value.firstSeg(), legacy);
TTCN_Logger::log_event_str(", cR := ");
single_value->field_cR.log_match(match_value.cR(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void APDU__Flags__V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lastSeg().is_bound()) lastSeg().set_implicit_omit();
if (firstSeg().is_bound()) firstSeg().set_implicit_omit();
if (cR().is_bound()) cR().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void APDU__Flags__V_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_lastSeg.decode_text(text_buf);
single_value->field_firstSeg.decode_text(text_buf);
single_value->field_cR.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new APDU__Flags__V_template[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.APDU_Flags_V.");
}
}

void APDU__Flags__V_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: {
    APDU__Flags__V_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.APDU_Flags_V 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) lastSeg().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) firstSeg().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cR().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lastSeg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lastSeg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "firstSeg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          firstSeg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.APDU_Flags_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    APDU__Flags__V_template* precondition = new APDU__Flags__V_template;
    precondition->set_param(*param.get_elem(0));
    APDU__Flags__V_template* implied_template = new APDU__Flags__V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = APDU__Flags__V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.APDU_Flags_V");
  }
  is_ifpresent = param.get_ifpresent();
}

void APDU__Flags__V_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_lastSeg.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.APDU_Flags_V");
single_value->field_firstSeg.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.APDU_Flags_V");
single_value->field_cR.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.APDU_Flags_V");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.APDU_Flags_V");
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.APDU_Flags_V");
}

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

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

APDU__Data__LV::APDU__Data__LV()
{
}

APDU__Data__LV::APDU__Data__LV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_aPDU__DataValue)
  :   field_lengthIndicator(par_lengthIndicator),
  field_aPDU__DataValue(par_aPDU__DataValue)
{
}

APDU__Data__LV::APDU__Data__LV(const APDU__Data__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.APDU_Data_LV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.aPDU__DataValue().is_bound()) field_aPDU__DataValue = other_value.aPDU__DataValue();
else field_aPDU__DataValue.clean_up();
}

void APDU__Data__LV::clean_up()
{
field_lengthIndicator.clean_up();
field_aPDU__DataValue.clean_up();
}

const TTCN_Typedescriptor_t* APDU__Data__LV::get_descriptor() const { return &APDU__Data__LV_descr_; }
APDU__Data__LV& APDU__Data__LV::operator=(const APDU__Data__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.APDU_Data_LV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.aPDU__DataValue().is_bound()) field_aPDU__DataValue = other_value.aPDU__DataValue();
  else field_aPDU__DataValue.clean_up();
}
return *this;
}

boolean APDU__Data__LV::operator==(const APDU__Data__LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_aPDU__DataValue==other_value.field_aPDU__DataValue;
}

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

void APDU__Data__LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (aPDU__DataValue().is_bound()) aPDU__DataValue().set_implicit_omit();
}

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

void APDU__Data__LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_aPDU__DataValue.encode_text(text_buf);
}

void APDU__Data__LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_aPDU__DataValue.decode_text(text_buf);
}

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

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

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

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

struct APDU__Data__LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_aPDU__DataValue;
};

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

void APDU__Data__LV_template::copy_value(const APDU__Data__LV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.aPDU__DataValue().is_bound()) {
  single_value->field_aPDU__DataValue = other_value.aPDU__DataValue();
} else {
  single_value->field_aPDU__DataValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

APDU__Data__LV_template::APDU__Data__LV_template()
{
}

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

APDU__Data__LV_template::APDU__Data__LV_template(const APDU__Data__LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean APDU__Data__LV_template::match(const APDU__Data__LV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.aPDU__DataValue().is_bound()) return FALSE;
if(!single_value->field_aPDU__DataValue.match(other_value.aPDU__DataValue(), 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.APDU_Data_LV.");
}
return FALSE;
}

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

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

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

APDU__Data__LV APDU__Data__LV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.APDU_Data_LV.");
APDU__Data__LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_aPDU__DataValue.is_bound()) {
ret_val.aPDU__DataValue() = single_value->field_aPDU__DataValue.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& APDU__Data__LV_template::aPDU__DataValue()
{
set_specific();
return single_value->field_aPDU__DataValue;
}

const OCTETSTRING_template& APDU__Data__LV_template::aPDU__DataValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aPDU_DataValue of a non-specific template of type @MobileL3_RRM_Types.APDU_Data_LV.");
return single_value->field_aPDU__DataValue;
}

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

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

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

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

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

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

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

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

HandoverToUTRANCommand__LV::HandoverToUTRANCommand__LV()
{
}

HandoverToUTRANCommand__LV::HandoverToUTRANCommand__LV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_handoverToUTRANCommandValue)
  :   field_lengthIndicator(par_lengthIndicator),
  field_handoverToUTRANCommandValue(par_handoverToUTRANCommandValue)
{
}

HandoverToUTRANCommand__LV::HandoverToUTRANCommand__LV(const HandoverToUTRANCommand__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.HandoverToUTRANCommand_LV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.handoverToUTRANCommandValue().is_bound()) field_handoverToUTRANCommandValue = other_value.handoverToUTRANCommandValue();
else field_handoverToUTRANCommandValue.clean_up();
}

void HandoverToUTRANCommand__LV::clean_up()
{
field_lengthIndicator.clean_up();
field_handoverToUTRANCommandValue.clean_up();
}

const TTCN_Typedescriptor_t* HandoverToUTRANCommand__LV::get_descriptor() const { return &HandoverToUTRANCommand__LV_descr_; }
HandoverToUTRANCommand__LV& HandoverToUTRANCommand__LV::operator=(const HandoverToUTRANCommand__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.HandoverToUTRANCommand_LV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.handoverToUTRANCommandValue().is_bound()) field_handoverToUTRANCommandValue = other_value.handoverToUTRANCommandValue();
  else field_handoverToUTRANCommandValue.clean_up();
}
return *this;
}

boolean HandoverToUTRANCommand__LV::operator==(const HandoverToUTRANCommand__LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_handoverToUTRANCommandValue==other_value.field_handoverToUTRANCommandValue;
}

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

void HandoverToUTRANCommand__LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (handoverToUTRANCommandValue().is_bound()) handoverToUTRANCommandValue().set_implicit_omit();
}

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

void HandoverToUTRANCommand__LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_handoverToUTRANCommandValue.encode_text(text_buf);
}

void HandoverToUTRANCommand__LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_handoverToUTRANCommandValue.decode_text(text_buf);
}

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

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

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

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

struct HandoverToUTRANCommand__LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_handoverToUTRANCommandValue;
};

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

void HandoverToUTRANCommand__LV_template::copy_value(const HandoverToUTRANCommand__LV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.handoverToUTRANCommandValue().is_bound()) {
  single_value->field_handoverToUTRANCommandValue = other_value.handoverToUTRANCommandValue();
} else {
  single_value->field_handoverToUTRANCommandValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

HandoverToUTRANCommand__LV_template::HandoverToUTRANCommand__LV_template()
{
}

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

HandoverToUTRANCommand__LV_template::HandoverToUTRANCommand__LV_template(const HandoverToUTRANCommand__LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean HandoverToUTRANCommand__LV_template::match(const HandoverToUTRANCommand__LV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.handoverToUTRANCommandValue().is_bound()) return FALSE;
if(!single_value->field_handoverToUTRANCommandValue.match(other_value.handoverToUTRANCommandValue(), 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.HandoverToUTRANCommand_LV.");
}
return FALSE;
}

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

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

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

HandoverToUTRANCommand__LV HandoverToUTRANCommand__LV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.HandoverToUTRANCommand_LV.");
HandoverToUTRANCommand__LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_handoverToUTRANCommandValue.is_bound()) {
ret_val.handoverToUTRANCommandValue() = single_value->field_handoverToUTRANCommandValue.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& HandoverToUTRANCommand__LV_template::handoverToUTRANCommandValue()
{
set_specific();
return single_value->field_handoverToUTRANCommandValue;
}

const OCTETSTRING_template& HandoverToUTRANCommand__LV_template::handoverToUTRANCommandValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field handoverToUTRANCommandValue of a non-specific template of type @MobileL3_RRM_Types.HandoverToUTRANCommand_LV.");
return single_value->field_handoverToUTRANCommandValue;
}

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

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

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

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

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

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

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

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

HandoverToCDMA2000Command__LV::HandoverToCDMA2000Command__LV()
{
}

HandoverToCDMA2000Command__LV::HandoverToCDMA2000Command__LV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_handoverToCDMA2000CommandValue)
  :   field_lengthIndicator(par_lengthIndicator),
  field_handoverToCDMA2000CommandValue(par_handoverToCDMA2000CommandValue)
{
}

HandoverToCDMA2000Command__LV::HandoverToCDMA2000Command__LV(const HandoverToCDMA2000Command__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.HandoverToCDMA2000Command_LV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.handoverToCDMA2000CommandValue().is_bound()) field_handoverToCDMA2000CommandValue = other_value.handoverToCDMA2000CommandValue();
else field_handoverToCDMA2000CommandValue.clean_up();
}

void HandoverToCDMA2000Command__LV::clean_up()
{
field_lengthIndicator.clean_up();
field_handoverToCDMA2000CommandValue.clean_up();
}

const TTCN_Typedescriptor_t* HandoverToCDMA2000Command__LV::get_descriptor() const { return &HandoverToCDMA2000Command__LV_descr_; }
HandoverToCDMA2000Command__LV& HandoverToCDMA2000Command__LV::operator=(const HandoverToCDMA2000Command__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.HandoverToCDMA2000Command_LV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.handoverToCDMA2000CommandValue().is_bound()) field_handoverToCDMA2000CommandValue = other_value.handoverToCDMA2000CommandValue();
  else field_handoverToCDMA2000CommandValue.clean_up();
}
return *this;
}

boolean HandoverToCDMA2000Command__LV::operator==(const HandoverToCDMA2000Command__LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_handoverToCDMA2000CommandValue==other_value.field_handoverToCDMA2000CommandValue;
}

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

void HandoverToCDMA2000Command__LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (handoverToCDMA2000CommandValue().is_bound()) handoverToCDMA2000CommandValue().set_implicit_omit();
}

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

void HandoverToCDMA2000Command__LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_handoverToCDMA2000CommandValue.encode_text(text_buf);
}

void HandoverToCDMA2000Command__LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_handoverToCDMA2000CommandValue.decode_text(text_buf);
}

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

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

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

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

struct HandoverToCDMA2000Command__LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_handoverToCDMA2000CommandValue;
};

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

void HandoverToCDMA2000Command__LV_template::copy_value(const HandoverToCDMA2000Command__LV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.handoverToCDMA2000CommandValue().is_bound()) {
  single_value->field_handoverToCDMA2000CommandValue = other_value.handoverToCDMA2000CommandValue();
} else {
  single_value->field_handoverToCDMA2000CommandValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

HandoverToCDMA2000Command__LV_template::HandoverToCDMA2000Command__LV_template()
{
}

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

HandoverToCDMA2000Command__LV_template::HandoverToCDMA2000Command__LV_template(const HandoverToCDMA2000Command__LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean HandoverToCDMA2000Command__LV_template::match(const HandoverToCDMA2000Command__LV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.handoverToCDMA2000CommandValue().is_bound()) return FALSE;
if(!single_value->field_handoverToCDMA2000CommandValue.match(other_value.handoverToCDMA2000CommandValue(), 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.HandoverToCDMA2000Command_LV.");
}
return FALSE;
}

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

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

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

HandoverToCDMA2000Command__LV HandoverToCDMA2000Command__LV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.HandoverToCDMA2000Command_LV.");
HandoverToCDMA2000Command__LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_handoverToCDMA2000CommandValue.is_bound()) {
ret_val.handoverToCDMA2000CommandValue() = single_value->field_handoverToCDMA2000CommandValue.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& HandoverToCDMA2000Command__LV_template::handoverToCDMA2000CommandValue()
{
set_specific();
return single_value->field_handoverToCDMA2000CommandValue;
}

const OCTETSTRING_template& HandoverToCDMA2000Command__LV_template::handoverToCDMA2000CommandValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field handoverToCDMA2000CommandValue of a non-specific template of type @MobileL3_RRM_Types.HandoverToCDMA2000Command_LV.");
return single_value->field_handoverToCDMA2000CommandValue;
}

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

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

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

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

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

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

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

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

RadioBearerReconfiguration__LV::RadioBearerReconfiguration__LV()
{
}

RadioBearerReconfiguration__LV::RadioBearerReconfiguration__LV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_radioBearerReconfiguration44118)
  :   field_lengthIndicator(par_lengthIndicator),
  field_radioBearerReconfiguration44118(par_radioBearerReconfiguration44118)
{
}

RadioBearerReconfiguration__LV::RadioBearerReconfiguration__LV(const RadioBearerReconfiguration__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.RadioBearerReconfiguration_LV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.radioBearerReconfiguration44118().is_bound()) field_radioBearerReconfiguration44118 = other_value.radioBearerReconfiguration44118();
else field_radioBearerReconfiguration44118.clean_up();
}

void RadioBearerReconfiguration__LV::clean_up()
{
field_lengthIndicator.clean_up();
field_radioBearerReconfiguration44118.clean_up();
}

const TTCN_Typedescriptor_t* RadioBearerReconfiguration__LV::get_descriptor() const { return &RadioBearerReconfiguration__LV_descr_; }
RadioBearerReconfiguration__LV& RadioBearerReconfiguration__LV::operator=(const RadioBearerReconfiguration__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.RadioBearerReconfiguration_LV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.radioBearerReconfiguration44118().is_bound()) field_radioBearerReconfiguration44118 = other_value.radioBearerReconfiguration44118();
  else field_radioBearerReconfiguration44118.clean_up();
}
return *this;
}

boolean RadioBearerReconfiguration__LV::operator==(const RadioBearerReconfiguration__LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_radioBearerReconfiguration44118==other_value.field_radioBearerReconfiguration44118;
}

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

void RadioBearerReconfiguration__LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (radioBearerReconfiguration44118().is_bound()) radioBearerReconfiguration44118().set_implicit_omit();
}

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

void RadioBearerReconfiguration__LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_radioBearerReconfiguration44118.encode_text(text_buf);
}

void RadioBearerReconfiguration__LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_radioBearerReconfiguration44118.decode_text(text_buf);
}

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

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

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

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

struct RadioBearerReconfiguration__LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_radioBearerReconfiguration44118;
};

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

void RadioBearerReconfiguration__LV_template::copy_value(const RadioBearerReconfiguration__LV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.radioBearerReconfiguration44118().is_bound()) {
  single_value->field_radioBearerReconfiguration44118 = other_value.radioBearerReconfiguration44118();
} else {
  single_value->field_radioBearerReconfiguration44118.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

RadioBearerReconfiguration__LV_template::RadioBearerReconfiguration__LV_template()
{
}

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

RadioBearerReconfiguration__LV_template::RadioBearerReconfiguration__LV_template(const RadioBearerReconfiguration__LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RadioBearerReconfiguration__LV_template::match(const RadioBearerReconfiguration__LV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.radioBearerReconfiguration44118().is_bound()) return FALSE;
if(!single_value->field_radioBearerReconfiguration44118.match(other_value.radioBearerReconfiguration44118(), 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.RadioBearerReconfiguration_LV.");
}
return FALSE;
}

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

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

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

RadioBearerReconfiguration__LV RadioBearerReconfiguration__LV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.RadioBearerReconfiguration_LV.");
RadioBearerReconfiguration__LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_radioBearerReconfiguration44118.is_bound()) {
ret_val.radioBearerReconfiguration44118() = single_value->field_radioBearerReconfiguration44118.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& RadioBearerReconfiguration__LV_template::radioBearerReconfiguration44118()
{
set_specific();
return single_value->field_radioBearerReconfiguration44118;
}

const OCTETSTRING_template& RadioBearerReconfiguration__LV_template::radioBearerReconfiguration44118() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radioBearerReconfiguration44118 of a non-specific template of type @MobileL3_RRM_Types.RadioBearerReconfiguration_LV.");
return single_value->field_radioBearerReconfiguration44118;
}

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

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

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

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

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

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

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

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

ServiceSupport__TV::ServiceSupport__TV()
{
}

ServiceSupport__TV::ServiceSupport__TV(const OCTETSTRING& par_elementIdentifier,
    const BITSTRING& par_mBMS__Broadcast,
    const BITSTRING& par_mBMS__Multicast,
    const BITSTRING& par_spare)
  :   field_elementIdentifier(par_elementIdentifier),
  field_mBMS__Broadcast(par_mBMS__Broadcast),
  field_mBMS__Multicast(par_mBMS__Multicast),
  field_spare(par_spare)
{
}

ServiceSupport__TV::ServiceSupport__TV(const ServiceSupport__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.ServiceSupport_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.mBMS__Broadcast().is_bound()) field_mBMS__Broadcast = other_value.mBMS__Broadcast();
else field_mBMS__Broadcast.clean_up();
if (other_value.mBMS__Multicast().is_bound()) field_mBMS__Multicast = other_value.mBMS__Multicast();
else field_mBMS__Multicast.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void ServiceSupport__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_mBMS__Broadcast.clean_up();
field_mBMS__Multicast.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* ServiceSupport__TV::get_descriptor() const { return &ServiceSupport__TV_descr_; }
ServiceSupport__TV& ServiceSupport__TV::operator=(const ServiceSupport__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.ServiceSupport_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.mBMS__Broadcast().is_bound()) field_mBMS__Broadcast = other_value.mBMS__Broadcast();
  else field_mBMS__Broadcast.clean_up();
  if (other_value.mBMS__Multicast().is_bound()) field_mBMS__Multicast = other_value.mBMS__Multicast();
  else field_mBMS__Multicast.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean ServiceSupport__TV::operator==(const ServiceSupport__TV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_mBMS__Broadcast==other_value.field_mBMS__Broadcast
  && field_mBMS__Multicast==other_value.field_mBMS__Multicast
  && field_spare==other_value.field_spare;
}

boolean ServiceSupport__TV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_mBMS__Broadcast.is_bound())
  || (field_mBMS__Multicast.is_bound())
  || (field_spare.is_bound());
}
boolean ServiceSupport__TV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_mBMS__Broadcast.is_value()
  && field_mBMS__Multicast.is_value()
  && field_spare.is_value();
}
void ServiceSupport__TV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", mBMS_Broadcast := ");
field_mBMS__Broadcast.log();
TTCN_Logger::log_event_str(", mBMS_Multicast := ");
field_mBMS__Multicast.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void ServiceSupport__TV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (mBMS__Broadcast().is_bound()) mBMS__Broadcast().set_implicit_omit();
if (mBMS__Multicast().is_bound()) mBMS__Multicast().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void ServiceSupport__TV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_mBMS__Broadcast.encode_text(text_buf);
field_mBMS__Multicast.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void ServiceSupport__TV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_mBMS__Broadcast.decode_text(text_buf);
field_mBMS__Multicast.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

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

struct ServiceSupport__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
BITSTRING_template field_mBMS__Broadcast;
BITSTRING_template field_mBMS__Multicast;
BITSTRING_template field_spare;
};

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

void ServiceSupport__TV_template::copy_value(const ServiceSupport__TV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.mBMS__Broadcast().is_bound()) {
  single_value->field_mBMS__Broadcast = other_value.mBMS__Broadcast();
} else {
  single_value->field_mBMS__Broadcast.clean_up();
}
if (other_value.mBMS__Multicast().is_bound()) {
  single_value->field_mBMS__Multicast = other_value.mBMS__Multicast();
} else {
  single_value->field_mBMS__Multicast.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

ServiceSupport__TV_template::ServiceSupport__TV_template()
{
}

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

ServiceSupport__TV_template::ServiceSupport__TV_template(const ServiceSupport__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

ServiceSupport__TV ServiceSupport__TV_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.ServiceSupport_TV.");
ServiceSupport__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_mBMS__Broadcast.is_bound()) {
ret_val.mBMS__Broadcast() = single_value->field_mBMS__Broadcast.valueof();
}
if (single_value->field_mBMS__Multicast.is_bound()) {
ret_val.mBMS__Multicast() = single_value->field_mBMS__Multicast.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

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

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

BITSTRING_template& ServiceSupport__TV_template::mBMS__Broadcast()
{
set_specific();
return single_value->field_mBMS__Broadcast;
}

const BITSTRING_template& ServiceSupport__TV_template::mBMS__Broadcast() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Broadcast of a non-specific template of type @MobileL3_RRM_Types.ServiceSupport_TV.");
return single_value->field_mBMS__Broadcast;
}

BITSTRING_template& ServiceSupport__TV_template::mBMS__Multicast()
{
set_specific();
return single_value->field_mBMS__Multicast;
}

const BITSTRING_template& ServiceSupport__TV_template::mBMS__Multicast() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Multicast of a non-specific template of type @MobileL3_RRM_Types.ServiceSupport_TV.");
return single_value->field_mBMS__Multicast;
}

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

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

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

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

void ServiceSupport__TV_template::log_match(const ServiceSupport__TV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mBMS__Broadcast.match(match_value.mBMS__Broadcast(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Broadcast");
single_value->field_mBMS__Broadcast.log_match(match_value.mBMS__Broadcast(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mBMS__Multicast.match(match_value.mBMS__Multicast(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Multicast");
single_value->field_mBMS__Multicast.log_match(match_value.mBMS__Multicast(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", mBMS_Broadcast := ");
single_value->field_mBMS__Broadcast.log_match(match_value.mBMS__Broadcast(), legacy);
TTCN_Logger::log_event_str(", mBMS_Multicast := ");
single_value->field_mBMS__Multicast.log_match(match_value.mBMS__Multicast(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void ServiceSupport__TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (mBMS__Broadcast().is_bound()) mBMS__Broadcast().set_implicit_omit();
if (mBMS__Multicast().is_bound()) mBMS__Multicast().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

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

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

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

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

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

ServiceSupport__V::ServiceSupport__V()
{
}

ServiceSupport__V::ServiceSupport__V(const BITSTRING& par_mBMS__Broadcast,
    const BITSTRING& par_mBMS__Multicast,
    const BITSTRING& par_spare)
  :   field_mBMS__Broadcast(par_mBMS__Broadcast),
  field_mBMS__Multicast(par_mBMS__Multicast),
  field_spare(par_spare)
{
}

ServiceSupport__V::ServiceSupport__V(const ServiceSupport__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.ServiceSupport_V.");
if (other_value.mBMS__Broadcast().is_bound()) field_mBMS__Broadcast = other_value.mBMS__Broadcast();
else field_mBMS__Broadcast.clean_up();
if (other_value.mBMS__Multicast().is_bound()) field_mBMS__Multicast = other_value.mBMS__Multicast();
else field_mBMS__Multicast.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void ServiceSupport__V::clean_up()
{
field_mBMS__Broadcast.clean_up();
field_mBMS__Multicast.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* ServiceSupport__V::get_descriptor() const { return &ServiceSupport__V_descr_; }
ServiceSupport__V& ServiceSupport__V::operator=(const ServiceSupport__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.ServiceSupport_V.");
  if (other_value.mBMS__Broadcast().is_bound()) field_mBMS__Broadcast = other_value.mBMS__Broadcast();
  else field_mBMS__Broadcast.clean_up();
  if (other_value.mBMS__Multicast().is_bound()) field_mBMS__Multicast = other_value.mBMS__Multicast();
  else field_mBMS__Multicast.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean ServiceSupport__V::operator==(const ServiceSupport__V& other_value) const
{
return field_mBMS__Broadcast==other_value.field_mBMS__Broadcast
  && field_mBMS__Multicast==other_value.field_mBMS__Multicast
  && field_spare==other_value.field_spare;
}

boolean ServiceSupport__V::is_bound() const
{
return (field_mBMS__Broadcast.is_bound())
  || (field_mBMS__Multicast.is_bound())
  || (field_spare.is_bound());
}
boolean ServiceSupport__V::is_value() const
{
return field_mBMS__Broadcast.is_value()
  && field_mBMS__Multicast.is_value()
  && field_spare.is_value();
}
void ServiceSupport__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ mBMS_Broadcast := ");
field_mBMS__Broadcast.log();
TTCN_Logger::log_event_str(", mBMS_Multicast := ");
field_mBMS__Multicast.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void ServiceSupport__V::set_implicit_omit()
{
if (mBMS__Broadcast().is_bound()) mBMS__Broadcast().set_implicit_omit();
if (mBMS__Multicast().is_bound()) mBMS__Multicast().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void ServiceSupport__V::encode_text(Text_Buf& text_buf) const
{
field_mBMS__Broadcast.encode_text(text_buf);
field_mBMS__Multicast.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void ServiceSupport__V::decode_text(Text_Buf& text_buf)
{
field_mBMS__Broadcast.decode_text(text_buf);
field_mBMS__Multicast.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int ServiceSupport__V::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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__Broadcast.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__Multicast.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT6_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 ServiceSupport__V::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT6_descr_.raw);
  encoded_length += field_mBMS__Broadcast.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mBMS__Multicast.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct ServiceSupport__V_template::single_value_struct {
BITSTRING_template field_mBMS__Broadcast;
BITSTRING_template field_mBMS__Multicast;
BITSTRING_template field_spare;
};

void ServiceSupport__V_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_mBMS__Broadcast = ANY_VALUE;
single_value->field_mBMS__Multicast = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void ServiceSupport__V_template::copy_value(const ServiceSupport__V& other_value)
{
single_value = new single_value_struct;
if (other_value.mBMS__Broadcast().is_bound()) {
  single_value->field_mBMS__Broadcast = other_value.mBMS__Broadcast();
} else {
  single_value->field_mBMS__Broadcast.clean_up();
}
if (other_value.mBMS__Multicast().is_bound()) {
  single_value->field_mBMS__Multicast = other_value.mBMS__Multicast();
} else {
  single_value->field_mBMS__Multicast.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ServiceSupport__V_template::copy_template(const ServiceSupport__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__Broadcast().get_selection()) {
single_value->field_mBMS__Broadcast = other_value.mBMS__Broadcast();
} else {
single_value->field_mBMS__Broadcast.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__Multicast().get_selection()) {
single_value->field_mBMS__Multicast = other_value.mBMS__Multicast();
} else {
single_value->field_mBMS__Multicast.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ServiceSupport__V_template[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 ServiceSupport__V_template(*other_value.implication_.precondition);
implication_.implied_template = new ServiceSupport__V_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.ServiceSupport_V.");
break;
}
set_selection(other_value);
}

ServiceSupport__V_template::ServiceSupport__V_template()
{
}

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

ServiceSupport__V_template::ServiceSupport__V_template(const ServiceSupport__V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ServiceSupport__V_template::match(const ServiceSupport__V& 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.mBMS__Broadcast().is_bound()) return FALSE;
if(!single_value->field_mBMS__Broadcast.match(other_value.mBMS__Broadcast(), legacy))return FALSE;
if(!other_value.mBMS__Multicast().is_bound()) return FALSE;
if(!single_value->field_mBMS__Multicast.match(other_value.mBMS__Multicast(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.ServiceSupport_V.");
}
return FALSE;
}

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

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

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

ServiceSupport__V ServiceSupport__V_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.ServiceSupport_V.");
ServiceSupport__V ret_val;
if (single_value->field_mBMS__Broadcast.is_bound()) {
ret_val.mBMS__Broadcast() = single_value->field_mBMS__Broadcast.valueof();
}
if (single_value->field_mBMS__Multicast.is_bound()) {
ret_val.mBMS__Multicast() = single_value->field_mBMS__Multicast.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& ServiceSupport__V_template::mBMS__Broadcast()
{
set_specific();
return single_value->field_mBMS__Broadcast;
}

const BITSTRING_template& ServiceSupport__V_template::mBMS__Broadcast() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Broadcast of a non-specific template of type @MobileL3_RRM_Types.ServiceSupport_V.");
return single_value->field_mBMS__Broadcast;
}

BITSTRING_template& ServiceSupport__V_template::mBMS__Multicast()
{
set_specific();
return single_value->field_mBMS__Multicast;
}

const BITSTRING_template& ServiceSupport__V_template::mBMS__Multicast() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Multicast of a non-specific template of type @MobileL3_RRM_Types.ServiceSupport_V.");
return single_value->field_mBMS__Multicast;
}

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

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

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

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

void ServiceSupport__V_template::log_match(const ServiceSupport__V& 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_mBMS__Broadcast.match(match_value.mBMS__Broadcast(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Broadcast");
single_value->field_mBMS__Broadcast.log_match(match_value.mBMS__Broadcast(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mBMS__Multicast.match(match_value.mBMS__Multicast(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Multicast");
single_value->field_mBMS__Multicast.log_match(match_value.mBMS__Multicast(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ mBMS_Broadcast := ");
single_value->field_mBMS__Broadcast.log_match(match_value.mBMS__Broadcast(), legacy);
TTCN_Logger::log_event_str(", mBMS_Multicast := ");
single_value->field_mBMS__Multicast.log_match(match_value.mBMS__Multicast(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void ServiceSupport__V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (mBMS__Broadcast().is_bound()) mBMS__Broadcast().set_implicit_omit();
if (mBMS__Multicast().is_bound()) mBMS__Multicast().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void ServiceSupport__V_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_mBMS__Broadcast.decode_text(text_buf);
single_value->field_mBMS__Multicast.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ServiceSupport__V_template[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.ServiceSupport_V.");
}
}

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

void ServiceSupport__V_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_mBMS__Broadcast.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.ServiceSupport_V");
single_value->field_mBMS__Multicast.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.ServiceSupport_V");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.ServiceSupport_V");
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.ServiceSupport_V");
}

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

boolean ServiceSupport__V_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__ptm__ChannelDescription__TLV::MBMS__ptm__ChannelDescription__TLV()
{
}

MBMS__ptm__ChannelDescription__TLV::MBMS__ptm__ChannelDescription__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_mMS__ptm__ChannelDescriptionValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_mMS__ptm__ChannelDescriptionValue(par_mMS__ptm__ChannelDescriptionValue)
{
}

MBMS__ptm__ChannelDescription__TLV::MBMS__ptm__ChannelDescription__TLV(const MBMS__ptm__ChannelDescription__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.MBMS_ptm_ChannelDescription_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mMS__ptm__ChannelDescriptionValue().is_bound()) field_mMS__ptm__ChannelDescriptionValue = other_value.mMS__ptm__ChannelDescriptionValue();
else field_mMS__ptm__ChannelDescriptionValue.clean_up();
}

void MBMS__ptm__ChannelDescription__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_mMS__ptm__ChannelDescriptionValue.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__ptm__ChannelDescription__TLV::get_descriptor() const { return &MBMS__ptm__ChannelDescription__TLV_descr_; }
MBMS__ptm__ChannelDescription__TLV& MBMS__ptm__ChannelDescription__TLV::operator=(const MBMS__ptm__ChannelDescription__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.MBMS_ptm_ChannelDescription_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mMS__ptm__ChannelDescriptionValue().is_bound()) field_mMS__ptm__ChannelDescriptionValue = other_value.mMS__ptm__ChannelDescriptionValue();
  else field_mMS__ptm__ChannelDescriptionValue.clean_up();
}
return *this;
}

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

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

void MBMS__ptm__ChannelDescription__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mMS__ptm__ChannelDescriptionValue().is_bound()) mMS__ptm__ChannelDescriptionValue().set_implicit_omit();
}

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

void MBMS__ptm__ChannelDescription__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mMS__ptm__ChannelDescriptionValue.encode_text(text_buf);
}

void MBMS__ptm__ChannelDescription__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mMS__ptm__ChannelDescriptionValue.decode_text(text_buf);
}

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

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

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

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

struct MBMS__ptm__ChannelDescription__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_mMS__ptm__ChannelDescriptionValue;
};

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

void MBMS__ptm__ChannelDescription__TLV_template::copy_value(const MBMS__ptm__ChannelDescription__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mMS__ptm__ChannelDescriptionValue().is_bound()) {
  single_value->field_mMS__ptm__ChannelDescriptionValue = other_value.mMS__ptm__ChannelDescriptionValue();
} else {
  single_value->field_mMS__ptm__ChannelDescriptionValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

MBMS__ptm__ChannelDescription__TLV_template::MBMS__ptm__ChannelDescription__TLV_template()
{
}

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

MBMS__ptm__ChannelDescription__TLV_template::MBMS__ptm__ChannelDescription__TLV_template(const MBMS__ptm__ChannelDescription__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

MBMS__ptm__ChannelDescription__TLV MBMS__ptm__ChannelDescription__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.MBMS_ptm_ChannelDescription_TLV.");
MBMS__ptm__ChannelDescription__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mMS__ptm__ChannelDescriptionValue.is_bound()) {
ret_val.mMS__ptm__ChannelDescriptionValue() = single_value->field_mMS__ptm__ChannelDescriptionValue.valueof();
}
return ret_val;
}

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

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

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

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

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

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

OCTETSTRING_template& MBMS__ptm__ChannelDescription__TLV_template::mMS__ptm__ChannelDescriptionValue()
{
set_specific();
return single_value->field_mMS__ptm__ChannelDescriptionValue;
}

const OCTETSTRING_template& MBMS__ptm__ChannelDescription__TLV_template::mMS__ptm__ChannelDescriptionValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mMS_ptm_ChannelDescriptionValue of a non-specific template of type @MobileL3_RRM_Types.MBMS_ptm_ChannelDescription_TLV.");
return single_value->field_mMS__ptm__ChannelDescriptionValue;
}

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

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

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

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

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

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

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

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

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

MBMS__SessionParameterList__TLV::MBMS__SessionParameterList__TLV()
{
}

MBMS__SessionParameterList__TLV::MBMS__SessionParameterList__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_mBMS__SessionParameterListValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_mBMS__SessionParameterListValue(par_mBMS__SessionParameterListValue)
{
}

MBMS__SessionParameterList__TLV::MBMS__SessionParameterList__TLV(const MBMS__SessionParameterList__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.MBMS_SessionParameterList_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mBMS__SessionParameterListValue().is_bound()) field_mBMS__SessionParameterListValue = other_value.mBMS__SessionParameterListValue();
else field_mBMS__SessionParameterListValue.clean_up();
}

void MBMS__SessionParameterList__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_mBMS__SessionParameterListValue.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__SessionParameterList__TLV::get_descriptor() const { return &MBMS__SessionParameterList__TLV_descr_; }
MBMS__SessionParameterList__TLV& MBMS__SessionParameterList__TLV::operator=(const MBMS__SessionParameterList__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.MBMS_SessionParameterList_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mBMS__SessionParameterListValue().is_bound()) field_mBMS__SessionParameterListValue = other_value.mBMS__SessionParameterListValue();
  else field_mBMS__SessionParameterListValue.clean_up();
}
return *this;
}

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

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

void MBMS__SessionParameterList__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mBMS__SessionParameterListValue().is_bound()) mBMS__SessionParameterListValue().set_implicit_omit();
}

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

void MBMS__SessionParameterList__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mBMS__SessionParameterListValue.encode_text(text_buf);
}

void MBMS__SessionParameterList__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mBMS__SessionParameterListValue.decode_text(text_buf);
}

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

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

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

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

struct MBMS__SessionParameterList__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_mBMS__SessionParameterListValue;
};

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

void MBMS__SessionParameterList__TLV_template::copy_value(const MBMS__SessionParameterList__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mBMS__SessionParameterListValue().is_bound()) {
  single_value->field_mBMS__SessionParameterListValue = other_value.mBMS__SessionParameterListValue();
} else {
  single_value->field_mBMS__SessionParameterListValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

MBMS__SessionParameterList__TLV_template::MBMS__SessionParameterList__TLV_template()
{
}

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

MBMS__SessionParameterList__TLV_template::MBMS__SessionParameterList__TLV_template(const MBMS__SessionParameterList__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

MBMS__SessionParameterList__TLV MBMS__SessionParameterList__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.MBMS_SessionParameterList_TLV.");
MBMS__SessionParameterList__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mBMS__SessionParameterListValue.is_bound()) {
ret_val.mBMS__SessionParameterListValue() = single_value->field_mBMS__SessionParameterListValue.valueof();
}
return ret_val;
}

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

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

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

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

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

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

OCTETSTRING_template& MBMS__SessionParameterList__TLV_template::mBMS__SessionParameterListValue()
{
set_specific();
return single_value->field_mBMS__SessionParameterListValue;
}

const OCTETSTRING_template& MBMS__SessionParameterList__TLV_template::mBMS__SessionParameterListValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_SessionParameterListValue of a non-specific template of type @MobileL3_RRM_Types.MBMS_SessionParameterList_TLV.");
return single_value->field_mBMS__SessionParameterListValue;
}

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

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

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

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

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

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

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

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

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

DedicatedServiceInformation__TV::DedicatedServiceInformation__TV()
{
}

DedicatedServiceInformation__TV::DedicatedServiceInformation__TV(const OCTETSTRING& par_elementIdentifier,
    const BITSTRING& par_sIS,
    const BITSTRING& par_spare)
  :   field_elementIdentifier(par_elementIdentifier),
  field_sIS(par_sIS),
  field_spare(par_spare)
{
}

DedicatedServiceInformation__TV::DedicatedServiceInformation__TV(const DedicatedServiceInformation__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.DedicatedServiceInformation_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.sIS().is_bound()) field_sIS = other_value.sIS();
else field_sIS.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void DedicatedServiceInformation__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_sIS.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* DedicatedServiceInformation__TV::get_descriptor() const { return &DedicatedServiceInformation__TV_descr_; }
DedicatedServiceInformation__TV& DedicatedServiceInformation__TV::operator=(const DedicatedServiceInformation__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.DedicatedServiceInformation_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.sIS().is_bound()) field_sIS = other_value.sIS();
  else field_sIS.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean DedicatedServiceInformation__TV::operator==(const DedicatedServiceInformation__TV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_sIS==other_value.field_sIS
  && field_spare==other_value.field_spare;
}

boolean DedicatedServiceInformation__TV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_sIS.is_bound())
  || (field_spare.is_bound());
}
boolean DedicatedServiceInformation__TV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_sIS.is_value()
  && field_spare.is_value();
}
void DedicatedServiceInformation__TV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", sIS := ");
field_sIS.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void DedicatedServiceInformation__TV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (sIS().is_bound()) sIS().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void DedicatedServiceInformation__TV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_sIS.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void DedicatedServiceInformation__TV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_sIS.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

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

struct DedicatedServiceInformation__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
BITSTRING_template field_sIS;
BITSTRING_template field_spare;
};

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

void DedicatedServiceInformation__TV_template::copy_value(const DedicatedServiceInformation__TV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.sIS().is_bound()) {
  single_value->field_sIS = other_value.sIS();
} else {
  single_value->field_sIS.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

DedicatedServiceInformation__TV_template::DedicatedServiceInformation__TV_template()
{
}

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

DedicatedServiceInformation__TV_template::DedicatedServiceInformation__TV_template(const DedicatedServiceInformation__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

DedicatedServiceInformation__TV DedicatedServiceInformation__TV_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.DedicatedServiceInformation_TV.");
DedicatedServiceInformation__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_sIS.is_bound()) {
ret_val.sIS() = single_value->field_sIS.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

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

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

BITSTRING_template& DedicatedServiceInformation__TV_template::sIS()
{
set_specific();
return single_value->field_sIS;
}

const BITSTRING_template& DedicatedServiceInformation__TV_template::sIS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sIS of a non-specific template of type @MobileL3_RRM_Types.DedicatedServiceInformation_TV.");
return single_value->field_sIS;
}

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

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

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

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

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

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

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

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

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

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

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

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

MPRACH__Description__TLV::MPRACH__Description__TLV()
{
}

MPRACH__Description__TLV::MPRACH__Description__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_mPRACH__DescriptionValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_mPRACH__DescriptionValue(par_mPRACH__DescriptionValue)
{
}

MPRACH__Description__TLV::MPRACH__Description__TLV(const MPRACH__Description__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.MPRACH_Description_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mPRACH__DescriptionValue().is_bound()) field_mPRACH__DescriptionValue = other_value.mPRACH__DescriptionValue();
else field_mPRACH__DescriptionValue.clean_up();
}

void MPRACH__Description__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_mPRACH__DescriptionValue.clean_up();
}

const TTCN_Typedescriptor_t* MPRACH__Description__TLV::get_descriptor() const { return &MPRACH__Description__TLV_descr_; }
MPRACH__Description__TLV& MPRACH__Description__TLV::operator=(const MPRACH__Description__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.MPRACH_Description_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mPRACH__DescriptionValue().is_bound()) field_mPRACH__DescriptionValue = other_value.mPRACH__DescriptionValue();
  else field_mPRACH__DescriptionValue.clean_up();
}
return *this;
}

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

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

void MPRACH__Description__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mPRACH__DescriptionValue().is_bound()) mPRACH__DescriptionValue().set_implicit_omit();
}

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

void MPRACH__Description__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mPRACH__DescriptionValue.encode_text(text_buf);
}

void MPRACH__Description__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mPRACH__DescriptionValue.decode_text(text_buf);
}

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

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

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

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

struct MPRACH__Description__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_mPRACH__DescriptionValue;
};

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

void MPRACH__Description__TLV_template::copy_value(const MPRACH__Description__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mPRACH__DescriptionValue().is_bound()) {
  single_value->field_mPRACH__DescriptionValue = other_value.mPRACH__DescriptionValue();
} else {
  single_value->field_mPRACH__DescriptionValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

MPRACH__Description__TLV_template::MPRACH__Description__TLV_template()
{
}

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

MPRACH__Description__TLV_template::MPRACH__Description__TLV_template(const MPRACH__Description__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

MPRACH__Description__TLV MPRACH__Description__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.MPRACH_Description_TLV.");
MPRACH__Description__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mPRACH__DescriptionValue.is_bound()) {
ret_val.mPRACH__DescriptionValue() = single_value->field_mPRACH__DescriptionValue.valueof();
}
return ret_val;
}

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

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

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

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

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

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

OCTETSTRING_template& MPRACH__Description__TLV_template::mPRACH__DescriptionValue()
{
set_specific();
return single_value->field_mPRACH__DescriptionValue;
}

const OCTETSTRING_template& MPRACH__Description__TLV_template::mPRACH__DescriptionValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mPRACH_DescriptionValue of a non-specific template of type @MobileL3_RRM_Types.MPRACH_Description_TLV.");
return single_value->field_mPRACH__DescriptionValue;
}

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

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

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

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

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

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

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

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

RestrictionTimer__TV::RestrictionTimer__TV()
{
}

RestrictionTimer__TV::RestrictionTimer__TV(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_restrictionTimerValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_restrictionTimerValue(par_restrictionTimerValue)
{
}

RestrictionTimer__TV::RestrictionTimer__TV(const RestrictionTimer__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.RestrictionTimer_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.restrictionTimerValue().is_bound()) field_restrictionTimerValue = other_value.restrictionTimerValue();
else field_restrictionTimerValue.clean_up();
}

void RestrictionTimer__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_restrictionTimerValue.clean_up();
}

const TTCN_Typedescriptor_t* RestrictionTimer__TV::get_descriptor() const { return &RestrictionTimer__TV_descr_; }
RestrictionTimer__TV& RestrictionTimer__TV::operator=(const RestrictionTimer__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.RestrictionTimer_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.restrictionTimerValue().is_bound()) field_restrictionTimerValue = other_value.restrictionTimerValue();
  else field_restrictionTimerValue.clean_up();
}
return *this;
}

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

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

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

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

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

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

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

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

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

struct RestrictionTimer__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_restrictionTimerValue;
};

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

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

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

RestrictionTimer__TV_template::RestrictionTimer__TV_template()
{
}

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

RestrictionTimer__TV_template::RestrictionTimer__TV_template(const RestrictionTimer__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RestrictionTimer__TV_template::match(const RestrictionTimer__TV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.restrictionTimerValue().is_bound()) return FALSE;
if(!single_value->field_restrictionTimerValue.match(other_value.restrictionTimerValue(), 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.RestrictionTimer_TV.");
}
return FALSE;
}

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

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

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

RestrictionTimer__TV RestrictionTimer__TV_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.RestrictionTimer_TV.");
RestrictionTimer__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_restrictionTimerValue.is_bound()) {
ret_val.restrictionTimerValue() = single_value->field_restrictionTimerValue.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& RestrictionTimer__TV_template::restrictionTimerValue()
{
set_specific();
return single_value->field_restrictionTimerValue;
}

const OCTETSTRING_template& RestrictionTimer__TV_template::restrictionTimerValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field restrictionTimerValue of a non-specific template of type @MobileL3_RRM_Types.RestrictionTimer_TV.");
return single_value->field_restrictionTimerValue;
}

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

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

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

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

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

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

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

boolean RestrictionTimer__TV_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__SessionIdentity__TV::MBMS__SessionIdentity__TV()
{
}

MBMS__SessionIdentity__TV::MBMS__SessionIdentity__TV(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_mBMS__SessionIdentityValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_mBMS__SessionIdentityValue(par_mBMS__SessionIdentityValue)
{
}

MBMS__SessionIdentity__TV::MBMS__SessionIdentity__TV(const MBMS__SessionIdentity__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.MBMS_SessionIdentity_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.mBMS__SessionIdentityValue().is_bound()) field_mBMS__SessionIdentityValue = other_value.mBMS__SessionIdentityValue();
else field_mBMS__SessionIdentityValue.clean_up();
}

void MBMS__SessionIdentity__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_mBMS__SessionIdentityValue.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__SessionIdentity__TV::get_descriptor() const { return &MBMS__SessionIdentity__TV_descr_; }
MBMS__SessionIdentity__TV& MBMS__SessionIdentity__TV::operator=(const MBMS__SessionIdentity__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.MBMS_SessionIdentity_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.mBMS__SessionIdentityValue().is_bound()) field_mBMS__SessionIdentityValue = other_value.mBMS__SessionIdentityValue();
  else field_mBMS__SessionIdentityValue.clean_up();
}
return *this;
}

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

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

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

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

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

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

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

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

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

struct MBMS__SessionIdentity__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_mBMS__SessionIdentityValue;
};

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

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

void MBMS__SessionIdentity__TV_template::copy_template(const MBMS__SessionIdentity__TV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__SessionIdentityValue().get_selection()) {
single_value->field_mBMS__SessionIdentityValue = other_value.mBMS__SessionIdentityValue();
} else {
single_value->field_mBMS__SessionIdentityValue.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__SessionIdentity__TV_template[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__SessionIdentity__TV_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__SessionIdentity__TV_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_SessionIdentity_TV.");
break;
}
set_selection(other_value);
}

MBMS__SessionIdentity__TV_template::MBMS__SessionIdentity__TV_template()
{
}

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

MBMS__SessionIdentity__TV_template::MBMS__SessionIdentity__TV_template(const MBMS__SessionIdentity__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMS__SessionIdentity__TV_template::match(const MBMS__SessionIdentity__TV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.mBMS__SessionIdentityValue().is_bound()) return FALSE;
if(!single_value->field_mBMS__SessionIdentityValue.match(other_value.mBMS__SessionIdentityValue(), 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_SessionIdentity_TV.");
}
return FALSE;
}

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

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

void MBMS__SessionIdentity__TV_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__SessionIdentity__TV MBMS__SessionIdentity__TV_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_SessionIdentity_TV.");
MBMS__SessionIdentity__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_mBMS__SessionIdentityValue.is_bound()) {
ret_val.mBMS__SessionIdentityValue() = single_value->field_mBMS__SessionIdentityValue.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& MBMS__SessionIdentity__TV_template::mBMS__SessionIdentityValue()
{
set_specific();
return single_value->field_mBMS__SessionIdentityValue;
}

const OCTETSTRING_template& MBMS__SessionIdentity__TV_template::mBMS__SessionIdentityValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_SessionIdentityValue of a non-specific template of type @MobileL3_RRM_Types.MBMS_SessionIdentity_TV.");
return single_value->field_mBMS__SessionIdentityValue;
}

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

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

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

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

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

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

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

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

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

TalkerPriorityStatus__TLV::TalkerPriorityStatus__TLV()
{
}

TalkerPriorityStatus__TLV::TalkerPriorityStatus__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_priority,
    const BITSTRING& par_uAI,
    const BITSTRING& par_spare,
    const BITSTRING& par_eS)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_priority(par_priority),
  field_uAI(par_uAI),
  field_spare(par_spare),
  field_eS(par_eS)
{
}

TalkerPriorityStatus__TLV::TalkerPriorityStatus__TLV(const TalkerPriorityStatus__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.TalkerPriorityStatus_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.priority().is_bound()) field_priority = other_value.priority();
else field_priority.clean_up();
if (other_value.uAI().is_bound()) field_uAI = other_value.uAI();
else field_uAI.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.eS().is_bound()) field_eS = other_value.eS();
else field_eS.clean_up();
}

void TalkerPriorityStatus__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_priority.clean_up();
field_uAI.clean_up();
field_spare.clean_up();
field_eS.clean_up();
}

const TTCN_Typedescriptor_t* TalkerPriorityStatus__TLV::get_descriptor() const { return &TalkerPriorityStatus__TLV_descr_; }
TalkerPriorityStatus__TLV& TalkerPriorityStatus__TLV::operator=(const TalkerPriorityStatus__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.TalkerPriorityStatus_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.priority().is_bound()) field_priority = other_value.priority();
  else field_priority.clean_up();
  if (other_value.uAI().is_bound()) field_uAI = other_value.uAI();
  else field_uAI.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.eS().is_bound()) field_eS = other_value.eS();
  else field_eS.clean_up();
}
return *this;
}

boolean TalkerPriorityStatus__TLV::operator==(const TalkerPriorityStatus__TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_priority==other_value.field_priority
  && field_uAI==other_value.field_uAI
  && field_spare==other_value.field_spare
  && field_eS==other_value.field_eS;
}

boolean TalkerPriorityStatus__TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_priority.is_bound())
  || (field_uAI.is_bound())
  || (field_spare.is_bound())
  || (field_eS.is_bound());
}
boolean TalkerPriorityStatus__TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_priority.is_value()
  && field_uAI.is_value()
  && field_spare.is_value()
  && field_eS.is_value();
}
void TalkerPriorityStatus__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", priority := ");
field_priority.log();
TTCN_Logger::log_event_str(", uAI := ");
field_uAI.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", eS := ");
field_eS.log();
TTCN_Logger::log_event_str(" }");
}

void TalkerPriorityStatus__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (priority().is_bound()) priority().set_implicit_omit();
if (uAI().is_bound()) uAI().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (eS().is_bound()) eS().set_implicit_omit();
}

void TalkerPriorityStatus__TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.TalkerPriorityStatus_TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) priority().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) uAI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eS().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uAI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uAI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.TalkerPriorityStatus_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.TalkerPriorityStatus_TLV");
  }
}

void TalkerPriorityStatus__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_priority.encode_text(text_buf);
field_uAI.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_eS.encode_text(text_buf);
}

void TalkerPriorityStatus__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_priority.decode_text(text_buf);
field_uAI.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_eS.decode_text(text_buf);
}

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

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

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

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

struct TalkerPriorityStatus__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_priority;
BITSTRING_template field_uAI;
BITSTRING_template field_spare;
BITSTRING_template field_eS;
};

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

void TalkerPriorityStatus__TLV_template::copy_value(const TalkerPriorityStatus__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.priority().is_bound()) {
  single_value->field_priority = other_value.priority();
} else {
  single_value->field_priority.clean_up();
}
if (other_value.uAI().is_bound()) {
  single_value->field_uAI = other_value.uAI();
} else {
  single_value->field_uAI.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.eS().is_bound()) {
  single_value->field_eS = other_value.eS();
} else {
  single_value->field_eS.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TalkerPriorityStatus__TLV_template::copy_template(const TalkerPriorityStatus__TLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.priority().get_selection()) {
single_value->field_priority = other_value.priority();
} else {
single_value->field_priority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uAI().get_selection()) {
single_value->field_uAI = other_value.uAI();
} else {
single_value->field_uAI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eS().get_selection()) {
single_value->field_eS = other_value.eS();
} else {
single_value->field_eS.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 TalkerPriorityStatus__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TalkerPriorityStatus__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new TalkerPriorityStatus__TLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.TalkerPriorityStatus_TLV.");
break;
}
set_selection(other_value);
}

TalkerPriorityStatus__TLV_template::TalkerPriorityStatus__TLV_template()
{
}

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

TalkerPriorityStatus__TLV_template::TalkerPriorityStatus__TLV_template(const TalkerPriorityStatus__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TalkerPriorityStatus__TLV_template::match(const TalkerPriorityStatus__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.priority().is_bound()) return FALSE;
if(!single_value->field_priority.match(other_value.priority(), legacy))return FALSE;
if(!other_value.uAI().is_bound()) return FALSE;
if(!single_value->field_uAI.match(other_value.uAI(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.eS().is_bound()) return FALSE;
if(!single_value->field_eS.match(other_value.eS(), 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.TalkerPriorityStatus_TLV.");
}
return FALSE;
}

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

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

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

TalkerPriorityStatus__TLV TalkerPriorityStatus__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.TalkerPriorityStatus_TLV.");
TalkerPriorityStatus__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_priority.is_bound()) {
ret_val.priority() = single_value->field_priority.valueof();
}
if (single_value->field_uAI.is_bound()) {
ret_val.uAI() = single_value->field_uAI.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_eS.is_bound()) {
ret_val.eS() = single_value->field_eS.valueof();
}
return ret_val;
}

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

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

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

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

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

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

BITSTRING_template& TalkerPriorityStatus__TLV_template::priority()
{
set_specific();
return single_value->field_priority;
}

const BITSTRING_template& TalkerPriorityStatus__TLV_template::priority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priority of a non-specific template of type @MobileL3_RRM_Types.TalkerPriorityStatus_TLV.");
return single_value->field_priority;
}

BITSTRING_template& TalkerPriorityStatus__TLV_template::uAI()
{
set_specific();
return single_value->field_uAI;
}

const BITSTRING_template& TalkerPriorityStatus__TLV_template::uAI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uAI of a non-specific template of type @MobileL3_RRM_Types.TalkerPriorityStatus_TLV.");
return single_value->field_uAI;
}

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

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

BITSTRING_template& TalkerPriorityStatus__TLV_template::eS()
{
set_specific();
return single_value->field_eS;
}

const BITSTRING_template& TalkerPriorityStatus__TLV_template::eS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eS of a non-specific template of type @MobileL3_RRM_Types.TalkerPriorityStatus_TLV.");
return single_value->field_eS;
}

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

void TalkerPriorityStatus__TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", priority := ");
single_value->field_priority.log();
TTCN_Logger::log_event_str(", uAI := ");
single_value->field_uAI.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", eS := ");
single_value->field_eS.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 TalkerPriorityStatus__TLV_template::log_match(const TalkerPriorityStatus__TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_priority.match(match_value.priority(), legacy)){
TTCN_Logger::log_logmatch_info(".priority");
single_value->field_priority.log_match(match_value.priority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uAI.match(match_value.uAI(), legacy)){
TTCN_Logger::log_logmatch_info(".uAI");
single_value->field_uAI.log_match(match_value.uAI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eS.match(match_value.eS(), legacy)){
TTCN_Logger::log_logmatch_info(".eS");
single_value->field_eS.log_match(match_value.eS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", priority := ");
single_value->field_priority.log_match(match_value.priority(), legacy);
TTCN_Logger::log_event_str(", uAI := ");
single_value->field_uAI.log_match(match_value.uAI(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", eS := ");
single_value->field_eS.log_match(match_value.eS(), 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 TalkerPriorityStatus__TLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (priority().is_bound()) priority().set_implicit_omit();
if (uAI().is_bound()) uAI().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (eS().is_bound()) eS().set_implicit_omit();
}

void TalkerPriorityStatus__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_priority.encode_text(text_buf);
single_value->field_uAI.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_eS.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.TalkerPriorityStatus_TLV.");
}
}

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

void TalkerPriorityStatus__TLV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TalkerPriorityStatus__TLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.TalkerPriorityStatus_TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) priority().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) uAI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eS().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uAI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uAI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.TalkerPriorityStatus_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TalkerPriorityStatus__TLV_template* precondition = new TalkerPriorityStatus__TLV_template;
    precondition->set_param(*param.get_elem(0));
    TalkerPriorityStatus__TLV_template* implied_template = new TalkerPriorityStatus__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TalkerPriorityStatus__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.TalkerPriorityStatus_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

TalkerIdentity__TLV::TalkerIdentity__TLV()
{
}

TalkerIdentity__TLV::TalkerIdentity__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_fillerBits,
    const BITSTRING& par_spare,
    const OPTIONAL< OCTETSTRING >& par_talkerIdentityField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_fillerBits(par_fillerBits),
  field_spare(par_spare),
  field_talkerIdentityField(par_talkerIdentityField)
{
}

TalkerIdentity__TLV::TalkerIdentity__TLV(const TalkerIdentity__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.TalkerIdentity_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.fillerBits().is_bound()) field_fillerBits = other_value.fillerBits();
else field_fillerBits.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.talkerIdentityField().is_bound()) field_talkerIdentityField = other_value.talkerIdentityField();
else field_talkerIdentityField.clean_up();
}

void TalkerIdentity__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_fillerBits.clean_up();
field_spare.clean_up();
field_talkerIdentityField.clean_up();
}

const TTCN_Typedescriptor_t* TalkerIdentity__TLV::get_descriptor() const { return &TalkerIdentity__TLV_descr_; }
TalkerIdentity__TLV& TalkerIdentity__TLV::operator=(const TalkerIdentity__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.TalkerIdentity_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.fillerBits().is_bound()) field_fillerBits = other_value.fillerBits();
  else field_fillerBits.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.talkerIdentityField().is_bound()) field_talkerIdentityField = other_value.talkerIdentityField();
  else field_talkerIdentityField.clean_up();
}
return *this;
}

boolean TalkerIdentity__TLV::operator==(const TalkerIdentity__TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_fillerBits==other_value.field_fillerBits
  && field_spare==other_value.field_spare
  && field_talkerIdentityField==other_value.field_talkerIdentityField;
}

boolean TalkerIdentity__TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_fillerBits.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_talkerIdentityField.get_selection() || field_talkerIdentityField.is_bound());
}
boolean TalkerIdentity__TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_fillerBits.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_talkerIdentityField.get_selection() || field_talkerIdentityField.is_value());
}
int TalkerIdentity__TLV::size_of() const
{
  int ret_val = 4;
  if (field_talkerIdentityField.ispresent()) ret_val++;
  return ret_val;
}

void TalkerIdentity__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", fillerBits := ");
field_fillerBits.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", talkerIdentityField := ");
field_talkerIdentityField.log();
TTCN_Logger::log_event_str(" }");
}

void TalkerIdentity__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (fillerBits().is_bound()) fillerBits().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!talkerIdentityField().is_bound()) talkerIdentityField() = OMIT_VALUE;
else talkerIdentityField().set_implicit_omit();
}

void TalkerIdentity__TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.TalkerIdentity_TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fillerBits().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) talkerIdentityField().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerBits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerBits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "talkerIdentityField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          talkerIdentityField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.TalkerIdentity_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.TalkerIdentity_TLV");
  }
}

void TalkerIdentity__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_fillerBits.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_talkerIdentityField.encode_text(text_buf);
}

void TalkerIdentity__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_fillerBits.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_talkerIdentityField.decode_text(text_buf);
}

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

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

int TalkerIdentity__TLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, TalkerIdentity__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(TalkerIdentity__TLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(TalkerIdentity__TLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_fillerBits.RAW_decode(General__Types::BIT3_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT5_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  if (limit > 0 && value_of_length_field1 > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_talkerIdentityField = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::OCT17_descr_.raw->forceomit);
  decoded_field_length = field_talkerIdentityField().RAW_decode(General__Types::OCT17_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_talkerIdentityField = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  }
  }
  }
  else field_talkerIdentityField=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TalkerIdentity__TLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TalkerIdentity__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT5_descr_.raw);
  if (field_talkerIdentityField.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::OCT17_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &TalkerIdentity__TLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(3);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  if (field_talkerIdentityField.ispresent()) {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = 0;
  }
  encoded_length += field_fillerBits.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[3]);
  if (field_talkerIdentityField.ispresent()) {
  encoded_length += field_talkerIdentityField().RAW_encode(General__Types::OCT17_descr_, *myleaf.body.node.nodes[4]);
  }
  return myleaf.length = encoded_length;
}

struct TalkerIdentity__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_fillerBits;
BITSTRING_template field_spare;
OCTETSTRING_template field_talkerIdentityField;
};

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

void TalkerIdentity__TLV_template::copy_value(const TalkerIdentity__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.fillerBits().is_bound()) {
  single_value->field_fillerBits = other_value.fillerBits();
} else {
  single_value->field_fillerBits.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.talkerIdentityField().is_bound()) {
  if (other_value.talkerIdentityField().ispresent()) single_value->field_talkerIdentityField = other_value.talkerIdentityField()();
  else single_value->field_talkerIdentityField = OMIT_VALUE;
} else {
  single_value->field_talkerIdentityField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

TalkerIdentity__TLV_template::TalkerIdentity__TLV_template()
{
}

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

TalkerIdentity__TLV_template::TalkerIdentity__TLV_template(const TalkerIdentity__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TalkerIdentity__TLV_template::match(const TalkerIdentity__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.fillerBits().is_bound()) return FALSE;
if(!single_value->field_fillerBits.match(other_value.fillerBits(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.talkerIdentityField().is_bound()) return FALSE;
if((other_value.talkerIdentityField().ispresent() ? !single_value->field_talkerIdentityField.match((const OCTETSTRING&)other_value.talkerIdentityField(), legacy) : !single_value->field_talkerIdentityField.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.TalkerIdentity_TLV.");
}
return FALSE;
}

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

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

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

TalkerIdentity__TLV TalkerIdentity__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.TalkerIdentity_TLV.");
TalkerIdentity__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_fillerBits.is_bound()) {
ret_val.fillerBits() = single_value->field_fillerBits.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_talkerIdentityField.is_omit()) ret_val.talkerIdentityField() = OMIT_VALUE;
else if (single_value->field_talkerIdentityField.is_bound()) {
ret_val.talkerIdentityField() = single_value->field_talkerIdentityField.valueof();
}
return ret_val;
}

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

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

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

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

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

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

BITSTRING_template& TalkerIdentity__TLV_template::fillerBits()
{
set_specific();
return single_value->field_fillerBits;
}

const BITSTRING_template& TalkerIdentity__TLV_template::fillerBits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fillerBits of a non-specific template of type @MobileL3_RRM_Types.TalkerIdentity_TLV.");
return single_value->field_fillerBits;
}

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

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

OCTETSTRING_template& TalkerIdentity__TLV_template::talkerIdentityField()
{
set_specific();
return single_value->field_talkerIdentityField;
}

const OCTETSTRING_template& TalkerIdentity__TLV_template::talkerIdentityField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field talkerIdentityField of a non-specific template of type @MobileL3_RRM_Types.TalkerIdentity_TLV.");
return single_value->field_talkerIdentityField;
}

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

void TalkerIdentity__TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", fillerBits := ");
single_value->field_fillerBits.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", talkerIdentityField := ");
single_value->field_talkerIdentityField.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 TalkerIdentity__TLV_template::log_match(const TalkerIdentity__TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fillerBits.match(match_value.fillerBits(), legacy)){
TTCN_Logger::log_logmatch_info(".fillerBits");
single_value->field_fillerBits.log_match(match_value.fillerBits(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.talkerIdentityField().ispresent()){
if(!single_value->field_talkerIdentityField.match(match_value.talkerIdentityField(), legacy)){
TTCN_Logger::log_logmatch_info(".talkerIdentityField");
single_value->field_talkerIdentityField.log_match(match_value.talkerIdentityField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_talkerIdentityField.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".talkerIdentityField := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_talkerIdentityField.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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", fillerBits := ");
single_value->field_fillerBits.log_match(match_value.fillerBits(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", talkerIdentityField := ");
if (match_value.talkerIdentityField().ispresent()) {
single_value->field_talkerIdentityField.log_match(match_value.talkerIdentityField(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_talkerIdentityField.log();
if (single_value->field_talkerIdentityField.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 TalkerIdentity__TLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (fillerBits().is_bound()) fillerBits().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!talkerIdentityField().is_bound()) talkerIdentityField() = OMIT_VALUE;
else talkerIdentityField().set_implicit_omit();
}

void TalkerIdentity__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_fillerBits.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_talkerIdentityField.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.TalkerIdentity_TLV.");
}
}

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

void TalkerIdentity__TLV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TalkerIdentity__TLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.TalkerIdentity_TLV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fillerBits().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) talkerIdentityField().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fillerBits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fillerBits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "talkerIdentityField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          talkerIdentityField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.TalkerIdentity_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TalkerIdentity__TLV_template* precondition = new TalkerIdentity__TLV_template;
    precondition->set_param(*param.get_elem(0));
    TalkerIdentity__TLV_template* implied_template = new TalkerIdentity__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TalkerIdentity__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.TalkerIdentity_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

Token__TV::Token__TV()
{
}

Token__TV::Token__TV(const OCTETSTRING& par_elementIdentifier,
    const OCTETSTRING& par_tokenValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_tokenValue(par_tokenValue)
{
}

Token__TV::Token__TV(const Token__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.Token_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.tokenValue().is_bound()) field_tokenValue = other_value.tokenValue();
else field_tokenValue.clean_up();
}

void Token__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_tokenValue.clean_up();
}

const TTCN_Typedescriptor_t* Token__TV::get_descriptor() const { return &Token__TV_descr_; }
Token__TV& Token__TV::operator=(const Token__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.Token_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.tokenValue().is_bound()) field_tokenValue = other_value.tokenValue();
  else field_tokenValue.clean_up();
}
return *this;
}

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

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

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

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

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

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

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

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

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

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

struct Token__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
OCTETSTRING_template field_tokenValue;
};

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

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

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

Token__TV_template::Token__TV_template()
{
}

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

Token__TV_template::Token__TV_template(const Token__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Token__TV_template::match(const Token__TV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.tokenValue().is_bound()) return FALSE;
if(!single_value->field_tokenValue.match(other_value.tokenValue(), 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.Token_TV.");
}
return FALSE;
}

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

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

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

Token__TV Token__TV_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.Token_TV.");
Token__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_tokenValue.is_bound()) {
ret_val.tokenValue() = single_value->field_tokenValue.valueof();
}
return ret_val;
}

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

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

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

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

OCTETSTRING_template& Token__TV_template::tokenValue()
{
set_specific();
return single_value->field_tokenValue;
}

const OCTETSTRING_template& Token__TV_template::tokenValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tokenValue of a non-specific template of type @MobileL3_RRM_Types.Token_TV.");
return single_value->field_tokenValue;
}

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

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

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

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

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

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

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

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

PS__Cause__TV::PS__Cause__TV()
{
}

PS__Cause__TV::PS__Cause__TV(const BITSTRING& par_causeValue,
    const BITSTRING& par_elementIdentifier)
  :   field_causeValue(par_causeValue),
  field_elementIdentifier(par_elementIdentifier)
{
}

PS__Cause__TV::PS__Cause__TV(const PS__Cause__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PS_Cause_TV.");
if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
else field_causeValue.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void PS__Cause__TV::clean_up()
{
field_causeValue.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* PS__Cause__TV::get_descriptor() const { return &PS__Cause__TV_descr_; }
PS__Cause__TV& PS__Cause__TV::operator=(const PS__Cause__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PS_Cause_TV.");
  if (other_value.causeValue().is_bound()) field_causeValue = other_value.causeValue();
  else field_causeValue.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

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

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

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

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

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

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

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

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

int PS__Cause__TV::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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_causeValue.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct PS__Cause__TV_template::single_value_struct {
BITSTRING_template field_causeValue;
BITSTRING_template field_elementIdentifier;
};

void PS__Cause__TV_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_causeValue = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

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

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

PS__Cause__TV_template::PS__Cause__TV_template()
{
}

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

PS__Cause__TV_template::PS__Cause__TV_template(const PS__Cause__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PS__Cause__TV_template::match(const PS__Cause__TV& 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.causeValue().is_bound()) return FALSE;
if(!single_value->field_causeValue.match(other_value.causeValue(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.PS_Cause_TV.");
}
return FALSE;
}

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

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

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

PS__Cause__TV PS__Cause__TV_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.PS_Cause_TV.");
PS__Cause__TV ret_val;
if (single_value->field_causeValue.is_bound()) {
ret_val.causeValue() = single_value->field_causeValue.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

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

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

BITSTRING_template& PS__Cause__TV_template::causeValue()
{
set_specific();
return single_value->field_causeValue;
}

const BITSTRING_template& PS__Cause__TV_template::causeValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field causeValue of a non-specific template of type @MobileL3_RRM_Types.PS_Cause_TV.");
return single_value->field_causeValue;
}

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

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

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

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

void PS__Cause__TV_template::log_match(const PS__Cause__TV& 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_causeValue.match(match_value.causeValue(), legacy)){
TTCN_Logger::log_logmatch_info(".causeValue");
single_value->field_causeValue.log_match(match_value.causeValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ causeValue := ");
single_value->field_causeValue.log_match(match_value.causeValue(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

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

void PS__Cause__TV_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_causeValue.decode_text(text_buf);
single_value->field_elementIdentifier.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PS__Cause__TV_template[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.PS_Cause_TV.");
}
}

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

void PS__Cause__TV_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_causeValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PS_Cause_TV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PS_Cause_TV");
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.PS_Cause_TV");
}

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

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

VGCS__AMR__Configuration__TLV::VGCS__AMR__Configuration__TLV()
{
}

VGCS__AMR__Configuration__TLV::VGCS__AMR__Configuration__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const BITSTRING& par_spare,
    const BITSTRING& par_aMR__ConfigurationValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_spare(par_spare),
  field_aMR__ConfigurationValue(par_aMR__ConfigurationValue)
{
}

VGCS__AMR__Configuration__TLV::VGCS__AMR__Configuration__TLV(const VGCS__AMR__Configuration__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.VGCS_AMR_Configuration_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.aMR__ConfigurationValue().is_bound()) field_aMR__ConfigurationValue = other_value.aMR__ConfigurationValue();
else field_aMR__ConfigurationValue.clean_up();
}

void VGCS__AMR__Configuration__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_spare.clean_up();
field_aMR__ConfigurationValue.clean_up();
}

const TTCN_Typedescriptor_t* VGCS__AMR__Configuration__TLV::get_descriptor() const { return &VGCS__AMR__Configuration__TLV_descr_; }
VGCS__AMR__Configuration__TLV& VGCS__AMR__Configuration__TLV::operator=(const VGCS__AMR__Configuration__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.VGCS_AMR_Configuration_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.aMR__ConfigurationValue().is_bound()) field_aMR__ConfigurationValue = other_value.aMR__ConfigurationValue();
  else field_aMR__ConfigurationValue.clean_up();
}
return *this;
}

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

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

void VGCS__AMR__Configuration__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (aMR__ConfigurationValue().is_bound()) aMR__ConfigurationValue().set_implicit_omit();
}

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

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

void VGCS__AMR__Configuration__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_aMR__ConfigurationValue.decode_text(text_buf);
}

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

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

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

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

struct VGCS__AMR__Configuration__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
BITSTRING_template field_spare;
BITSTRING_template field_aMR__ConfigurationValue;
};

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

void VGCS__AMR__Configuration__TLV_template::copy_value(const VGCS__AMR__Configuration__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.aMR__ConfigurationValue().is_bound()) {
  single_value->field_aMR__ConfigurationValue = other_value.aMR__ConfigurationValue();
} else {
  single_value->field_aMR__ConfigurationValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

VGCS__AMR__Configuration__TLV_template::VGCS__AMR__Configuration__TLV_template()
{
}

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

VGCS__AMR__Configuration__TLV_template::VGCS__AMR__Configuration__TLV_template(const VGCS__AMR__Configuration__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean VGCS__AMR__Configuration__TLV_template::match(const VGCS__AMR__Configuration__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.aMR__ConfigurationValue().is_bound()) return FALSE;
if(!single_value->field_aMR__ConfigurationValue.match(other_value.aMR__ConfigurationValue(), 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.VGCS_AMR_Configuration_TLV.");
}
return FALSE;
}

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

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

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

VGCS__AMR__Configuration__TLV VGCS__AMR__Configuration__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.VGCS_AMR_Configuration_TLV.");
VGCS__AMR__Configuration__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_aMR__ConfigurationValue.is_bound()) {
ret_val.aMR__ConfigurationValue() = single_value->field_aMR__ConfigurationValue.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

BITSTRING_template& VGCS__AMR__Configuration__TLV_template::aMR__ConfigurationValue()
{
set_specific();
return single_value->field_aMR__ConfigurationValue;
}

const BITSTRING_template& VGCS__AMR__Configuration__TLV_template::aMR__ConfigurationValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aMR_ConfigurationValue of a non-specific template of type @MobileL3_RRM_Types.VGCS_AMR_Configuration_TLV.");
return single_value->field_aMR__ConfigurationValue;
}

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

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

void VGCS__AMR__Configuration__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_aMR__ConfigurationValue.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.VGCS_AMR_Configuration_TLV.");
}
}

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

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

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

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

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

CarrierIndication__TV::CarrierIndication__TV()
{
}

CarrierIndication__TV::CarrierIndication__TV(const BITSTRING& par_cI,
    const BITSTRING& par_spare1__3,
    const BITSTRING& par_elementIdentifier)
  :   field_cI(par_cI),
  field_spare1__3(par_spare1__3),
  field_elementIdentifier(par_elementIdentifier)
{
}

CarrierIndication__TV::CarrierIndication__TV(const CarrierIndication__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.CarrierIndication_TV.");
if (other_value.cI().is_bound()) field_cI = other_value.cI();
else field_cI.clean_up();
if (other_value.spare1__3().is_bound()) field_spare1__3 = other_value.spare1__3();
else field_spare1__3.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void CarrierIndication__TV::clean_up()
{
field_cI.clean_up();
field_spare1__3.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* CarrierIndication__TV::get_descriptor() const { return &CarrierIndication__TV_descr_; }
CarrierIndication__TV& CarrierIndication__TV::operator=(const CarrierIndication__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.CarrierIndication_TV.");
  if (other_value.cI().is_bound()) field_cI = other_value.cI();
  else field_cI.clean_up();
  if (other_value.spare1__3().is_bound()) field_spare1__3 = other_value.spare1__3();
  else field_spare1__3.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean CarrierIndication__TV::operator==(const CarrierIndication__TV& other_value) const
{
return field_cI==other_value.field_cI
  && field_spare1__3==other_value.field_spare1__3
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean CarrierIndication__TV::is_bound() const
{
return (field_cI.is_bound())
  || (field_spare1__3.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean CarrierIndication__TV::is_value() const
{
return field_cI.is_value()
  && field_spare1__3.is_value()
  && field_elementIdentifier.is_value();
}
void CarrierIndication__TV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cI := ");
field_cI.log();
TTCN_Logger::log_event_str(", spare1_3 := ");
field_spare1__3.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void CarrierIndication__TV::set_implicit_omit()
{
if (cI().is_bound()) cI().set_implicit_omit();
if (spare1__3().is_bound()) spare1__3().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

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

void CarrierIndication__TV::encode_text(Text_Buf& text_buf) const
{
field_cI.encode_text(text_buf);
field_spare1__3.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void CarrierIndication__TV::decode_text(Text_Buf& text_buf)
{
field_cI.decode_text(text_buf);
field_spare1__3.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

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

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

int CarrierIndication__TV::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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cI.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_spare1__3.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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 CarrierIndication__TV::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  encoded_length += field_cI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare1__3.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct CarrierIndication__TV_template::single_value_struct {
BITSTRING_template field_cI;
BITSTRING_template field_spare1__3;
BITSTRING_template field_elementIdentifier;
};

void CarrierIndication__TV_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_cI = ANY_VALUE;
single_value->field_spare1__3 = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void CarrierIndication__TV_template::copy_value(const CarrierIndication__TV& other_value)
{
single_value = new single_value_struct;
if (other_value.cI().is_bound()) {
  single_value->field_cI = other_value.cI();
} else {
  single_value->field_cI.clean_up();
}
if (other_value.spare1__3().is_bound()) {
  single_value->field_spare1__3 = other_value.spare1__3();
} else {
  single_value->field_spare1__3.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

CarrierIndication__TV_template::CarrierIndication__TV_template()
{
}

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

CarrierIndication__TV_template::CarrierIndication__TV_template(const CarrierIndication__TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

CarrierIndication__TV_template& CarrierIndication__TV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

CarrierIndication__TV_template& CarrierIndication__TV_template::operator=(const CarrierIndication__TV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

CarrierIndication__TV_template& CarrierIndication__TV_template::operator=(const OPTIONAL<CarrierIndication__TV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CarrierIndication__TV&)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.CarrierIndication_TV.");
}
return *this;
}

CarrierIndication__TV_template& CarrierIndication__TV_template::operator=(const CarrierIndication__TV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean CarrierIndication__TV_template::match(const CarrierIndication__TV& 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.cI().is_bound()) return FALSE;
if(!single_value->field_cI.match(other_value.cI(), legacy))return FALSE;
if(!other_value.spare1__3().is_bound()) return FALSE;
if(!single_value->field_spare1__3.match(other_value.spare1__3(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.CarrierIndication_TV.");
}
return FALSE;
}

boolean CarrierIndication__TV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_cI.is_bound()
 || single_value->field_spare1__3.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

boolean CarrierIndication__TV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cI.is_value()
 && single_value->field_spare1__3.is_value()
 && single_value->field_elementIdentifier.is_value();
}

void CarrierIndication__TV_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;
}

CarrierIndication__TV CarrierIndication__TV_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.CarrierIndication_TV.");
CarrierIndication__TV ret_val;
if (single_value->field_cI.is_bound()) {
ret_val.cI() = single_value->field_cI.valueof();
}
if (single_value->field_spare1__3.is_bound()) {
ret_val.spare1__3() = single_value->field_spare1__3.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void CarrierIndication__TV_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.CarrierIndication_TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CarrierIndication__TV_template[list_length];
}

CarrierIndication__TV_template& CarrierIndication__TV_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.CarrierIndication_TV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.CarrierIndication_TV.");
return value_list.list_value[list_index];
}

BITSTRING_template& CarrierIndication__TV_template::cI()
{
set_specific();
return single_value->field_cI;
}

const BITSTRING_template& CarrierIndication__TV_template::cI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cI of a non-specific template of type @MobileL3_RRM_Types.CarrierIndication_TV.");
return single_value->field_cI;
}

BITSTRING_template& CarrierIndication__TV_template::spare1__3()
{
set_specific();
return single_value->field_spare1__3;
}

const BITSTRING_template& CarrierIndication__TV_template::spare1__3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare1_3 of a non-specific template of type @MobileL3_RRM_Types.CarrierIndication_TV.");
return single_value->field_spare1__3;
}

BITSTRING_template& CarrierIndication__TV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& CarrierIndication__TV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_RRM_Types.CarrierIndication_TV.");
return single_value->field_elementIdentifier;
}

int CarrierIndication__TV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CarrierIndication_TV 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.CarrierIndication_TV 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.CarrierIndication_TV 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.CarrierIndication_TV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CarrierIndication_TV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CarrierIndication_TV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CarrierIndication_TV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CarrierIndication_TV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CarrierIndication_TV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.CarrierIndication_TV.");
  }
  return 0;
}

void CarrierIndication__TV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ cI := ");
single_value->field_cI.log();
TTCN_Logger::log_event_str(", spare1_3 := ");
single_value->field_spare1__3.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void CarrierIndication__TV_template::log_match(const CarrierIndication__TV& 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_cI.match(match_value.cI(), legacy)){
TTCN_Logger::log_logmatch_info(".cI");
single_value->field_cI.log_match(match_value.cI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare1__3.match(match_value.spare1__3(), legacy)){
TTCN_Logger::log_logmatch_info(".spare1_3");
single_value->field_spare1__3.log_match(match_value.spare1__3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ cI := ");
single_value->field_cI.log_match(match_value.cI(), legacy);
TTCN_Logger::log_event_str(", spare1_3 := ");
single_value->field_spare1__3.log_match(match_value.spare1__3(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void CarrierIndication__TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cI().is_bound()) cI().set_implicit_omit();
if (spare1__3().is_bound()) spare1__3().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void CarrierIndication__TV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_cI.encode_text(text_buf);
single_value->field_spare1__3.encode_text(text_buf);
single_value->field_elementIdentifier.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_RRM_Types.CarrierIndication_TV.");
}
}

void CarrierIndication__TV_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_cI.decode_text(text_buf);
single_value->field_spare1__3.decode_text(text_buf);
single_value->field_elementIdentifier.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CarrierIndication__TV_template[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.CarrierIndication_TV.");
}
}

void CarrierIndication__TV_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: {
    CarrierIndication__TV_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.CarrierIndication_TV 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) cI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare1__3().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "cI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1__3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.CarrierIndication_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CarrierIndication__TV_template* precondition = new CarrierIndication__TV_template;
    precondition->set_param(*param.get_elem(0));
    CarrierIndication__TV_template* implied_template = new CarrierIndication__TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CarrierIndication__TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.CarrierIndication_TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void CarrierIndication__TV_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_cI.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.CarrierIndication_TV");
single_value->field_spare1__3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.CarrierIndication_TV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.CarrierIndication_TV");
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.CarrierIndication_TV");
}

boolean CarrierIndication__TV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean CarrierIndication__TV_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;
}

UplinkAccessIndication__TV::UplinkAccessIndication__TV()
{
}

UplinkAccessIndication__TV::UplinkAccessIndication__TV(const BITSTRING& par_uA__Ind,
    const BITSTRING& par_spare,
    const BITSTRING& par_elementIdentifier)
  :   field_uA__Ind(par_uA__Ind),
  field_spare(par_spare),
  field_elementIdentifier(par_elementIdentifier)
{
}

UplinkAccessIndication__TV::UplinkAccessIndication__TV(const UplinkAccessIndication__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.UplinkAccessIndication_TV.");
if (other_value.uA__Ind().is_bound()) field_uA__Ind = other_value.uA__Ind();
else field_uA__Ind.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void UplinkAccessIndication__TV::clean_up()
{
field_uA__Ind.clean_up();
field_spare.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* UplinkAccessIndication__TV::get_descriptor() const { return &UplinkAccessIndication__TV_descr_; }
UplinkAccessIndication__TV& UplinkAccessIndication__TV::operator=(const UplinkAccessIndication__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.UplinkAccessIndication_TV.");
  if (other_value.uA__Ind().is_bound()) field_uA__Ind = other_value.uA__Ind();
  else field_uA__Ind.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean UplinkAccessIndication__TV::operator==(const UplinkAccessIndication__TV& other_value) const
{
return field_uA__Ind==other_value.field_uA__Ind
  && field_spare==other_value.field_spare
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean UplinkAccessIndication__TV::is_bound() const
{
return (field_uA__Ind.is_bound())
  || (field_spare.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean UplinkAccessIndication__TV::is_value() const
{
return field_uA__Ind.is_value()
  && field_spare.is_value()
  && field_elementIdentifier.is_value();
}
void UplinkAccessIndication__TV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ uA_Ind := ");
field_uA__Ind.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void UplinkAccessIndication__TV::set_implicit_omit()
{
if (uA__Ind().is_bound()) uA__Ind().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void UplinkAccessIndication__TV::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.UplinkAccessIndication_TV 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) uA__Ind().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "uA_Ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uA__Ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.UplinkAccessIndication_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.UplinkAccessIndication_TV");
  }
}

void UplinkAccessIndication__TV::encode_text(Text_Buf& text_buf) const
{
field_uA__Ind.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void UplinkAccessIndication__TV::decode_text(Text_Buf& text_buf)
{
field_uA__Ind.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void UplinkAccessIndication__TV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UplinkAccessIndication__TV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UplinkAccessIndication__TV::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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_uA__Ind.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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 UplinkAccessIndication__TV::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  encoded_length += field_uA__Ind.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct UplinkAccessIndication__TV_template::single_value_struct {
BITSTRING_template field_uA__Ind;
BITSTRING_template field_spare;
BITSTRING_template field_elementIdentifier;
};

void UplinkAccessIndication__TV_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_uA__Ind = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void UplinkAccessIndication__TV_template::copy_value(const UplinkAccessIndication__TV& other_value)
{
single_value = new single_value_struct;
if (other_value.uA__Ind().is_bound()) {
  single_value->field_uA__Ind = other_value.uA__Ind();
} else {
  single_value->field_uA__Ind.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UplinkAccessIndication__TV_template::copy_template(const UplinkAccessIndication__TV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.uA__Ind().get_selection()) {
single_value->field_uA__Ind = other_value.uA__Ind();
} else {
single_value->field_uA__Ind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new UplinkAccessIndication__TV_template[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 UplinkAccessIndication__TV_template(*other_value.implication_.precondition);
implication_.implied_template = new UplinkAccessIndication__TV_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.UplinkAccessIndication_TV.");
break;
}
set_selection(other_value);
}

UplinkAccessIndication__TV_template::UplinkAccessIndication__TV_template()
{
}

UplinkAccessIndication__TV_template::UplinkAccessIndication__TV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

UplinkAccessIndication__TV_template::UplinkAccessIndication__TV_template(const UplinkAccessIndication__TV& other_value)
{
copy_value(other_value);
}

UplinkAccessIndication__TV_template::UplinkAccessIndication__TV_template(const OPTIONAL<UplinkAccessIndication__TV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UplinkAccessIndication__TV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV from an unbound optional field.");
}
}

UplinkAccessIndication__TV_template::UplinkAccessIndication__TV_template(UplinkAccessIndication__TV_template* p_precondition, UplinkAccessIndication__TV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

UplinkAccessIndication__TV_template::UplinkAccessIndication__TV_template(Dynamic_Match_Interface<UplinkAccessIndication__TV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<UplinkAccessIndication__TV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

UplinkAccessIndication__TV_template::UplinkAccessIndication__TV_template(const UplinkAccessIndication__TV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

UplinkAccessIndication__TV_template::~UplinkAccessIndication__TV_template()
{
clean_up();
}

UplinkAccessIndication__TV_template& UplinkAccessIndication__TV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

UplinkAccessIndication__TV_template& UplinkAccessIndication__TV_template::operator=(const UplinkAccessIndication__TV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

UplinkAccessIndication__TV_template& UplinkAccessIndication__TV_template::operator=(const OPTIONAL<UplinkAccessIndication__TV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UplinkAccessIndication__TV&)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.UplinkAccessIndication_TV.");
}
return *this;
}

UplinkAccessIndication__TV_template& UplinkAccessIndication__TV_template::operator=(const UplinkAccessIndication__TV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean UplinkAccessIndication__TV_template::match(const UplinkAccessIndication__TV& 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.uA__Ind().is_bound()) return FALSE;
if(!single_value->field_uA__Ind.match(other_value.uA__Ind(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV.");
}
return FALSE;
}

boolean UplinkAccessIndication__TV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_uA__Ind.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

boolean UplinkAccessIndication__TV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_uA__Ind.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_elementIdentifier.is_value();
}

void UplinkAccessIndication__TV_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;
}

UplinkAccessIndication__TV UplinkAccessIndication__TV_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.UplinkAccessIndication_TV.");
UplinkAccessIndication__TV ret_val;
if (single_value->field_uA__Ind.is_bound()) {
ret_val.uA__Ind() = single_value->field_uA__Ind.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void UplinkAccessIndication__TV_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.UplinkAccessIndication_TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UplinkAccessIndication__TV_template[list_length];
}

UplinkAccessIndication__TV_template& UplinkAccessIndication__TV_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.UplinkAccessIndication_TV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV.");
return value_list.list_value[list_index];
}

BITSTRING_template& UplinkAccessIndication__TV_template::uA__Ind()
{
set_specific();
return single_value->field_uA__Ind;
}

const BITSTRING_template& UplinkAccessIndication__TV_template::uA__Ind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uA_Ind of a non-specific template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV.");
return single_value->field_uA__Ind;
}

BITSTRING_template& UplinkAccessIndication__TV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& UplinkAccessIndication__TV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV.");
return single_value->field_spare;
}

BITSTRING_template& UplinkAccessIndication__TV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& UplinkAccessIndication__TV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV.");
return single_value->field_elementIdentifier;
}

int UplinkAccessIndication__TV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV 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.UplinkAccessIndication_TV 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.UplinkAccessIndication_TV 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.UplinkAccessIndication_TV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV.");
  }
  return 0;
}

void UplinkAccessIndication__TV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ uA_Ind := ");
single_value->field_uA__Ind.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void UplinkAccessIndication__TV_template::log_match(const UplinkAccessIndication__TV& 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_uA__Ind.match(match_value.uA__Ind(), legacy)){
TTCN_Logger::log_logmatch_info(".uA_Ind");
single_value->field_uA__Ind.log_match(match_value.uA__Ind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ uA_Ind := ");
single_value->field_uA__Ind.log_match(match_value.uA__Ind(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void UplinkAccessIndication__TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (uA__Ind().is_bound()) uA__Ind().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void UplinkAccessIndication__TV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_uA__Ind.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_elementIdentifier.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_RRM_Types.UplinkAccessIndication_TV.");
}
}

void UplinkAccessIndication__TV_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_uA__Ind.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_elementIdentifier.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new UplinkAccessIndication__TV_template[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.UplinkAccessIndication_TV.");
}
}

void UplinkAccessIndication__TV_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: {
    UplinkAccessIndication__TV_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.UplinkAccessIndication_TV 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) uA__Ind().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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(), "uA_Ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uA__Ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.UplinkAccessIndication_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UplinkAccessIndication__TV_template* precondition = new UplinkAccessIndication__TV_template;
    precondition->set_param(*param.get_elem(0));
    UplinkAccessIndication__TV_template* implied_template = new UplinkAccessIndication__TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UplinkAccessIndication__TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.UplinkAccessIndication_TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UplinkAccessIndication__TV_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_uA__Ind.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.UplinkAccessIndication_TV");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.UplinkAccessIndication_TV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.UplinkAccessIndication_TV");
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.UplinkAccessIndication_TV");
}

boolean UplinkAccessIndication__TV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean UplinkAccessIndication__TV_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;
}

Individual__Priorities__TLV::Individual__Priorities__TLV()
{
}

Individual__Priorities__TLV::Individual__Priorities__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_individualPrioritiesValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_individualPrioritiesValue(par_individualPrioritiesValue)
{
}

Individual__Priorities__TLV::Individual__Priorities__TLV(const Individual__Priorities__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.individualPrioritiesValue().is_bound()) field_individualPrioritiesValue = other_value.individualPrioritiesValue();
else field_individualPrioritiesValue.clean_up();
}

void Individual__Priorities__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_individualPrioritiesValue.clean_up();
}

const TTCN_Typedescriptor_t* Individual__Priorities__TLV::get_descriptor() const { return &Individual__Priorities__TLV_descr_; }
Individual__Priorities__TLV& Individual__Priorities__TLV::operator=(const Individual__Priorities__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.individualPrioritiesValue().is_bound()) field_individualPrioritiesValue = other_value.individualPrioritiesValue();
  else field_individualPrioritiesValue.clean_up();
}
return *this;
}

boolean Individual__Priorities__TLV::operator==(const Individual__Priorities__TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_individualPrioritiesValue==other_value.field_individualPrioritiesValue;
}

boolean Individual__Priorities__TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_individualPrioritiesValue.is_bound());
}
boolean Individual__Priorities__TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_individualPrioritiesValue.is_value();
}
void Individual__Priorities__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", individualPrioritiesValue := ");
field_individualPrioritiesValue.log();
TTCN_Logger::log_event_str(" }");
}

void Individual__Priorities__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (individualPrioritiesValue().is_bound()) individualPrioritiesValue().set_implicit_omit();
}

void Individual__Priorities__TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.Individual_Priorities_TLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) individualPrioritiesValue().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "individualPrioritiesValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          individualPrioritiesValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.Individual_Priorities_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.Individual_Priorities_TLV");
  }
}

void Individual__Priorities__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_individualPrioritiesValue.encode_text(text_buf);
}

void Individual__Priorities__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_individualPrioritiesValue.decode_text(text_buf);
}

void Individual__Priorities__TLV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void Individual__Priorities__TLV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int Individual__Priorities__TLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, Individual__Priorities__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Individual__Priorities__TLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(Individual__Priorities__TLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_individualPrioritiesValue.RAW_decode(General__Types::OCTN_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Individual__Priorities__TLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Individual__Priorities__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCTN_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &Individual__Priorities__TLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_individualPrioritiesValue.RAW_encode(General__Types::OCTN_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct Individual__Priorities__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_individualPrioritiesValue;
};

void Individual__Priorities__TLV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_individualPrioritiesValue = ANY_VALUE;
}
}
}

void Individual__Priorities__TLV_template::copy_value(const Individual__Priorities__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.individualPrioritiesValue().is_bound()) {
  single_value->field_individualPrioritiesValue = other_value.individualPrioritiesValue();
} else {
  single_value->field_individualPrioritiesValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Individual__Priorities__TLV_template::copy_template(const Individual__Priorities__TLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.individualPrioritiesValue().get_selection()) {
single_value->field_individualPrioritiesValue = other_value.individualPrioritiesValue();
} else {
single_value->field_individualPrioritiesValue.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 Individual__Priorities__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new Individual__Priorities__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new Individual__Priorities__TLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
break;
}
set_selection(other_value);
}

Individual__Priorities__TLV_template::Individual__Priorities__TLV_template()
{
}

Individual__Priorities__TLV_template::Individual__Priorities__TLV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Individual__Priorities__TLV_template::Individual__Priorities__TLV_template(const Individual__Priorities__TLV& other_value)
{
copy_value(other_value);
}

Individual__Priorities__TLV_template::Individual__Priorities__TLV_template(const OPTIONAL<Individual__Priorities__TLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Individual__Priorities__TLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV from an unbound optional field.");
}
}

Individual__Priorities__TLV_template::Individual__Priorities__TLV_template(Individual__Priorities__TLV_template* p_precondition, Individual__Priorities__TLV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Individual__Priorities__TLV_template::Individual__Priorities__TLV_template(Dynamic_Match_Interface<Individual__Priorities__TLV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Individual__Priorities__TLV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Individual__Priorities__TLV_template::Individual__Priorities__TLV_template(const Individual__Priorities__TLV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Individual__Priorities__TLV_template::~Individual__Priorities__TLV_template()
{
clean_up();
}

Individual__Priorities__TLV_template& Individual__Priorities__TLV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Individual__Priorities__TLV_template& Individual__Priorities__TLV_template::operator=(const Individual__Priorities__TLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Individual__Priorities__TLV_template& Individual__Priorities__TLV_template::operator=(const OPTIONAL<Individual__Priorities__TLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Individual__Priorities__TLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
}
return *this;
}

Individual__Priorities__TLV_template& Individual__Priorities__TLV_template::operator=(const Individual__Priorities__TLV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Individual__Priorities__TLV_template::match(const Individual__Priorities__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.individualPrioritiesValue().is_bound()) return FALSE;
if(!single_value->field_individualPrioritiesValue.match(other_value.individualPrioritiesValue(), 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.Individual_Priorities_TLV.");
}
return FALSE;
}

boolean Individual__Priorities__TLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_individualPrioritiesValue.is_bound();
}

boolean Individual__Priorities__TLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_individualPrioritiesValue.is_value();
}

void Individual__Priorities__TLV_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

Individual__Priorities__TLV Individual__Priorities__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
Individual__Priorities__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_individualPrioritiesValue.is_bound()) {
ret_val.individualPrioritiesValue() = single_value->field_individualPrioritiesValue.valueof();
}
return ret_val;
}

void Individual__Priorities__TLV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Individual__Priorities__TLV_template[list_length];
}

Individual__Priorities__TLV_template& Individual__Priorities__TLV_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& Individual__Priorities__TLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& Individual__Priorities__TLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& Individual__Priorities__TLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& Individual__Priorities__TLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Individual__Priorities__TLV_template::individualPrioritiesValue()
{
set_specific();
return single_value->field_individualPrioritiesValue;
}

const OCTETSTRING_template& Individual__Priorities__TLV_template::individualPrioritiesValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field individualPrioritiesValue of a non-specific template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
return single_value->field_individualPrioritiesValue;
}

int Individual__Priorities__TLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV 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.Individual_Priorities_TLV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
  }
  return 0;
}

void Individual__Priorities__TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", individualPrioritiesValue := ");
single_value->field_individualPrioritiesValue.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 Individual__Priorities__TLV_template::log_match(const Individual__Priorities__TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_individualPrioritiesValue.match(match_value.individualPrioritiesValue(), legacy)){
TTCN_Logger::log_logmatch_info(".individualPrioritiesValue");
single_value->field_individualPrioritiesValue.log_match(match_value.individualPrioritiesValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", individualPrioritiesValue := ");
single_value->field_individualPrioritiesValue.log_match(match_value.individualPrioritiesValue(), 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 Individual__Priorities__TLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (individualPrioritiesValue().is_bound()) individualPrioritiesValue().set_implicit_omit();
}

void Individual__Priorities__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_individualPrioritiesValue.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.Individual_Priorities_TLV.");
}
}

void Individual__Priorities__TLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_individualPrioritiesValue.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 Individual__Priorities__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.Individual_Priorities_TLV.");
}
}

void Individual__Priorities__TLV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Individual__Priorities__TLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.Individual_Priorities_TLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) individualPrioritiesValue().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "individualPrioritiesValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          individualPrioritiesValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.Individual_Priorities_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Individual__Priorities__TLV_template* precondition = new Individual__Priorities__TLV_template;
    precondition->set_param(*param.get_elem(0));
    Individual__Priorities__TLV_template* implied_template = new Individual__Priorities__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Individual__Priorities__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.Individual_Priorities_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void Individual__Priorities__TLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.Individual_Priorities_TLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.Individual_Priorities_TLV");
single_value->field_individualPrioritiesValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.Individual_Priorities_TLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.Individual_Priorities_TLV");
}

boolean Individual__Priorities__TLV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Individual__Priorities__TLV_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

FeatureIndicator__V::FeatureIndicator__V()
{
}

FeatureIndicator__V::FeatureIndicator__V(const BITSTRING& par_pS__IR,
    const BITSTRING& par_cs__IR,
    const BITSTRING& par_spare,
    const BITSTRING& par_pEO__BCCH__CHANGE__MARK)
  :   field_pS__IR(par_pS__IR),
  field_cs__IR(par_cs__IR),
  field_spare(par_spare),
  field_pEO__BCCH__CHANGE__MARK(par_pEO__BCCH__CHANGE__MARK)
{
}

FeatureIndicator__V::FeatureIndicator__V(const FeatureIndicator__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.FeatureIndicator_V.");
if (other_value.pS__IR().is_bound()) field_pS__IR = other_value.pS__IR();
else field_pS__IR.clean_up();
if (other_value.cs__IR().is_bound()) field_cs__IR = other_value.cs__IR();
else field_cs__IR.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.pEO__BCCH__CHANGE__MARK().is_bound()) field_pEO__BCCH__CHANGE__MARK = other_value.pEO__BCCH__CHANGE__MARK();
else field_pEO__BCCH__CHANGE__MARK.clean_up();
}

void FeatureIndicator__V::clean_up()
{
field_pS__IR.clean_up();
field_cs__IR.clean_up();
field_spare.clean_up();
field_pEO__BCCH__CHANGE__MARK.clean_up();
}

const TTCN_Typedescriptor_t* FeatureIndicator__V::get_descriptor() const { return &FeatureIndicator__V_descr_; }
FeatureIndicator__V& FeatureIndicator__V::operator=(const FeatureIndicator__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.FeatureIndicator_V.");
  if (other_value.pS__IR().is_bound()) field_pS__IR = other_value.pS__IR();
  else field_pS__IR.clean_up();
  if (other_value.cs__IR().is_bound()) field_cs__IR = other_value.cs__IR();
  else field_cs__IR.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.pEO__BCCH__CHANGE__MARK().is_bound()) field_pEO__BCCH__CHANGE__MARK = other_value.pEO__BCCH__CHANGE__MARK();
  else field_pEO__BCCH__CHANGE__MARK.clean_up();
}
return *this;
}

boolean FeatureIndicator__V::operator==(const FeatureIndicator__V& other_value) const
{
return field_pS__IR==other_value.field_pS__IR
  && field_cs__IR==other_value.field_cs__IR
  && field_spare==other_value.field_spare
  && field_pEO__BCCH__CHANGE__MARK==other_value.field_pEO__BCCH__CHANGE__MARK;
}

boolean FeatureIndicator__V::is_bound() const
{
return (field_pS__IR.is_bound())
  || (field_cs__IR.is_bound())
  || (field_spare.is_bound())
  || (field_pEO__BCCH__CHANGE__MARK.is_bound());
}
boolean FeatureIndicator__V::is_value() const
{
return field_pS__IR.is_value()
  && field_cs__IR.is_value()
  && field_spare.is_value()
  && field_pEO__BCCH__CHANGE__MARK.is_value();
}
void FeatureIndicator__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ pS_IR := ");
field_pS__IR.log();
TTCN_Logger::log_event_str(", cs_IR := ");
field_cs__IR.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", pEO_BCCH_CHANGE_MARK := ");
field_pEO__BCCH__CHANGE__MARK.log();
TTCN_Logger::log_event_str(" }");
}

void FeatureIndicator__V::set_implicit_omit()
{
if (pS__IR().is_bound()) pS__IR().set_implicit_omit();
if (cs__IR().is_bound()) cs__IR().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (pEO__BCCH__CHANGE__MARK().is_bound()) pEO__BCCH__CHANGE__MARK().set_implicit_omit();
}

void FeatureIndicator__V::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.FeatureIndicator_V 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) pS__IR().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cs__IR().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pEO__BCCH__CHANGE__MARK().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(), "pS_IR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__IR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cs_IR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cs__IR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pEO_BCCH_CHANGE_MARK")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pEO__BCCH__CHANGE__MARK().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.FeatureIndicator_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.FeatureIndicator_V");
  }
}

void FeatureIndicator__V::encode_text(Text_Buf& text_buf) const
{
field_pS__IR.encode_text(text_buf);
field_cs__IR.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_pEO__BCCH__CHANGE__MARK.encode_text(text_buf);
}

void FeatureIndicator__V::decode_text(Text_Buf& text_buf)
{
field_pS__IR.decode_text(text_buf);
field_cs__IR.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_pEO__BCCH__CHANGE__MARK.decode_text(text_buf);
}

void FeatureIndicator__V::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void FeatureIndicator__V::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int FeatureIndicator__V::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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_pS__IR.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cs__IR.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_pEO__BCCH__CHANGE__MARK.RAW_decode(General__Types::BIT1_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 FeatureIndicator__V::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  encoded_length += field_pS__IR.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cs__IR.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_pEO__BCCH__CHANGE__MARK.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct FeatureIndicator__V_template::single_value_struct {
BITSTRING_template field_pS__IR;
BITSTRING_template field_cs__IR;
BITSTRING_template field_spare;
BITSTRING_template field_pEO__BCCH__CHANGE__MARK;
};

void FeatureIndicator__V_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_pS__IR = ANY_VALUE;
single_value->field_cs__IR = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_pEO__BCCH__CHANGE__MARK = ANY_VALUE;
}
}
}

void FeatureIndicator__V_template::copy_value(const FeatureIndicator__V& other_value)
{
single_value = new single_value_struct;
if (other_value.pS__IR().is_bound()) {
  single_value->field_pS__IR = other_value.pS__IR();
} else {
  single_value->field_pS__IR.clean_up();
}
if (other_value.cs__IR().is_bound()) {
  single_value->field_cs__IR = other_value.cs__IR();
} else {
  single_value->field_cs__IR.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.pEO__BCCH__CHANGE__MARK().is_bound()) {
  single_value->field_pEO__BCCH__CHANGE__MARK = other_value.pEO__BCCH__CHANGE__MARK();
} else {
  single_value->field_pEO__BCCH__CHANGE__MARK.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void FeatureIndicator__V_template::copy_template(const FeatureIndicator__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.pS__IR().get_selection()) {
single_value->field_pS__IR = other_value.pS__IR();
} else {
single_value->field_pS__IR.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cs__IR().get_selection()) {
single_value->field_cs__IR = other_value.cs__IR();
} else {
single_value->field_cs__IR.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pEO__BCCH__CHANGE__MARK().get_selection()) {
single_value->field_pEO__BCCH__CHANGE__MARK = other_value.pEO__BCCH__CHANGE__MARK();
} else {
single_value->field_pEO__BCCH__CHANGE__MARK.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 FeatureIndicator__V_template[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 FeatureIndicator__V_template(*other_value.implication_.precondition);
implication_.implied_template = new FeatureIndicator__V_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.FeatureIndicator_V.");
break;
}
set_selection(other_value);
}

FeatureIndicator__V_template::FeatureIndicator__V_template()
{
}

FeatureIndicator__V_template::FeatureIndicator__V_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

FeatureIndicator__V_template::FeatureIndicator__V_template(const FeatureIndicator__V& other_value)
{
copy_value(other_value);
}

FeatureIndicator__V_template::FeatureIndicator__V_template(const OPTIONAL<FeatureIndicator__V>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FeatureIndicator__V&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.FeatureIndicator_V from an unbound optional field.");
}
}

FeatureIndicator__V_template::FeatureIndicator__V_template(FeatureIndicator__V_template* p_precondition, FeatureIndicator__V_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

FeatureIndicator__V_template::FeatureIndicator__V_template(Dynamic_Match_Interface<FeatureIndicator__V>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<FeatureIndicator__V>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

FeatureIndicator__V_template::FeatureIndicator__V_template(const FeatureIndicator__V_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

FeatureIndicator__V_template::~FeatureIndicator__V_template()
{
clean_up();
}

FeatureIndicator__V_template& FeatureIndicator__V_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

FeatureIndicator__V_template& FeatureIndicator__V_template::operator=(const FeatureIndicator__V& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

FeatureIndicator__V_template& FeatureIndicator__V_template::operator=(const OPTIONAL<FeatureIndicator__V>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FeatureIndicator__V&)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.FeatureIndicator_V.");
}
return *this;
}

FeatureIndicator__V_template& FeatureIndicator__V_template::operator=(const FeatureIndicator__V_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean FeatureIndicator__V_template::match(const FeatureIndicator__V& 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.pS__IR().is_bound()) return FALSE;
if(!single_value->field_pS__IR.match(other_value.pS__IR(), legacy))return FALSE;
if(!other_value.cs__IR().is_bound()) return FALSE;
if(!single_value->field_cs__IR.match(other_value.cs__IR(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.pEO__BCCH__CHANGE__MARK().is_bound()) return FALSE;
if(!single_value->field_pEO__BCCH__CHANGE__MARK.match(other_value.pEO__BCCH__CHANGE__MARK(), 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.FeatureIndicator_V.");
}
return FALSE;
}

boolean FeatureIndicator__V_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_pS__IR.is_bound()
 || single_value->field_cs__IR.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_pEO__BCCH__CHANGE__MARK.is_bound();
}

boolean FeatureIndicator__V_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_pS__IR.is_value()
 && single_value->field_cs__IR.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_pEO__BCCH__CHANGE__MARK.is_value();
}

void FeatureIndicator__V_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;
}

FeatureIndicator__V FeatureIndicator__V_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.FeatureIndicator_V.");
FeatureIndicator__V ret_val;
if (single_value->field_pS__IR.is_bound()) {
ret_val.pS__IR() = single_value->field_pS__IR.valueof();
}
if (single_value->field_cs__IR.is_bound()) {
ret_val.cs__IR() = single_value->field_cs__IR.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_pEO__BCCH__CHANGE__MARK.is_bound()) {
ret_val.pEO__BCCH__CHANGE__MARK() = single_value->field_pEO__BCCH__CHANGE__MARK.valueof();
}
return ret_val;
}

void FeatureIndicator__V_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.FeatureIndicator_V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new FeatureIndicator__V_template[list_length];
}

FeatureIndicator__V_template& FeatureIndicator__V_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.FeatureIndicator_V.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.FeatureIndicator_V.");
return value_list.list_value[list_index];
}

BITSTRING_template& FeatureIndicator__V_template::pS__IR()
{
set_specific();
return single_value->field_pS__IR;
}

const BITSTRING_template& FeatureIndicator__V_template::pS__IR() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pS_IR of a non-specific template of type @MobileL3_RRM_Types.FeatureIndicator_V.");
return single_value->field_pS__IR;
}

BITSTRING_template& FeatureIndicator__V_template::cs__IR()
{
set_specific();
return single_value->field_cs__IR;
}

const BITSTRING_template& FeatureIndicator__V_template::cs__IR() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cs_IR of a non-specific template of type @MobileL3_RRM_Types.FeatureIndicator_V.");
return single_value->field_cs__IR;
}

BITSTRING_template& FeatureIndicator__V_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& FeatureIndicator__V_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_RRM_Types.FeatureIndicator_V.");
return single_value->field_spare;
}

BITSTRING_template& FeatureIndicator__V_template::pEO__BCCH__CHANGE__MARK()
{
set_specific();
return single_value->field_pEO__BCCH__CHANGE__MARK;
}

const BITSTRING_template& FeatureIndicator__V_template::pEO__BCCH__CHANGE__MARK() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pEO_BCCH_CHANGE_MARK of a non-specific template of type @MobileL3_RRM_Types.FeatureIndicator_V.");
return single_value->field_pEO__BCCH__CHANGE__MARK;
}

int FeatureIndicator__V_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.FeatureIndicator_V 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.FeatureIndicator_V 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.FeatureIndicator_V 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.FeatureIndicator_V containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.FeatureIndicator_V containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.FeatureIndicator_V containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.FeatureIndicator_V containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.FeatureIndicator_V containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.FeatureIndicator_V containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.FeatureIndicator_V.");
  }
  return 0;
}

void FeatureIndicator__V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ pS_IR := ");
single_value->field_pS__IR.log();
TTCN_Logger::log_event_str(", cs_IR := ");
single_value->field_cs__IR.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", pEO_BCCH_CHANGE_MARK := ");
single_value->field_pEO__BCCH__CHANGE__MARK.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 FeatureIndicator__V_template::log_match(const FeatureIndicator__V& 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_pS__IR.match(match_value.pS__IR(), legacy)){
TTCN_Logger::log_logmatch_info(".pS_IR");
single_value->field_pS__IR.log_match(match_value.pS__IR(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cs__IR.match(match_value.cs__IR(), legacy)){
TTCN_Logger::log_logmatch_info(".cs_IR");
single_value->field_cs__IR.log_match(match_value.cs__IR(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pEO__BCCH__CHANGE__MARK.match(match_value.pEO__BCCH__CHANGE__MARK(), legacy)){
TTCN_Logger::log_logmatch_info(".pEO_BCCH_CHANGE_MARK");
single_value->field_pEO__BCCH__CHANGE__MARK.log_match(match_value.pEO__BCCH__CHANGE__MARK(), 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("{ pS_IR := ");
single_value->field_pS__IR.log_match(match_value.pS__IR(), legacy);
TTCN_Logger::log_event_str(", cs_IR := ");
single_value->field_cs__IR.log_match(match_value.cs__IR(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", pEO_BCCH_CHANGE_MARK := ");
single_value->field_pEO__BCCH__CHANGE__MARK.log_match(match_value.pEO__BCCH__CHANGE__MARK(), 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 FeatureIndicator__V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (pS__IR().is_bound()) pS__IR().set_implicit_omit();
if (cs__IR().is_bound()) cs__IR().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (pEO__BCCH__CHANGE__MARK().is_bound()) pEO__BCCH__CHANGE__MARK().set_implicit_omit();
}

void FeatureIndicator__V_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_pS__IR.encode_text(text_buf);
single_value->field_cs__IR.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_pEO__BCCH__CHANGE__MARK.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.FeatureIndicator_V.");
}
}

void FeatureIndicator__V_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_pS__IR.decode_text(text_buf);
single_value->field_cs__IR.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_pEO__BCCH__CHANGE__MARK.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 FeatureIndicator__V_template[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.FeatureIndicator_V.");
}
}

void FeatureIndicator__V_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: {
    FeatureIndicator__V_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.FeatureIndicator_V 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) pS__IR().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cs__IR().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pEO__BCCH__CHANGE__MARK().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(), "pS_IR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__IR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cs_IR")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cs__IR().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pEO_BCCH_CHANGE_MARK")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pEO__BCCH__CHANGE__MARK().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.FeatureIndicator_V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    FeatureIndicator__V_template* precondition = new FeatureIndicator__V_template;
    precondition->set_param(*param.get_elem(0));
    FeatureIndicator__V_template* implied_template = new FeatureIndicator__V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = FeatureIndicator__V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.FeatureIndicator_V");
  }
  is_ifpresent = param.get_ifpresent();
}

void FeatureIndicator__V_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_pS__IR.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.FeatureIndicator_V");
single_value->field_cs__IR.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.FeatureIndicator_V");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.FeatureIndicator_V");
single_value->field_pEO__BCCH__CHANGE__MARK.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.FeatureIndicator_V");
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.FeatureIndicator_V");
}

boolean FeatureIndicator__V_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean FeatureIndicator__V_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;
}

DL__DCCH__Message__LV::DL__DCCH__Message__LV()
{
}

DL__DCCH__Message__LV::DL__DCCH__Message__LV(const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_dL__DCCH__MessageValue)
  :   field_lengthIndicator(par_lengthIndicator),
  field_dL__DCCH__MessageValue(par_dL__DCCH__MessageValue)
{
}

DL__DCCH__Message__LV::DL__DCCH__Message__LV(const DL__DCCH__Message__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.dL__DCCH__MessageValue().is_bound()) field_dL__DCCH__MessageValue = other_value.dL__DCCH__MessageValue();
else field_dL__DCCH__MessageValue.clean_up();
}

void DL__DCCH__Message__LV::clean_up()
{
field_lengthIndicator.clean_up();
field_dL__DCCH__MessageValue.clean_up();
}

const TTCN_Typedescriptor_t* DL__DCCH__Message__LV::get_descriptor() const { return &DL__DCCH__Message__LV_descr_; }
DL__DCCH__Message__LV& DL__DCCH__Message__LV::operator=(const DL__DCCH__Message__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.dL__DCCH__MessageValue().is_bound()) field_dL__DCCH__MessageValue = other_value.dL__DCCH__MessageValue();
  else field_dL__DCCH__MessageValue.clean_up();
}
return *this;
}

boolean DL__DCCH__Message__LV::operator==(const DL__DCCH__Message__LV& other_value) const
{
return field_lengthIndicator==other_value.field_lengthIndicator
  && field_dL__DCCH__MessageValue==other_value.field_dL__DCCH__MessageValue;
}

boolean DL__DCCH__Message__LV::is_bound() const
{
return (field_lengthIndicator.is_bound())
  || (field_dL__DCCH__MessageValue.is_bound());
}
boolean DL__DCCH__Message__LV::is_value() const
{
return field_lengthIndicator.is_value()
  && field_dL__DCCH__MessageValue.is_value();
}
void DL__DCCH__Message__LV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", dL_DCCH_MessageValue := ");
field_dL__DCCH__MessageValue.log();
TTCN_Logger::log_event_str(" }");
}

void DL__DCCH__Message__LV::set_implicit_omit()
{
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (dL__DCCH__MessageValue().is_bound()) dL__DCCH__MessageValue().set_implicit_omit();
}

void DL__DCCH__Message__LV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.DL_DCCH_Message_LV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dL__DCCH__MessageValue().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dL_DCCH_MessageValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dL__DCCH__MessageValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.DL_DCCH_Message_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.DL_DCCH_Message_LV");
  }
}

void DL__DCCH__Message__LV::encode_text(Text_Buf& text_buf) const
{
field_lengthIndicator.encode_text(text_buf);
field_dL__DCCH__MessageValue.encode_text(text_buf);
}

void DL__DCCH__Message__LV::decode_text(Text_Buf& text_buf)
{
field_lengthIndicator.decode_text(text_buf);
field_dL__DCCH__MessageValue.decode_text(text_buf);
}

void DL__DCCH__Message__LV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void DL__DCCH__Message__LV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int DL__DCCH__Message__LV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, DL__DCCH__Message__LV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(DL__DCCH__Message__LV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(DL__DCCH__Message__LV_lengthIndicator_descr_);
  field_lengthIndicator = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_dL__DCCH__MessageValue.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int DL__DCCH__Message__LV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, DL__DCCH__Message__LV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, OCTETSTRING_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &DL__DCCH__Message__LV_lengthIndicator_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_dL__DCCH__MessageValue.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct DL__DCCH__Message__LV_template::single_value_struct {
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_dL__DCCH__MessageValue;
};

void DL__DCCH__Message__LV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_dL__DCCH__MessageValue = ANY_VALUE;
}
}
}

void DL__DCCH__Message__LV_template::copy_value(const DL__DCCH__Message__LV& other_value)
{
single_value = new single_value_struct;
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.dL__DCCH__MessageValue().is_bound()) {
  single_value->field_dL__DCCH__MessageValue = other_value.dL__DCCH__MessageValue();
} else {
  single_value->field_dL__DCCH__MessageValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DL__DCCH__Message__LV_template::copy_template(const DL__DCCH__Message__LV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dL__DCCH__MessageValue().get_selection()) {
single_value->field_dL__DCCH__MessageValue = other_value.dL__DCCH__MessageValue();
} else {
single_value->field_dL__DCCH__MessageValue.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 DL__DCCH__Message__LV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new DL__DCCH__Message__LV_template(*other_value.implication_.precondition);
implication_.implied_template = new DL__DCCH__Message__LV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
break;
}
set_selection(other_value);
}

DL__DCCH__Message__LV_template::DL__DCCH__Message__LV_template()
{
}

DL__DCCH__Message__LV_template::DL__DCCH__Message__LV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

DL__DCCH__Message__LV_template::DL__DCCH__Message__LV_template(const DL__DCCH__Message__LV& other_value)
{
copy_value(other_value);
}

DL__DCCH__Message__LV_template::DL__DCCH__Message__LV_template(const OPTIONAL<DL__DCCH__Message__LV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DL__DCCH__Message__LV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV from an unbound optional field.");
}
}

DL__DCCH__Message__LV_template::DL__DCCH__Message__LV_template(DL__DCCH__Message__LV_template* p_precondition, DL__DCCH__Message__LV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

DL__DCCH__Message__LV_template::DL__DCCH__Message__LV_template(Dynamic_Match_Interface<DL__DCCH__Message__LV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<DL__DCCH__Message__LV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

DL__DCCH__Message__LV_template::DL__DCCH__Message__LV_template(const DL__DCCH__Message__LV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

DL__DCCH__Message__LV_template::~DL__DCCH__Message__LV_template()
{
clean_up();
}

DL__DCCH__Message__LV_template& DL__DCCH__Message__LV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

DL__DCCH__Message__LV_template& DL__DCCH__Message__LV_template::operator=(const DL__DCCH__Message__LV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

DL__DCCH__Message__LV_template& DL__DCCH__Message__LV_template::operator=(const OPTIONAL<DL__DCCH__Message__LV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const DL__DCCH__Message__LV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
}
return *this;
}

DL__DCCH__Message__LV_template& DL__DCCH__Message__LV_template::operator=(const DL__DCCH__Message__LV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean DL__DCCH__Message__LV_template::match(const DL__DCCH__Message__LV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.dL__DCCH__MessageValue().is_bound()) return FALSE;
if(!single_value->field_dL__DCCH__MessageValue.match(other_value.dL__DCCH__MessageValue(), 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.DL_DCCH_Message_LV.");
}
return FALSE;
}

boolean DL__DCCH__Message__LV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lengthIndicator.is_bound()
 || single_value->field_dL__DCCH__MessageValue.is_bound();
}

boolean DL__DCCH__Message__LV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lengthIndicator.is_value()
 && single_value->field_dL__DCCH__MessageValue.is_value();
}

void DL__DCCH__Message__LV_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

DL__DCCH__Message__LV DL__DCCH__Message__LV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
DL__DCCH__Message__LV ret_val;
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_dL__DCCH__MessageValue.is_bound()) {
ret_val.dL__DCCH__MessageValue() = single_value->field_dL__DCCH__MessageValue.valueof();
}
return ret_val;
}

void DL__DCCH__Message__LV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DL__DCCH__Message__LV_template[list_length];
}

DL__DCCH__Message__LV_template& DL__DCCH__Message__LV_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
return value_list.list_value[list_index];
}

INTEGER_template& DL__DCCH__Message__LV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& DL__DCCH__Message__LV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& DL__DCCH__Message__LV_template::dL__DCCH__MessageValue()
{
set_specific();
return single_value->field_dL__DCCH__MessageValue;
}

const OCTETSTRING_template& DL__DCCH__Message__LV_template::dL__DCCH__MessageValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dL_DCCH_MessageValue of a non-specific template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
return single_value->field_dL__DCCH__MessageValue;
}

int DL__DCCH__Message__LV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
  }
  return 0;
}

void DL__DCCH__Message__LV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", dL_DCCH_MessageValue := ");
single_value->field_dL__DCCH__MessageValue.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 DL__DCCH__Message__LV_template::log_match(const DL__DCCH__Message__LV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dL__DCCH__MessageValue.match(match_value.dL__DCCH__MessageValue(), legacy)){
TTCN_Logger::log_logmatch_info(".dL_DCCH_MessageValue");
single_value->field_dL__DCCH__MessageValue.log_match(match_value.dL__DCCH__MessageValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", dL_DCCH_MessageValue := ");
single_value->field_dL__DCCH__MessageValue.log_match(match_value.dL__DCCH__MessageValue(), 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 DL__DCCH__Message__LV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (dL__DCCH__MessageValue().is_bound()) dL__DCCH__MessageValue().set_implicit_omit();
}

void DL__DCCH__Message__LV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_dL__DCCH__MessageValue.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.DL_DCCH_Message_LV.");
}
}

void DL__DCCH__Message__LV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_dL__DCCH__MessageValue.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 DL__DCCH__Message__LV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV.");
}
}

void DL__DCCH__Message__LV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    DL__DCCH__Message__LV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.DL_DCCH_Message_LV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dL__DCCH__MessageValue().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dL_DCCH_MessageValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dL__DCCH__MessageValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.DL_DCCH_Message_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DL__DCCH__Message__LV_template* precondition = new DL__DCCH__Message__LV_template;
    precondition->set_param(*param.get_elem(0));
    DL__DCCH__Message__LV_template* implied_template = new DL__DCCH__Message__LV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DL__DCCH__Message__LV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.DL_DCCH_Message_LV");
  }
  is_ifpresent = param.get_ifpresent();
}

void DL__DCCH__Message__LV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.DL_DCCH_Message_LV");
single_value->field_dL__DCCH__MessageValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.DL_DCCH_Message_LV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.DL_DCCH_Message_LV");
}

boolean DL__DCCH__Message__LV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DL__DCCH__Message__LV_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

CNToMSTransparentInformation__TLV::CNToMSTransparentInformation__TLV()
{
}

CNToMSTransparentInformation__TLV::CNToMSTransparentInformation__TLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_cNToMSTransparentInformationValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_cNToMSTransparentInformationValue(par_cNToMSTransparentInformationValue)
{
}

CNToMSTransparentInformation__TLV::CNToMSTransparentInformation__TLV(const CNToMSTransparentInformation__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.cNToMSTransparentInformationValue().is_bound()) field_cNToMSTransparentInformationValue = other_value.cNToMSTransparentInformationValue();
else field_cNToMSTransparentInformationValue.clean_up();
}

void CNToMSTransparentInformation__TLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_cNToMSTransparentInformationValue.clean_up();
}

const TTCN_Typedescriptor_t* CNToMSTransparentInformation__TLV::get_descriptor() const { return &CNToMSTransparentInformation__TLV_descr_; }
CNToMSTransparentInformation__TLV& CNToMSTransparentInformation__TLV::operator=(const CNToMSTransparentInformation__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.cNToMSTransparentInformationValue().is_bound()) field_cNToMSTransparentInformationValue = other_value.cNToMSTransparentInformationValue();
  else field_cNToMSTransparentInformationValue.clean_up();
}
return *this;
}

boolean CNToMSTransparentInformation__TLV::operator==(const CNToMSTransparentInformation__TLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_cNToMSTransparentInformationValue==other_value.field_cNToMSTransparentInformationValue;
}

boolean CNToMSTransparentInformation__TLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_cNToMSTransparentInformationValue.is_bound());
}
boolean CNToMSTransparentInformation__TLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_cNToMSTransparentInformationValue.is_value();
}
void CNToMSTransparentInformation__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", cNToMSTransparentInformationValue := ");
field_cNToMSTransparentInformationValue.log();
TTCN_Logger::log_event_str(" }");
}

void CNToMSTransparentInformation__TLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (cNToMSTransparentInformationValue().is_bound()) cNToMSTransparentInformationValue().set_implicit_omit();
}

void CNToMSTransparentInformation__TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cNToMSTransparentInformationValue().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cNToMSTransparentInformationValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cNToMSTransparentInformationValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.CNToMSTransparentInformation_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.CNToMSTransparentInformation_TLV");
  }
}

void CNToMSTransparentInformation__TLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_cNToMSTransparentInformationValue.encode_text(text_buf);
}

void CNToMSTransparentInformation__TLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_cNToMSTransparentInformationValue.decode_text(text_buf);
}

void CNToMSTransparentInformation__TLV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void CNToMSTransparentInformation__TLV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int CNToMSTransparentInformation__TLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, CNToMSTransparentInformation__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(CNToMSTransparentInformation__TLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(CNToMSTransparentInformation__TLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_cNToMSTransparentInformationValue.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CNToMSTransparentInformation__TLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CNToMSTransparentInformation__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &CNToMSTransparentInformation__TLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_cNToMSTransparentInformationValue.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct CNToMSTransparentInformation__TLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_cNToMSTransparentInformationValue;
};

void CNToMSTransparentInformation__TLV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_cNToMSTransparentInformationValue = ANY_VALUE;
}
}
}

void CNToMSTransparentInformation__TLV_template::copy_value(const CNToMSTransparentInformation__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.cNToMSTransparentInformationValue().is_bound()) {
  single_value->field_cNToMSTransparentInformationValue = other_value.cNToMSTransparentInformationValue();
} else {
  single_value->field_cNToMSTransparentInformationValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CNToMSTransparentInformation__TLV_template::copy_template(const CNToMSTransparentInformation__TLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cNToMSTransparentInformationValue().get_selection()) {
single_value->field_cNToMSTransparentInformationValue = other_value.cNToMSTransparentInformationValue();
} else {
single_value->field_cNToMSTransparentInformationValue.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 CNToMSTransparentInformation__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new CNToMSTransparentInformation__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new CNToMSTransparentInformation__TLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
break;
}
set_selection(other_value);
}

CNToMSTransparentInformation__TLV_template::CNToMSTransparentInformation__TLV_template()
{
}

CNToMSTransparentInformation__TLV_template::CNToMSTransparentInformation__TLV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

CNToMSTransparentInformation__TLV_template::CNToMSTransparentInformation__TLV_template(const CNToMSTransparentInformation__TLV& other_value)
{
copy_value(other_value);
}

CNToMSTransparentInformation__TLV_template::CNToMSTransparentInformation__TLV_template(const OPTIONAL<CNToMSTransparentInformation__TLV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CNToMSTransparentInformation__TLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV from an unbound optional field.");
}
}

CNToMSTransparentInformation__TLV_template::CNToMSTransparentInformation__TLV_template(CNToMSTransparentInformation__TLV_template* p_precondition, CNToMSTransparentInformation__TLV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

CNToMSTransparentInformation__TLV_template::CNToMSTransparentInformation__TLV_template(Dynamic_Match_Interface<CNToMSTransparentInformation__TLV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<CNToMSTransparentInformation__TLV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

CNToMSTransparentInformation__TLV_template::CNToMSTransparentInformation__TLV_template(const CNToMSTransparentInformation__TLV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

CNToMSTransparentInformation__TLV_template::~CNToMSTransparentInformation__TLV_template()
{
clean_up();
}

CNToMSTransparentInformation__TLV_template& CNToMSTransparentInformation__TLV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

CNToMSTransparentInformation__TLV_template& CNToMSTransparentInformation__TLV_template::operator=(const CNToMSTransparentInformation__TLV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

CNToMSTransparentInformation__TLV_template& CNToMSTransparentInformation__TLV_template::operator=(const OPTIONAL<CNToMSTransparentInformation__TLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CNToMSTransparentInformation__TLV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
}
return *this;
}

CNToMSTransparentInformation__TLV_template& CNToMSTransparentInformation__TLV_template::operator=(const CNToMSTransparentInformation__TLV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean CNToMSTransparentInformation__TLV_template::match(const CNToMSTransparentInformation__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.cNToMSTransparentInformationValue().is_bound()) return FALSE;
if(!single_value->field_cNToMSTransparentInformationValue.match(other_value.cNToMSTransparentInformationValue(), 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.CNToMSTransparentInformation_TLV.");
}
return FALSE;
}

boolean CNToMSTransparentInformation__TLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_cNToMSTransparentInformationValue.is_bound();
}

boolean CNToMSTransparentInformation__TLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_cNToMSTransparentInformationValue.is_value();
}

void CNToMSTransparentInformation__TLV_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

CNToMSTransparentInformation__TLV CNToMSTransparentInformation__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
CNToMSTransparentInformation__TLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_cNToMSTransparentInformationValue.is_bound()) {
ret_val.cNToMSTransparentInformationValue() = single_value->field_cNToMSTransparentInformationValue.valueof();
}
return ret_val;
}

void CNToMSTransparentInformation__TLV_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CNToMSTransparentInformation__TLV_template[list_length];
}

CNToMSTransparentInformation__TLV_template& CNToMSTransparentInformation__TLV_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& CNToMSTransparentInformation__TLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& CNToMSTransparentInformation__TLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& CNToMSTransparentInformation__TLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& CNToMSTransparentInformation__TLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& CNToMSTransparentInformation__TLV_template::cNToMSTransparentInformationValue()
{
set_specific();
return single_value->field_cNToMSTransparentInformationValue;
}

const OCTETSTRING_template& CNToMSTransparentInformation__TLV_template::cNToMSTransparentInformationValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cNToMSTransparentInformationValue of a non-specific template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
return single_value->field_cNToMSTransparentInformationValue;
}

int CNToMSTransparentInformation__TLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV 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.CNToMSTransparentInformation_TLV containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
  }
  return 0;
}

void CNToMSTransparentInformation__TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", cNToMSTransparentInformationValue := ");
single_value->field_cNToMSTransparentInformationValue.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 CNToMSTransparentInformation__TLV_template::log_match(const CNToMSTransparentInformation__TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cNToMSTransparentInformationValue.match(match_value.cNToMSTransparentInformationValue(), legacy)){
TTCN_Logger::log_logmatch_info(".cNToMSTransparentInformationValue");
single_value->field_cNToMSTransparentInformationValue.log_match(match_value.cNToMSTransparentInformationValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", cNToMSTransparentInformationValue := ");
single_value->field_cNToMSTransparentInformationValue.log_match(match_value.cNToMSTransparentInformationValue(), 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 CNToMSTransparentInformation__TLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (cNToMSTransparentInformationValue().is_bound()) cNToMSTransparentInformationValue().set_implicit_omit();
}

void CNToMSTransparentInformation__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_cNToMSTransparentInformationValue.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.CNToMSTransparentInformation_TLV.");
}
}

void CNToMSTransparentInformation__TLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_cNToMSTransparentInformationValue.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 CNToMSTransparentInformation__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV.");
}
}

void CNToMSTransparentInformation__TLV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CNToMSTransparentInformation__TLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.CNToMSTransparentInformation_TLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cNToMSTransparentInformationValue().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cNToMSTransparentInformationValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cNToMSTransparentInformationValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.CNToMSTransparentInformation_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CNToMSTransparentInformation__TLV_template* precondition = new CNToMSTransparentInformation__TLV_template;
    precondition->set_param(*param.get_elem(0));
    CNToMSTransparentInformation__TLV_template* implied_template = new CNToMSTransparentInformation__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CNToMSTransparentInformation__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.CNToMSTransparentInformation_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void CNToMSTransparentInformation__TLV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.CNToMSTransparentInformation_TLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.CNToMSTransparentInformation_TLV");
single_value->field_cNToMSTransparentInformationValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.CNToMSTransparentInformation_TLV");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.CNToMSTransparentInformation_TLV");
}

boolean CNToMSTransparentInformation__TLV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean CNToMSTransparentInformation__TLV_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PLMNIndex__TV::PLMNIndex__TV()
{
}

PLMNIndex__TV::PLMNIndex__TV(const BITSTRING& par_pLMNIndex,
    const BITSTRING& par_elementIdentifier)
  :   field_pLMNIndex(par_pLMNIndex),
  field_elementIdentifier(par_elementIdentifier)
{
}

PLMNIndex__TV::PLMNIndex__TV(const PLMNIndex__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PLMNIndex_TV.");
if (other_value.pLMNIndex().is_bound()) field_pLMNIndex = other_value.pLMNIndex();
else field_pLMNIndex.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void PLMNIndex__TV::clean_up()
{
field_pLMNIndex.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* PLMNIndex__TV::get_descriptor() const { return &PLMNIndex__TV_descr_; }
PLMNIndex__TV& PLMNIndex__TV::operator=(const PLMNIndex__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PLMNIndex_TV.");
  if (other_value.pLMNIndex().is_bound()) field_pLMNIndex = other_value.pLMNIndex();
  else field_pLMNIndex.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean PLMNIndex__TV::operator==(const PLMNIndex__TV& other_value) const
{
return field_pLMNIndex==other_value.field_pLMNIndex
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean PLMNIndex__TV::is_bound() const
{
return (field_pLMNIndex.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean PLMNIndex__TV::is_value() const
{
return field_pLMNIndex.is_value()
  && field_elementIdentifier.is_value();
}
void PLMNIndex__TV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ pLMNIndex := ");
field_pLMNIndex.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void PLMNIndex__TV::set_implicit_omit()
{
if (pLMNIndex().is_bound()) pLMNIndex().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void PLMNIndex__TV::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.PLMNIndex_TV 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) pLMNIndex().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PLMNIndex_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PLMNIndex_TV");
  }
}

void PLMNIndex__TV::encode_text(Text_Buf& text_buf) const
{
field_pLMNIndex.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void PLMNIndex__TV::decode_text(Text_Buf& text_buf)
{
field_pLMNIndex.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void PLMNIndex__TV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PLMNIndex__TV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PLMNIndex__TV::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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_pLMNIndex.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PLMNIndex__TV::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::BIT4_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_pLMNIndex.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PLMNIndex__TV_template::single_value_struct {
BITSTRING_template field_pLMNIndex;
BITSTRING_template field_elementIdentifier;
};

void PLMNIndex__TV_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_pLMNIndex = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void PLMNIndex__TV_template::copy_value(const PLMNIndex__TV& other_value)
{
single_value = new single_value_struct;
if (other_value.pLMNIndex().is_bound()) {
  single_value->field_pLMNIndex = other_value.pLMNIndex();
} else {
  single_value->field_pLMNIndex.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PLMNIndex__TV_template::copy_template(const PLMNIndex__TV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
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.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PLMNIndex__TV_template[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 PLMNIndex__TV_template(*other_value.implication_.precondition);
implication_.implied_template = new PLMNIndex__TV_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.PLMNIndex_TV.");
break;
}
set_selection(other_value);
}

PLMNIndex__TV_template::PLMNIndex__TV_template()
{
}

PLMNIndex__TV_template::PLMNIndex__TV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PLMNIndex__TV_template::PLMNIndex__TV_template(const PLMNIndex__TV& other_value)
{
copy_value(other_value);
}

PLMNIndex__TV_template::PLMNIndex__TV_template(const OPTIONAL<PLMNIndex__TV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PLMNIndex__TV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.PLMNIndex_TV from an unbound optional field.");
}
}

PLMNIndex__TV_template::PLMNIndex__TV_template(PLMNIndex__TV_template* p_precondition, PLMNIndex__TV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PLMNIndex__TV_template::PLMNIndex__TV_template(Dynamic_Match_Interface<PLMNIndex__TV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PLMNIndex__TV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PLMNIndex__TV_template::PLMNIndex__TV_template(const PLMNIndex__TV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PLMNIndex__TV_template::~PLMNIndex__TV_template()
{
clean_up();
}

PLMNIndex__TV_template& PLMNIndex__TV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PLMNIndex__TV_template& PLMNIndex__TV_template::operator=(const PLMNIndex__TV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PLMNIndex__TV_template& PLMNIndex__TV_template::operator=(const OPTIONAL<PLMNIndex__TV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PLMNIndex__TV&)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.PLMNIndex_TV.");
}
return *this;
}

PLMNIndex__TV_template& PLMNIndex__TV_template::operator=(const PLMNIndex__TV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PLMNIndex__TV_template::match(const PLMNIndex__TV& 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.pLMNIndex().is_bound()) return FALSE;
if(!single_value->field_pLMNIndex.match(other_value.pLMNIndex(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.PLMNIndex_TV.");
}
return FALSE;
}

boolean PLMNIndex__TV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_pLMNIndex.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

boolean PLMNIndex__TV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_pLMNIndex.is_value()
 && single_value->field_elementIdentifier.is_value();
}

void PLMNIndex__TV_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;
}

PLMNIndex__TV PLMNIndex__TV_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.PLMNIndex_TV.");
PLMNIndex__TV ret_val;
if (single_value->field_pLMNIndex.is_bound()) {
ret_val.pLMNIndex() = single_value->field_pLMNIndex.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void PLMNIndex__TV_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.PLMNIndex_TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PLMNIndex__TV_template[list_length];
}

PLMNIndex__TV_template& PLMNIndex__TV_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.PLMNIndex_TV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PLMNIndex_TV.");
return value_list.list_value[list_index];
}

BITSTRING_template& PLMNIndex__TV_template::pLMNIndex()
{
set_specific();
return single_value->field_pLMNIndex;
}

const BITSTRING_template& PLMNIndex__TV_template::pLMNIndex() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pLMNIndex of a non-specific template of type @MobileL3_RRM_Types.PLMNIndex_TV.");
return single_value->field_pLMNIndex;
}

BITSTRING_template& PLMNIndex__TV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& PLMNIndex__TV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_RRM_Types.PLMNIndex_TV.");
return single_value->field_elementIdentifier;
}

int PLMNIndex__TV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PLMNIndex_TV 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.PLMNIndex_TV 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.PLMNIndex_TV 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.PLMNIndex_TV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PLMNIndex_TV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PLMNIndex_TV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PLMNIndex_TV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PLMNIndex_TV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PLMNIndex_TV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PLMNIndex_TV.");
  }
  return 0;
}

void PLMNIndex__TV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ pLMNIndex := ");
single_value->field_pLMNIndex.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PLMNIndex__TV_template::log_match(const PLMNIndex__TV& 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_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);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ pLMNIndex := ");
single_value->field_pLMNIndex.log_match(match_value.pLMNIndex(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PLMNIndex__TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (pLMNIndex().is_bound()) pLMNIndex().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void PLMNIndex__TV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_pLMNIndex.encode_text(text_buf);
single_value->field_elementIdentifier.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_RRM_Types.PLMNIndex_TV.");
}
}

void PLMNIndex__TV_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_pLMNIndex.decode_text(text_buf);
single_value->field_elementIdentifier.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PLMNIndex__TV_template[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.PLMNIndex_TV.");
}
}

void PLMNIndex__TV_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: {
    PLMNIndex__TV_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.PLMNIndex_TV 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) pLMNIndex().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PLMNIndex_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PLMNIndex__TV_template* precondition = new PLMNIndex__TV_template;
    precondition->set_param(*param.get_elem(0));
    PLMNIndex__TV_template* implied_template = new PLMNIndex__TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PLMNIndex__TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PLMNIndex_TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void PLMNIndex__TV_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_pLMNIndex.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PLMNIndex_TV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PLMNIndex_TV");
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.PLMNIndex_TV");
}

boolean PLMNIndex__TV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PLMNIndex__TV_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;
}

ExtendedTSCSet__TV::ExtendedTSCSet__TV()
{
}

ExtendedTSCSet__TV::ExtendedTSCSet__TV(const OCTETSTRING& par_elementIdentifier,
    const BITSTRING& par_cSDomainTSCSet,
    const BITSTRING& par_secondPSDomainTSCAssigned,
    const BITSTRING& par_primaryPSDomainTSCSet,
    const BITSTRING& par_secondaryPSDomainTSCSet,
    const BITSTRING& par_secondaryPSDomainTSCValue)
  :   field_elementIdentifier(par_elementIdentifier),
  field_cSDomainTSCSet(par_cSDomainTSCSet),
  field_secondPSDomainTSCAssigned(par_secondPSDomainTSCAssigned),
  field_primaryPSDomainTSCSet(par_primaryPSDomainTSCSet),
  field_secondaryPSDomainTSCSet(par_secondaryPSDomainTSCSet),
  field_secondaryPSDomainTSCValue(par_secondaryPSDomainTSCValue)
{
}

ExtendedTSCSet__TV::ExtendedTSCSet__TV(const ExtendedTSCSet__TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.cSDomainTSCSet().is_bound()) field_cSDomainTSCSet = other_value.cSDomainTSCSet();
else field_cSDomainTSCSet.clean_up();
if (other_value.secondPSDomainTSCAssigned().is_bound()) field_secondPSDomainTSCAssigned = other_value.secondPSDomainTSCAssigned();
else field_secondPSDomainTSCAssigned.clean_up();
if (other_value.primaryPSDomainTSCSet().is_bound()) field_primaryPSDomainTSCSet = other_value.primaryPSDomainTSCSet();
else field_primaryPSDomainTSCSet.clean_up();
if (other_value.secondaryPSDomainTSCSet().is_bound()) field_secondaryPSDomainTSCSet = other_value.secondaryPSDomainTSCSet();
else field_secondaryPSDomainTSCSet.clean_up();
if (other_value.secondaryPSDomainTSCValue().is_bound()) field_secondaryPSDomainTSCValue = other_value.secondaryPSDomainTSCValue();
else field_secondaryPSDomainTSCValue.clean_up();
}

void ExtendedTSCSet__TV::clean_up()
{
field_elementIdentifier.clean_up();
field_cSDomainTSCSet.clean_up();
field_secondPSDomainTSCAssigned.clean_up();
field_primaryPSDomainTSCSet.clean_up();
field_secondaryPSDomainTSCSet.clean_up();
field_secondaryPSDomainTSCValue.clean_up();
}

const TTCN_Typedescriptor_t* ExtendedTSCSet__TV::get_descriptor() const { return &ExtendedTSCSet__TV_descr_; }
ExtendedTSCSet__TV& ExtendedTSCSet__TV::operator=(const ExtendedTSCSet__TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.cSDomainTSCSet().is_bound()) field_cSDomainTSCSet = other_value.cSDomainTSCSet();
  else field_cSDomainTSCSet.clean_up();
  if (other_value.secondPSDomainTSCAssigned().is_bound()) field_secondPSDomainTSCAssigned = other_value.secondPSDomainTSCAssigned();
  else field_secondPSDomainTSCAssigned.clean_up();
  if (other_value.primaryPSDomainTSCSet().is_bound()) field_primaryPSDomainTSCSet = other_value.primaryPSDomainTSCSet();
  else field_primaryPSDomainTSCSet.clean_up();
  if (other_value.secondaryPSDomainTSCSet().is_bound()) field_secondaryPSDomainTSCSet = other_value.secondaryPSDomainTSCSet();
  else field_secondaryPSDomainTSCSet.clean_up();
  if (other_value.secondaryPSDomainTSCValue().is_bound()) field_secondaryPSDomainTSCValue = other_value.secondaryPSDomainTSCValue();
  else field_secondaryPSDomainTSCValue.clean_up();
}
return *this;
}

boolean ExtendedTSCSet__TV::operator==(const ExtendedTSCSet__TV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_cSDomainTSCSet==other_value.field_cSDomainTSCSet
  && field_secondPSDomainTSCAssigned==other_value.field_secondPSDomainTSCAssigned
  && field_primaryPSDomainTSCSet==other_value.field_primaryPSDomainTSCSet
  && field_secondaryPSDomainTSCSet==other_value.field_secondaryPSDomainTSCSet
  && field_secondaryPSDomainTSCValue==other_value.field_secondaryPSDomainTSCValue;
}

boolean ExtendedTSCSet__TV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_cSDomainTSCSet.is_bound())
  || (field_secondPSDomainTSCAssigned.is_bound())
  || (field_primaryPSDomainTSCSet.is_bound())
  || (field_secondaryPSDomainTSCSet.is_bound())
  || (field_secondaryPSDomainTSCValue.is_bound());
}
boolean ExtendedTSCSet__TV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_cSDomainTSCSet.is_value()
  && field_secondPSDomainTSCAssigned.is_value()
  && field_primaryPSDomainTSCSet.is_value()
  && field_secondaryPSDomainTSCSet.is_value()
  && field_secondaryPSDomainTSCValue.is_value();
}
void ExtendedTSCSet__TV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", cSDomainTSCSet := ");
field_cSDomainTSCSet.log();
TTCN_Logger::log_event_str(", secondPSDomainTSCAssigned := ");
field_secondPSDomainTSCAssigned.log();
TTCN_Logger::log_event_str(", primaryPSDomainTSCSet := ");
field_primaryPSDomainTSCSet.log();
TTCN_Logger::log_event_str(", secondaryPSDomainTSCSet := ");
field_secondaryPSDomainTSCSet.log();
TTCN_Logger::log_event_str(", secondaryPSDomainTSCValue := ");
field_secondaryPSDomainTSCValue.log();
TTCN_Logger::log_event_str(" }");
}

void ExtendedTSCSet__TV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (cSDomainTSCSet().is_bound()) cSDomainTSCSet().set_implicit_omit();
if (secondPSDomainTSCAssigned().is_bound()) secondPSDomainTSCAssigned().set_implicit_omit();
if (primaryPSDomainTSCSet().is_bound()) primaryPSDomainTSCSet().set_implicit_omit();
if (secondaryPSDomainTSCSet().is_bound()) secondaryPSDomainTSCSet().set_implicit_omit();
if (secondaryPSDomainTSCValue().is_bound()) secondaryPSDomainTSCValue().set_implicit_omit();
}

void ExtendedTSCSet__TV::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.ExtendedTSCSet_TV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cSDomainTSCSet().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) secondPSDomainTSCAssigned().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) primaryPSDomainTSCSet().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) secondaryPSDomainTSCSet().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) secondaryPSDomainTSCValue().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cSDomainTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cSDomainTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondPSDomainTSCAssigned")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondPSDomainTSCAssigned().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "primaryPSDomainTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          primaryPSDomainTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondaryPSDomainTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondaryPSDomainTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondaryPSDomainTSCValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondaryPSDomainTSCValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.ExtendedTSCSet_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.ExtendedTSCSet_TV");
  }
}

void ExtendedTSCSet__TV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_cSDomainTSCSet.encode_text(text_buf);
field_secondPSDomainTSCAssigned.encode_text(text_buf);
field_primaryPSDomainTSCSet.encode_text(text_buf);
field_secondaryPSDomainTSCSet.encode_text(text_buf);
field_secondaryPSDomainTSCValue.encode_text(text_buf);
}

void ExtendedTSCSet__TV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_cSDomainTSCSet.decode_text(text_buf);
field_secondPSDomainTSCAssigned.decode_text(text_buf);
field_primaryPSDomainTSCSet.decode_text(text_buf);
field_secondaryPSDomainTSCSet.decode_text(text_buf);
field_secondaryPSDomainTSCValue.decode_text(text_buf);
}

void ExtendedTSCSet__TV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ExtendedTSCSet__TV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ExtendedTSCSet__TV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_cSDomainTSCSet.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_secondPSDomainTSCAssigned.RAW_decode(General__Types::BIT1_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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_primaryPSDomainTSCSet.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_secondaryPSDomainTSCSet.RAW_decode(General__Types::BIT1_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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_secondaryPSDomainTSCValue.RAW_decode(General__Types::BIT3_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 ExtendedTSCSet__TV::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::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT3_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cSDomainTSCSet.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_secondPSDomainTSCAssigned.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_primaryPSDomainTSCSet.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_secondaryPSDomainTSCSet.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_secondaryPSDomainTSCValue.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[5]);
  return myleaf.length = encoded_length;
}

struct ExtendedTSCSet__TV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
BITSTRING_template field_cSDomainTSCSet;
BITSTRING_template field_secondPSDomainTSCAssigned;
BITSTRING_template field_primaryPSDomainTSCSet;
BITSTRING_template field_secondaryPSDomainTSCSet;
BITSTRING_template field_secondaryPSDomainTSCValue;
};

void ExtendedTSCSet__TV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_elementIdentifier = ANY_VALUE;
single_value->field_cSDomainTSCSet = ANY_VALUE;
single_value->field_secondPSDomainTSCAssigned = ANY_VALUE;
single_value->field_primaryPSDomainTSCSet = ANY_VALUE;
single_value->field_secondaryPSDomainTSCSet = ANY_VALUE;
single_value->field_secondaryPSDomainTSCValue = ANY_VALUE;
}
}
}

void ExtendedTSCSet__TV_template::copy_value(const ExtendedTSCSet__TV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
if (other_value.cSDomainTSCSet().is_bound()) {
  single_value->field_cSDomainTSCSet = other_value.cSDomainTSCSet();
} else {
  single_value->field_cSDomainTSCSet.clean_up();
}
if (other_value.secondPSDomainTSCAssigned().is_bound()) {
  single_value->field_secondPSDomainTSCAssigned = other_value.secondPSDomainTSCAssigned();
} else {
  single_value->field_secondPSDomainTSCAssigned.clean_up();
}
if (other_value.primaryPSDomainTSCSet().is_bound()) {
  single_value->field_primaryPSDomainTSCSet = other_value.primaryPSDomainTSCSet();
} else {
  single_value->field_primaryPSDomainTSCSet.clean_up();
}
if (other_value.secondaryPSDomainTSCSet().is_bound()) {
  single_value->field_secondaryPSDomainTSCSet = other_value.secondaryPSDomainTSCSet();
} else {
  single_value->field_secondaryPSDomainTSCSet.clean_up();
}
if (other_value.secondaryPSDomainTSCValue().is_bound()) {
  single_value->field_secondaryPSDomainTSCValue = other_value.secondaryPSDomainTSCValue();
} else {
  single_value->field_secondaryPSDomainTSCValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ExtendedTSCSet__TV_template::copy_template(const ExtendedTSCSet__TV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cSDomainTSCSet().get_selection()) {
single_value->field_cSDomainTSCSet = other_value.cSDomainTSCSet();
} else {
single_value->field_cSDomainTSCSet.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.secondPSDomainTSCAssigned().get_selection()) {
single_value->field_secondPSDomainTSCAssigned = other_value.secondPSDomainTSCAssigned();
} else {
single_value->field_secondPSDomainTSCAssigned.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.primaryPSDomainTSCSet().get_selection()) {
single_value->field_primaryPSDomainTSCSet = other_value.primaryPSDomainTSCSet();
} else {
single_value->field_primaryPSDomainTSCSet.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.secondaryPSDomainTSCSet().get_selection()) {
single_value->field_secondaryPSDomainTSCSet = other_value.secondaryPSDomainTSCSet();
} else {
single_value->field_secondaryPSDomainTSCSet.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.secondaryPSDomainTSCValue().get_selection()) {
single_value->field_secondaryPSDomainTSCValue = other_value.secondaryPSDomainTSCValue();
} else {
single_value->field_secondaryPSDomainTSCValue.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 ExtendedTSCSet__TV_template[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 ExtendedTSCSet__TV_template(*other_value.implication_.precondition);
implication_.implied_template = new ExtendedTSCSet__TV_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.ExtendedTSCSet_TV.");
break;
}
set_selection(other_value);
}

ExtendedTSCSet__TV_template::ExtendedTSCSet__TV_template()
{
}

ExtendedTSCSet__TV_template::ExtendedTSCSet__TV_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

ExtendedTSCSet__TV_template::ExtendedTSCSet__TV_template(const ExtendedTSCSet__TV& other_value)
{
copy_value(other_value);
}

ExtendedTSCSet__TV_template::ExtendedTSCSet__TV_template(const OPTIONAL<ExtendedTSCSet__TV>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ExtendedTSCSet__TV&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV from an unbound optional field.");
}
}

ExtendedTSCSet__TV_template::ExtendedTSCSet__TV_template(ExtendedTSCSet__TV_template* p_precondition, ExtendedTSCSet__TV_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

ExtendedTSCSet__TV_template::ExtendedTSCSet__TV_template(Dynamic_Match_Interface<ExtendedTSCSet__TV>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<ExtendedTSCSet__TV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

ExtendedTSCSet__TV_template::ExtendedTSCSet__TV_template(const ExtendedTSCSet__TV_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

ExtendedTSCSet__TV_template::~ExtendedTSCSet__TV_template()
{
clean_up();
}

ExtendedTSCSet__TV_template& ExtendedTSCSet__TV_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

ExtendedTSCSet__TV_template& ExtendedTSCSet__TV_template::operator=(const ExtendedTSCSet__TV& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ExtendedTSCSet__TV_template& ExtendedTSCSet__TV_template::operator=(const OPTIONAL<ExtendedTSCSet__TV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ExtendedTSCSet__TV&)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.ExtendedTSCSet_TV.");
}
return *this;
}

ExtendedTSCSet__TV_template& ExtendedTSCSet__TV_template::operator=(const ExtendedTSCSet__TV_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean ExtendedTSCSet__TV_template::match(const ExtendedTSCSet__TV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), legacy))return FALSE;
if(!other_value.cSDomainTSCSet().is_bound()) return FALSE;
if(!single_value->field_cSDomainTSCSet.match(other_value.cSDomainTSCSet(), legacy))return FALSE;
if(!other_value.secondPSDomainTSCAssigned().is_bound()) return FALSE;
if(!single_value->field_secondPSDomainTSCAssigned.match(other_value.secondPSDomainTSCAssigned(), legacy))return FALSE;
if(!other_value.primaryPSDomainTSCSet().is_bound()) return FALSE;
if(!single_value->field_primaryPSDomainTSCSet.match(other_value.primaryPSDomainTSCSet(), legacy))return FALSE;
if(!other_value.secondaryPSDomainTSCSet().is_bound()) return FALSE;
if(!single_value->field_secondaryPSDomainTSCSet.match(other_value.secondaryPSDomainTSCSet(), legacy))return FALSE;
if(!other_value.secondaryPSDomainTSCValue().is_bound()) return FALSE;
if(!single_value->field_secondaryPSDomainTSCValue.match(other_value.secondaryPSDomainTSCValue(), 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.ExtendedTSCSet_TV.");
}
return FALSE;
}

boolean ExtendedTSCSet__TV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_cSDomainTSCSet.is_bound()
 || single_value->field_secondPSDomainTSCAssigned.is_bound()
 || single_value->field_primaryPSDomainTSCSet.is_bound()
 || single_value->field_secondaryPSDomainTSCSet.is_bound()
 || single_value->field_secondaryPSDomainTSCValue.is_bound();
}

boolean ExtendedTSCSet__TV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_cSDomainTSCSet.is_value()
 && single_value->field_secondPSDomainTSCAssigned.is_value()
 && single_value->field_primaryPSDomainTSCSet.is_value()
 && single_value->field_secondaryPSDomainTSCSet.is_value()
 && single_value->field_secondaryPSDomainTSCValue.is_value();
}

void ExtendedTSCSet__TV_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;
}

ExtendedTSCSet__TV ExtendedTSCSet__TV_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.ExtendedTSCSet_TV.");
ExtendedTSCSet__TV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_cSDomainTSCSet.is_bound()) {
ret_val.cSDomainTSCSet() = single_value->field_cSDomainTSCSet.valueof();
}
if (single_value->field_secondPSDomainTSCAssigned.is_bound()) {
ret_val.secondPSDomainTSCAssigned() = single_value->field_secondPSDomainTSCAssigned.valueof();
}
if (single_value->field_primaryPSDomainTSCSet.is_bound()) {
ret_val.primaryPSDomainTSCSet() = single_value->field_primaryPSDomainTSCSet.valueof();
}
if (single_value->field_secondaryPSDomainTSCSet.is_bound()) {
ret_val.secondaryPSDomainTSCSet() = single_value->field_secondaryPSDomainTSCSet.valueof();
}
if (single_value->field_secondaryPSDomainTSCValue.is_bound()) {
ret_val.secondaryPSDomainTSCValue() = single_value->field_secondaryPSDomainTSCValue.valueof();
}
return ret_val;
}

void ExtendedTSCSet__TV_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.ExtendedTSCSet_TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ExtendedTSCSet__TV_template[list_length];
}

ExtendedTSCSet__TV_template& ExtendedTSCSet__TV_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.ExtendedTSCSet_TV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& ExtendedTSCSet__TV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& ExtendedTSCSet__TV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
return single_value->field_elementIdentifier;
}

BITSTRING_template& ExtendedTSCSet__TV_template::cSDomainTSCSet()
{
set_specific();
return single_value->field_cSDomainTSCSet;
}

const BITSTRING_template& ExtendedTSCSet__TV_template::cSDomainTSCSet() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cSDomainTSCSet of a non-specific template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
return single_value->field_cSDomainTSCSet;
}

BITSTRING_template& ExtendedTSCSet__TV_template::secondPSDomainTSCAssigned()
{
set_specific();
return single_value->field_secondPSDomainTSCAssigned;
}

const BITSTRING_template& ExtendedTSCSet__TV_template::secondPSDomainTSCAssigned() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field secondPSDomainTSCAssigned of a non-specific template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
return single_value->field_secondPSDomainTSCAssigned;
}

BITSTRING_template& ExtendedTSCSet__TV_template::primaryPSDomainTSCSet()
{
set_specific();
return single_value->field_primaryPSDomainTSCSet;
}

const BITSTRING_template& ExtendedTSCSet__TV_template::primaryPSDomainTSCSet() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field primaryPSDomainTSCSet of a non-specific template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
return single_value->field_primaryPSDomainTSCSet;
}

BITSTRING_template& ExtendedTSCSet__TV_template::secondaryPSDomainTSCSet()
{
set_specific();
return single_value->field_secondaryPSDomainTSCSet;
}

const BITSTRING_template& ExtendedTSCSet__TV_template::secondaryPSDomainTSCSet() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field secondaryPSDomainTSCSet of a non-specific template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
return single_value->field_secondaryPSDomainTSCSet;
}

BITSTRING_template& ExtendedTSCSet__TV_template::secondaryPSDomainTSCValue()
{
set_specific();
return single_value->field_secondaryPSDomainTSCValue;
}

const BITSTRING_template& ExtendedTSCSet__TV_template::secondaryPSDomainTSCValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field secondaryPSDomainTSCValue of a non-specific template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
return single_value->field_secondaryPSDomainTSCValue;
}

int ExtendedTSCSet__TV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 6;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV 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.ExtendedTSCSet_TV 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.ExtendedTSCSet_TV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.ExtendedTSCSet_TV.");
  }
  return 0;
}

void ExtendedTSCSet__TV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", cSDomainTSCSet := ");
single_value->field_cSDomainTSCSet.log();
TTCN_Logger::log_event_str(", secondPSDomainTSCAssigned := ");
single_value->field_secondPSDomainTSCAssigned.log();
TTCN_Logger::log_event_str(", primaryPSDomainTSCSet := ");
single_value->field_primaryPSDomainTSCSet.log();
TTCN_Logger::log_event_str(", secondaryPSDomainTSCSet := ");
single_value->field_secondaryPSDomainTSCSet.log();
TTCN_Logger::log_event_str(", secondaryPSDomainTSCValue := ");
single_value->field_secondaryPSDomainTSCValue.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 ExtendedTSCSet__TV_template::log_match(const ExtendedTSCSet__TV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cSDomainTSCSet.match(match_value.cSDomainTSCSet(), legacy)){
TTCN_Logger::log_logmatch_info(".cSDomainTSCSet");
single_value->field_cSDomainTSCSet.log_match(match_value.cSDomainTSCSet(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_secondPSDomainTSCAssigned.match(match_value.secondPSDomainTSCAssigned(), legacy)){
TTCN_Logger::log_logmatch_info(".secondPSDomainTSCAssigned");
single_value->field_secondPSDomainTSCAssigned.log_match(match_value.secondPSDomainTSCAssigned(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_primaryPSDomainTSCSet.match(match_value.primaryPSDomainTSCSet(), legacy)){
TTCN_Logger::log_logmatch_info(".primaryPSDomainTSCSet");
single_value->field_primaryPSDomainTSCSet.log_match(match_value.primaryPSDomainTSCSet(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_secondaryPSDomainTSCSet.match(match_value.secondaryPSDomainTSCSet(), legacy)){
TTCN_Logger::log_logmatch_info(".secondaryPSDomainTSCSet");
single_value->field_secondaryPSDomainTSCSet.log_match(match_value.secondaryPSDomainTSCSet(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_secondaryPSDomainTSCValue.match(match_value.secondaryPSDomainTSCValue(), legacy)){
TTCN_Logger::log_logmatch_info(".secondaryPSDomainTSCValue");
single_value->field_secondaryPSDomainTSCValue.log_match(match_value.secondaryPSDomainTSCValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", cSDomainTSCSet := ");
single_value->field_cSDomainTSCSet.log_match(match_value.cSDomainTSCSet(), legacy);
TTCN_Logger::log_event_str(", secondPSDomainTSCAssigned := ");
single_value->field_secondPSDomainTSCAssigned.log_match(match_value.secondPSDomainTSCAssigned(), legacy);
TTCN_Logger::log_event_str(", primaryPSDomainTSCSet := ");
single_value->field_primaryPSDomainTSCSet.log_match(match_value.primaryPSDomainTSCSet(), legacy);
TTCN_Logger::log_event_str(", secondaryPSDomainTSCSet := ");
single_value->field_secondaryPSDomainTSCSet.log_match(match_value.secondaryPSDomainTSCSet(), legacy);
TTCN_Logger::log_event_str(", secondaryPSDomainTSCValue := ");
single_value->field_secondaryPSDomainTSCValue.log_match(match_value.secondaryPSDomainTSCValue(), 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 ExtendedTSCSet__TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (cSDomainTSCSet().is_bound()) cSDomainTSCSet().set_implicit_omit();
if (secondPSDomainTSCAssigned().is_bound()) secondPSDomainTSCAssigned().set_implicit_omit();
if (primaryPSDomainTSCSet().is_bound()) primaryPSDomainTSCSet().set_implicit_omit();
if (secondaryPSDomainTSCSet().is_bound()) secondaryPSDomainTSCSet().set_implicit_omit();
if (secondaryPSDomainTSCValue().is_bound()) secondaryPSDomainTSCValue().set_implicit_omit();
}

void ExtendedTSCSet__TV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_cSDomainTSCSet.encode_text(text_buf);
single_value->field_secondPSDomainTSCAssigned.encode_text(text_buf);
single_value->field_primaryPSDomainTSCSet.encode_text(text_buf);
single_value->field_secondaryPSDomainTSCSet.encode_text(text_buf);
single_value->field_secondaryPSDomainTSCValue.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.ExtendedTSCSet_TV.");
}
}

void ExtendedTSCSet__TV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_elementIdentifier.decode_text(text_buf);
single_value->field_cSDomainTSCSet.decode_text(text_buf);
single_value->field_secondPSDomainTSCAssigned.decode_text(text_buf);
single_value->field_primaryPSDomainTSCSet.decode_text(text_buf);
single_value->field_secondaryPSDomainTSCSet.decode_text(text_buf);
single_value->field_secondaryPSDomainTSCValue.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 ExtendedTSCSet__TV_template[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.ExtendedTSCSet_TV.");
}
}

void ExtendedTSCSet__TV_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: {
    ExtendedTSCSet__TV_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.ExtendedTSCSet_TV 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) elementIdentifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cSDomainTSCSet().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) secondPSDomainTSCAssigned().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) primaryPSDomainTSCSet().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) secondaryPSDomainTSCSet().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) secondaryPSDomainTSCValue().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(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cSDomainTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cSDomainTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondPSDomainTSCAssigned")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondPSDomainTSCAssigned().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "primaryPSDomainTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          primaryPSDomainTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondaryPSDomainTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondaryPSDomainTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "secondaryPSDomainTSCValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          secondaryPSDomainTSCValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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.ExtendedTSCSet_TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ExtendedTSCSet__TV_template* precondition = new ExtendedTSCSet__TV_template;
    precondition->set_param(*param.get_elem(0));
    ExtendedTSCSet__TV_template* implied_template = new ExtendedTSCSet__TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ExtendedTSCSet__TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.ExtendedTSCSet_TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void ExtendedTSCSet__TV_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.ExtendedTSCSet_TV");
single_value->field_cSDomainTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.ExtendedTSCSet_TV");
single_value->field_secondPSDomainTSCAssigned.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.ExtendedTSCSet_TV");
single_value->field_primaryPSDomainTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.ExtendedTSCSet_TV");
single_value->field_secondaryPSDomainTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.ExtendedTSCSet_TV");
single_value->field_secondaryPSDomainTSCValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.ExtendedTSCSet_TV");
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.ExtendedTSCSet_TV");
}

boolean ExtendedTSCSet__TV_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean ExtendedTSCSet__TV_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__AdditionalAssignment__NW__MS::PDU__RRM__AdditionalAssignment__NW__MS()
{
}

PDU__RRM__AdditionalAssignment__NW__MS::PDU__RRM__AdditionalAssignment__NW__MS(const BITSTRING& par_messageType,
    const ChannelDescription__V& par_channelDescription,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_mobileAllocation,
    const OPTIONAL< StartingTime__TV >& par_startingTime,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet)
  :   field_messageType(par_messageType),
  field_channelDescription(par_channelDescription),
  field_mobileAllocation(par_mobileAllocation),
  field_startingTime(par_startingTime),
  field_extendedTSCSet(par_extendedTSCSet)
{
}

PDU__RRM__AdditionalAssignment__NW__MS::PDU__RRM__AdditionalAssignment__NW__MS(const PDU__RRM__AdditionalAssignment__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_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.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
else field_extendedTSCSet.clean_up();
}

void PDU__RRM__AdditionalAssignment__NW__MS::clean_up()
{
field_messageType.clean_up();
field_channelDescription.clean_up();
field_mobileAllocation.clean_up();
field_startingTime.clean_up();
field_extendedTSCSet.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__AdditionalAssignment__NW__MS::get_descriptor() const { return &PDU__RRM__AdditionalAssignment__NW__MS_descr_; }
PDU__RRM__AdditionalAssignment__NW__MS& PDU__RRM__AdditionalAssignment__NW__MS::operator=(const PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_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.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
  else field_extendedTSCSet.clean_up();
}
return *this;
}

boolean PDU__RRM__AdditionalAssignment__NW__MS::operator==(const PDU__RRM__AdditionalAssignment__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_extendedTSCSet==other_value.field_extendedTSCSet;
}

boolean PDU__RRM__AdditionalAssignment__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_channelDescription.is_bound())
  || (OPTIONAL_OMIT == field_mobileAllocation.get_selection() || field_mobileAllocation.is_bound())
  || (OPTIONAL_OMIT == field_startingTime.get_selection() || field_startingTime.is_bound())
  || (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_bound());
}
boolean PDU__RRM__AdditionalAssignment__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_channelDescription.is_value()
  && (OPTIONAL_OMIT == field_mobileAllocation.get_selection() || field_mobileAllocation.is_value())
  && (OPTIONAL_OMIT == field_startingTime.get_selection() || field_startingTime.is_value())
  && (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_value());
}
int PDU__RRM__AdditionalAssignment__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_mobileAllocation.ispresent()) ret_val++;
  if (field_startingTime.ispresent()) ret_val++;
  if (field_extendedTSCSet.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__AdditionalAssignment__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(", extendedTSCSet := ");
field_extendedTSCSet.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__AdditionalAssignment__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() = OMIT_VALUE;
else mobileAllocation().set_implicit_omit();
if (!startingTime().is_bound()) startingTime() = OMIT_VALUE;
else startingTime().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_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) 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) extendedTSCSet().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(), "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(), "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_AdditionalAssignment_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_NW_MS");
  }
}

void PDU__RRM__AdditionalAssignment__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_extendedTSCSet.encode_text(text_buf);
}

void PDU__RRM__AdditionalAssignment__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_extendedTSCSet.decode_text(text_buf);
}

void PDU__RRM__AdditionalAssignment__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__AdditionalAssignment__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__AdditionalAssignment__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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_mobileAllocation = 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::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocation().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_mobileAllocation = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileAllocation.ispresent() || field_mobileAllocation().elementIdentifier() !=  os_0){
  field_mobileAllocation=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileAllocation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_startingTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, 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_3_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)(4)) {
    field_extendedTSCSet = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, 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_4_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__AdditionalAssignment__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);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ChannelDescription__V_descr_.raw);
  if (field_mobileAllocation.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_startingTime.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, StartingTime__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_extendedTSCSet.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ExtendedTSCSet__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_channelDescription.RAW_encode(ChannelDescription__V_descr_, *myleaf.body.node.nodes[1]);
  if (field_mobileAllocation.ispresent()) {
  encoded_length += field_mobileAllocation().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_startingTime.ispresent()) {
  encoded_length += field_startingTime().RAW_encode(StartingTime__TV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_extendedTSCSet.ispresent()) {
  encoded_length += field_extendedTSCSet().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_mobileAllocation.ispresent() && (!field_mobileAllocation.ispresent() || field_mobileAllocation().elementIdentifier() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_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[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_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[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__AdditionalAssignment__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
ChannelDescription__V_template field_channelDescription;
MobileL3__CommonIE__Types::Type4__TLV_template field_mobileAllocation;
StartingTime__TV_template field_startingTime;
ExtendedTSCSet__TV_template field_extendedTSCSet;
};

void PDU__RRM__AdditionalAssignment__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_OR_OMIT;
single_value->field_startingTime = ANY_OR_OMIT;
single_value->field_extendedTSCSet = ANY_OR_OMIT;
}
}
}

void PDU__RRM__AdditionalAssignment__NW__MS_template::copy_value(const PDU__RRM__AdditionalAssignment__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()) {
  if (other_value.mobileAllocation().ispresent()) single_value->field_mobileAllocation = other_value.mobileAllocation()();
  else single_value->field_mobileAllocation = OMIT_VALUE;
} else {
  single_value->field_mobileAllocation.clean_up();
}
if (other_value.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.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__AdditionalAssignment__NW__MS_template::copy_template(const PDU__RRM__AdditionalAssignment__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.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__AdditionalAssignment__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__AdditionalAssignment__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__AdditionalAssignment__NW__MS_template::PDU__RRM__AdditionalAssignment__NW__MS_template()
{
}

PDU__RRM__AdditionalAssignment__NW__MS_template::PDU__RRM__AdditionalAssignment__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__AdditionalAssignment__NW__MS_template::PDU__RRM__AdditionalAssignment__NW__MS_template(const PDU__RRM__AdditionalAssignment__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__AdditionalAssignment__NW__MS_template::PDU__RRM__AdditionalAssignment__NW__MS_template(const OPTIONAL<PDU__RRM__AdditionalAssignment__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS from an unbound optional field.");
}
}

PDU__RRM__AdditionalAssignment__NW__MS_template::PDU__RRM__AdditionalAssignment__NW__MS_template(PDU__RRM__AdditionalAssignment__NW__MS_template* p_precondition, PDU__RRM__AdditionalAssignment__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__AdditionalAssignment__NW__MS_template::PDU__RRM__AdditionalAssignment__NW__MS_template(Dynamic_Match_Interface<PDU__RRM__AdditionalAssignment__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__AdditionalAssignment__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__AdditionalAssignment__NW__MS_template::PDU__RRM__AdditionalAssignment__NW__MS_template(const PDU__RRM__AdditionalAssignment__NW__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__AdditionalAssignment__NW__MS_template::~PDU__RRM__AdditionalAssignment__NW__MS_template()
{
clean_up();
}

PDU__RRM__AdditionalAssignment__NW__MS_template& PDU__RRM__AdditionalAssignment__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__AdditionalAssignment__NW__MS_template& PDU__RRM__AdditionalAssignment__NW__MS_template::operator=(const PDU__RRM__AdditionalAssignment__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__AdditionalAssignment__NW__MS_template& PDU__RRM__AdditionalAssignment__NW__MS_template::operator=(const OPTIONAL<PDU__RRM__AdditionalAssignment__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
}
return *this;
}

PDU__RRM__AdditionalAssignment__NW__MS_template& PDU__RRM__AdditionalAssignment__NW__MS_template::operator=(const PDU__RRM__AdditionalAssignment__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__AdditionalAssignment__NW__MS_template::match(const PDU__RRM__AdditionalAssignment__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((other_value.mobileAllocation().ispresent() ? !single_value->field_mobileAllocation.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.mobileAllocation(), legacy) : !single_value->field_mobileAllocation.match_omit(legacy)))return FALSE;
if(!other_value.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.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_AdditionalAssignment_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__AdditionalAssignment__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_omit() || single_value->field_mobileAllocation.is_bound())
 || (single_value->field_startingTime.is_omit() || single_value->field_startingTime.is_bound())
 || (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_bound());
}

boolean PDU__RRM__AdditionalAssignment__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_omit() || single_value->field_mobileAllocation.is_value())
 && (single_value->field_startingTime.is_omit() || single_value->field_startingTime.is_value())
 && (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_value());
}

void PDU__RRM__AdditionalAssignment__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__AdditionalAssignment__NW__MS PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
PDU__RRM__AdditionalAssignment__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_omit()) ret_val.mobileAllocation() = OMIT_VALUE;
else if (single_value->field_mobileAllocation.is_bound()) {
ret_val.mobileAllocation() = single_value->field_mobileAllocation.valueof();
}
if (single_value->field_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_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__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__AdditionalAssignment__NW__MS_template[list_length];
}

PDU__RRM__AdditionalAssignment__NW__MS_template& PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_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_AdditionalAssignment_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__AdditionalAssignment__NW__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
return single_value->field_messageType;
}

ChannelDescription__V_template& PDU__RRM__AdditionalAssignment__NW__MS_template::channelDescription()
{
set_specific();
return single_value->field_channelDescription;
}

const ChannelDescription__V_template& PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
return single_value->field_channelDescription;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AdditionalAssignment__NW__MS_template::mobileAllocation()
{
set_specific();
return single_value->field_mobileAllocation;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
return single_value->field_mobileAllocation;
}

StartingTime__TV_template& PDU__RRM__AdditionalAssignment__NW__MS_template::startingTime()
{
set_specific();
return single_value->field_startingTime;
}

const StartingTime__TV_template& PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
return single_value->field_startingTime;
}

ExtendedTSCSet__TV_template& PDU__RRM__AdditionalAssignment__NW__MS_template::extendedTSCSet()
{
set_specific();
return single_value->field_extendedTSCSet;
}

const ExtendedTSCSet__TV_template& PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
return single_value->field_extendedTSCSet;
}

int PDU__RRM__AdditionalAssignment__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_mobileAllocation.is_present()) ret_val++;
      if (single_value->field_startingTime.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_AdditionalAssignment_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_AdditionalAssignment_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_AdditionalAssignment_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_AdditionalAssignment_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_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_AdditionalAssignment_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_NW_MS.");
  }
  return 0;
}

void PDU__RRM__AdditionalAssignment__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(", 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__AdditionalAssignment__NW__MS_template::log_match(const PDU__RRM__AdditionalAssignment__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 (match_value.mobileAllocation().ispresent()){
if(!single_value->field_mobileAllocation.match(match_value.mobileAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocation");
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileAllocation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileAllocation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileAllocation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.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.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 := ");
if (match_value.mobileAllocation().ispresent()) {
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileAllocation.log();
if (single_value->field_mobileAllocation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", 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(", 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__AdditionalAssignment__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (channelDescription().is_bound()) channelDescription().set_implicit_omit();
if (!mobileAllocation().is_bound()) mobileAllocation() = OMIT_VALUE;
else mobileAllocation().set_implicit_omit();
if (!startingTime().is_bound()) startingTime() = OMIT_VALUE;
else startingTime().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__AdditionalAssignment__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_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_AdditionalAssignment_NW_MS.");
}
}

void PDU__RRM__AdditionalAssignment__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_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__AdditionalAssignment__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_AdditionalAssignment_NW_MS.");
}
}

void PDU__RRM__AdditionalAssignment__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__AdditionalAssignment__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_AdditionalAssignment_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) 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) extendedTSCSet().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(), "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(), "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_AdditionalAssignment_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__AdditionalAssignment__NW__MS_template* precondition = new PDU__RRM__AdditionalAssignment__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__AdditionalAssignment__NW__MS_template* implied_template = new PDU__RRM__AdditionalAssignment__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__AdditionalAssignment__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__AdditionalAssignment__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_AdditionalAssignment_NW_MS");
single_value->field_channelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_NW_MS");
single_value->field_mobileAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_NW_MS");
single_value->field_startingTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_NW_MS");
single_value->field_extendedTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AdditionalAssignment_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_AdditionalAssignment_NW_MS");
}

boolean PDU__RRM__AdditionalAssignment__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__AdditionalAssignment__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__AssignmentCommand__NW__MS::PDU__RRM__AssignmentCommand__NW__MS()
{
}

PDU__RRM__AssignmentCommand__NW__MS::PDU__RRM__AssignmentCommand__NW__MS(const BITSTRING& par_messageType,
    const ChannelDescription2__V& par_descrOf1stChAfterTime,
    const PowerCommand__V& par_PowerCommand,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_frequencyList__at,
    const OPTIONAL< CellChannelDescription__TV >& par_cellChannelDescr,
    const OPTIONAL< MultislotAllocation__TLV >& par_descrMultislotAllocation,
    const OPTIONAL< ChannelMode__TV >& par_modeOf1stChannel,
    const OPTIONAL< ChannelMode__TV >& par_channelSet2,
    const OPTIONAL< ChannelMode__TV >& par_channelSet3,
    const OPTIONAL< ChannelMode__TV >& par_channelSet4,
    const OPTIONAL< ChannelMode__TV >& par_channelSet5,
    const OPTIONAL< ChannelMode__TV >& par_channelSet6,
    const OPTIONAL< ChannelMode__TV >& par_channelSet7,
    const OPTIONAL< ChannelMode__TV >& par_channelSet8,
    const OPTIONAL< ChannelDescription__TV >& par_descrOf2ndChAfterTime,
    const OPTIONAL< ChannelMode2__TV >& par_modeOf2ndChannel,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_mobileAllocation__at,
    const OPTIONAL< StartingTime__TV >& par_startingTime,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_frequencyList__bt,
    const OPTIONAL< ChannelDescription2__TV >& par_descrOf1stCh__bt,
    const OPTIONAL< ChannelDescription__TV >& par_descrOf2ndCh__bt,
    const OPTIONAL< FrequencyChannelSequence__TV >& par_frequencyChannelSequence,
    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< VGCS__Ciphering__Parameters__TLV >& par_vGCS__Ciphering__Parameters,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet__afterTime,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet__beforeTime)
  :   field_messageType(par_messageType),
  field_descrOf1stChAfterTime(par_descrOf1stChAfterTime),
  field_PowerCommand(par_PowerCommand),
  field_frequencyList__at(par_frequencyList__at),
  field_cellChannelDescr(par_cellChannelDescr),
  field_descrMultislotAllocation(par_descrMultislotAllocation),
  field_modeOf1stChannel(par_modeOf1stChannel),
  field_channelSet2(par_channelSet2),
  field_channelSet3(par_channelSet3),
  field_channelSet4(par_channelSet4),
  field_channelSet5(par_channelSet5),
  field_channelSet6(par_channelSet6),
  field_channelSet7(par_channelSet7),
  field_channelSet8(par_channelSet8),
  field_descrOf2ndChAfterTime(par_descrOf2ndChAfterTime),
  field_modeOf2ndChannel(par_modeOf2ndChannel),
  field_mobileAllocation__at(par_mobileAllocation__at),
  field_startingTime(par_startingTime),
  field_frequencyList__bt(par_frequencyList__bt),
  field_descrOf1stCh__bt(par_descrOf1stCh__bt),
  field_descrOf2ndCh__bt(par_descrOf2ndCh__bt),
  field_frequencyChannelSequence(par_frequencyChannelSequence),
  field_mobileAllocation__bt(par_mobileAllocation__bt),
  field_cipherModeSetting(par_cipherModeSetting),
  field_vGCS__TargetModeIndication(par_vGCS__TargetModeIndication),
  field_multiRateConfiguration(par_multiRateConfiguration),
  field_vGCS__Ciphering__Parameters(par_vGCS__Ciphering__Parameters),
  field_extendedTSCSet__afterTime(par_extendedTSCSet__afterTime),
  field_extendedTSCSet__beforeTime(par_extendedTSCSet__beforeTime)
{
}

PDU__RRM__AssignmentCommand__NW__MS::PDU__RRM__AssignmentCommand__NW__MS(const PDU__RRM__AssignmentCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.descrOf1stChAfterTime().is_bound()) field_descrOf1stChAfterTime = other_value.descrOf1stChAfterTime();
else field_descrOf1stChAfterTime.clean_up();
if (other_value.PowerCommand().is_bound()) field_PowerCommand = other_value.PowerCommand();
else field_PowerCommand.clean_up();
if (other_value.frequencyList__at().is_bound()) field_frequencyList__at = other_value.frequencyList__at();
else field_frequencyList__at.clean_up();
if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
else field_cellChannelDescr.clean_up();
if (other_value.descrMultislotAllocation().is_bound()) field_descrMultislotAllocation = other_value.descrMultislotAllocation();
else field_descrMultislotAllocation.clean_up();
if (other_value.modeOf1stChannel().is_bound()) field_modeOf1stChannel = other_value.modeOf1stChannel();
else field_modeOf1stChannel.clean_up();
if (other_value.channelSet2().is_bound()) field_channelSet2 = other_value.channelSet2();
else field_channelSet2.clean_up();
if (other_value.channelSet3().is_bound()) field_channelSet3 = other_value.channelSet3();
else field_channelSet3.clean_up();
if (other_value.channelSet4().is_bound()) field_channelSet4 = other_value.channelSet4();
else field_channelSet4.clean_up();
if (other_value.channelSet5().is_bound()) field_channelSet5 = other_value.channelSet5();
else field_channelSet5.clean_up();
if (other_value.channelSet6().is_bound()) field_channelSet6 = other_value.channelSet6();
else field_channelSet6.clean_up();
if (other_value.channelSet7().is_bound()) field_channelSet7 = other_value.channelSet7();
else field_channelSet7.clean_up();
if (other_value.channelSet8().is_bound()) field_channelSet8 = other_value.channelSet8();
else field_channelSet8.clean_up();
if (other_value.descrOf2ndChAfterTime().is_bound()) field_descrOf2ndChAfterTime = other_value.descrOf2ndChAfterTime();
else field_descrOf2ndChAfterTime.clean_up();
if (other_value.modeOf2ndChannel().is_bound()) field_modeOf2ndChannel = other_value.modeOf2ndChannel();
else field_modeOf2ndChannel.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.frequencyList__bt().is_bound()) field_frequencyList__bt = other_value.frequencyList__bt();
else field_frequencyList__bt.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().is_bound()) field_frequencyChannelSequence = other_value.frequencyChannelSequence();
else field_frequencyChannelSequence.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.vGCS__Ciphering__Parameters().is_bound()) field_vGCS__Ciphering__Parameters = other_value.vGCS__Ciphering__Parameters();
else field_vGCS__Ciphering__Parameters.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__AssignmentCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_descrOf1stChAfterTime.clean_up();
field_PowerCommand.clean_up();
field_frequencyList__at.clean_up();
field_cellChannelDescr.clean_up();
field_descrMultislotAllocation.clean_up();
field_modeOf1stChannel.clean_up();
field_channelSet2.clean_up();
field_channelSet3.clean_up();
field_channelSet4.clean_up();
field_channelSet5.clean_up();
field_channelSet6.clean_up();
field_channelSet7.clean_up();
field_channelSet8.clean_up();
field_descrOf2ndChAfterTime.clean_up();
field_modeOf2ndChannel.clean_up();
field_mobileAllocation__at.clean_up();
field_startingTime.clean_up();
field_frequencyList__bt.clean_up();
field_descrOf1stCh__bt.clean_up();
field_descrOf2ndCh__bt.clean_up();
field_frequencyChannelSequence.clean_up();
field_mobileAllocation__bt.clean_up();
field_cipherModeSetting.clean_up();
field_vGCS__TargetModeIndication.clean_up();
field_multiRateConfiguration.clean_up();
field_vGCS__Ciphering__Parameters.clean_up();
field_extendedTSCSet__afterTime.clean_up();
field_extendedTSCSet__beforeTime.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__AssignmentCommand__NW__MS::get_descriptor() const { return &PDU__RRM__AssignmentCommand__NW__MS_descr_; }
PDU__RRM__AssignmentCommand__NW__MS& PDU__RRM__AssignmentCommand__NW__MS::operator=(const PDU__RRM__AssignmentCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.descrOf1stChAfterTime().is_bound()) field_descrOf1stChAfterTime = other_value.descrOf1stChAfterTime();
  else field_descrOf1stChAfterTime.clean_up();
  if (other_value.PowerCommand().is_bound()) field_PowerCommand = other_value.PowerCommand();
  else field_PowerCommand.clean_up();
  if (other_value.frequencyList__at().is_bound()) field_frequencyList__at = other_value.frequencyList__at();
  else field_frequencyList__at.clean_up();
  if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
  else field_cellChannelDescr.clean_up();
  if (other_value.descrMultislotAllocation().is_bound()) field_descrMultislotAllocation = other_value.descrMultislotAllocation();
  else field_descrMultislotAllocation.clean_up();
  if (other_value.modeOf1stChannel().is_bound()) field_modeOf1stChannel = other_value.modeOf1stChannel();
  else field_modeOf1stChannel.clean_up();
  if (other_value.channelSet2().is_bound()) field_channelSet2 = other_value.channelSet2();
  else field_channelSet2.clean_up();
  if (other_value.channelSet3().is_bound()) field_channelSet3 = other_value.channelSet3();
  else field_channelSet3.clean_up();
  if (other_value.channelSet4().is_bound()) field_channelSet4 = other_value.channelSet4();
  else field_channelSet4.clean_up();
  if (other_value.channelSet5().is_bound()) field_channelSet5 = other_value.channelSet5();
  else field_channelSet5.clean_up();
  if (other_value.channelSet6().is_bound()) field_channelSet6 = other_value.channelSet6();
  else field_channelSet6.clean_up();
  if (other_value.channelSet7().is_bound()) field_channelSet7 = other_value.channelSet7();
  else field_channelSet7.clean_up();
  if (other_value.channelSet8().is_bound()) field_channelSet8 = other_value.channelSet8();
  else field_channelSet8.clean_up();
  if (other_value.descrOf2ndChAfterTime().is_bound()) field_descrOf2ndChAfterTime = other_value.descrOf2ndChAfterTime();
  else field_descrOf2ndChAfterTime.clean_up();
  if (other_value.modeOf2ndChannel().is_bound()) field_modeOf2ndChannel = other_value.modeOf2ndChannel();
  else field_modeOf2ndChannel.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.frequencyList__bt().is_bound()) field_frequencyList__bt = other_value.frequencyList__bt();
  else field_frequencyList__bt.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().is_bound()) field_frequencyChannelSequence = other_value.frequencyChannelSequence();
  else field_frequencyChannelSequence.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.vGCS__Ciphering__Parameters().is_bound()) field_vGCS__Ciphering__Parameters = other_value.vGCS__Ciphering__Parameters();
  else field_vGCS__Ciphering__Parameters.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__AssignmentCommand__NW__MS::operator==(const PDU__RRM__AssignmentCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_descrOf1stChAfterTime==other_value.field_descrOf1stChAfterTime
  && field_PowerCommand==other_value.field_PowerCommand
  && field_frequencyList__at==other_value.field_frequencyList__at
  && field_cellChannelDescr==other_value.field_cellChannelDescr
  && field_descrMultislotAllocation==other_value.field_descrMultislotAllocation
  && field_modeOf1stChannel==other_value.field_modeOf1stChannel
  && field_channelSet2==other_value.field_channelSet2
  && field_channelSet3==other_value.field_channelSet3
  && field_channelSet4==other_value.field_channelSet4
  && field_channelSet5==other_value.field_channelSet5
  && field_channelSet6==other_value.field_channelSet6
  && field_channelSet7==other_value.field_channelSet7
  && field_channelSet8==other_value.field_channelSet8
  && field_descrOf2ndChAfterTime==other_value.field_descrOf2ndChAfterTime
  && field_modeOf2ndChannel==other_value.field_modeOf2ndChannel
  && field_mobileAllocation__at==other_value.field_mobileAllocation__at
  && field_startingTime==other_value.field_startingTime
  && field_frequencyList__bt==other_value.field_frequencyList__bt
  && field_descrOf1stCh__bt==other_value.field_descrOf1stCh__bt
  && field_descrOf2ndCh__bt==other_value.field_descrOf2ndCh__bt
  && field_frequencyChannelSequence==other_value.field_frequencyChannelSequence
  && 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_vGCS__Ciphering__Parameters==other_value.field_vGCS__Ciphering__Parameters
  && field_extendedTSCSet__afterTime==other_value.field_extendedTSCSet__afterTime
  && field_extendedTSCSet__beforeTime==other_value.field_extendedTSCSet__beforeTime;
}

boolean PDU__RRM__AssignmentCommand__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_descrOf1stChAfterTime.is_bound())
  || (field_PowerCommand.is_bound())
  || (OPTIONAL_OMIT == field_frequencyList__at.get_selection() || field_frequencyList__at.is_bound())
  || (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_bound())
  || (OPTIONAL_OMIT == field_descrMultislotAllocation.get_selection() || field_descrMultislotAllocation.is_bound())
  || (OPTIONAL_OMIT == field_modeOf1stChannel.get_selection() || field_modeOf1stChannel.is_bound())
  || (OPTIONAL_OMIT == field_channelSet2.get_selection() || field_channelSet2.is_bound())
  || (OPTIONAL_OMIT == field_channelSet3.get_selection() || field_channelSet3.is_bound())
  || (OPTIONAL_OMIT == field_channelSet4.get_selection() || field_channelSet4.is_bound())
  || (OPTIONAL_OMIT == field_channelSet5.get_selection() || field_channelSet5.is_bound())
  || (OPTIONAL_OMIT == field_channelSet6.get_selection() || field_channelSet6.is_bound())
  || (OPTIONAL_OMIT == field_channelSet7.get_selection() || field_channelSet7.is_bound())
  || (OPTIONAL_OMIT == field_channelSet8.get_selection() || field_channelSet8.is_bound())
  || (OPTIONAL_OMIT == field_descrOf2ndChAfterTime.get_selection() || field_descrOf2ndChAfterTime.is_bound())
  || (OPTIONAL_OMIT == field_modeOf2ndChannel.get_selection() || field_modeOf2ndChannel.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_frequencyList__bt.get_selection() || field_frequencyList__bt.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.get_selection() || field_frequencyChannelSequence.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_vGCS__Ciphering__Parameters.get_selection() || field_vGCS__Ciphering__Parameters.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__AssignmentCommand__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_descrOf1stChAfterTime.is_value()
  && field_PowerCommand.is_value()
  && (OPTIONAL_OMIT == field_frequencyList__at.get_selection() || field_frequencyList__at.is_value())
  && (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_value())
  && (OPTIONAL_OMIT == field_descrMultislotAllocation.get_selection() || field_descrMultislotAllocation.is_value())
  && (OPTIONAL_OMIT == field_modeOf1stChannel.get_selection() || field_modeOf1stChannel.is_value())
  && (OPTIONAL_OMIT == field_channelSet2.get_selection() || field_channelSet2.is_value())
  && (OPTIONAL_OMIT == field_channelSet3.get_selection() || field_channelSet3.is_value())
  && (OPTIONAL_OMIT == field_channelSet4.get_selection() || field_channelSet4.is_value())
  && (OPTIONAL_OMIT == field_channelSet5.get_selection() || field_channelSet5.is_value())
  && (OPTIONAL_OMIT == field_channelSet6.get_selection() || field_channelSet6.is_value())
  && (OPTIONAL_OMIT == field_channelSet7.get_selection() || field_channelSet7.is_value())
  && (OPTIONAL_OMIT == field_channelSet8.get_selection() || field_channelSet8.is_value())
  && (OPTIONAL_OMIT == field_descrOf2ndChAfterTime.get_selection() || field_descrOf2ndChAfterTime.is_value())
  && (OPTIONAL_OMIT == field_modeOf2ndChannel.get_selection() || field_modeOf2ndChannel.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_frequencyList__bt.get_selection() || field_frequencyList__bt.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.get_selection() || field_frequencyChannelSequence.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_vGCS__Ciphering__Parameters.get_selection() || field_vGCS__Ciphering__Parameters.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__AssignmentCommand__NW__MS::size_of() const
{
  int ret_val = 3;
  if (field_frequencyList__at.ispresent()) ret_val++;
  if (field_cellChannelDescr.ispresent()) ret_val++;
  if (field_descrMultislotAllocation.ispresent()) ret_val++;
  if (field_modeOf1stChannel.ispresent()) ret_val++;
  if (field_channelSet2.ispresent()) ret_val++;
  if (field_channelSet3.ispresent()) ret_val++;
  if (field_channelSet4.ispresent()) ret_val++;
  if (field_channelSet5.ispresent()) ret_val++;
  if (field_channelSet6.ispresent()) ret_val++;
  if (field_channelSet7.ispresent()) ret_val++;
  if (field_channelSet8.ispresent()) ret_val++;
  if (field_descrOf2ndChAfterTime.ispresent()) ret_val++;
  if (field_modeOf2ndChannel.ispresent()) ret_val++;
  if (field_mobileAllocation__at.ispresent()) ret_val++;
  if (field_startingTime.ispresent()) ret_val++;
  if (field_frequencyList__bt.ispresent()) ret_val++;
  if (field_descrOf1stCh__bt.ispresent()) ret_val++;
  if (field_descrOf2ndCh__bt.ispresent()) ret_val++;
  if (field_frequencyChannelSequence.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_vGCS__Ciphering__Parameters.ispresent()) ret_val++;
  if (field_extendedTSCSet__afterTime.ispresent()) ret_val++;
  if (field_extendedTSCSet__beforeTime.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__AssignmentCommand__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", descrOf1stChAfterTime := ");
field_descrOf1stChAfterTime.log();
TTCN_Logger::log_event_str(", PowerCommand := ");
field_PowerCommand.log();
TTCN_Logger::log_event_str(", frequencyList_at := ");
field_frequencyList__at.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", descrMultislotAllocation := ");
field_descrMultislotAllocation.log();
TTCN_Logger::log_event_str(", modeOf1stChannel := ");
field_modeOf1stChannel.log();
TTCN_Logger::log_event_str(", channelSet2 := ");
field_channelSet2.log();
TTCN_Logger::log_event_str(", channelSet3 := ");
field_channelSet3.log();
TTCN_Logger::log_event_str(", channelSet4 := ");
field_channelSet4.log();
TTCN_Logger::log_event_str(", channelSet5 := ");
field_channelSet5.log();
TTCN_Logger::log_event_str(", channelSet6 := ");
field_channelSet6.log();
TTCN_Logger::log_event_str(", channelSet7 := ");
field_channelSet7.log();
TTCN_Logger::log_event_str(", channelSet8 := ");
field_channelSet8.log();
TTCN_Logger::log_event_str(", descrOf2ndChAfterTime := ");
field_descrOf2ndChAfterTime.log();
TTCN_Logger::log_event_str(", modeOf2ndChannel := ");
field_modeOf2ndChannel.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(", frequencyList_bt := ");
field_frequencyList__bt.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 := ");
field_frequencyChannelSequence.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(", vGCS_Ciphering_Parameters := ");
field_vGCS__Ciphering__Parameters.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__AssignmentCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (descrOf1stChAfterTime().is_bound()) descrOf1stChAfterTime().set_implicit_omit();
if (PowerCommand().is_bound()) PowerCommand().set_implicit_omit();
if (!frequencyList__at().is_bound()) frequencyList__at() = OMIT_VALUE;
else frequencyList__at().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!descrMultislotAllocation().is_bound()) descrMultislotAllocation() = OMIT_VALUE;
else descrMultislotAllocation().set_implicit_omit();
if (!modeOf1stChannel().is_bound()) modeOf1stChannel() = OMIT_VALUE;
else modeOf1stChannel().set_implicit_omit();
if (!channelSet2().is_bound()) channelSet2() = OMIT_VALUE;
else channelSet2().set_implicit_omit();
if (!channelSet3().is_bound()) channelSet3() = OMIT_VALUE;
else channelSet3().set_implicit_omit();
if (!channelSet4().is_bound()) channelSet4() = OMIT_VALUE;
else channelSet4().set_implicit_omit();
if (!channelSet5().is_bound()) channelSet5() = OMIT_VALUE;
else channelSet5().set_implicit_omit();
if (!channelSet6().is_bound()) channelSet6() = OMIT_VALUE;
else channelSet6().set_implicit_omit();
if (!channelSet7().is_bound()) channelSet7() = OMIT_VALUE;
else channelSet7().set_implicit_omit();
if (!channelSet8().is_bound()) channelSet8() = OMIT_VALUE;
else channelSet8().set_implicit_omit();
if (!descrOf2ndChAfterTime().is_bound()) descrOf2ndChAfterTime() = OMIT_VALUE;
else descrOf2ndChAfterTime().set_implicit_omit();
if (!modeOf2ndChannel().is_bound()) modeOf2ndChannel() = OMIT_VALUE;
else modeOf2ndChannel().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 (!frequencyList__bt().is_bound()) frequencyList__bt() = OMIT_VALUE;
else frequencyList__bt().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().is_bound()) frequencyChannelSequence() = OMIT_VALUE;
else frequencyChannelSequence().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 (!vGCS__Ciphering__Parameters().is_bound()) vGCS__Ciphering__Parameters() = OMIT_VALUE;
else vGCS__Ciphering__Parameters().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__AssignmentCommand__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (29<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS has 29 fields but 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) descrOf1stChAfterTime().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) PowerCommand().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) frequencyList__at().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) descrMultislotAllocation().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) modeOf1stChannel().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) channelSet2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) channelSet3().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) channelSet4().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) channelSet5().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) channelSet6().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) channelSet7().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) channelSet8().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) descrOf2ndChAfterTime().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) modeOf2ndChannel().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation__at().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) frequencyList__bt().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) descrOf1stCh__bt().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) descrOf2ndCh__bt().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) frequencyChannelSequence().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation__bt().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) cipherModeSetting().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) vGCS__TargetModeIndication().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) vGCS__Ciphering__Parameters().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet__afterTime().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet__beforeTime().set_param(*param.get_elem(28));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "descrOf1stChAfterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf1stChAfterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "PowerCommand")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          PowerCommand().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyList_at")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyList__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(), "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(), "descrMultislotAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrMultislotAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOf1stChannel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOf1stChannel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet6().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrOf2ndChAfterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf2ndChAfterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "frequencyList_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyList__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(), "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")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyChannelSequence().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "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_AssignmentCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
  }
}

void PDU__RRM__AssignmentCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_descrOf1stChAfterTime.encode_text(text_buf);
field_PowerCommand.encode_text(text_buf);
field_frequencyList__at.encode_text(text_buf);
field_cellChannelDescr.encode_text(text_buf);
field_descrMultislotAllocation.encode_text(text_buf);
field_modeOf1stChannel.encode_text(text_buf);
field_channelSet2.encode_text(text_buf);
field_channelSet3.encode_text(text_buf);
field_channelSet4.encode_text(text_buf);
field_channelSet5.encode_text(text_buf);
field_channelSet6.encode_text(text_buf);
field_channelSet7.encode_text(text_buf);
field_channelSet8.encode_text(text_buf);
field_descrOf2ndChAfterTime.encode_text(text_buf);
field_modeOf2ndChannel.encode_text(text_buf);
field_mobileAllocation__at.encode_text(text_buf);
field_startingTime.encode_text(text_buf);
field_frequencyList__bt.encode_text(text_buf);
field_descrOf1stCh__bt.encode_text(text_buf);
field_descrOf2ndCh__bt.encode_text(text_buf);
field_frequencyChannelSequence.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_vGCS__Ciphering__Parameters.encode_text(text_buf);
field_extendedTSCSet__afterTime.encode_text(text_buf);
field_extendedTSCSet__beforeTime.encode_text(text_buf);
}

void PDU__RRM__AssignmentCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_descrOf1stChAfterTime.decode_text(text_buf);
field_PowerCommand.decode_text(text_buf);
field_frequencyList__at.decode_text(text_buf);
field_cellChannelDescr.decode_text(text_buf);
field_descrMultislotAllocation.decode_text(text_buf);
field_modeOf1stChannel.decode_text(text_buf);
field_channelSet2.decode_text(text_buf);
field_channelSet3.decode_text(text_buf);
field_channelSet4.decode_text(text_buf);
field_channelSet5.decode_text(text_buf);
field_channelSet6.decode_text(text_buf);
field_channelSet7.decode_text(text_buf);
field_channelSet8.decode_text(text_buf);
field_descrOf2ndChAfterTime.decode_text(text_buf);
field_modeOf2ndChannel.decode_text(text_buf);
field_mobileAllocation__at.decode_text(text_buf);
field_startingTime.decode_text(text_buf);
field_frequencyList__bt.decode_text(text_buf);
field_descrOf1stCh__bt.decode_text(text_buf);
field_descrOf2ndCh__bt.decode_text(text_buf);
field_frequencyChannelSequence.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_vGCS__Ciphering__Parameters.decode_text(text_buf);
field_extendedTSCSet__afterTime.decode_text(text_buf);
field_extendedTSCSet__beforeTime.decode_text(text_buf);
}

void PDU__RRM__AssignmentCommand__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__AssignmentCommand__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__AssignmentCommand__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, ChannelDescription2__V_descr_.raw->forceomit);
  decoded_field_length = field_descrOf1stChAfterTime.RAW_decode(ChannelDescription2__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, PowerCommand__V_descr_.raw->forceomit);
  decoded_field_length = field_PowerCommand.RAW_decode(PowerCommand__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_frequencyList__at = 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::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyList__at().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyList__at = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyList__at.ispresent() || field_frequencyList__at().elementIdentifier() !=  os_3){
  field_frequencyList__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_frequencyList__at=OMIT_VALUE;
  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_descrMultislotAllocation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MultislotAllocation__TLV_descr_.raw->forceomit);
  decoded_field_length = field_descrMultislotAllocation().RAW_decode(MultislotAllocation__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_descrMultislotAllocation = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descrMultislotAllocation.ispresent() || field_descrMultislotAllocation().elementIdentifier() !=  os_5){
  field_descrMultislotAllocation=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descrMultislotAllocation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_modeOf1stChannel = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOf1stChannel().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_modeOf1stChannel = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOf1stChannel.ispresent() || field_modeOf1stChannel().elementIdentifier() !=  os_6){
  field_modeOf1stChannel=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOf1stChannel=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_channelSet2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_channelSet2().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_channelSet2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelSet2.ispresent() || field_channelSet2().elementIdentifier() !=  os_7){
  field_channelSet2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelSet2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_channelSet3 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_channelSet3().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_channelSet3 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelSet3.ispresent() || field_channelSet3().elementIdentifier() !=  os_8){
  field_channelSet3=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelSet3=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_channelSet4 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_channelSet4().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_channelSet4 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelSet4.ispresent() || field_channelSet4().elementIdentifier() !=  os_9){
  field_channelSet4=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelSet4=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_channelSet5 = 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_channelSet5().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_channelSet5 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelSet5.ispresent() || field_channelSet5().elementIdentifier() !=  os_10){
  field_channelSet5=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelSet5=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_channelSet6 = 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_channelSet6().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_channelSet6 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelSet6.ispresent() || field_channelSet6().elementIdentifier() !=  os_11){
  field_channelSet6=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelSet6=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_channelSet7 = 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_channelSet7().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_channelSet7 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelSet7.ispresent() || field_channelSet7().elementIdentifier() !=  os_12){
  field_channelSet7=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelSet7=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_channelSet8 = 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_channelSet8().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_channelSet8 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelSet8.ispresent() || field_channelSet8().elementIdentifier() !=  os_13){
  field_channelSet8=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelSet8=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_descrOf2ndChAfterTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, ChannelDescription__TV_descr_.raw->forceomit);
  decoded_field_length = field_descrOf2ndChAfterTime().RAW_decode(ChannelDescription__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_descrOf2ndChAfterTime = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descrOf2ndChAfterTime.ispresent() || field_descrOf2ndChAfterTime().elementIdentifier() !=  os_14){
  field_descrOf2ndChAfterTime=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descrOf2ndChAfterTime=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_modeOf2ndChannel = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, 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_15_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)(16)) {
    field_mobileAllocation__at = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__CommonIE__Types::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_16_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)(17)) {
    field_startingTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, 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_17_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)(18)) {
    field_frequencyList__bt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyList__bt().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyList__bt = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyList__bt.ispresent() || field_frequencyList__bt().elementIdentifier() !=  os_16){
  field_frequencyList__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_frequencyList__bt=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_descrOf1stCh__bt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, 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_19_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_17){
  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)(20)) {
    field_descrOf2ndCh__bt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, 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_20_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_18){
  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)(21)) {
    field_frequencyChannelSequence = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, FrequencyChannelSequence__TV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyChannelSequence().RAW_decode(FrequencyChannelSequence__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyChannelSequence = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyChannelSequence.ispresent() || field_frequencyChannelSequence().elementIdentifier() !=  os_19){
  field_frequencyChannelSequence=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  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=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_mobileAllocation__bt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, MobileL3__CommonIE__Types::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_22_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)(23)) {
    field_cipherModeSetting = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, 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_23_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)(24)) {
    field_vGCS__TargetModeIndication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, 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_24_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)(25)) {
    field_multiRateConfiguration = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_25_force_omit(25, 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_25_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)(26)) {
    field_vGCS__Ciphering__Parameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_26_force_omit(26, 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_26_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)(27)) {
    field_extendedTSCSet__afterTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_27_force_omit(27, 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_27_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)(28)) {
    field_extendedTSCSet__beforeTime = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_28_force_omit(28, 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_28_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__AssignmentCommand__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 29;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(29);
  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, ChannelDescription2__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PowerCommand__V_descr_.raw);
  if (field_frequencyList__at.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  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_descrMultislotAllocation.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MultislotAllocation__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_modeOf1stChannel.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_channelSet2.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_channelSet3.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_channelSet4.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_channelSet5.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_channelSet6.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_channelSet7.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_channelSet8.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_descrOf2ndChAfterTime.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, ChannelDescription__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_modeOf2ndChannel.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, ChannelMode2__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_mobileAllocation__at.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_startingTime.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, StartingTime__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_frequencyList__bt.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_descrOf1stCh__bt.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, ChannelDescription2__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_descrOf2ndCh__bt.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, ChannelDescription__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_frequencyChannelSequence.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, FrequencyChannelSequence__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_mobileAllocation__bt.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_cipherModeSetting.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, CipherModeSetting__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_vGCS__TargetModeIndication.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, VGCS__TargetModeIndication__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  if (field_multiRateConfiguration.ispresent()) {
  myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 25, MultiRateConfiguration__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[25] = NULL;
  if (field_vGCS__Ciphering__Parameters.ispresent()) {
  myleaf.body.node.nodes[26] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 26, VGCS__Ciphering__Parameters__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[26] = NULL;
  if (field_extendedTSCSet__afterTime.ispresent()) {
  myleaf.body.node.nodes[27] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 27, ExtendedTSCSet__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[27] = NULL;
  if (field_extendedTSCSet__beforeTime.ispresent()) {
  myleaf.body.node.nodes[28] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 28, ExtendedTSCSet__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[28] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_descrOf1stChAfterTime.RAW_encode(ChannelDescription2__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_PowerCommand.RAW_encode(PowerCommand__V_descr_, *myleaf.body.node.nodes[2]);
  if (field_frequencyList__at.ispresent()) {
  encoded_length += field_frequencyList__at().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_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_descrMultislotAllocation.ispresent()) {
  encoded_length += field_descrMultislotAllocation().RAW_encode(MultislotAllocation__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_modeOf1stChannel.ispresent()) {
  encoded_length += field_modeOf1stChannel().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_channelSet2.ispresent()) {
  encoded_length += field_channelSet2().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_channelSet3.ispresent()) {
  encoded_length += field_channelSet3().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_channelSet4.ispresent()) {
  encoded_length += field_channelSet4().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_channelSet5.ispresent()) {
  encoded_length += field_channelSet5().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_channelSet6.ispresent()) {
  encoded_length += field_channelSet6().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_channelSet7.ispresent()) {
  encoded_length += field_channelSet7().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_channelSet8.ispresent()) {
  encoded_length += field_channelSet8().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_descrOf2ndChAfterTime.ispresent()) {
  encoded_length += field_descrOf2ndChAfterTime().RAW_encode(ChannelDescription__TV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_modeOf2ndChannel.ispresent()) {
  encoded_length += field_modeOf2ndChannel().RAW_encode(ChannelMode2__TV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_mobileAllocation__at.ispresent()) {
  encoded_length += field_mobileAllocation__at().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_startingTime.ispresent()) {
  encoded_length += field_startingTime().RAW_encode(StartingTime__TV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_frequencyList__bt.ispresent()) {
  encoded_length += field_frequencyList__bt().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_descrOf1stCh__bt.ispresent()) {
  encoded_length += field_descrOf1stCh__bt().RAW_encode(ChannelDescription2__TV_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_descrOf2ndCh__bt.ispresent()) {
  encoded_length += field_descrOf2ndCh__bt().RAW_encode(ChannelDescription__TV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_frequencyChannelSequence.ispresent()) {
  encoded_length += field_frequencyChannelSequence().RAW_encode(FrequencyChannelSequence__TV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_mobileAllocation__bt.ispresent()) {
  encoded_length += field_mobileAllocation__bt().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_cipherModeSetting.ispresent()) {
  encoded_length += field_cipherModeSetting().RAW_encode(CipherModeSetting__TV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_vGCS__TargetModeIndication.ispresent()) {
  encoded_length += field_vGCS__TargetModeIndication().RAW_encode(VGCS__TargetModeIndication__TLV_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_multiRateConfiguration.ispresent()) {
  encoded_length += field_multiRateConfiguration().RAW_encode(MultiRateConfiguration__TLV_descr_, *myleaf.body.node.nodes[25]);
  }
  if (field_vGCS__Ciphering__Parameters.ispresent()) {
  encoded_length += field_vGCS__Ciphering__Parameters().RAW_encode(VGCS__Ciphering__Parameters__TLV_descr_, *myleaf.body.node.nodes[26]);
  }
  if (field_extendedTSCSet__afterTime.ispresent()) {
  encoded_length += field_extendedTSCSet__afterTime().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[27]);
  }
  if (field_extendedTSCSet__beforeTime.ispresent()) {
  encoded_length += field_extendedTSCSet__beforeTime().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[28]);
  }
  if (field_frequencyList__at.ispresent() && (!field_frequencyList__at.ispresent() || field_frequencyList__at().elementIdentifier() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  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_descrMultislotAllocation.ispresent() && (!field_descrMultislotAllocation.ispresent() || field_descrMultislotAllocation().elementIdentifier() !=  os_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOf1stChannel.ispresent() && (!field_modeOf1stChannel.ispresent() || field_modeOf1stChannel().elementIdentifier() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_channelSet2.ispresent() && (!field_channelSet2.ispresent() || field_channelSet2().elementIdentifier() !=  os_7)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_channelSet3.ispresent() && (!field_channelSet3.ispresent() || field_channelSet3().elementIdentifier() !=  os_8)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={8,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_8.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_channelSet4.ispresent() && (!field_channelSet4.ispresent() || field_channelSet4().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[]={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_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_channelSet5.ispresent() && (!field_channelSet5.ispresent() || field_channelSet5().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[]={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_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_channelSet6.ispresent() && (!field_channelSet6.ispresent() || field_channelSet6().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[]={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_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_channelSet7.ispresent() && (!field_channelSet7.ispresent() || field_channelSet7().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[]={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_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_channelSet8.ispresent() && (!field_channelSet8.ispresent() || field_channelSet8().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[]={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_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_descrOf2ndChAfterTime.ispresent() && (!field_descrOf2ndChAfterTime.ispresent() || field_descrOf2ndChAfterTime().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={14,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_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[]={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_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_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[]={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_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[]={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_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_frequencyList__bt.ispresent() && (!field_frequencyList__bt.ispresent() || field_frequencyList__bt().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[]={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_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_17)) {
  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_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_descrOf2ndCh__bt.ispresent() && (!field_descrOf2ndCh__bt.ispresent() || field_descrOf2ndCh__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[]={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_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_frequencyChannelSequence.ispresent() && (!field_frequencyChannelSequence.ispresent() || field_frequencyChannelSequence().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[]={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_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[]={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_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[]={23,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_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[]={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_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[]={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_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_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[]={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_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_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[]={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_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[]={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_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__AssignmentCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
ChannelDescription2__V_template field_descrOf1stChAfterTime;
PowerCommand__V_template field_PowerCommand;
MobileL3__CommonIE__Types::Type4__TLV_template field_frequencyList__at;
CellChannelDescription__TV_template field_cellChannelDescr;
MultislotAllocation__TLV_template field_descrMultislotAllocation;
ChannelMode__TV_template field_modeOf1stChannel;
ChannelMode__TV_template field_channelSet2;
ChannelMode__TV_template field_channelSet3;
ChannelMode__TV_template field_channelSet4;
ChannelMode__TV_template field_channelSet5;
ChannelMode__TV_template field_channelSet6;
ChannelMode__TV_template field_channelSet7;
ChannelMode__TV_template field_channelSet8;
ChannelDescription__TV_template field_descrOf2ndChAfterTime;
ChannelMode2__TV_template field_modeOf2ndChannel;
MobileL3__CommonIE__Types::Type4__TLV_template field_mobileAllocation__at;
StartingTime__TV_template field_startingTime;
MobileL3__CommonIE__Types::Type4__TLV_template field_frequencyList__bt;
ChannelDescription2__TV_template field_descrOf1stCh__bt;
ChannelDescription__TV_template field_descrOf2ndCh__bt;
FrequencyChannelSequence__TV_template field_frequencyChannelSequence;
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;
VGCS__Ciphering__Parameters__TLV_template field_vGCS__Ciphering__Parameters;
ExtendedTSCSet__TV_template field_extendedTSCSet__afterTime;
ExtendedTSCSet__TV_template field_extendedTSCSet__beforeTime;
};

void PDU__RRM__AssignmentCommand__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_descrOf1stChAfterTime = ANY_VALUE;
single_value->field_PowerCommand = ANY_VALUE;
single_value->field_frequencyList__at = ANY_OR_OMIT;
single_value->field_cellChannelDescr = ANY_OR_OMIT;
single_value->field_descrMultislotAllocation = ANY_OR_OMIT;
single_value->field_modeOf1stChannel = ANY_OR_OMIT;
single_value->field_channelSet2 = ANY_OR_OMIT;
single_value->field_channelSet3 = ANY_OR_OMIT;
single_value->field_channelSet4 = ANY_OR_OMIT;
single_value->field_channelSet5 = ANY_OR_OMIT;
single_value->field_channelSet6 = ANY_OR_OMIT;
single_value->field_channelSet7 = ANY_OR_OMIT;
single_value->field_channelSet8 = ANY_OR_OMIT;
single_value->field_descrOf2ndChAfterTime = ANY_OR_OMIT;
single_value->field_modeOf2ndChannel = ANY_OR_OMIT;
single_value->field_mobileAllocation__at = ANY_OR_OMIT;
single_value->field_startingTime = ANY_OR_OMIT;
single_value->field_frequencyList__bt = ANY_OR_OMIT;
single_value->field_descrOf1stCh__bt = ANY_OR_OMIT;
single_value->field_descrOf2ndCh__bt = ANY_OR_OMIT;
single_value->field_frequencyChannelSequence = 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_vGCS__Ciphering__Parameters = ANY_OR_OMIT;
single_value->field_extendedTSCSet__afterTime = ANY_OR_OMIT;
single_value->field_extendedTSCSet__beforeTime = ANY_OR_OMIT;
}
}
}

void PDU__RRM__AssignmentCommand__NW__MS_template::copy_value(const PDU__RRM__AssignmentCommand__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.descrOf1stChAfterTime().is_bound()) {
  single_value->field_descrOf1stChAfterTime = other_value.descrOf1stChAfterTime();
} else {
  single_value->field_descrOf1stChAfterTime.clean_up();
}
if (other_value.PowerCommand().is_bound()) {
  single_value->field_PowerCommand = other_value.PowerCommand();
} else {
  single_value->field_PowerCommand.clean_up();
}
if (other_value.frequencyList__at().is_bound()) {
  if (other_value.frequencyList__at().ispresent()) single_value->field_frequencyList__at = other_value.frequencyList__at()();
  else single_value->field_frequencyList__at = OMIT_VALUE;
} else {
  single_value->field_frequencyList__at.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.descrMultislotAllocation().is_bound()) {
  if (other_value.descrMultislotAllocation().ispresent()) single_value->field_descrMultislotAllocation = other_value.descrMultislotAllocation()();
  else single_value->field_descrMultislotAllocation = OMIT_VALUE;
} else {
  single_value->field_descrMultislotAllocation.clean_up();
}
if (other_value.modeOf1stChannel().is_bound()) {
  if (other_value.modeOf1stChannel().ispresent()) single_value->field_modeOf1stChannel = other_value.modeOf1stChannel()();
  else single_value->field_modeOf1stChannel = OMIT_VALUE;
} else {
  single_value->field_modeOf1stChannel.clean_up();
}
if (other_value.channelSet2().is_bound()) {
  if (other_value.channelSet2().ispresent()) single_value->field_channelSet2 = other_value.channelSet2()();
  else single_value->field_channelSet2 = OMIT_VALUE;
} else {
  single_value->field_channelSet2.clean_up();
}
if (other_value.channelSet3().is_bound()) {
  if (other_value.channelSet3().ispresent()) single_value->field_channelSet3 = other_value.channelSet3()();
  else single_value->field_channelSet3 = OMIT_VALUE;
} else {
  single_value->field_channelSet3.clean_up();
}
if (other_value.channelSet4().is_bound()) {
  if (other_value.channelSet4().ispresent()) single_value->field_channelSet4 = other_value.channelSet4()();
  else single_value->field_channelSet4 = OMIT_VALUE;
} else {
  single_value->field_channelSet4.clean_up();
}
if (other_value.channelSet5().is_bound()) {
  if (other_value.channelSet5().ispresent()) single_value->field_channelSet5 = other_value.channelSet5()();
  else single_value->field_channelSet5 = OMIT_VALUE;
} else {
  single_value->field_channelSet5.clean_up();
}
if (other_value.channelSet6().is_bound()) {
  if (other_value.channelSet6().ispresent()) single_value->field_channelSet6 = other_value.channelSet6()();
  else single_value->field_channelSet6 = OMIT_VALUE;
} else {
  single_value->field_channelSet6.clean_up();
}
if (other_value.channelSet7().is_bound()) {
  if (other_value.channelSet7().ispresent()) single_value->field_channelSet7 = other_value.channelSet7()();
  else single_value->field_channelSet7 = OMIT_VALUE;
} else {
  single_value->field_channelSet7.clean_up();
}
if (other_value.channelSet8().is_bound()) {
  if (other_value.channelSet8().ispresent()) single_value->field_channelSet8 = other_value.channelSet8()();
  else single_value->field_channelSet8 = OMIT_VALUE;
} else {
  single_value->field_channelSet8.clean_up();
}
if (other_value.descrOf2ndChAfterTime().is_bound()) {
  if (other_value.descrOf2ndChAfterTime().ispresent()) single_value->field_descrOf2ndChAfterTime = other_value.descrOf2ndChAfterTime()();
  else single_value->field_descrOf2ndChAfterTime = OMIT_VALUE;
} else {
  single_value->field_descrOf2ndChAfterTime.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.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.frequencyList__bt().is_bound()) {
  if (other_value.frequencyList__bt().ispresent()) single_value->field_frequencyList__bt = other_value.frequencyList__bt()();
  else single_value->field_frequencyList__bt = OMIT_VALUE;
} else {
  single_value->field_frequencyList__bt.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().is_bound()) {
  if (other_value.frequencyChannelSequence().ispresent()) single_value->field_frequencyChannelSequence = other_value.frequencyChannelSequence()();
  else single_value->field_frequencyChannelSequence = OMIT_VALUE;
} else {
  single_value->field_frequencyChannelSequence.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.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.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__AssignmentCommand__NW__MS_template::copy_template(const PDU__RRM__AssignmentCommand__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descrOf1stChAfterTime().get_selection()) {
single_value->field_descrOf1stChAfterTime = other_value.descrOf1stChAfterTime();
} else {
single_value->field_descrOf1stChAfterTime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.PowerCommand().get_selection()) {
single_value->field_PowerCommand = other_value.PowerCommand();
} else {
single_value->field_PowerCommand.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyList__at().get_selection()) {
single_value->field_frequencyList__at = other_value.frequencyList__at();
} else {
single_value->field_frequencyList__at.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.descrMultislotAllocation().get_selection()) {
single_value->field_descrMultislotAllocation = other_value.descrMultislotAllocation();
} else {
single_value->field_descrMultislotAllocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOf1stChannel().get_selection()) {
single_value->field_modeOf1stChannel = other_value.modeOf1stChannel();
} else {
single_value->field_modeOf1stChannel.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelSet2().get_selection()) {
single_value->field_channelSet2 = other_value.channelSet2();
} else {
single_value->field_channelSet2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelSet3().get_selection()) {
single_value->field_channelSet3 = other_value.channelSet3();
} else {
single_value->field_channelSet3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelSet4().get_selection()) {
single_value->field_channelSet4 = other_value.channelSet4();
} else {
single_value->field_channelSet4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelSet5().get_selection()) {
single_value->field_channelSet5 = other_value.channelSet5();
} else {
single_value->field_channelSet5.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelSet6().get_selection()) {
single_value->field_channelSet6 = other_value.channelSet6();
} else {
single_value->field_channelSet6.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelSet7().get_selection()) {
single_value->field_channelSet7 = other_value.channelSet7();
} else {
single_value->field_channelSet7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelSet8().get_selection()) {
single_value->field_channelSet8 = other_value.channelSet8();
} else {
single_value->field_channelSet8.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descrOf2ndChAfterTime().get_selection()) {
single_value->field_descrOf2ndChAfterTime = other_value.descrOf2ndChAfterTime();
} else {
single_value->field_descrOf2ndChAfterTime.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.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.frequencyList__bt().get_selection()) {
single_value->field_frequencyList__bt = other_value.frequencyList__bt();
} else {
single_value->field_frequencyList__bt.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().get_selection()) {
single_value->field_frequencyChannelSequence = other_value.frequencyChannelSequence();
} else {
single_value->field_frequencyChannelSequence.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.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.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__AssignmentCommand__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__RRM__AssignmentCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__AssignmentCommand__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__AssignmentCommand__NW__MS_template::PDU__RRM__AssignmentCommand__NW__MS_template()
{
}

PDU__RRM__AssignmentCommand__NW__MS_template::PDU__RRM__AssignmentCommand__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__AssignmentCommand__NW__MS_template::PDU__RRM__AssignmentCommand__NW__MS_template(const PDU__RRM__AssignmentCommand__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__AssignmentCommand__NW__MS_template::PDU__RRM__AssignmentCommand__NW__MS_template(const OPTIONAL<PDU__RRM__AssignmentCommand__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__AssignmentCommand__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS from an unbound optional field.");
}
}

PDU__RRM__AssignmentCommand__NW__MS_template::PDU__RRM__AssignmentCommand__NW__MS_template(PDU__RRM__AssignmentCommand__NW__MS_template* p_precondition, PDU__RRM__AssignmentCommand__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__AssignmentCommand__NW__MS_template::PDU__RRM__AssignmentCommand__NW__MS_template(Dynamic_Match_Interface<PDU__RRM__AssignmentCommand__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__AssignmentCommand__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__AssignmentCommand__NW__MS_template::PDU__RRM__AssignmentCommand__NW__MS_template(const PDU__RRM__AssignmentCommand__NW__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__AssignmentCommand__NW__MS_template::~PDU__RRM__AssignmentCommand__NW__MS_template()
{
clean_up();
}

PDU__RRM__AssignmentCommand__NW__MS_template& PDU__RRM__AssignmentCommand__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__AssignmentCommand__NW__MS_template& PDU__RRM__AssignmentCommand__NW__MS_template::operator=(const PDU__RRM__AssignmentCommand__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__AssignmentCommand__NW__MS_template& PDU__RRM__AssignmentCommand__NW__MS_template::operator=(const OPTIONAL<PDU__RRM__AssignmentCommand__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__AssignmentCommand__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
}
return *this;
}

PDU__RRM__AssignmentCommand__NW__MS_template& PDU__RRM__AssignmentCommand__NW__MS_template::operator=(const PDU__RRM__AssignmentCommand__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__AssignmentCommand__NW__MS_template::match(const PDU__RRM__AssignmentCommand__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.descrOf1stChAfterTime().is_bound()) return FALSE;
if(!single_value->field_descrOf1stChAfterTime.match(other_value.descrOf1stChAfterTime(), legacy))return FALSE;
if(!other_value.PowerCommand().is_bound()) return FALSE;
if(!single_value->field_PowerCommand.match(other_value.PowerCommand(), legacy))return FALSE;
if(!other_value.frequencyList__at().is_bound()) return FALSE;
if((other_value.frequencyList__at().ispresent() ? !single_value->field_frequencyList__at.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.frequencyList__at(), legacy) : !single_value->field_frequencyList__at.match_omit(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.descrMultislotAllocation().is_bound()) return FALSE;
if((other_value.descrMultislotAllocation().ispresent() ? !single_value->field_descrMultislotAllocation.match((const MultislotAllocation__TLV&)other_value.descrMultislotAllocation(), legacy) : !single_value->field_descrMultislotAllocation.match_omit(legacy)))return FALSE;
if(!other_value.modeOf1stChannel().is_bound()) return FALSE;
if((other_value.modeOf1stChannel().ispresent() ? !single_value->field_modeOf1stChannel.match((const ChannelMode__TV&)other_value.modeOf1stChannel(), legacy) : !single_value->field_modeOf1stChannel.match_omit(legacy)))return FALSE;
if(!other_value.channelSet2().is_bound()) return FALSE;
if((other_value.channelSet2().ispresent() ? !single_value->field_channelSet2.match((const ChannelMode__TV&)other_value.channelSet2(), legacy) : !single_value->field_channelSet2.match_omit(legacy)))return FALSE;
if(!other_value.channelSet3().is_bound()) return FALSE;
if((other_value.channelSet3().ispresent() ? !single_value->field_channelSet3.match((const ChannelMode__TV&)other_value.channelSet3(), legacy) : !single_value->field_channelSet3.match_omit(legacy)))return FALSE;
if(!other_value.channelSet4().is_bound()) return FALSE;
if((other_value.channelSet4().ispresent() ? !single_value->field_channelSet4.match((const ChannelMode__TV&)other_value.channelSet4(), legacy) : !single_value->field_channelSet4.match_omit(legacy)))return FALSE;
if(!other_value.channelSet5().is_bound()) return FALSE;
if((other_value.channelSet5().ispresent() ? !single_value->field_channelSet5.match((const ChannelMode__TV&)other_value.channelSet5(), legacy) : !single_value->field_channelSet5.match_omit(legacy)))return FALSE;
if(!other_value.channelSet6().is_bound()) return FALSE;
if((other_value.channelSet6().ispresent() ? !single_value->field_channelSet6.match((const ChannelMode__TV&)other_value.channelSet6(), legacy) : !single_value->field_channelSet6.match_omit(legacy)))return FALSE;
if(!other_value.channelSet7().is_bound()) return FALSE;
if((other_value.channelSet7().ispresent() ? !single_value->field_channelSet7.match((const ChannelMode__TV&)other_value.channelSet7(), legacy) : !single_value->field_channelSet7.match_omit(legacy)))return FALSE;
if(!other_value.channelSet8().is_bound()) return FALSE;
if((other_value.channelSet8().ispresent() ? !single_value->field_channelSet8.match((const ChannelMode__TV&)other_value.channelSet8(), legacy) : !single_value->field_channelSet8.match_omit(legacy)))return FALSE;
if(!other_value.descrOf2ndChAfterTime().is_bound()) return FALSE;
if((other_value.descrOf2ndChAfterTime().ispresent() ? !single_value->field_descrOf2ndChAfterTime.match((const ChannelDescription__TV&)other_value.descrOf2ndChAfterTime(), legacy) : !single_value->field_descrOf2ndChAfterTime.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.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.frequencyList__bt().is_bound()) return FALSE;
if((other_value.frequencyList__bt().ispresent() ? !single_value->field_frequencyList__bt.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.frequencyList__bt(), legacy) : !single_value->field_frequencyList__bt.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().is_bound()) return FALSE;
if((other_value.frequencyChannelSequence().ispresent() ? !single_value->field_frequencyChannelSequence.match((const FrequencyChannelSequence__TV&)other_value.frequencyChannelSequence(), legacy) : !single_value->field_frequencyChannelSequence.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.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.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_AssignmentCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__AssignmentCommand__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_descrOf1stChAfterTime.is_bound()
 || single_value->field_PowerCommand.is_bound()
 || (single_value->field_frequencyList__at.is_omit() || single_value->field_frequencyList__at.is_bound())
 || (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_bound())
 || (single_value->field_descrMultislotAllocation.is_omit() || single_value->field_descrMultislotAllocation.is_bound())
 || (single_value->field_modeOf1stChannel.is_omit() || single_value->field_modeOf1stChannel.is_bound())
 || (single_value->field_channelSet2.is_omit() || single_value->field_channelSet2.is_bound())
 || (single_value->field_channelSet3.is_omit() || single_value->field_channelSet3.is_bound())
 || (single_value->field_channelSet4.is_omit() || single_value->field_channelSet4.is_bound())
 || (single_value->field_channelSet5.is_omit() || single_value->field_channelSet5.is_bound())
 || (single_value->field_channelSet6.is_omit() || single_value->field_channelSet6.is_bound())
 || (single_value->field_channelSet7.is_omit() || single_value->field_channelSet7.is_bound())
 || (single_value->field_channelSet8.is_omit() || single_value->field_channelSet8.is_bound())
 || (single_value->field_descrOf2ndChAfterTime.is_omit() || single_value->field_descrOf2ndChAfterTime.is_bound())
 || (single_value->field_modeOf2ndChannel.is_omit() || single_value->field_modeOf2ndChannel.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_frequencyList__bt.is_omit() || single_value->field_frequencyList__bt.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.is_omit() || single_value->field_frequencyChannelSequence.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_vGCS__Ciphering__Parameters.is_omit() || single_value->field_vGCS__Ciphering__Parameters.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__AssignmentCommand__NW__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_descrOf1stChAfterTime.is_value()
 && single_value->field_PowerCommand.is_value()
 && (single_value->field_frequencyList__at.is_omit() || single_value->field_frequencyList__at.is_value())
 && (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_value())
 && (single_value->field_descrMultislotAllocation.is_omit() || single_value->field_descrMultislotAllocation.is_value())
 && (single_value->field_modeOf1stChannel.is_omit() || single_value->field_modeOf1stChannel.is_value())
 && (single_value->field_channelSet2.is_omit() || single_value->field_channelSet2.is_value())
 && (single_value->field_channelSet3.is_omit() || single_value->field_channelSet3.is_value())
 && (single_value->field_channelSet4.is_omit() || single_value->field_channelSet4.is_value())
 && (single_value->field_channelSet5.is_omit() || single_value->field_channelSet5.is_value())
 && (single_value->field_channelSet6.is_omit() || single_value->field_channelSet6.is_value())
 && (single_value->field_channelSet7.is_omit() || single_value->field_channelSet7.is_value())
 && (single_value->field_channelSet8.is_omit() || single_value->field_channelSet8.is_value())
 && (single_value->field_descrOf2ndChAfterTime.is_omit() || single_value->field_descrOf2ndChAfterTime.is_value())
 && (single_value->field_modeOf2ndChannel.is_omit() || single_value->field_modeOf2ndChannel.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_frequencyList__bt.is_omit() || single_value->field_frequencyList__bt.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.is_omit() || single_value->field_frequencyChannelSequence.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_vGCS__Ciphering__Parameters.is_omit() || single_value->field_vGCS__Ciphering__Parameters.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__AssignmentCommand__NW__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__RRM__AssignmentCommand__NW__MS PDU__RRM__AssignmentCommand__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
PDU__RRM__AssignmentCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_descrOf1stChAfterTime.is_bound()) {
ret_val.descrOf1stChAfterTime() = single_value->field_descrOf1stChAfterTime.valueof();
}
if (single_value->field_PowerCommand.is_bound()) {
ret_val.PowerCommand() = single_value->field_PowerCommand.valueof();
}
if (single_value->field_frequencyList__at.is_omit()) ret_val.frequencyList__at() = OMIT_VALUE;
else if (single_value->field_frequencyList__at.is_bound()) {
ret_val.frequencyList__at() = single_value->field_frequencyList__at.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_descrMultislotAllocation.is_omit()) ret_val.descrMultislotAllocation() = OMIT_VALUE;
else if (single_value->field_descrMultislotAllocation.is_bound()) {
ret_val.descrMultislotAllocation() = single_value->field_descrMultislotAllocation.valueof();
}
if (single_value->field_modeOf1stChannel.is_omit()) ret_val.modeOf1stChannel() = OMIT_VALUE;
else if (single_value->field_modeOf1stChannel.is_bound()) {
ret_val.modeOf1stChannel() = single_value->field_modeOf1stChannel.valueof();
}
if (single_value->field_channelSet2.is_omit()) ret_val.channelSet2() = OMIT_VALUE;
else if (single_value->field_channelSet2.is_bound()) {
ret_val.channelSet2() = single_value->field_channelSet2.valueof();
}
if (single_value->field_channelSet3.is_omit()) ret_val.channelSet3() = OMIT_VALUE;
else if (single_value->field_channelSet3.is_bound()) {
ret_val.channelSet3() = single_value->field_channelSet3.valueof();
}
if (single_value->field_channelSet4.is_omit()) ret_val.channelSet4() = OMIT_VALUE;
else if (single_value->field_channelSet4.is_bound()) {
ret_val.channelSet4() = single_value->field_channelSet4.valueof();
}
if (single_value->field_channelSet5.is_omit()) ret_val.channelSet5() = OMIT_VALUE;
else if (single_value->field_channelSet5.is_bound()) {
ret_val.channelSet5() = single_value->field_channelSet5.valueof();
}
if (single_value->field_channelSet6.is_omit()) ret_val.channelSet6() = OMIT_VALUE;
else if (single_value->field_channelSet6.is_bound()) {
ret_val.channelSet6() = single_value->field_channelSet6.valueof();
}
if (single_value->field_channelSet7.is_omit()) ret_val.channelSet7() = OMIT_VALUE;
else if (single_value->field_channelSet7.is_bound()) {
ret_val.channelSet7() = single_value->field_channelSet7.valueof();
}
if (single_value->field_channelSet8.is_omit()) ret_val.channelSet8() = OMIT_VALUE;
else if (single_value->field_channelSet8.is_bound()) {
ret_val.channelSet8() = single_value->field_channelSet8.valueof();
}
if (single_value->field_descrOf2ndChAfterTime.is_omit()) ret_val.descrOf2ndChAfterTime() = OMIT_VALUE;
else if (single_value->field_descrOf2ndChAfterTime.is_bound()) {
ret_val.descrOf2ndChAfterTime() = single_value->field_descrOf2ndChAfterTime.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_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_frequencyList__bt.is_omit()) ret_val.frequencyList__bt() = OMIT_VALUE;
else if (single_value->field_frequencyList__bt.is_bound()) {
ret_val.frequencyList__bt() = single_value->field_frequencyList__bt.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.is_omit()) ret_val.frequencyChannelSequence() = OMIT_VALUE;
else if (single_value->field_frequencyChannelSequence.is_bound()) {
ret_val.frequencyChannelSequence() = single_value->field_frequencyChannelSequence.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_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_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__AssignmentCommand__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__AssignmentCommand__NW__MS_template[list_length];
}

PDU__RRM__AssignmentCommand__NW__MS_template& PDU__RRM__AssignmentCommand__NW__MS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__AssignmentCommand__NW__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__AssignmentCommand__NW__MS_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_messageType;
}

ChannelDescription2__V_template& PDU__RRM__AssignmentCommand__NW__MS_template::descrOf1stChAfterTime()
{
set_specific();
return single_value->field_descrOf1stChAfterTime;
}

const ChannelDescription2__V_template& PDU__RRM__AssignmentCommand__NW__MS_template::descrOf1stChAfterTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrOf1stChAfterTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_descrOf1stChAfterTime;
}

PowerCommand__V_template& PDU__RRM__AssignmentCommand__NW__MS_template::PowerCommand()
{
set_specific();
return single_value->field_PowerCommand;
}

const PowerCommand__V_template& PDU__RRM__AssignmentCommand__NW__MS_template::PowerCommand() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field PowerCommand of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_PowerCommand;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::frequencyList__at()
{
set_specific();
return single_value->field_frequencyList__at;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::frequencyList__at() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyList_at of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_frequencyList__at;
}

CellChannelDescription__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::cellChannelDescr()
{
set_specific();
return single_value->field_cellChannelDescr;
}

const CellChannelDescription__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::cellChannelDescr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellChannelDescr of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_cellChannelDescr;
}

MultislotAllocation__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::descrMultislotAllocation()
{
set_specific();
return single_value->field_descrMultislotAllocation;
}

const MultislotAllocation__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::descrMultislotAllocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrMultislotAllocation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_descrMultislotAllocation;
}

ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::modeOf1stChannel()
{
set_specific();
return single_value->field_modeOf1stChannel;
}

const ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::modeOf1stChannel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOf1stChannel of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_modeOf1stChannel;
}

ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet2()
{
set_specific();
return single_value->field_channelSet2;
}

const ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelSet2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_channelSet2;
}

ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet3()
{
set_specific();
return single_value->field_channelSet3;
}

const ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelSet3 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_channelSet3;
}

ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet4()
{
set_specific();
return single_value->field_channelSet4;
}

const ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelSet4 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_channelSet4;
}

ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet5()
{
set_specific();
return single_value->field_channelSet5;
}

const ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelSet5 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_channelSet5;
}

ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet6()
{
set_specific();
return single_value->field_channelSet6;
}

const ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet6() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelSet6 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_channelSet6;
}

ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet7()
{
set_specific();
return single_value->field_channelSet7;
}

const ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelSet7 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_channelSet7;
}

ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet8()
{
set_specific();
return single_value->field_channelSet8;
}

const ChannelMode__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::channelSet8() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelSet8 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_channelSet8;
}

ChannelDescription__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::descrOf2ndChAfterTime()
{
set_specific();
return single_value->field_descrOf2ndChAfterTime;
}

const ChannelDescription__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::descrOf2ndChAfterTime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrOf2ndChAfterTime of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_descrOf2ndChAfterTime;
}

ChannelMode2__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::modeOf2ndChannel()
{
set_specific();
return single_value->field_modeOf2ndChannel;
}

const ChannelMode2__TV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_modeOf2ndChannel;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::mobileAllocation__at()
{
set_specific();
return single_value->field_mobileAllocation__at;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_mobileAllocation__at;
}

StartingTime__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::startingTime()
{
set_specific();
return single_value->field_startingTime;
}

const StartingTime__TV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_startingTime;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::frequencyList__bt()
{
set_specific();
return single_value->field_frequencyList__bt;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::frequencyList__bt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyList_bt of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_frequencyList__bt;
}

ChannelDescription2__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::descrOf1stCh__bt()
{
set_specific();
return single_value->field_descrOf1stCh__bt;
}

const ChannelDescription2__TV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_descrOf1stCh__bt;
}

ChannelDescription__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::descrOf2ndCh__bt()
{
set_specific();
return single_value->field_descrOf2ndCh__bt;
}

const ChannelDescription__TV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_descrOf2ndCh__bt;
}

FrequencyChannelSequence__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::frequencyChannelSequence()
{
set_specific();
return single_value->field_frequencyChannelSequence;
}

const FrequencyChannelSequence__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::frequencyChannelSequence() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyChannelSequence of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_frequencyChannelSequence;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::mobileAllocation__bt()
{
set_specific();
return single_value->field_mobileAllocation__bt;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_mobileAllocation__bt;
}

CipherModeSetting__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::cipherModeSetting()
{
set_specific();
return single_value->field_cipherModeSetting;
}

const CipherModeSetting__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::cipherModeSetting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipherModeSetting of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_cipherModeSetting;
}

VGCS__TargetModeIndication__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::vGCS__TargetModeIndication()
{
set_specific();
return single_value->field_vGCS__TargetModeIndication;
}

const VGCS__TargetModeIndication__TLV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_vGCS__TargetModeIndication;
}

MultiRateConfiguration__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::multiRateConfiguration()
{
set_specific();
return single_value->field_multiRateConfiguration;
}

const MultiRateConfiguration__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::multiRateConfiguration() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multiRateConfiguration of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
return single_value->field_multiRateConfiguration;
}

VGCS__Ciphering__Parameters__TLV_template& PDU__RRM__AssignmentCommand__NW__MS_template::vGCS__Ciphering__Parameters()
{
set_specific();
return single_value->field_vGCS__Ciphering__Parameters;
}

const VGCS__Ciphering__Parameters__TLV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_vGCS__Ciphering__Parameters;
}

ExtendedTSCSet__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::extendedTSCSet__afterTime()
{
set_specific();
return single_value->field_extendedTSCSet__afterTime;
}

const ExtendedTSCSet__TV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_extendedTSCSet__afterTime;
}

ExtendedTSCSet__TV_template& PDU__RRM__AssignmentCommand__NW__MS_template::extendedTSCSet__beforeTime()
{
set_specific();
return single_value->field_extendedTSCSet__beforeTime;
}

const ExtendedTSCSet__TV_template& PDU__RRM__AssignmentCommand__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_AssignmentCommand_NW_MS.");
return single_value->field_extendedTSCSet__beforeTime;
}

int PDU__RRM__AssignmentCommand__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_frequencyList__at.is_present()) ret_val++;
      if (single_value->field_cellChannelDescr.is_present()) ret_val++;
      if (single_value->field_descrMultislotAllocation.is_present()) ret_val++;
      if (single_value->field_modeOf1stChannel.is_present()) ret_val++;
      if (single_value->field_channelSet2.is_present()) ret_val++;
      if (single_value->field_channelSet3.is_present()) ret_val++;
      if (single_value->field_channelSet4.is_present()) ret_val++;
      if (single_value->field_channelSet5.is_present()) ret_val++;
      if (single_value->field_channelSet6.is_present()) ret_val++;
      if (single_value->field_channelSet7.is_present()) ret_val++;
      if (single_value->field_channelSet8.is_present()) ret_val++;
      if (single_value->field_descrOf2ndChAfterTime.is_present()) ret_val++;
      if (single_value->field_modeOf2ndChannel.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_frequencyList__bt.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.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_vGCS__Ciphering__Parameters.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_AssignmentCommand_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
  }
  return 0;
}

void PDU__RRM__AssignmentCommand__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", descrOf1stChAfterTime := ");
single_value->field_descrOf1stChAfterTime.log();
TTCN_Logger::log_event_str(", PowerCommand := ");
single_value->field_PowerCommand.log();
TTCN_Logger::log_event_str(", frequencyList_at := ");
single_value->field_frequencyList__at.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
single_value->field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", descrMultislotAllocation := ");
single_value->field_descrMultislotAllocation.log();
TTCN_Logger::log_event_str(", modeOf1stChannel := ");
single_value->field_modeOf1stChannel.log();
TTCN_Logger::log_event_str(", channelSet2 := ");
single_value->field_channelSet2.log();
TTCN_Logger::log_event_str(", channelSet3 := ");
single_value->field_channelSet3.log();
TTCN_Logger::log_event_str(", channelSet4 := ");
single_value->field_channelSet4.log();
TTCN_Logger::log_event_str(", channelSet5 := ");
single_value->field_channelSet5.log();
TTCN_Logger::log_event_str(", channelSet6 := ");
single_value->field_channelSet6.log();
TTCN_Logger::log_event_str(", channelSet7 := ");
single_value->field_channelSet7.log();
TTCN_Logger::log_event_str(", channelSet8 := ");
single_value->field_channelSet8.log();
TTCN_Logger::log_event_str(", descrOf2ndChAfterTime := ");
single_value->field_descrOf2ndChAfterTime.log();
TTCN_Logger::log_event_str(", modeOf2ndChannel := ");
single_value->field_modeOf2ndChannel.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(", frequencyList_bt := ");
single_value->field_frequencyList__bt.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 := ");
single_value->field_frequencyChannelSequence.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(", vGCS_Ciphering_Parameters := ");
single_value->field_vGCS__Ciphering__Parameters.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__AssignmentCommand__NW__MS_template::log_match(const PDU__RRM__AssignmentCommand__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_descrOf1stChAfterTime.match(match_value.descrOf1stChAfterTime(), legacy)){
TTCN_Logger::log_logmatch_info(".descrOf1stChAfterTime");
single_value->field_descrOf1stChAfterTime.log_match(match_value.descrOf1stChAfterTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_PowerCommand.match(match_value.PowerCommand(), legacy)){
TTCN_Logger::log_logmatch_info(".PowerCommand");
single_value->field_PowerCommand.log_match(match_value.PowerCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.frequencyList__at().ispresent()){
if(!single_value->field_frequencyList__at.match(match_value.frequencyList__at(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyList_at");
single_value->field_frequencyList__at.log_match(match_value.frequencyList__at(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyList__at.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyList_at := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyList__at.log();
TTCN_Logger::log_event_str(" unmatched");
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.descrMultislotAllocation().ispresent()){
if(!single_value->field_descrMultislotAllocation.match(match_value.descrMultislotAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".descrMultislotAllocation");
single_value->field_descrMultislotAllocation.log_match(match_value.descrMultislotAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descrMultislotAllocation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descrMultislotAllocation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descrMultislotAllocation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOf1stChannel().ispresent()){
if(!single_value->field_modeOf1stChannel.match(match_value.modeOf1stChannel(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOf1stChannel");
single_value->field_modeOf1stChannel.log_match(match_value.modeOf1stChannel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOf1stChannel.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOf1stChannel := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOf1stChannel.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelSet2().ispresent()){
if(!single_value->field_channelSet2.match(match_value.channelSet2(), legacy)){
TTCN_Logger::log_logmatch_info(".channelSet2");
single_value->field_channelSet2.log_match(match_value.channelSet2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelSet2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelSet2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelSet2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelSet3().ispresent()){
if(!single_value->field_channelSet3.match(match_value.channelSet3(), legacy)){
TTCN_Logger::log_logmatch_info(".channelSet3");
single_value->field_channelSet3.log_match(match_value.channelSet3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelSet3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelSet3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelSet3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelSet4().ispresent()){
if(!single_value->field_channelSet4.match(match_value.channelSet4(), legacy)){
TTCN_Logger::log_logmatch_info(".channelSet4");
single_value->field_channelSet4.log_match(match_value.channelSet4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelSet4.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelSet4 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelSet4.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelSet5().ispresent()){
if(!single_value->field_channelSet5.match(match_value.channelSet5(), legacy)){
TTCN_Logger::log_logmatch_info(".channelSet5");
single_value->field_channelSet5.log_match(match_value.channelSet5(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelSet5.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelSet5 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelSet5.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelSet6().ispresent()){
if(!single_value->field_channelSet6.match(match_value.channelSet6(), legacy)){
TTCN_Logger::log_logmatch_info(".channelSet6");
single_value->field_channelSet6.log_match(match_value.channelSet6(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelSet6.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelSet6 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelSet6.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelSet7().ispresent()){
if(!single_value->field_channelSet7.match(match_value.channelSet7(), legacy)){
TTCN_Logger::log_logmatch_info(".channelSet7");
single_value->field_channelSet7.log_match(match_value.channelSet7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelSet7.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelSet7 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelSet7.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelSet8().ispresent()){
if(!single_value->field_channelSet8.match(match_value.channelSet8(), legacy)){
TTCN_Logger::log_logmatch_info(".channelSet8");
single_value->field_channelSet8.log_match(match_value.channelSet8(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelSet8.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelSet8 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelSet8.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descrOf2ndChAfterTime().ispresent()){
if(!single_value->field_descrOf2ndChAfterTime.match(match_value.descrOf2ndChAfterTime(), legacy)){
TTCN_Logger::log_logmatch_info(".descrOf2ndChAfterTime");
single_value->field_descrOf2ndChAfterTime.log_match(match_value.descrOf2ndChAfterTime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descrOf2ndChAfterTime.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descrOf2ndChAfterTime := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descrOf2ndChAfterTime.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.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.frequencyList__bt().ispresent()){
if(!single_value->field_frequencyList__bt.match(match_value.frequencyList__bt(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyList_bt");
single_value->field_frequencyList__bt.log_match(match_value.frequencyList__bt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyList__bt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyList_bt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyList__bt.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().ispresent()){
if(!single_value->field_frequencyChannelSequence.match(match_value.frequencyChannelSequence(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyChannelSequence");
single_value->field_frequencyChannelSequence.log_match(match_value.frequencyChannelSequence(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyChannelSequence.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyChannelSequence := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyChannelSequence.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.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.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(", descrOf1stChAfterTime := ");
single_value->field_descrOf1stChAfterTime.log_match(match_value.descrOf1stChAfterTime(), legacy);
TTCN_Logger::log_event_str(", PowerCommand := ");
single_value->field_PowerCommand.log_match(match_value.PowerCommand(), legacy);
TTCN_Logger::log_event_str(", frequencyList_at := ");
if (match_value.frequencyList__at().ispresent()) {
single_value->field_frequencyList__at.log_match(match_value.frequencyList__at(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyList__at.log();
if (single_value->field_frequencyList__at.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
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(", descrMultislotAllocation := ");
if (match_value.descrMultislotAllocation().ispresent()) {
single_value->field_descrMultislotAllocation.log_match(match_value.descrMultislotAllocation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descrMultislotAllocation.log();
if (single_value->field_descrMultislotAllocation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOf1stChannel := ");
if (match_value.modeOf1stChannel().ispresent()) {
single_value->field_modeOf1stChannel.log_match(match_value.modeOf1stChannel(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOf1stChannel.log();
if (single_value->field_modeOf1stChannel.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelSet2 := ");
if (match_value.channelSet2().ispresent()) {
single_value->field_channelSet2.log_match(match_value.channelSet2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelSet2.log();
if (single_value->field_channelSet2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelSet3 := ");
if (match_value.channelSet3().ispresent()) {
single_value->field_channelSet3.log_match(match_value.channelSet3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelSet3.log();
if (single_value->field_channelSet3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelSet4 := ");
if (match_value.channelSet4().ispresent()) {
single_value->field_channelSet4.log_match(match_value.channelSet4(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelSet4.log();
if (single_value->field_channelSet4.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelSet5 := ");
if (match_value.channelSet5().ispresent()) {
single_value->field_channelSet5.log_match(match_value.channelSet5(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelSet5.log();
if (single_value->field_channelSet5.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelSet6 := ");
if (match_value.channelSet6().ispresent()) {
single_value->field_channelSet6.log_match(match_value.channelSet6(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelSet6.log();
if (single_value->field_channelSet6.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelSet7 := ");
if (match_value.channelSet7().ispresent()) {
single_value->field_channelSet7.log_match(match_value.channelSet7(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelSet7.log();
if (single_value->field_channelSet7.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelSet8 := ");
if (match_value.channelSet8().ispresent()) {
single_value->field_channelSet8.log_match(match_value.channelSet8(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelSet8.log();
if (single_value->field_channelSet8.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descrOf2ndChAfterTime := ");
if (match_value.descrOf2ndChAfterTime().ispresent()) {
single_value->field_descrOf2ndChAfterTime.log_match(match_value.descrOf2ndChAfterTime(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descrOf2ndChAfterTime.log();
if (single_value->field_descrOf2ndChAfterTime.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(", 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(", frequencyList_bt := ");
if (match_value.frequencyList__bt().ispresent()) {
single_value->field_frequencyList__bt.log_match(match_value.frequencyList__bt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyList__bt.log();
if (single_value->field_frequencyList__bt.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 := ");
if (match_value.frequencyChannelSequence().ispresent()) {
single_value->field_frequencyChannelSequence.log_match(match_value.frequencyChannelSequence(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyChannelSequence.log();
if (single_value->field_frequencyChannelSequence.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(", 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(", 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__AssignmentCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (descrOf1stChAfterTime().is_bound()) descrOf1stChAfterTime().set_implicit_omit();
if (PowerCommand().is_bound()) PowerCommand().set_implicit_omit();
if (!frequencyList__at().is_bound()) frequencyList__at() = OMIT_VALUE;
else frequencyList__at().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!descrMultislotAllocation().is_bound()) descrMultislotAllocation() = OMIT_VALUE;
else descrMultislotAllocation().set_implicit_omit();
if (!modeOf1stChannel().is_bound()) modeOf1stChannel() = OMIT_VALUE;
else modeOf1stChannel().set_implicit_omit();
if (!channelSet2().is_bound()) channelSet2() = OMIT_VALUE;
else channelSet2().set_implicit_omit();
if (!channelSet3().is_bound()) channelSet3() = OMIT_VALUE;
else channelSet3().set_implicit_omit();
if (!channelSet4().is_bound()) channelSet4() = OMIT_VALUE;
else channelSet4().set_implicit_omit();
if (!channelSet5().is_bound()) channelSet5() = OMIT_VALUE;
else channelSet5().set_implicit_omit();
if (!channelSet6().is_bound()) channelSet6() = OMIT_VALUE;
else channelSet6().set_implicit_omit();
if (!channelSet7().is_bound()) channelSet7() = OMIT_VALUE;
else channelSet7().set_implicit_omit();
if (!channelSet8().is_bound()) channelSet8() = OMIT_VALUE;
else channelSet8().set_implicit_omit();
if (!descrOf2ndChAfterTime().is_bound()) descrOf2ndChAfterTime() = OMIT_VALUE;
else descrOf2ndChAfterTime().set_implicit_omit();
if (!modeOf2ndChannel().is_bound()) modeOf2ndChannel() = OMIT_VALUE;
else modeOf2ndChannel().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 (!frequencyList__bt().is_bound()) frequencyList__bt() = OMIT_VALUE;
else frequencyList__bt().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().is_bound()) frequencyChannelSequence() = OMIT_VALUE;
else frequencyChannelSequence().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 (!vGCS__Ciphering__Parameters().is_bound()) vGCS__Ciphering__Parameters() = OMIT_VALUE;
else vGCS__Ciphering__Parameters().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__AssignmentCommand__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_descrOf1stChAfterTime.encode_text(text_buf);
single_value->field_PowerCommand.encode_text(text_buf);
single_value->field_frequencyList__at.encode_text(text_buf);
single_value->field_cellChannelDescr.encode_text(text_buf);
single_value->field_descrMultislotAllocation.encode_text(text_buf);
single_value->field_modeOf1stChannel.encode_text(text_buf);
single_value->field_channelSet2.encode_text(text_buf);
single_value->field_channelSet3.encode_text(text_buf);
single_value->field_channelSet4.encode_text(text_buf);
single_value->field_channelSet5.encode_text(text_buf);
single_value->field_channelSet6.encode_text(text_buf);
single_value->field_channelSet7.encode_text(text_buf);
single_value->field_channelSet8.encode_text(text_buf);
single_value->field_descrOf2ndChAfterTime.encode_text(text_buf);
single_value->field_modeOf2ndChannel.encode_text(text_buf);
single_value->field_mobileAllocation__at.encode_text(text_buf);
single_value->field_startingTime.encode_text(text_buf);
single_value->field_frequencyList__bt.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.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_vGCS__Ciphering__Parameters.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_AssignmentCommand_NW_MS.");
}
}

void PDU__RRM__AssignmentCommand__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_descrOf1stChAfterTime.decode_text(text_buf);
single_value->field_PowerCommand.decode_text(text_buf);
single_value->field_frequencyList__at.decode_text(text_buf);
single_value->field_cellChannelDescr.decode_text(text_buf);
single_value->field_descrMultislotAllocation.decode_text(text_buf);
single_value->field_modeOf1stChannel.decode_text(text_buf);
single_value->field_channelSet2.decode_text(text_buf);
single_value->field_channelSet3.decode_text(text_buf);
single_value->field_channelSet4.decode_text(text_buf);
single_value->field_channelSet5.decode_text(text_buf);
single_value->field_channelSet6.decode_text(text_buf);
single_value->field_channelSet7.decode_text(text_buf);
single_value->field_channelSet8.decode_text(text_buf);
single_value->field_descrOf2ndChAfterTime.decode_text(text_buf);
single_value->field_modeOf2ndChannel.decode_text(text_buf);
single_value->field_mobileAllocation__at.decode_text(text_buf);
single_value->field_startingTime.decode_text(text_buf);
single_value->field_frequencyList__bt.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.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_vGCS__Ciphering__Parameters.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__AssignmentCommand__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS.");
}
}

void PDU__RRM__AssignmentCommand__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__RRM__AssignmentCommand__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (29<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS has 29 fields but 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) descrOf1stChAfterTime().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) PowerCommand().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) frequencyList__at().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) descrMultislotAllocation().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) modeOf1stChannel().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) channelSet2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) channelSet3().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) channelSet4().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) channelSet5().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) channelSet6().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) channelSet7().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) channelSet8().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) descrOf2ndChAfterTime().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) modeOf2ndChannel().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation__at().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) startingTime().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) frequencyList__bt().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) descrOf1stCh__bt().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) descrOf2ndCh__bt().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) frequencyChannelSequence().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation__bt().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) cipherModeSetting().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) vGCS__TargetModeIndication().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) vGCS__Ciphering__Parameters().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet__afterTime().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet__beforeTime().set_param(*param.get_elem(28));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "descrOf1stChAfterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf1stChAfterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "PowerCommand")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          PowerCommand().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyList_at")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyList__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(), "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(), "descrMultislotAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrMultislotAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOf1stChannel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOf1stChannel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet6().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelSet8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelSet8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrOf2ndChAfterTime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrOf2ndChAfterTime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "frequencyList_bt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyList__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(), "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")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyChannelSequence().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "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_AssignmentCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__AssignmentCommand__NW__MS_template* precondition = new PDU__RRM__AssignmentCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__AssignmentCommand__NW__MS_template* implied_template = new PDU__RRM__AssignmentCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__AssignmentCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__AssignmentCommand__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_descrOf1stChAfterTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_PowerCommand.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_frequencyList__at.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_cellChannelDescr.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_descrMultislotAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_modeOf1stChannel.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_channelSet2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_channelSet3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_channelSet4.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_channelSet5.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_channelSet6.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_channelSet7.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_channelSet8.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_descrOf2ndChAfterTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_modeOf2ndChannel.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_mobileAllocation__at.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_startingTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_frequencyList__bt.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_descrOf1stCh__bt.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_descrOf2ndCh__bt.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_frequencyChannelSequence.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_mobileAllocation__bt.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_cipherModeSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_vGCS__TargetModeIndication.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_multiRateConfiguration.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_vGCS__Ciphering__Parameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_extendedTSCSet__afterTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
single_value->field_extendedTSCSet__beforeTime.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS");
}

boolean PDU__RRM__AssignmentCommand__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__AssignmentCommand__NW__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__RRM__AssignmentComplete__MS__NW::PDU__RRM__AssignmentComplete__MS__NW()
{
}

PDU__RRM__AssignmentComplete__MS__NW::PDU__RRM__AssignmentComplete__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__AssignmentComplete__MS__NW::PDU__RRM__AssignmentComplete__MS__NW(const PDU__RRM__AssignmentComplete__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_AssignmentComplete_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__AssignmentComplete__MS__NW::clean_up()
{
field_messageType.clean_up();
field_rR__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__AssignmentComplete__MS__NW::get_descriptor() const { return &PDU__RRM__AssignmentComplete__MS__NW_descr_; }
PDU__RRM__AssignmentComplete__MS__NW& PDU__RRM__AssignmentComplete__MS__NW::operator=(const PDU__RRM__AssignmentComplete__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_AssignmentComplete_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__AssignmentComplete__MS__NW::operator==(const PDU__RRM__AssignmentComplete__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rR__Cause==other_value.field_rR__Cause;
}

boolean PDU__RRM__AssignmentComplete__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_rR__Cause.is_bound());
}
boolean PDU__RRM__AssignmentComplete__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_rR__Cause.is_value();
}
void PDU__RRM__AssignmentComplete__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__AssignmentComplete__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__AssignmentComplete__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_AssignmentComplete_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_AssignmentComplete_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_AssignmentComplete_MS_NW");
  }
}

void PDU__RRM__AssignmentComplete__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__AssignmentComplete__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_rR__Cause.decode_text(text_buf);
}

void PDU__RRM__AssignmentComplete__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__AssignmentComplete__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__AssignmentComplete__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__AssignmentComplete__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__AssignmentComplete__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
RR__Cause__V_template field_rR__Cause;
};

void PDU__RRM__AssignmentComplete__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__AssignmentComplete__MS__NW_template::copy_value(const PDU__RRM__AssignmentComplete__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__AssignmentComplete__MS__NW_template::copy_template(const PDU__RRM__AssignmentComplete__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__AssignmentComplete__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__AssignmentComplete__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__AssignmentComplete__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_AssignmentComplete_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__AssignmentComplete__MS__NW_template::PDU__RRM__AssignmentComplete__MS__NW_template()
{
}

PDU__RRM__AssignmentComplete__MS__NW_template::PDU__RRM__AssignmentComplete__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__AssignmentComplete__MS__NW_template::PDU__RRM__AssignmentComplete__MS__NW_template(const PDU__RRM__AssignmentComplete__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__AssignmentComplete__MS__NW_template::PDU__RRM__AssignmentComplete__MS__NW_template(const OPTIONAL<PDU__RRM__AssignmentComplete__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__AssignmentComplete__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_AssignmentComplete_MS_NW from an unbound optional field.");
}
}

PDU__RRM__AssignmentComplete__MS__NW_template::PDU__RRM__AssignmentComplete__MS__NW_template(PDU__RRM__AssignmentComplete__MS__NW_template* p_precondition, PDU__RRM__AssignmentComplete__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__AssignmentComplete__MS__NW_template::PDU__RRM__AssignmentComplete__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__AssignmentComplete__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__AssignmentComplete__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__AssignmentComplete__MS__NW_template::PDU__RRM__AssignmentComplete__MS__NW_template(const PDU__RRM__AssignmentComplete__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__AssignmentComplete__MS__NW_template::~PDU__RRM__AssignmentComplete__MS__NW_template()
{
clean_up();
}

PDU__RRM__AssignmentComplete__MS__NW_template& PDU__RRM__AssignmentComplete__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__AssignmentComplete__MS__NW_template& PDU__RRM__AssignmentComplete__MS__NW_template::operator=(const PDU__RRM__AssignmentComplete__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__AssignmentComplete__MS__NW_template& PDU__RRM__AssignmentComplete__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__AssignmentComplete__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__AssignmentComplete__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_AssignmentComplete_MS_NW.");
}
return *this;
}

PDU__RRM__AssignmentComplete__MS__NW_template& PDU__RRM__AssignmentComplete__MS__NW_template::operator=(const PDU__RRM__AssignmentComplete__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__AssignmentComplete__MS__NW_template::match(const PDU__RRM__AssignmentComplete__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_AssignmentComplete_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__AssignmentComplete__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__AssignmentComplete__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__AssignmentComplete__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__AssignmentComplete__MS__NW PDU__RRM__AssignmentComplete__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_AssignmentComplete_MS_NW.");
PDU__RRM__AssignmentComplete__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__AssignmentComplete__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_AssignmentComplete_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__AssignmentComplete__MS__NW_template[list_length];
}

PDU__RRM__AssignmentComplete__MS__NW_template& PDU__RRM__AssignmentComplete__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_AssignmentComplete_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_AssignmentComplete_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__AssignmentComplete__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__AssignmentComplete__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_AssignmentComplete_MS_NW.");
return single_value->field_messageType;
}

RR__Cause__V_template& PDU__RRM__AssignmentComplete__MS__NW_template::rR__Cause()
{
set_specific();
return single_value->field_rR__Cause;
}

const RR__Cause__V_template& PDU__RRM__AssignmentComplete__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_AssignmentComplete_MS_NW.");
return single_value->field_rR__Cause;
}

int PDU__RRM__AssignmentComplete__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentComplete_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_AssignmentComplete_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_AssignmentComplete_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_AssignmentComplete_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_AssignmentComplete_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentComplete_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentComplete_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_AssignmentComplete_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentComplete_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentComplete_MS_NW.");
  }
  return 0;
}

void PDU__RRM__AssignmentComplete__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__AssignmentComplete__MS__NW_template::log_match(const PDU__RRM__AssignmentComplete__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__AssignmentComplete__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rR__Cause().is_bound()) rR__Cause().set_implicit_omit();
}

void PDU__RRM__AssignmentComplete__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_AssignmentComplete_MS_NW.");
}
}

void PDU__RRM__AssignmentComplete__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__AssignmentComplete__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_AssignmentComplete_MS_NW.");
}
}

void PDU__RRM__AssignmentComplete__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__AssignmentComplete__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_AssignmentComplete_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_AssignmentComplete_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__AssignmentComplete__MS__NW_template* precondition = new PDU__RRM__AssignmentComplete__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__AssignmentComplete__MS__NW_template* implied_template = new PDU__RRM__AssignmentComplete__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__AssignmentComplete__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_AssignmentComplete_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__AssignmentComplete__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_AssignmentComplete_MS_NW");
single_value->field_rR__Cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_AssignmentComplete_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_AssignmentComplete_MS_NW");
}

boolean PDU__RRM__AssignmentComplete__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__AssignmentComplete__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__AssignmentFailure__MS__NW::PDU__RRM__AssignmentFailure__MS__NW()
{
}

PDU__RRM__AssignmentFailure__MS__NW::PDU__RRM__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__AssignmentFailure__MS__NW::PDU__RRM__AssignmentFailure__MS__NW(const PDU__RRM__AssignmentFailure__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_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__AssignmentFailure__MS__NW::clean_up()
{
field_messageType.clean_up();
field_rR__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__AssignmentFailure__MS__NW::get_descriptor() const { return &PDU__RRM__AssignmentFailure__MS__NW_descr_; }
PDU__RRM__AssignmentFailure__MS__NW& PDU__RRM__AssignmentFailure__MS__NW::operator=(const PDU__RRM__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_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__AssignmentFailure__MS__NW::operator==(const PDU__RRM__AssignmentFailure__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rR__Cause==other_value.field_rR__Cause;
}

boolean PDU__RRM__AssignmentFailure__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_rR__Cause.is_bound());
}
boolean PDU__RRM__AssignmentFailure__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_rR__Cause.is_value();
}
void PDU__RRM__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__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__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_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_AssignmentFailure_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_AssignmentFailure_MS_NW");
  }
}

void PDU__RRM__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__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__AssignmentFailure__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__AssignmentFailure__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__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__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__AssignmentFailure__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
RR__Cause__V_template field_rR__Cause;
};

void PDU__RRM__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__AssignmentFailure__MS__NW_template::copy_value(const PDU__RRM__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__AssignmentFailure__MS__NW_template::copy_template(const PDU__RRM__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__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__AssignmentFailure__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__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_AssignmentFailure_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__AssignmentFailure__MS__NW_template::PDU__RRM__AssignmentFailure__MS__NW_template()
{
}

PDU__RRM__AssignmentFailure__MS__NW_template::PDU__RRM__AssignmentFailure__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__AssignmentFailure__MS__NW_template::PDU__RRM__AssignmentFailure__MS__NW_template(const PDU__RRM__AssignmentFailure__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__AssignmentFailure__MS__NW_template::PDU__RRM__AssignmentFailure__MS__NW_template(const OPTIONAL<PDU__RRM__AssignmentFailure__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__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_AssignmentFailure_MS_NW from an unbound optional field.");
}
}

PDU__RRM__AssignmentFailure__MS__NW_template::PDU__RRM__AssignmentFailure__MS__NW_template(PDU__RRM__AssignmentFailure__MS__NW_template* p_precondition, PDU__RRM__AssignmentFailure__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__AssignmentFailure__MS__NW_template::PDU__RRM__AssignmentFailure__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__AssignmentFailure__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__AssignmentFailure__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__AssignmentFailure__MS__NW_template::PDU__RRM__AssignmentFailure__MS__NW_template(const PDU__RRM__AssignmentFailure__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__AssignmentFailure__MS__NW_template::~PDU__RRM__AssignmentFailure__MS__NW_template()
{
clean_up();
}

PDU__RRM__AssignmentFailure__MS__NW_template& PDU__RRM__AssignmentFailure__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__AssignmentFailure__MS__NW_template& PDU__RRM__AssignmentFailure__MS__NW_template::operator=(const PDU__RRM__AssignmentFailure__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__AssignmentFailure__MS__NW_template& PDU__RRM__AssignmentFailure__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__AssignmentFailure__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__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_AssignmentFailure_MS_NW.");
}
return *this;
}

PDU__RRM__AssignmentFailure__MS__NW_template& PDU__RRM__AssignmentFailure__MS__NW_template::operator=(const PDU__RRM__AssignmentFailure__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__AssignmentFailure__MS__NW_template::match(const PDU__RRM__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_AssignmentFailure_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__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__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__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__AssignmentFailure__MS__NW PDU__RRM__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_AssignmentFailure_MS_NW.");
PDU__RRM__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__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_AssignmentFailure_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__AssignmentFailure__MS__NW_template[list_length];
}

PDU__RRM__AssignmentFailure__MS__NW_template& PDU__RRM__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_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_AssignmentFailure_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__AssignmentFailure__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__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_AssignmentFailure_MS_NW.");
return single_value->field_messageType;
}

RR__Cause__V_template& PDU__RRM__AssignmentFailure__MS__NW_template::rR__Cause()
{
set_specific();
return single_value->field_rR__Cause;
}

const RR__Cause__V_template& PDU__RRM__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_AssignmentFailure_MS_NW.");
return single_value->field_rR__Cause;
}

int PDU__RRM__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_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_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_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_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_AssignmentFailure_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_AssignmentFailure_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_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_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_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_AssignmentFailure_MS_NW.");
  }
  return 0;
}

void PDU__RRM__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__AssignmentFailure__MS__NW_template::log_match(const PDU__RRM__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__AssignmentFailure__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rR__Cause().is_bound()) rR__Cause().set_implicit_omit();
}

void PDU__RRM__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_AssignmentFailure_MS_NW.");
}
}

void PDU__RRM__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__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_AssignmentFailure_MS_NW.");
}
}

void PDU__RRM__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__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_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_AssignmentFailure_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__AssignmentFailure__MS__NW_template* precondition = new PDU__RRM__AssignmentFailure__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__AssignmentFailure__MS__NW_template* implied_template = new PDU__RRM__AssignmentFailure__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__AssignmentFailure__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_AssignmentFailure_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__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_AssignmentFailure_MS_NW");
single_value->field_rR__Cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_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_AssignmentFailure_MS_NW");
}

boolean PDU__RRM__AssignmentFailure__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__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__ChannelModeModify__NW__MS::PDU__RRM__ChannelModeModify__NW__MS()
{
}

PDU__RRM__ChannelModeModify__NW__MS::PDU__RRM__ChannelModeModify__NW__MS(const BITSTRING& par_messageType,
    const ChannelDescription2__V& par_channelDescription,
    const ChannelMode__V& par_channelMode,
    const OPTIONAL< VGCS__TargetModeIndication__TLV >& par_vGCS__TargetModeIndication,
    const OPTIONAL< MultiRateConfiguration__TLV >& par_multiRateConfiguration,
    const OPTIONAL< VGCS__Ciphering__Parameters__TLV >& par_vGCS__Ciphering__Parameters,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet)
  :   field_messageType(par_messageType),
  field_channelDescription(par_channelDescription),
  field_channelMode(par_channelMode),
  field_vGCS__TargetModeIndication(par_vGCS__TargetModeIndication),
  field_multiRateConfiguration(par_multiRateConfiguration),
  field_vGCS__Ciphering__Parameters(par_vGCS__Ciphering__Parameters),
  field_extendedTSCSet(par_extendedTSCSet)
{
}

PDU__RRM__ChannelModeModify__NW__MS::PDU__RRM__ChannelModeModify__NW__MS(const PDU__RRM__ChannelModeModify__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_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.channelMode().is_bound()) field_channelMode = other_value.channelMode();
else field_channelMode.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.vGCS__Ciphering__Parameters().is_bound()) field_vGCS__Ciphering__Parameters = other_value.vGCS__Ciphering__Parameters();
else field_vGCS__Ciphering__Parameters.clean_up();
if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
else field_extendedTSCSet.clean_up();
}

void PDU__RRM__ChannelModeModify__NW__MS::clean_up()
{
field_messageType.clean_up();
field_channelDescription.clean_up();
field_channelMode.clean_up();
field_vGCS__TargetModeIndication.clean_up();
field_multiRateConfiguration.clean_up();
field_vGCS__Ciphering__Parameters.clean_up();
field_extendedTSCSet.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ChannelModeModify__NW__MS::get_descriptor() const { return &PDU__RRM__ChannelModeModify__NW__MS_descr_; }
PDU__RRM__ChannelModeModify__NW__MS& PDU__RRM__ChannelModeModify__NW__MS::operator=(const PDU__RRM__ChannelModeModify__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_ChannelModeModify_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.channelMode().is_bound()) field_channelMode = other_value.channelMode();
  else field_channelMode.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.vGCS__Ciphering__Parameters().is_bound()) field_vGCS__Ciphering__Parameters = other_value.vGCS__Ciphering__Parameters();
  else field_vGCS__Ciphering__Parameters.clean_up();
  if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
  else field_extendedTSCSet.clean_up();
}
return *this;
}

boolean PDU__RRM__ChannelModeModify__NW__MS::operator==(const PDU__RRM__ChannelModeModify__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_channelDescription==other_value.field_channelDescription
  && field_channelMode==other_value.field_channelMode
  && field_vGCS__TargetModeIndication==other_value.field_vGCS__TargetModeIndication
  && field_multiRateConfiguration==other_value.field_multiRateConfiguration
  && field_vGCS__Ciphering__Parameters==other_value.field_vGCS__Ciphering__Parameters
  && field_extendedTSCSet==other_value.field_extendedTSCSet;
}

boolean PDU__RRM__ChannelModeModify__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_channelDescription.is_bound())
  || (field_channelMode.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_vGCS__Ciphering__Parameters.get_selection() || field_vGCS__Ciphering__Parameters.is_bound())
  || (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_bound());
}
boolean PDU__RRM__ChannelModeModify__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_channelDescription.is_value()
  && field_channelMode.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_vGCS__Ciphering__Parameters.get_selection() || field_vGCS__Ciphering__Parameters.is_value())
  && (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_value());
}
int PDU__RRM__ChannelModeModify__NW__MS::size_of() const
{
  int ret_val = 3;
  if (field_vGCS__TargetModeIndication.ispresent()) ret_val++;
  if (field_multiRateConfiguration.ispresent()) ret_val++;
  if (field_vGCS__Ciphering__Parameters.ispresent()) ret_val++;
  if (field_extendedTSCSet.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__ChannelModeModify__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(", channelMode := ");
field_channelMode.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(", vGCS_Ciphering_Parameters := ");
field_vGCS__Ciphering__Parameters.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
field_extendedTSCSet.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ChannelModeModify__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (channelDescription().is_bound()) channelDescription().set_implicit_omit();
if (channelMode().is_bound()) channelMode().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 (!vGCS__Ciphering__Parameters().is_bound()) vGCS__Ciphering__Parameters() = OMIT_VALUE;
else vGCS__Ciphering__Parameters().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__ChannelModeModify__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_ChannelModeModify_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) channelDescription().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelMode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) vGCS__TargetModeIndication().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) vGCS__Ciphering__Parameters().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().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(), "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(), "channelMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "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(), "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_ChannelModeModify_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS");
  }
}

void PDU__RRM__ChannelModeModify__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_channelDescription.encode_text(text_buf);
field_channelMode.encode_text(text_buf);
field_vGCS__TargetModeIndication.encode_text(text_buf);
field_multiRateConfiguration.encode_text(text_buf);
field_vGCS__Ciphering__Parameters.encode_text(text_buf);
field_extendedTSCSet.encode_text(text_buf);
}

void PDU__RRM__ChannelModeModify__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_channelDescription.decode_text(text_buf);
field_channelMode.decode_text(text_buf);
field_vGCS__TargetModeIndication.decode_text(text_buf);
field_multiRateConfiguration.decode_text(text_buf);
field_vGCS__Ciphering__Parameters.decode_text(text_buf);
field_extendedTSCSet.decode_text(text_buf);
}

void PDU__RRM__ChannelModeModify__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__ChannelModeModify__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__ChannelModeModify__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, ChannelDescription2__V_descr_.raw->forceomit);
  decoded_field_length = field_channelDescription.RAW_decode(ChannelDescription2__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, ChannelMode__V_descr_.raw->forceomit);
  decoded_field_length = field_channelMode.RAW_decode(ChannelMode__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_vGCS__TargetModeIndication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, 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_3_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)(4)) {
    field_multiRateConfiguration = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, 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_4_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)(5)) {
    field_vGCS__Ciphering__Parameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, 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_5_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)(6)) {
    field_extendedTSCSet = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, 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_6_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__ChannelModeModify__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, ChannelDescription2__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ChannelMode__V_descr_.raw);
  if (field_vGCS__TargetModeIndication.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, VGCS__TargetModeIndication__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_multiRateConfiguration.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MultiRateConfiguration__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_vGCS__Ciphering__Parameters.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, VGCS__Ciphering__Parameters__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_extendedTSCSet.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ExtendedTSCSet__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_channelDescription.RAW_encode(ChannelDescription2__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_channelMode.RAW_encode(ChannelMode__V_descr_, *myleaf.body.node.nodes[2]);
  if (field_vGCS__TargetModeIndication.ispresent()) {
  encoded_length += field_vGCS__TargetModeIndication().RAW_encode(VGCS__TargetModeIndication__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_multiRateConfiguration.ispresent()) {
  encoded_length += field_multiRateConfiguration().RAW_encode(MultiRateConfiguration__TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_vGCS__Ciphering__Parameters.ispresent()) {
  encoded_length += field_vGCS__Ciphering__Parameters().RAW_encode(VGCS__Ciphering__Parameters__TLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_extendedTSCSet.ispresent()) {
  encoded_length += field_extendedTSCSet().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[6]);
  }
  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[]={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_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[]={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_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[]={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_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[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ChannelModeModify__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
ChannelDescription2__V_template field_channelDescription;
ChannelMode__V_template field_channelMode;
VGCS__TargetModeIndication__TLV_template field_vGCS__TargetModeIndication;
MultiRateConfiguration__TLV_template field_multiRateConfiguration;
VGCS__Ciphering__Parameters__TLV_template field_vGCS__Ciphering__Parameters;
ExtendedTSCSet__TV_template field_extendedTSCSet;
};

void PDU__RRM__ChannelModeModify__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_channelMode = ANY_VALUE;
single_value->field_vGCS__TargetModeIndication = ANY_OR_OMIT;
single_value->field_multiRateConfiguration = ANY_OR_OMIT;
single_value->field_vGCS__Ciphering__Parameters = ANY_OR_OMIT;
single_value->field_extendedTSCSet = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ChannelModeModify__NW__MS_template::copy_value(const PDU__RRM__ChannelModeModify__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.channelMode().is_bound()) {
  single_value->field_channelMode = other_value.channelMode();
} else {
  single_value->field_channelMode.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.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.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__ChannelModeModify__NW__MS_template::copy_template(const PDU__RRM__ChannelModeModify__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.channelMode().get_selection()) {
single_value->field_channelMode = other_value.channelMode();
} else {
single_value->field_channelMode.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.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.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__ChannelModeModify__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__ChannelModeModify__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ChannelModeModify__NW__MS_template::PDU__RRM__ChannelModeModify__NW__MS_template()
{
}

PDU__RRM__ChannelModeModify__NW__MS_template::PDU__RRM__ChannelModeModify__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__ChannelModeModify__NW__MS_template::PDU__RRM__ChannelModeModify__NW__MS_template(const PDU__RRM__ChannelModeModify__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__ChannelModeModify__NW__MS_template::PDU__RRM__ChannelModeModify__NW__MS_template(const OPTIONAL<PDU__RRM__ChannelModeModify__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS from an unbound optional field.");
}
}

PDU__RRM__ChannelModeModify__NW__MS_template::PDU__RRM__ChannelModeModify__NW__MS_template(PDU__RRM__ChannelModeModify__NW__MS_template* p_precondition, PDU__RRM__ChannelModeModify__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__ChannelModeModify__NW__MS_template::PDU__RRM__ChannelModeModify__NW__MS_template(Dynamic_Match_Interface<PDU__RRM__ChannelModeModify__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__ChannelModeModify__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__ChannelModeModify__NW__MS_template::PDU__RRM__ChannelModeModify__NW__MS_template(const PDU__RRM__ChannelModeModify__NW__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__ChannelModeModify__NW__MS_template::~PDU__RRM__ChannelModeModify__NW__MS_template()
{
clean_up();
}

PDU__RRM__ChannelModeModify__NW__MS_template& PDU__RRM__ChannelModeModify__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__ChannelModeModify__NW__MS_template& PDU__RRM__ChannelModeModify__NW__MS_template::operator=(const PDU__RRM__ChannelModeModify__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__ChannelModeModify__NW__MS_template& PDU__RRM__ChannelModeModify__NW__MS_template::operator=(const OPTIONAL<PDU__RRM__ChannelModeModify__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS.");
}
return *this;
}

PDU__RRM__ChannelModeModify__NW__MS_template& PDU__RRM__ChannelModeModify__NW__MS_template::operator=(const PDU__RRM__ChannelModeModify__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__ChannelModeModify__NW__MS_template::match(const PDU__RRM__ChannelModeModify__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.channelMode().is_bound()) return FALSE;
if(!single_value->field_channelMode.match(other_value.channelMode(), 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.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.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_ChannelModeModify_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ChannelModeModify__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_channelMode.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_vGCS__Ciphering__Parameters.is_omit() || single_value->field_vGCS__Ciphering__Parameters.is_bound())
 || (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_bound());
}

boolean PDU__RRM__ChannelModeModify__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_channelMode.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_vGCS__Ciphering__Parameters.is_omit() || single_value->field_vGCS__Ciphering__Parameters.is_value())
 && (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_value());
}

void PDU__RRM__ChannelModeModify__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__ChannelModeModify__NW__MS PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS.");
PDU__RRM__ChannelModeModify__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_channelMode.is_bound()) {
ret_val.channelMode() = single_value->field_channelMode.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_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_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__ChannelModeModify__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_ChannelModeModify_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ChannelModeModify__NW__MS_template[list_length];
}

PDU__RRM__ChannelModeModify__NW__MS_template& PDU__RRM__ChannelModeModify__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_ChannelModeModify_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_ChannelModeModify_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__ChannelModeModify__NW__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS.");
return single_value->field_messageType;
}

ChannelDescription2__V_template& PDU__RRM__ChannelModeModify__NW__MS_template::channelDescription()
{
set_specific();
return single_value->field_channelDescription;
}

const ChannelDescription2__V_template& PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS.");
return single_value->field_channelDescription;
}

ChannelMode__V_template& PDU__RRM__ChannelModeModify__NW__MS_template::channelMode()
{
set_specific();
return single_value->field_channelMode;
}

const ChannelMode__V_template& PDU__RRM__ChannelModeModify__NW__MS_template::channelMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelMode of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS.");
return single_value->field_channelMode;
}

VGCS__TargetModeIndication__TLV_template& PDU__RRM__ChannelModeModify__NW__MS_template::vGCS__TargetModeIndication()
{
set_specific();
return single_value->field_vGCS__TargetModeIndication;
}

const VGCS__TargetModeIndication__TLV_template& PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS.");
return single_value->field_vGCS__TargetModeIndication;
}

MultiRateConfiguration__TLV_template& PDU__RRM__ChannelModeModify__NW__MS_template::multiRateConfiguration()
{
set_specific();
return single_value->field_multiRateConfiguration;
}

const MultiRateConfiguration__TLV_template& PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS.");
return single_value->field_multiRateConfiguration;
}

VGCS__Ciphering__Parameters__TLV_template& PDU__RRM__ChannelModeModify__NW__MS_template::vGCS__Ciphering__Parameters()
{
set_specific();
return single_value->field_vGCS__Ciphering__Parameters;
}

const VGCS__Ciphering__Parameters__TLV_template& PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS.");
return single_value->field_vGCS__Ciphering__Parameters;
}

ExtendedTSCSet__TV_template& PDU__RRM__ChannelModeModify__NW__MS_template::extendedTSCSet()
{
set_specific();
return single_value->field_extendedTSCSet;
}

const ExtendedTSCSet__TV_template& PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS.");
return single_value->field_extendedTSCSet;
}

int PDU__RRM__ChannelModeModify__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_vGCS__TargetModeIndication.is_present()) ret_val++;
      if (single_value->field_multiRateConfiguration.is_present()) ret_val++;
      if (single_value->field_vGCS__Ciphering__Parameters.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_ChannelModeModify_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_ChannelModeModify_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_ChannelModeModify_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_ChannelModeModify_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_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_ChannelModeModify_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS.");
  }
  return 0;
}

void PDU__RRM__ChannelModeModify__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(", channelMode := ");
single_value->field_channelMode.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(", vGCS_Ciphering_Parameters := ");
single_value->field_vGCS__Ciphering__Parameters.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__ChannelModeModify__NW__MS_template::log_match(const PDU__RRM__ChannelModeModify__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_channelMode.match(match_value.channelMode(), legacy)){
TTCN_Logger::log_logmatch_info(".channelMode");
single_value->field_channelMode.log_match(match_value.channelMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
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.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.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(", channelMode := ");
single_value->field_channelMode.log_match(match_value.channelMode(), legacy);
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(", 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(", 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__ChannelModeModify__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (channelDescription().is_bound()) channelDescription().set_implicit_omit();
if (channelMode().is_bound()) channelMode().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 (!vGCS__Ciphering__Parameters().is_bound()) vGCS__Ciphering__Parameters() = OMIT_VALUE;
else vGCS__Ciphering__Parameters().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__ChannelModeModify__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_channelMode.encode_text(text_buf);
single_value->field_vGCS__TargetModeIndication.encode_text(text_buf);
single_value->field_multiRateConfiguration.encode_text(text_buf);
single_value->field_vGCS__Ciphering__Parameters.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_ChannelModeModify_NW_MS.");
}
}

void PDU__RRM__ChannelModeModify__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_channelMode.decode_text(text_buf);
single_value->field_vGCS__TargetModeIndication.decode_text(text_buf);
single_value->field_multiRateConfiguration.decode_text(text_buf);
single_value->field_vGCS__Ciphering__Parameters.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__ChannelModeModify__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_ChannelModeModify_NW_MS.");
}
}

void PDU__RRM__ChannelModeModify__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__ChannelModeModify__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_ChannelModeModify_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) channelDescription().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelMode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) vGCS__TargetModeIndication().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) vGCS__Ciphering__Parameters().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().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(), "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(), "channelMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "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(), "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_ChannelModeModify_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ChannelModeModify__NW__MS_template* precondition = new PDU__RRM__ChannelModeModify__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ChannelModeModify__NW__MS_template* implied_template = new PDU__RRM__ChannelModeModify__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ChannelModeModify__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ChannelModeModify__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_ChannelModeModify_NW_MS");
single_value->field_channelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS");
single_value->field_channelMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS");
single_value->field_vGCS__TargetModeIndication.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS");
single_value->field_multiRateConfiguration.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS");
single_value->field_vGCS__Ciphering__Parameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_NW_MS");
single_value->field_extendedTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModify_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_ChannelModeModify_NW_MS");
}

boolean PDU__RRM__ChannelModeModify__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__ChannelModeModify__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__ChannelModeModifyAck__MS__NW::PDU__RRM__ChannelModeModifyAck__MS__NW()
{
}

PDU__RRM__ChannelModeModifyAck__MS__NW::PDU__RRM__ChannelModeModifyAck__MS__NW(const BITSTRING& par_messageType,
    const ChannelDescription2__V& par_channelDescription,
    const ChannelMode__V& par_channelMode,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet)
  :   field_messageType(par_messageType),
  field_channelDescription(par_channelDescription),
  field_channelMode(par_channelMode),
  field_extendedTSCSet(par_extendedTSCSet)
{
}

PDU__RRM__ChannelModeModifyAck__MS__NW::PDU__RRM__ChannelModeModifyAck__MS__NW(const PDU__RRM__ChannelModeModifyAck__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW.");
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.channelMode().is_bound()) field_channelMode = other_value.channelMode();
else field_channelMode.clean_up();
if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
else field_extendedTSCSet.clean_up();
}

void PDU__RRM__ChannelModeModifyAck__MS__NW::clean_up()
{
field_messageType.clean_up();
field_channelDescription.clean_up();
field_channelMode.clean_up();
field_extendedTSCSet.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ChannelModeModifyAck__MS__NW::get_descriptor() const { return &PDU__RRM__ChannelModeModifyAck__MS__NW_descr_; }
PDU__RRM__ChannelModeModifyAck__MS__NW& PDU__RRM__ChannelModeModifyAck__MS__NW::operator=(const PDU__RRM__ChannelModeModifyAck__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_ChannelModeModifyAck_MS_NW.");
  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.channelMode().is_bound()) field_channelMode = other_value.channelMode();
  else field_channelMode.clean_up();
  if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
  else field_extendedTSCSet.clean_up();
}
return *this;
}

boolean PDU__RRM__ChannelModeModifyAck__MS__NW::operator==(const PDU__RRM__ChannelModeModifyAck__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_channelDescription==other_value.field_channelDescription
  && field_channelMode==other_value.field_channelMode
  && field_extendedTSCSet==other_value.field_extendedTSCSet;
}

boolean PDU__RRM__ChannelModeModifyAck__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_channelDescription.is_bound())
  || (field_channelMode.is_bound())
  || (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_bound());
}
boolean PDU__RRM__ChannelModeModifyAck__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_channelDescription.is_value()
  && field_channelMode.is_value()
  && (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_value());
}
int PDU__RRM__ChannelModeModifyAck__MS__NW::size_of() const
{
  int ret_val = 3;
  if (field_extendedTSCSet.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__ChannelModeModifyAck__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(", channelDescription := ");
field_channelDescription.log();
TTCN_Logger::log_event_str(", channelMode := ");
field_channelMode.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
field_extendedTSCSet.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ChannelModeModifyAck__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (channelDescription().is_bound()) channelDescription().set_implicit_omit();
if (channelMode().is_bound()) channelMode().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__ChannelModeModifyAck__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_ChannelModeModifyAck_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) channelDescription().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelMode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().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(), "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(), "channelMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_ChannelModeModifyAck_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW");
  }
}

void PDU__RRM__ChannelModeModifyAck__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_channelDescription.encode_text(text_buf);
field_channelMode.encode_text(text_buf);
field_extendedTSCSet.encode_text(text_buf);
}

void PDU__RRM__ChannelModeModifyAck__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_channelDescription.decode_text(text_buf);
field_channelMode.decode_text(text_buf);
field_extendedTSCSet.decode_text(text_buf);
}

void PDU__RRM__ChannelModeModifyAck__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__ChannelModeModifyAck__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__ChannelModeModifyAck__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, ChannelDescription2__V_descr_.raw->forceomit);
  decoded_field_length = field_channelDescription.RAW_decode(ChannelDescription2__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, ChannelMode__V_descr_.raw->forceomit);
  decoded_field_length = field_channelMode.RAW_decode(ChannelMode__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_extendedTSCSet = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, 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_3_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__ChannelModeModifyAck__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, ChannelDescription2__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ChannelMode__V_descr_.raw);
  if (field_extendedTSCSet.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ExtendedTSCSet__TV_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_channelDescription.RAW_encode(ChannelDescription2__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_channelMode.RAW_encode(ChannelMode__V_descr_, *myleaf.body.node.nodes[2]);
  if (field_extendedTSCSet.ispresent()) {
  encoded_length += field_extendedTSCSet().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[3]);
  }
  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[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ChannelModeModifyAck__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
ChannelDescription2__V_template field_channelDescription;
ChannelMode__V_template field_channelMode;
ExtendedTSCSet__TV_template field_extendedTSCSet;
};

void PDU__RRM__ChannelModeModifyAck__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_channelDescription = ANY_VALUE;
single_value->field_channelMode = ANY_VALUE;
single_value->field_extendedTSCSet = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ChannelModeModifyAck__MS__NW_template::copy_value(const PDU__RRM__ChannelModeModifyAck__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.channelDescription().is_bound()) {
  single_value->field_channelDescription = other_value.channelDescription();
} else {
  single_value->field_channelDescription.clean_up();
}
if (other_value.channelMode().is_bound()) {
  single_value->field_channelMode = other_value.channelMode();
} else {
  single_value->field_channelMode.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__ChannelModeModifyAck__MS__NW_template::copy_template(const PDU__RRM__ChannelModeModifyAck__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.channelDescription().get_selection()) {
single_value->field_channelDescription = other_value.channelDescription();
} else {
single_value->field_channelDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelMode().get_selection()) {
single_value->field_channelMode = other_value.channelMode();
} else {
single_value->field_channelMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.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__ChannelModeModifyAck__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__ChannelModeModifyAck__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ChannelModeModifyAck__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_ChannelModeModifyAck_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template::PDU__RRM__ChannelModeModifyAck__MS__NW_template()
{
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template::PDU__RRM__ChannelModeModifyAck__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template::PDU__RRM__ChannelModeModifyAck__MS__NW_template(const PDU__RRM__ChannelModeModifyAck__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template::PDU__RRM__ChannelModeModifyAck__MS__NW_template(const OPTIONAL<PDU__RRM__ChannelModeModifyAck__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ChannelModeModifyAck__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_ChannelModeModifyAck_MS_NW from an unbound optional field.");
}
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template::PDU__RRM__ChannelModeModifyAck__MS__NW_template(PDU__RRM__ChannelModeModifyAck__MS__NW_template* p_precondition, PDU__RRM__ChannelModeModifyAck__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template::PDU__RRM__ChannelModeModifyAck__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__ChannelModeModifyAck__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__ChannelModeModifyAck__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template::PDU__RRM__ChannelModeModifyAck__MS__NW_template(const PDU__RRM__ChannelModeModifyAck__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template::~PDU__RRM__ChannelModeModifyAck__MS__NW_template()
{
clean_up();
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template& PDU__RRM__ChannelModeModifyAck__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template& PDU__RRM__ChannelModeModifyAck__MS__NW_template::operator=(const PDU__RRM__ChannelModeModifyAck__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template& PDU__RRM__ChannelModeModifyAck__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__ChannelModeModifyAck__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ChannelModeModifyAck__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_ChannelModeModifyAck_MS_NW.");
}
return *this;
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template& PDU__RRM__ChannelModeModifyAck__MS__NW_template::operator=(const PDU__RRM__ChannelModeModifyAck__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__ChannelModeModifyAck__MS__NW_template::match(const PDU__RRM__ChannelModeModifyAck__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.channelDescription().is_bound()) return FALSE;
if(!single_value->field_channelDescription.match(other_value.channelDescription(), legacy))return FALSE;
if(!other_value.channelMode().is_bound()) return FALSE;
if(!single_value->field_channelMode.match(other_value.channelMode(), 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_ChannelModeModifyAck_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__ChannelModeModifyAck__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_channelDescription.is_bound()
 || single_value->field_channelMode.is_bound()
 || (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_bound());
}

boolean PDU__RRM__ChannelModeModifyAck__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_channelDescription.is_value()
 && single_value->field_channelMode.is_value()
 && (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_value());
}

void PDU__RRM__ChannelModeModifyAck__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__ChannelModeModifyAck__MS__NW PDU__RRM__ChannelModeModifyAck__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_ChannelModeModifyAck_MS_NW.");
PDU__RRM__ChannelModeModifyAck__MS__NW 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_channelMode.is_bound()) {
ret_val.channelMode() = single_value->field_channelMode.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__ChannelModeModifyAck__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_ChannelModeModifyAck_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ChannelModeModifyAck__MS__NW_template[list_length];
}

PDU__RRM__ChannelModeModifyAck__MS__NW_template& PDU__RRM__ChannelModeModifyAck__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_ChannelModeModifyAck_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_ChannelModeModifyAck_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__ChannelModeModifyAck__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__ChannelModeModifyAck__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_ChannelModeModifyAck_MS_NW.");
return single_value->field_messageType;
}

ChannelDescription2__V_template& PDU__RRM__ChannelModeModifyAck__MS__NW_template::channelDescription()
{
set_specific();
return single_value->field_channelDescription;
}

const ChannelDescription2__V_template& PDU__RRM__ChannelModeModifyAck__MS__NW_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_ChannelModeModifyAck_MS_NW.");
return single_value->field_channelDescription;
}

ChannelMode__V_template& PDU__RRM__ChannelModeModifyAck__MS__NW_template::channelMode()
{
set_specific();
return single_value->field_channelMode;
}

const ChannelMode__V_template& PDU__RRM__ChannelModeModifyAck__MS__NW_template::channelMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelMode of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW.");
return single_value->field_channelMode;
}

ExtendedTSCSet__TV_template& PDU__RRM__ChannelModeModifyAck__MS__NW_template::extendedTSCSet()
{
set_specific();
return single_value->field_extendedTSCSet;
}

const ExtendedTSCSet__TV_template& PDU__RRM__ChannelModeModifyAck__MS__NW_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_ChannelModeModifyAck_MS_NW.");
return single_value->field_extendedTSCSet;
}

int PDU__RRM__ChannelModeModifyAck__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      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_ChannelModeModifyAck_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_ChannelModeModifyAck_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_ChannelModeModifyAck_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_ChannelModeModifyAck_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_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_ChannelModeModifyAck_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW.");
  }
  return 0;
}

void PDU__RRM__ChannelModeModifyAck__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(", channelDescription := ");
single_value->field_channelDescription.log();
TTCN_Logger::log_event_str(", channelMode := ");
single_value->field_channelMode.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__ChannelModeModifyAck__MS__NW_template::log_match(const PDU__RRM__ChannelModeModifyAck__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_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_channelMode.match(match_value.channelMode(), legacy)){
TTCN_Logger::log_logmatch_info(".channelMode");
single_value->field_channelMode.log_match(match_value.channelMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
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(", channelMode := ");
single_value->field_channelMode.log_match(match_value.channelMode(), legacy);
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__ChannelModeModifyAck__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (channelDescription().is_bound()) channelDescription().set_implicit_omit();
if (channelMode().is_bound()) channelMode().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__ChannelModeModifyAck__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_channelDescription.encode_text(text_buf);
single_value->field_channelMode.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_ChannelModeModifyAck_MS_NW.");
}
}

void PDU__RRM__ChannelModeModifyAck__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_channelDescription.decode_text(text_buf);
single_value->field_channelMode.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__ChannelModeModifyAck__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_ChannelModeModifyAck_MS_NW.");
}
}

void PDU__RRM__ChannelModeModifyAck__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__ChannelModeModifyAck__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_ChannelModeModifyAck_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) channelDescription().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) channelMode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().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(), "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(), "channelMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_ChannelModeModifyAck_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ChannelModeModifyAck__MS__NW_template* precondition = new PDU__RRM__ChannelModeModifyAck__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ChannelModeModifyAck__MS__NW_template* implied_template = new PDU__RRM__ChannelModeModifyAck__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ChannelModeModifyAck__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ChannelModeModifyAck__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_ChannelModeModifyAck_MS_NW");
single_value->field_channelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW");
single_value->field_channelMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_MS_NW");
single_value->field_extendedTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelModeModifyAck_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_ChannelModeModifyAck_MS_NW");
}

boolean PDU__RRM__ChannelModeModifyAck__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__ChannelModeModifyAck__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__ChannelRelease__NW__MS::PDU__RRM__ChannelRelease__NW__MS()
{
}

PDU__RRM__ChannelRelease__NW__MS::PDU__RRM__ChannelRelease__NW__MS(const BITSTRING& par_messageType,
    const RR__Cause__V& par_rRCause,
    const OPTIONAL< BARange__TLV >& par_bARange,
    const OPTIONAL< GroupChannelDescription__TLV >& par_groupChannelDescription,
    const OPTIONAL< MobileL3__CommonIE__Types::Type1__TV >& par_groupCipherKeyNumber,
    const OPTIONAL< MobileL3__CommonIE__Types::Type1__TV >& par_gPRSResumption,
    const OPTIONAL< BAListPref__TLV >& par_bAListPref,
    const OPTIONAL< UTRANFrequencyList__TLV >& par_uTRANFrequencyList,
    const OPTIONAL< CellChannelDescription__TV >& par_cellChannelDescr,
    const OPTIONAL< CellSelectionIndicatorAfterReleaseOfAll__TCH__and__SDCCH__IE >& par_cellSelectionIndicator,
    const OPTIONAL< Enhanced__DTM__CS__Release__Indication >& par_enhanced__DTM__CS__Release__Indication,
    const OPTIONAL< VGCS__Ciphering__Parameters__TLV >& par_vGCS__Ciphering__Parameters,
    const OPTIONAL< Group__Channel__Description__2__TLV >& par_group__Channel__Description__2,
    const OPTIONAL< TalkerIdentity__TLV >& par_talkerIdentity,
    const OPTIONAL< TalkerPriorityStatus__TLV >& par_talkerPriorityStatus,
    const OPTIONAL< VGCS__AMR__Configuration__TLV >& par_vGCS__AMR__Configuration,
    const OPTIONAL< Individual__Priorities__TLV >& par_individual__Priorities)
  :   field_messageType(par_messageType),
  field_rRCause(par_rRCause),
  field_bARange(par_bARange),
  field_groupChannelDescription(par_groupChannelDescription),
  field_groupCipherKeyNumber(par_groupCipherKeyNumber),
  field_gPRSResumption(par_gPRSResumption),
  field_bAListPref(par_bAListPref),
  field_uTRANFrequencyList(par_uTRANFrequencyList),
  field_cellChannelDescr(par_cellChannelDescr),
  field_cellSelectionIndicator(par_cellSelectionIndicator),
  field_enhanced__DTM__CS__Release__Indication(par_enhanced__DTM__CS__Release__Indication),
  field_vGCS__Ciphering__Parameters(par_vGCS__Ciphering__Parameters),
  field_group__Channel__Description__2(par_group__Channel__Description__2),
  field_talkerIdentity(par_talkerIdentity),
  field_talkerPriorityStatus(par_talkerPriorityStatus),
  field_vGCS__AMR__Configuration(par_vGCS__AMR__Configuration),
  field_individual__Priorities(par_individual__Priorities)
{
}

PDU__RRM__ChannelRelease__NW__MS::PDU__RRM__ChannelRelease__NW__MS(const PDU__RRM__ChannelRelease__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
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.bARange().is_bound()) field_bARange = other_value.bARange();
else field_bARange.clean_up();
if (other_value.groupChannelDescription().is_bound()) field_groupChannelDescription = other_value.groupChannelDescription();
else field_groupChannelDescription.clean_up();
if (other_value.groupCipherKeyNumber().is_bound()) field_groupCipherKeyNumber = other_value.groupCipherKeyNumber();
else field_groupCipherKeyNumber.clean_up();
if (other_value.gPRSResumption().is_bound()) field_gPRSResumption = other_value.gPRSResumption();
else field_gPRSResumption.clean_up();
if (other_value.bAListPref().is_bound()) field_bAListPref = other_value.bAListPref();
else field_bAListPref.clean_up();
if (other_value.uTRANFrequencyList().is_bound()) field_uTRANFrequencyList = other_value.uTRANFrequencyList();
else field_uTRANFrequencyList.clean_up();
if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
else field_cellChannelDescr.clean_up();
if (other_value.cellSelectionIndicator().is_bound()) field_cellSelectionIndicator = other_value.cellSelectionIndicator();
else field_cellSelectionIndicator.clean_up();
if (other_value.enhanced__DTM__CS__Release__Indication().is_bound()) field_enhanced__DTM__CS__Release__Indication = other_value.enhanced__DTM__CS__Release__Indication();
else field_enhanced__DTM__CS__Release__Indication.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.group__Channel__Description__2().is_bound()) field_group__Channel__Description__2 = other_value.group__Channel__Description__2();
else field_group__Channel__Description__2.clean_up();
if (other_value.talkerIdentity().is_bound()) field_talkerIdentity = other_value.talkerIdentity();
else field_talkerIdentity.clean_up();
if (other_value.talkerPriorityStatus().is_bound()) field_talkerPriorityStatus = other_value.talkerPriorityStatus();
else field_talkerPriorityStatus.clean_up();
if (other_value.vGCS__AMR__Configuration().is_bound()) field_vGCS__AMR__Configuration = other_value.vGCS__AMR__Configuration();
else field_vGCS__AMR__Configuration.clean_up();
if (other_value.individual__Priorities().is_bound()) field_individual__Priorities = other_value.individual__Priorities();
else field_individual__Priorities.clean_up();
}

void PDU__RRM__ChannelRelease__NW__MS::clean_up()
{
field_messageType.clean_up();
field_rRCause.clean_up();
field_bARange.clean_up();
field_groupChannelDescription.clean_up();
field_groupCipherKeyNumber.clean_up();
field_gPRSResumption.clean_up();
field_bAListPref.clean_up();
field_uTRANFrequencyList.clean_up();
field_cellChannelDescr.clean_up();
field_cellSelectionIndicator.clean_up();
field_enhanced__DTM__CS__Release__Indication.clean_up();
field_vGCS__Ciphering__Parameters.clean_up();
field_group__Channel__Description__2.clean_up();
field_talkerIdentity.clean_up();
field_talkerPriorityStatus.clean_up();
field_vGCS__AMR__Configuration.clean_up();
field_individual__Priorities.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ChannelRelease__NW__MS::get_descriptor() const { return &PDU__RRM__ChannelRelease__NW__MS_descr_; }
PDU__RRM__ChannelRelease__NW__MS& PDU__RRM__ChannelRelease__NW__MS::operator=(const PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
  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.bARange().is_bound()) field_bARange = other_value.bARange();
  else field_bARange.clean_up();
  if (other_value.groupChannelDescription().is_bound()) field_groupChannelDescription = other_value.groupChannelDescription();
  else field_groupChannelDescription.clean_up();
  if (other_value.groupCipherKeyNumber().is_bound()) field_groupCipherKeyNumber = other_value.groupCipherKeyNumber();
  else field_groupCipherKeyNumber.clean_up();
  if (other_value.gPRSResumption().is_bound()) field_gPRSResumption = other_value.gPRSResumption();
  else field_gPRSResumption.clean_up();
  if (other_value.bAListPref().is_bound()) field_bAListPref = other_value.bAListPref();
  else field_bAListPref.clean_up();
  if (other_value.uTRANFrequencyList().is_bound()) field_uTRANFrequencyList = other_value.uTRANFrequencyList();
  else field_uTRANFrequencyList.clean_up();
  if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
  else field_cellChannelDescr.clean_up();
  if (other_value.cellSelectionIndicator().is_bound()) field_cellSelectionIndicator = other_value.cellSelectionIndicator();
  else field_cellSelectionIndicator.clean_up();
  if (other_value.enhanced__DTM__CS__Release__Indication().is_bound()) field_enhanced__DTM__CS__Release__Indication = other_value.enhanced__DTM__CS__Release__Indication();
  else field_enhanced__DTM__CS__Release__Indication.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.group__Channel__Description__2().is_bound()) field_group__Channel__Description__2 = other_value.group__Channel__Description__2();
  else field_group__Channel__Description__2.clean_up();
  if (other_value.talkerIdentity().is_bound()) field_talkerIdentity = other_value.talkerIdentity();
  else field_talkerIdentity.clean_up();
  if (other_value.talkerPriorityStatus().is_bound()) field_talkerPriorityStatus = other_value.talkerPriorityStatus();
  else field_talkerPriorityStatus.clean_up();
  if (other_value.vGCS__AMR__Configuration().is_bound()) field_vGCS__AMR__Configuration = other_value.vGCS__AMR__Configuration();
  else field_vGCS__AMR__Configuration.clean_up();
  if (other_value.individual__Priorities().is_bound()) field_individual__Priorities = other_value.individual__Priorities();
  else field_individual__Priorities.clean_up();
}
return *this;
}

boolean PDU__RRM__ChannelRelease__NW__MS::operator==(const PDU__RRM__ChannelRelease__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rRCause==other_value.field_rRCause
  && field_bARange==other_value.field_bARange
  && field_groupChannelDescription==other_value.field_groupChannelDescription
  && field_groupCipherKeyNumber==other_value.field_groupCipherKeyNumber
  && field_gPRSResumption==other_value.field_gPRSResumption
  && field_bAListPref==other_value.field_bAListPref
  && field_uTRANFrequencyList==other_value.field_uTRANFrequencyList
  && field_cellChannelDescr==other_value.field_cellChannelDescr
  && field_cellSelectionIndicator==other_value.field_cellSelectionIndicator
  && field_enhanced__DTM__CS__Release__Indication==other_value.field_enhanced__DTM__CS__Release__Indication
  && field_vGCS__Ciphering__Parameters==other_value.field_vGCS__Ciphering__Parameters
  && field_group__Channel__Description__2==other_value.field_group__Channel__Description__2
  && field_talkerIdentity==other_value.field_talkerIdentity
  && field_talkerPriorityStatus==other_value.field_talkerPriorityStatus
  && field_vGCS__AMR__Configuration==other_value.field_vGCS__AMR__Configuration
  && field_individual__Priorities==other_value.field_individual__Priorities;
}

boolean PDU__RRM__ChannelRelease__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_rRCause.is_bound())
  || (OPTIONAL_OMIT == field_bARange.get_selection() || field_bARange.is_bound())
  || (OPTIONAL_OMIT == field_groupChannelDescription.get_selection() || field_groupChannelDescription.is_bound())
  || (OPTIONAL_OMIT == field_groupCipherKeyNumber.get_selection() || field_groupCipherKeyNumber.is_bound())
  || (OPTIONAL_OMIT == field_gPRSResumption.get_selection() || field_gPRSResumption.is_bound())
  || (OPTIONAL_OMIT == field_bAListPref.get_selection() || field_bAListPref.is_bound())
  || (OPTIONAL_OMIT == field_uTRANFrequencyList.get_selection() || field_uTRANFrequencyList.is_bound())
  || (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_bound())
  || (OPTIONAL_OMIT == field_cellSelectionIndicator.get_selection() || field_cellSelectionIndicator.is_bound())
  || (OPTIONAL_OMIT == field_enhanced__DTM__CS__Release__Indication.get_selection() || field_enhanced__DTM__CS__Release__Indication.is_bound())
  || (OPTIONAL_OMIT == field_vGCS__Ciphering__Parameters.get_selection() || field_vGCS__Ciphering__Parameters.is_bound())
  || (OPTIONAL_OMIT == field_group__Channel__Description__2.get_selection() || field_group__Channel__Description__2.is_bound())
  || (OPTIONAL_OMIT == field_talkerIdentity.get_selection() || field_talkerIdentity.is_bound())
  || (OPTIONAL_OMIT == field_talkerPriorityStatus.get_selection() || field_talkerPriorityStatus.is_bound())
  || (OPTIONAL_OMIT == field_vGCS__AMR__Configuration.get_selection() || field_vGCS__AMR__Configuration.is_bound())
  || (OPTIONAL_OMIT == field_individual__Priorities.get_selection() || field_individual__Priorities.is_bound());
}
boolean PDU__RRM__ChannelRelease__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_rRCause.is_value()
  && (OPTIONAL_OMIT == field_bARange.get_selection() || field_bARange.is_value())
  && (OPTIONAL_OMIT == field_groupChannelDescription.get_selection() || field_groupChannelDescription.is_value())
  && (OPTIONAL_OMIT == field_groupCipherKeyNumber.get_selection() || field_groupCipherKeyNumber.is_value())
  && (OPTIONAL_OMIT == field_gPRSResumption.get_selection() || field_gPRSResumption.is_value())
  && (OPTIONAL_OMIT == field_bAListPref.get_selection() || field_bAListPref.is_value())
  && (OPTIONAL_OMIT == field_uTRANFrequencyList.get_selection() || field_uTRANFrequencyList.is_value())
  && (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_value())
  && (OPTIONAL_OMIT == field_cellSelectionIndicator.get_selection() || field_cellSelectionIndicator.is_value())
  && (OPTIONAL_OMIT == field_enhanced__DTM__CS__Release__Indication.get_selection() || field_enhanced__DTM__CS__Release__Indication.is_value())
  && (OPTIONAL_OMIT == field_vGCS__Ciphering__Parameters.get_selection() || field_vGCS__Ciphering__Parameters.is_value())
  && (OPTIONAL_OMIT == field_group__Channel__Description__2.get_selection() || field_group__Channel__Description__2.is_value())
  && (OPTIONAL_OMIT == field_talkerIdentity.get_selection() || field_talkerIdentity.is_value())
  && (OPTIONAL_OMIT == field_talkerPriorityStatus.get_selection() || field_talkerPriorityStatus.is_value())
  && (OPTIONAL_OMIT == field_vGCS__AMR__Configuration.get_selection() || field_vGCS__AMR__Configuration.is_value())
  && (OPTIONAL_OMIT == field_individual__Priorities.get_selection() || field_individual__Priorities.is_value());
}
int PDU__RRM__ChannelRelease__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_bARange.ispresent()) ret_val++;
  if (field_groupChannelDescription.ispresent()) ret_val++;
  if (field_groupCipherKeyNumber.ispresent()) ret_val++;
  if (field_gPRSResumption.ispresent()) ret_val++;
  if (field_bAListPref.ispresent()) ret_val++;
  if (field_uTRANFrequencyList.ispresent()) ret_val++;
  if (field_cellChannelDescr.ispresent()) ret_val++;
  if (field_cellSelectionIndicator.ispresent()) ret_val++;
  if (field_enhanced__DTM__CS__Release__Indication.ispresent()) ret_val++;
  if (field_vGCS__Ciphering__Parameters.ispresent()) ret_val++;
  if (field_group__Channel__Description__2.ispresent()) ret_val++;
  if (field_talkerIdentity.ispresent()) ret_val++;
  if (field_talkerPriorityStatus.ispresent()) ret_val++;
  if (field_vGCS__AMR__Configuration.ispresent()) ret_val++;
  if (field_individual__Priorities.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__ChannelRelease__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(", rRCause := ");
field_rRCause.log();
TTCN_Logger::log_event_str(", bARange := ");
field_bARange.log();
TTCN_Logger::log_event_str(", groupChannelDescription := ");
field_groupChannelDescription.log();
TTCN_Logger::log_event_str(", groupCipherKeyNumber := ");
field_groupCipherKeyNumber.log();
TTCN_Logger::log_event_str(", gPRSResumption := ");
field_gPRSResumption.log();
TTCN_Logger::log_event_str(", bAListPref := ");
field_bAListPref.log();
TTCN_Logger::log_event_str(", uTRANFrequencyList := ");
field_uTRANFrequencyList.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", cellSelectionIndicator := ");
field_cellSelectionIndicator.log();
TTCN_Logger::log_event_str(", enhanced_DTM_CS_Release_Indication := ");
field_enhanced__DTM__CS__Release__Indication.log();
TTCN_Logger::log_event_str(", vGCS_Ciphering_Parameters := ");
field_vGCS__Ciphering__Parameters.log();
TTCN_Logger::log_event_str(", group_Channel_Description_2 := ");
field_group__Channel__Description__2.log();
TTCN_Logger::log_event_str(", talkerIdentity := ");
field_talkerIdentity.log();
TTCN_Logger::log_event_str(", talkerPriorityStatus := ");
field_talkerPriorityStatus.log();
TTCN_Logger::log_event_str(", vGCS_AMR_Configuration := ");
field_vGCS__AMR__Configuration.log();
TTCN_Logger::log_event_str(", individual_Priorities := ");
field_individual__Priorities.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ChannelRelease__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rRCause().is_bound()) rRCause().set_implicit_omit();
if (!bARange().is_bound()) bARange() = OMIT_VALUE;
else bARange().set_implicit_omit();
if (!groupChannelDescription().is_bound()) groupChannelDescription() = OMIT_VALUE;
else groupChannelDescription().set_implicit_omit();
if (!groupCipherKeyNumber().is_bound()) groupCipherKeyNumber() = OMIT_VALUE;
else groupCipherKeyNumber().set_implicit_omit();
if (!gPRSResumption().is_bound()) gPRSResumption() = OMIT_VALUE;
else gPRSResumption().set_implicit_omit();
if (!bAListPref().is_bound()) bAListPref() = OMIT_VALUE;
else bAListPref().set_implicit_omit();
if (!uTRANFrequencyList().is_bound()) uTRANFrequencyList() = OMIT_VALUE;
else uTRANFrequencyList().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!cellSelectionIndicator().is_bound()) cellSelectionIndicator() = OMIT_VALUE;
else cellSelectionIndicator().set_implicit_omit();
if (!enhanced__DTM__CS__Release__Indication().is_bound()) enhanced__DTM__CS__Release__Indication() = OMIT_VALUE;
else enhanced__DTM__CS__Release__Indication().set_implicit_omit();
if (!vGCS__Ciphering__Parameters().is_bound()) vGCS__Ciphering__Parameters() = OMIT_VALUE;
else vGCS__Ciphering__Parameters().set_implicit_omit();
if (!group__Channel__Description__2().is_bound()) group__Channel__Description__2() = OMIT_VALUE;
else group__Channel__Description__2().set_implicit_omit();
if (!talkerIdentity().is_bound()) talkerIdentity() = OMIT_VALUE;
else talkerIdentity().set_implicit_omit();
if (!talkerPriorityStatus().is_bound()) talkerPriorityStatus() = OMIT_VALUE;
else talkerPriorityStatus().set_implicit_omit();
if (!vGCS__AMR__Configuration().is_bound()) vGCS__AMR__Configuration() = OMIT_VALUE;
else vGCS__AMR__Configuration().set_implicit_omit();
if (!individual__Priorities().is_bound()) individual__Priorities() = OMIT_VALUE;
else individual__Priorities().set_implicit_omit();
}

void PDU__RRM__ChannelRelease__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (17<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS has 17 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rRCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bARange().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) groupChannelDescription().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) groupCipherKeyNumber().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) gPRSResumption().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) bAListPref().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) uTRANFrequencyList().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescr().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) cellSelectionIndicator().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) enhanced__DTM__CS__Release__Indication().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) vGCS__Ciphering__Parameters().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) group__Channel__Description__2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) talkerIdentity().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) talkerPriorityStatus().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) vGCS__AMR__Configuration().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) individual__Priorities().set_param(*param.get_elem(16));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bARange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bARange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "groupChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          groupChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "groupCipherKeyNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          groupCipherKeyNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gPRSResumption")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPRSResumption().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bAListPref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bAListPref().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uTRANFrequencyList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRANFrequencyList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "cellSelectionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellSelectionIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "enhanced_DTM_CS_Release_Indication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          enhanced__DTM__CS__Release__Indication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "group_Channel_Description_2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          group__Channel__Description__2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "vGCS_AMR_Configuration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vGCS__AMR__Configuration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "individual_Priorities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          individual__Priorities().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_ChannelRelease_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
  }
}

void PDU__RRM__ChannelRelease__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_rRCause.encode_text(text_buf);
field_bARange.encode_text(text_buf);
field_groupChannelDescription.encode_text(text_buf);
field_groupCipherKeyNumber.encode_text(text_buf);
field_gPRSResumption.encode_text(text_buf);
field_bAListPref.encode_text(text_buf);
field_uTRANFrequencyList.encode_text(text_buf);
field_cellChannelDescr.encode_text(text_buf);
field_cellSelectionIndicator.encode_text(text_buf);
field_enhanced__DTM__CS__Release__Indication.encode_text(text_buf);
field_vGCS__Ciphering__Parameters.encode_text(text_buf);
field_group__Channel__Description__2.encode_text(text_buf);
field_talkerIdentity.encode_text(text_buf);
field_talkerPriorityStatus.encode_text(text_buf);
field_vGCS__AMR__Configuration.encode_text(text_buf);
field_individual__Priorities.encode_text(text_buf);
}

void PDU__RRM__ChannelRelease__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_rRCause.decode_text(text_buf);
field_bARange.decode_text(text_buf);
field_groupChannelDescription.decode_text(text_buf);
field_groupCipherKeyNumber.decode_text(text_buf);
field_gPRSResumption.decode_text(text_buf);
field_bAListPref.decode_text(text_buf);
field_uTRANFrequencyList.decode_text(text_buf);
field_cellChannelDescr.decode_text(text_buf);
field_cellSelectionIndicator.decode_text(text_buf);
field_enhanced__DTM__CS__Release__Indication.decode_text(text_buf);
field_vGCS__Ciphering__Parameters.decode_text(text_buf);
field_group__Channel__Description__2.decode_text(text_buf);
field_talkerIdentity.decode_text(text_buf);
field_talkerPriorityStatus.decode_text(text_buf);
field_vGCS__AMR__Configuration.decode_text(text_buf);
field_individual__Priorities.decode_text(text_buf);
}

void PDU__RRM__ChannelRelease__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__ChannelRelease__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__ChannelRelease__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, 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_bARange = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, BARange__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bARange().RAW_decode(BARange__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_bARange = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bARange.ispresent() || field_bARange().elementIdentifier() !=  os_25){
  field_bARange=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_bARange=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_groupChannelDescription = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, GroupChannelDescription__TLV_descr_.raw->forceomit);
  decoded_field_length = field_groupChannelDescription().RAW_decode(GroupChannelDescription__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_groupChannelDescription = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_groupChannelDescription.ispresent() || field_groupChannelDescription().elementIdentifier() !=  os_26){
  field_groupChannelDescription=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_groupChannelDescription=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_groupCipherKeyNumber = 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::Type1__TV_descr_.raw->forceomit);
  decoded_field_length = field_groupCipherKeyNumber().RAW_decode(MobileL3__CommonIE__Types::Type1__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_groupCipherKeyNumber = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_groupCipherKeyNumber.ispresent() || field_groupCipherKeyNumber().elementIdentifier() !=  bs_2){
  field_groupCipherKeyNumber=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_groupCipherKeyNumber=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_gPRSResumption = 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::Type1__TV_descr_.raw->forceomit);
  decoded_field_length = field_gPRSResumption().RAW_decode(MobileL3__CommonIE__Types::Type1__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_gPRSResumption = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_gPRSResumption.ispresent() || field_gPRSResumption().elementIdentifier() !=  bs_3){
  field_gPRSResumption=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_gPRSResumption=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_bAListPref = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, BAListPref__TLV_descr_.raw->forceomit);
  decoded_field_length = field_bAListPref().RAW_decode(BAListPref__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_bAListPref = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_bAListPref.ispresent() || field_bAListPref().elementIdentifier() !=  os_27){
  field_bAListPref=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_bAListPref=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_uTRANFrequencyList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, UTRANFrequencyList__TLV_descr_.raw->forceomit);
  decoded_field_length = field_uTRANFrequencyList().RAW_decode(UTRANFrequencyList__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_uTRANFrequencyList = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_uTRANFrequencyList.ispresent() || field_uTRANFrequencyList().elementIdentifier() !=  os_28){
  field_uTRANFrequencyList=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_uTRANFrequencyList=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_cellChannelDescr = 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_cellChannelDescr().RAW_decode(CellChannelDescription__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_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)(9)) {
    field_cellSelectionIndicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, CellSelectionIndicatorAfterReleaseOfAll__TCH__and__SDCCH__IE_descr_.raw->forceomit);
  decoded_field_length = field_cellSelectionIndicator().RAW_decode(CellSelectionIndicatorAfterReleaseOfAll__TCH__and__SDCCH__IE_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_cellSelectionIndicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cellSelectionIndicator.ispresent() || field_cellSelectionIndicator().elementIdentifier() !=  os_29){
  field_cellSelectionIndicator=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cellSelectionIndicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_enhanced__DTM__CS__Release__Indication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, Enhanced__DTM__CS__Release__Indication_descr_.raw->forceomit);
  decoded_field_length = field_enhanced__DTM__CS__Release__Indication().RAW_decode(Enhanced__DTM__CS__Release__Indication_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_enhanced__DTM__CS__Release__Indication = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_enhanced__DTM__CS__Release__Indication.ispresent() || field_enhanced__DTM__CS__Release__Indication().elementIdentifier() !=  bs_4){
  field_enhanced__DTM__CS__Release__Indication=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_enhanced__DTM__CS__Release__Indication=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_vGCS__Ciphering__Parameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, 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_11_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)(12)) {
    field_group__Channel__Description__2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, Group__Channel__Description__2__TLV_descr_.raw->forceomit);
  decoded_field_length = field_group__Channel__Description__2().RAW_decode(Group__Channel__Description__2__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_group__Channel__Description__2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_group__Channel__Description__2.ispresent() || field_group__Channel__Description__2().elementIdentifier() !=  os_30){
  field_group__Channel__Description__2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_group__Channel__Description__2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_talkerIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, 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_13_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_31){
  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)(14)) {
    field_talkerPriorityStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, 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_14_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_32){
  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)(15)) {
    field_vGCS__AMR__Configuration = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, VGCS__AMR__Configuration__TLV_descr_.raw->forceomit);
  decoded_field_length = field_vGCS__AMR__Configuration().RAW_decode(VGCS__AMR__Configuration__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_vGCS__AMR__Configuration = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_vGCS__AMR__Configuration.ispresent() || field_vGCS__AMR__Configuration().elementIdentifier() !=  os_33){
  field_vGCS__AMR__Configuration=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  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__AMR__Configuration=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_individual__Priorities = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, Individual__Priorities__TLV_descr_.raw->forceomit);
  decoded_field_length = field_individual__Priorities().RAW_decode(Individual__Priorities__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_individual__Priorities = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_individual__Priorities.ispresent() || field_individual__Priorities().elementIdentifier() !=  os_1){
  field_individual__Priorities=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_individual__Priorities=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__ChannelRelease__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 17;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(17);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RR__Cause__V_descr_.raw);
  if (field_bARange.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, BARange__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_groupChannelDescription.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GroupChannelDescription__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_groupCipherKeyNumber.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::Type1__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_gPRSResumption.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::Type1__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_bAListPref.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, BAListPref__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_uTRANFrequencyList.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, UTRANFrequencyList__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_cellChannelDescr.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_cellSelectionIndicator.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, CellSelectionIndicatorAfterReleaseOfAll__TCH__and__SDCCH__IE_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_enhanced__DTM__CS__Release__Indication.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, Enhanced__DTM__CS__Release__Indication_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_vGCS__Ciphering__Parameters.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, VGCS__Ciphering__Parameters__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_group__Channel__Description__2.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, Group__Channel__Description__2__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_talkerIdentity.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, TalkerIdentity__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_talkerPriorityStatus.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, TalkerPriorityStatus__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_vGCS__AMR__Configuration.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, VGCS__AMR__Configuration__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_individual__Priorities.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, Individual__Priorities__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rRCause.RAW_encode(RR__Cause__V_descr_, *myleaf.body.node.nodes[1]);
  if (field_bARange.ispresent()) {
  encoded_length += field_bARange().RAW_encode(BARange__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_groupChannelDescription.ispresent()) {
  encoded_length += field_groupChannelDescription().RAW_encode(GroupChannelDescription__TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_groupCipherKeyNumber.ispresent()) {
  encoded_length += field_groupCipherKeyNumber().RAW_encode(MobileL3__CommonIE__Types::Type1__TV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_gPRSResumption.ispresent()) {
  encoded_length += field_gPRSResumption().RAW_encode(MobileL3__CommonIE__Types::Type1__TV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_bAListPref.ispresent()) {
  encoded_length += field_bAListPref().RAW_encode(BAListPref__TLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_uTRANFrequencyList.ispresent()) {
  encoded_length += field_uTRANFrequencyList().RAW_encode(UTRANFrequencyList__TLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_cellChannelDescr.ispresent()) {
  encoded_length += field_cellChannelDescr().RAW_encode(CellChannelDescription__TV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_cellSelectionIndicator.ispresent()) {
  encoded_length += field_cellSelectionIndicator().RAW_encode(CellSelectionIndicatorAfterReleaseOfAll__TCH__and__SDCCH__IE_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_enhanced__DTM__CS__Release__Indication.ispresent()) {
  encoded_length += field_enhanced__DTM__CS__Release__Indication().RAW_encode(Enhanced__DTM__CS__Release__Indication_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_vGCS__Ciphering__Parameters.ispresent()) {
  encoded_length += field_vGCS__Ciphering__Parameters().RAW_encode(VGCS__Ciphering__Parameters__TLV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_group__Channel__Description__2.ispresent()) {
  encoded_length += field_group__Channel__Description__2().RAW_encode(Group__Channel__Description__2__TLV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_talkerIdentity.ispresent()) {
  encoded_length += field_talkerIdentity().RAW_encode(TalkerIdentity__TLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_talkerPriorityStatus.ispresent()) {
  encoded_length += field_talkerPriorityStatus().RAW_encode(TalkerPriorityStatus__TLV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_vGCS__AMR__Configuration.ispresent()) {
  encoded_length += field_vGCS__AMR__Configuration().RAW_encode(VGCS__AMR__Configuration__TLV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_individual__Priorities.ispresent()) {
  encoded_length += field_individual__Priorities().RAW_encode(Individual__Priorities__TLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_bARange.ispresent() && (!field_bARange.ispresent() || field_bARange().elementIdentifier() !=  os_25)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_25.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_groupChannelDescription.ispresent() && (!field_groupChannelDescription.ispresent() || field_groupChannelDescription().elementIdentifier() !=  os_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_26.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_groupCipherKeyNumber.ispresent() && (!field_groupCipherKeyNumber.ispresent() || field_groupCipherKeyNumber().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,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_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);
  }
  }
  if (field_gPRSResumption.ispresent() && (!field_gPRSResumption.ispresent() || field_gPRSResumption().elementIdentifier() !=  bs_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,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_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_bAListPref.ispresent() && (!field_bAListPref.ispresent() || field_bAListPref().elementIdentifier() !=  os_27)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_27.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_uTRANFrequencyList.ispresent() && (!field_uTRANFrequencyList.ispresent() || field_uTRANFrequencyList().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[]={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_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_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[]={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_cellSelectionIndicator.ispresent() && (!field_cellSelectionIndicator.ispresent() || field_cellSelectionIndicator().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[]={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_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_enhanced__DTM__CS__Release__Indication.ispresent() && (!field_enhanced__DTM__CS__Release__Indication.ispresent() || field_enhanced__DTM__CS__Release__Indication().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[]={10,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_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_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[]={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_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_group__Channel__Description__2.ispresent() && (!field_group__Channel__Description__2.ispresent() || field_group__Channel__Description__2().elementIdentifier() !=  os_30)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_30.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_talkerIdentity.ispresent() && (!field_talkerIdentity.ispresent() || field_talkerIdentity().elementIdentifier() !=  os_31)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_31.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_talkerPriorityStatus.ispresent() && (!field_talkerPriorityStatus.ispresent() || field_talkerPriorityStatus().elementIdentifier() !=  os_32)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_32.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_vGCS__AMR__Configuration.ispresent() && (!field_vGCS__AMR__Configuration.ispresent() || field_vGCS__AMR__Configuration().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[]={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_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_individual__Priorities.ispresent() && (!field_individual__Priorities.ispresent() || field_individual__Priorities().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[]={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_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__ChannelRelease__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
RR__Cause__V_template field_rRCause;
BARange__TLV_template field_bARange;
GroupChannelDescription__TLV_template field_groupChannelDescription;
MobileL3__CommonIE__Types::Type1__TV_template field_groupCipherKeyNumber;
MobileL3__CommonIE__Types::Type1__TV_template field_gPRSResumption;
BAListPref__TLV_template field_bAListPref;
UTRANFrequencyList__TLV_template field_uTRANFrequencyList;
CellChannelDescription__TV_template field_cellChannelDescr;
CellSelectionIndicatorAfterReleaseOfAll__TCH__and__SDCCH__IE_template field_cellSelectionIndicator;
Enhanced__DTM__CS__Release__Indication_template field_enhanced__DTM__CS__Release__Indication;
VGCS__Ciphering__Parameters__TLV_template field_vGCS__Ciphering__Parameters;
Group__Channel__Description__2__TLV_template field_group__Channel__Description__2;
TalkerIdentity__TLV_template field_talkerIdentity;
TalkerPriorityStatus__TLV_template field_talkerPriorityStatus;
VGCS__AMR__Configuration__TLV_template field_vGCS__AMR__Configuration;
Individual__Priorities__TLV_template field_individual__Priorities;
};

void PDU__RRM__ChannelRelease__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_rRCause = ANY_VALUE;
single_value->field_bARange = ANY_OR_OMIT;
single_value->field_groupChannelDescription = ANY_OR_OMIT;
single_value->field_groupCipherKeyNumber = ANY_OR_OMIT;
single_value->field_gPRSResumption = ANY_OR_OMIT;
single_value->field_bAListPref = ANY_OR_OMIT;
single_value->field_uTRANFrequencyList = ANY_OR_OMIT;
single_value->field_cellChannelDescr = ANY_OR_OMIT;
single_value->field_cellSelectionIndicator = ANY_OR_OMIT;
single_value->field_enhanced__DTM__CS__Release__Indication = ANY_OR_OMIT;
single_value->field_vGCS__Ciphering__Parameters = ANY_OR_OMIT;
single_value->field_group__Channel__Description__2 = ANY_OR_OMIT;
single_value->field_talkerIdentity = ANY_OR_OMIT;
single_value->field_talkerPriorityStatus = ANY_OR_OMIT;
single_value->field_vGCS__AMR__Configuration = ANY_OR_OMIT;
single_value->field_individual__Priorities = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ChannelRelease__NW__MS_template::copy_value(const PDU__RRM__ChannelRelease__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.rRCause().is_bound()) {
  single_value->field_rRCause = other_value.rRCause();
} else {
  single_value->field_rRCause.clean_up();
}
if (other_value.bARange().is_bound()) {
  if (other_value.bARange().ispresent()) single_value->field_bARange = other_value.bARange()();
  else single_value->field_bARange = OMIT_VALUE;
} else {
  single_value->field_bARange.clean_up();
}
if (other_value.groupChannelDescription().is_bound()) {
  if (other_value.groupChannelDescription().ispresent()) single_value->field_groupChannelDescription = other_value.groupChannelDescription()();
  else single_value->field_groupChannelDescription = OMIT_VALUE;
} else {
  single_value->field_groupChannelDescription.clean_up();
}
if (other_value.groupCipherKeyNumber().is_bound()) {
  if (other_value.groupCipherKeyNumber().ispresent()) single_value->field_groupCipherKeyNumber = other_value.groupCipherKeyNumber()();
  else single_value->field_groupCipherKeyNumber = OMIT_VALUE;
} else {
  single_value->field_groupCipherKeyNumber.clean_up();
}
if (other_value.gPRSResumption().is_bound()) {
  if (other_value.gPRSResumption().ispresent()) single_value->field_gPRSResumption = other_value.gPRSResumption()();
  else single_value->field_gPRSResumption = OMIT_VALUE;
} else {
  single_value->field_gPRSResumption.clean_up();
}
if (other_value.bAListPref().is_bound()) {
  if (other_value.bAListPref().ispresent()) single_value->field_bAListPref = other_value.bAListPref()();
  else single_value->field_bAListPref = OMIT_VALUE;
} else {
  single_value->field_bAListPref.clean_up();
}
if (other_value.uTRANFrequencyList().is_bound()) {
  if (other_value.uTRANFrequencyList().ispresent()) single_value->field_uTRANFrequencyList = other_value.uTRANFrequencyList()();
  else single_value->field_uTRANFrequencyList = OMIT_VALUE;
} else {
  single_value->field_uTRANFrequencyList.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.cellSelectionIndicator().is_bound()) {
  if (other_value.cellSelectionIndicator().ispresent()) single_value->field_cellSelectionIndicator = other_value.cellSelectionIndicator()();
  else single_value->field_cellSelectionIndicator = OMIT_VALUE;
} else {
  single_value->field_cellSelectionIndicator.clean_up();
}
if (other_value.enhanced__DTM__CS__Release__Indication().is_bound()) {
  if (other_value.enhanced__DTM__CS__Release__Indication().ispresent()) single_value->field_enhanced__DTM__CS__Release__Indication = other_value.enhanced__DTM__CS__Release__Indication()();
  else single_value->field_enhanced__DTM__CS__Release__Indication = OMIT_VALUE;
} else {
  single_value->field_enhanced__DTM__CS__Release__Indication.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.group__Channel__Description__2().is_bound()) {
  if (other_value.group__Channel__Description__2().ispresent()) single_value->field_group__Channel__Description__2 = other_value.group__Channel__Description__2()();
  else single_value->field_group__Channel__Description__2 = OMIT_VALUE;
} else {
  single_value->field_group__Channel__Description__2.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.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.vGCS__AMR__Configuration().is_bound()) {
  if (other_value.vGCS__AMR__Configuration().ispresent()) single_value->field_vGCS__AMR__Configuration = other_value.vGCS__AMR__Configuration()();
  else single_value->field_vGCS__AMR__Configuration = OMIT_VALUE;
} else {
  single_value->field_vGCS__AMR__Configuration.clean_up();
}
if (other_value.individual__Priorities().is_bound()) {
  if (other_value.individual__Priorities().ispresent()) single_value->field_individual__Priorities = other_value.individual__Priorities()();
  else single_value->field_individual__Priorities = OMIT_VALUE;
} else {
  single_value->field_individual__Priorities.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ChannelRelease__NW__MS_template::copy_template(const PDU__RRM__ChannelRelease__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.rRCause().get_selection()) {
single_value->field_rRCause = other_value.rRCause();
} else {
single_value->field_rRCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bARange().get_selection()) {
single_value->field_bARange = other_value.bARange();
} else {
single_value->field_bARange.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.groupChannelDescription().get_selection()) {
single_value->field_groupChannelDescription = other_value.groupChannelDescription();
} else {
single_value->field_groupChannelDescription.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.groupCipherKeyNumber().get_selection()) {
single_value->field_groupCipherKeyNumber = other_value.groupCipherKeyNumber();
} else {
single_value->field_groupCipherKeyNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gPRSResumption().get_selection()) {
single_value->field_gPRSResumption = other_value.gPRSResumption();
} else {
single_value->field_gPRSResumption.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bAListPref().get_selection()) {
single_value->field_bAListPref = other_value.bAListPref();
} else {
single_value->field_bAListPref.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uTRANFrequencyList().get_selection()) {
single_value->field_uTRANFrequencyList = other_value.uTRANFrequencyList();
} else {
single_value->field_uTRANFrequencyList.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.cellSelectionIndicator().get_selection()) {
single_value->field_cellSelectionIndicator = other_value.cellSelectionIndicator();
} else {
single_value->field_cellSelectionIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.enhanced__DTM__CS__Release__Indication().get_selection()) {
single_value->field_enhanced__DTM__CS__Release__Indication = other_value.enhanced__DTM__CS__Release__Indication();
} else {
single_value->field_enhanced__DTM__CS__Release__Indication.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.group__Channel__Description__2().get_selection()) {
single_value->field_group__Channel__Description__2 = other_value.group__Channel__Description__2();
} else {
single_value->field_group__Channel__Description__2.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.talkerPriorityStatus().get_selection()) {
single_value->field_talkerPriorityStatus = other_value.talkerPriorityStatus();
} else {
single_value->field_talkerPriorityStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vGCS__AMR__Configuration().get_selection()) {
single_value->field_vGCS__AMR__Configuration = other_value.vGCS__AMR__Configuration();
} else {
single_value->field_vGCS__AMR__Configuration.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.individual__Priorities().get_selection()) {
single_value->field_individual__Priorities = other_value.individual__Priorities();
} else {
single_value->field_individual__Priorities.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__ChannelRelease__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__ChannelRelease__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ChannelRelease__NW__MS_template::PDU__RRM__ChannelRelease__NW__MS_template()
{
}

PDU__RRM__ChannelRelease__NW__MS_template::PDU__RRM__ChannelRelease__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__ChannelRelease__NW__MS_template::PDU__RRM__ChannelRelease__NW__MS_template(const PDU__RRM__ChannelRelease__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__ChannelRelease__NW__MS_template::PDU__RRM__ChannelRelease__NW__MS_template(const OPTIONAL<PDU__RRM__ChannelRelease__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS from an unbound optional field.");
}
}

PDU__RRM__ChannelRelease__NW__MS_template::PDU__RRM__ChannelRelease__NW__MS_template(PDU__RRM__ChannelRelease__NW__MS_template* p_precondition, PDU__RRM__ChannelRelease__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__ChannelRelease__NW__MS_template::PDU__RRM__ChannelRelease__NW__MS_template(Dynamic_Match_Interface<PDU__RRM__ChannelRelease__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__ChannelRelease__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__ChannelRelease__NW__MS_template::PDU__RRM__ChannelRelease__NW__MS_template(const PDU__RRM__ChannelRelease__NW__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__ChannelRelease__NW__MS_template::~PDU__RRM__ChannelRelease__NW__MS_template()
{
clean_up();
}

PDU__RRM__ChannelRelease__NW__MS_template& PDU__RRM__ChannelRelease__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__ChannelRelease__NW__MS_template& PDU__RRM__ChannelRelease__NW__MS_template::operator=(const PDU__RRM__ChannelRelease__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__ChannelRelease__NW__MS_template& PDU__RRM__ChannelRelease__NW__MS_template::operator=(const OPTIONAL<PDU__RRM__ChannelRelease__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
}
return *this;
}

PDU__RRM__ChannelRelease__NW__MS_template& PDU__RRM__ChannelRelease__NW__MS_template::operator=(const PDU__RRM__ChannelRelease__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__ChannelRelease__NW__MS_template::match(const PDU__RRM__ChannelRelease__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.rRCause().is_bound()) return FALSE;
if(!single_value->field_rRCause.match(other_value.rRCause(), legacy))return FALSE;
if(!other_value.bARange().is_bound()) return FALSE;
if((other_value.bARange().ispresent() ? !single_value->field_bARange.match((const BARange__TLV&)other_value.bARange(), legacy) : !single_value->field_bARange.match_omit(legacy)))return FALSE;
if(!other_value.groupChannelDescription().is_bound()) return FALSE;
if((other_value.groupChannelDescription().ispresent() ? !single_value->field_groupChannelDescription.match((const GroupChannelDescription__TLV&)other_value.groupChannelDescription(), legacy) : !single_value->field_groupChannelDescription.match_omit(legacy)))return FALSE;
if(!other_value.groupCipherKeyNumber().is_bound()) return FALSE;
if((other_value.groupCipherKeyNumber().ispresent() ? !single_value->field_groupCipherKeyNumber.match((const MobileL3__CommonIE__Types::Type1__TV&)other_value.groupCipherKeyNumber(), legacy) : !single_value->field_groupCipherKeyNumber.match_omit(legacy)))return FALSE;
if(!other_value.gPRSResumption().is_bound()) return FALSE;
if((other_value.gPRSResumption().ispresent() ? !single_value->field_gPRSResumption.match((const MobileL3__CommonIE__Types::Type1__TV&)other_value.gPRSResumption(), legacy) : !single_value->field_gPRSResumption.match_omit(legacy)))return FALSE;
if(!other_value.bAListPref().is_bound()) return FALSE;
if((other_value.bAListPref().ispresent() ? !single_value->field_bAListPref.match((const BAListPref__TLV&)other_value.bAListPref(), legacy) : !single_value->field_bAListPref.match_omit(legacy)))return FALSE;
if(!other_value.uTRANFrequencyList().is_bound()) return FALSE;
if((other_value.uTRANFrequencyList().ispresent() ? !single_value->field_uTRANFrequencyList.match((const UTRANFrequencyList__TLV&)other_value.uTRANFrequencyList(), legacy) : !single_value->field_uTRANFrequencyList.match_omit(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.cellSelectionIndicator().is_bound()) return FALSE;
if((other_value.cellSelectionIndicator().ispresent() ? !single_value->field_cellSelectionIndicator.match((const CellSelectionIndicatorAfterReleaseOfAll__TCH__and__SDCCH__IE&)other_value.cellSelectionIndicator(), legacy) : !single_value->field_cellSelectionIndicator.match_omit(legacy)))return FALSE;
if(!other_value.enhanced__DTM__CS__Release__Indication().is_bound()) return FALSE;
if((other_value.enhanced__DTM__CS__Release__Indication().ispresent() ? !single_value->field_enhanced__DTM__CS__Release__Indication.match((const Enhanced__DTM__CS__Release__Indication&)other_value.enhanced__DTM__CS__Release__Indication(), legacy) : !single_value->field_enhanced__DTM__CS__Release__Indication.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.group__Channel__Description__2().is_bound()) return FALSE;
if((other_value.group__Channel__Description__2().ispresent() ? !single_value->field_group__Channel__Description__2.match((const Group__Channel__Description__2__TLV&)other_value.group__Channel__Description__2(), legacy) : !single_value->field_group__Channel__Description__2.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.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.vGCS__AMR__Configuration().is_bound()) return FALSE;
if((other_value.vGCS__AMR__Configuration().ispresent() ? !single_value->field_vGCS__AMR__Configuration.match((const VGCS__AMR__Configuration__TLV&)other_value.vGCS__AMR__Configuration(), legacy) : !single_value->field_vGCS__AMR__Configuration.match_omit(legacy)))return FALSE;
if(!other_value.individual__Priorities().is_bound()) return FALSE;
if((other_value.individual__Priorities().ispresent() ? !single_value->field_individual__Priorities.match((const Individual__Priorities__TLV&)other_value.individual__Priorities(), legacy) : !single_value->field_individual__Priorities.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_ChannelRelease_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ChannelRelease__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_rRCause.is_bound()
 || (single_value->field_bARange.is_omit() || single_value->field_bARange.is_bound())
 || (single_value->field_groupChannelDescription.is_omit() || single_value->field_groupChannelDescription.is_bound())
 || (single_value->field_groupCipherKeyNumber.is_omit() || single_value->field_groupCipherKeyNumber.is_bound())
 || (single_value->field_gPRSResumption.is_omit() || single_value->field_gPRSResumption.is_bound())
 || (single_value->field_bAListPref.is_omit() || single_value->field_bAListPref.is_bound())
 || (single_value->field_uTRANFrequencyList.is_omit() || single_value->field_uTRANFrequencyList.is_bound())
 || (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_bound())
 || (single_value->field_cellSelectionIndicator.is_omit() || single_value->field_cellSelectionIndicator.is_bound())
 || (single_value->field_enhanced__DTM__CS__Release__Indication.is_omit() || single_value->field_enhanced__DTM__CS__Release__Indication.is_bound())
 || (single_value->field_vGCS__Ciphering__Parameters.is_omit() || single_value->field_vGCS__Ciphering__Parameters.is_bound())
 || (single_value->field_group__Channel__Description__2.is_omit() || single_value->field_group__Channel__Description__2.is_bound())
 || (single_value->field_talkerIdentity.is_omit() || single_value->field_talkerIdentity.is_bound())
 || (single_value->field_talkerPriorityStatus.is_omit() || single_value->field_talkerPriorityStatus.is_bound())
 || (single_value->field_vGCS__AMR__Configuration.is_omit() || single_value->field_vGCS__AMR__Configuration.is_bound())
 || (single_value->field_individual__Priorities.is_omit() || single_value->field_individual__Priorities.is_bound());
}

boolean PDU__RRM__ChannelRelease__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_rRCause.is_value()
 && (single_value->field_bARange.is_omit() || single_value->field_bARange.is_value())
 && (single_value->field_groupChannelDescription.is_omit() || single_value->field_groupChannelDescription.is_value())
 && (single_value->field_groupCipherKeyNumber.is_omit() || single_value->field_groupCipherKeyNumber.is_value())
 && (single_value->field_gPRSResumption.is_omit() || single_value->field_gPRSResumption.is_value())
 && (single_value->field_bAListPref.is_omit() || single_value->field_bAListPref.is_value())
 && (single_value->field_uTRANFrequencyList.is_omit() || single_value->field_uTRANFrequencyList.is_value())
 && (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_value())
 && (single_value->field_cellSelectionIndicator.is_omit() || single_value->field_cellSelectionIndicator.is_value())
 && (single_value->field_enhanced__DTM__CS__Release__Indication.is_omit() || single_value->field_enhanced__DTM__CS__Release__Indication.is_value())
 && (single_value->field_vGCS__Ciphering__Parameters.is_omit() || single_value->field_vGCS__Ciphering__Parameters.is_value())
 && (single_value->field_group__Channel__Description__2.is_omit() || single_value->field_group__Channel__Description__2.is_value())
 && (single_value->field_talkerIdentity.is_omit() || single_value->field_talkerIdentity.is_value())
 && (single_value->field_talkerPriorityStatus.is_omit() || single_value->field_talkerPriorityStatus.is_value())
 && (single_value->field_vGCS__AMR__Configuration.is_omit() || single_value->field_vGCS__AMR__Configuration.is_value())
 && (single_value->field_individual__Priorities.is_omit() || single_value->field_individual__Priorities.is_value());
}

void PDU__RRM__ChannelRelease__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__ChannelRelease__NW__MS PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
PDU__RRM__ChannelRelease__NW__MS 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_bARange.is_omit()) ret_val.bARange() = OMIT_VALUE;
else if (single_value->field_bARange.is_bound()) {
ret_val.bARange() = single_value->field_bARange.valueof();
}
if (single_value->field_groupChannelDescription.is_omit()) ret_val.groupChannelDescription() = OMIT_VALUE;
else if (single_value->field_groupChannelDescription.is_bound()) {
ret_val.groupChannelDescription() = single_value->field_groupChannelDescription.valueof();
}
if (single_value->field_groupCipherKeyNumber.is_omit()) ret_val.groupCipherKeyNumber() = OMIT_VALUE;
else if (single_value->field_groupCipherKeyNumber.is_bound()) {
ret_val.groupCipherKeyNumber() = single_value->field_groupCipherKeyNumber.valueof();
}
if (single_value->field_gPRSResumption.is_omit()) ret_val.gPRSResumption() = OMIT_VALUE;
else if (single_value->field_gPRSResumption.is_bound()) {
ret_val.gPRSResumption() = single_value->field_gPRSResumption.valueof();
}
if (single_value->field_bAListPref.is_omit()) ret_val.bAListPref() = OMIT_VALUE;
else if (single_value->field_bAListPref.is_bound()) {
ret_val.bAListPref() = single_value->field_bAListPref.valueof();
}
if (single_value->field_uTRANFrequencyList.is_omit()) ret_val.uTRANFrequencyList() = OMIT_VALUE;
else if (single_value->field_uTRANFrequencyList.is_bound()) {
ret_val.uTRANFrequencyList() = single_value->field_uTRANFrequencyList.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_cellSelectionIndicator.is_omit()) ret_val.cellSelectionIndicator() = OMIT_VALUE;
else if (single_value->field_cellSelectionIndicator.is_bound()) {
ret_val.cellSelectionIndicator() = single_value->field_cellSelectionIndicator.valueof();
}
if (single_value->field_enhanced__DTM__CS__Release__Indication.is_omit()) ret_val.enhanced__DTM__CS__Release__Indication() = OMIT_VALUE;
else if (single_value->field_enhanced__DTM__CS__Release__Indication.is_bound()) {
ret_val.enhanced__DTM__CS__Release__Indication() = single_value->field_enhanced__DTM__CS__Release__Indication.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_group__Channel__Description__2.is_omit()) ret_val.group__Channel__Description__2() = OMIT_VALUE;
else if (single_value->field_group__Channel__Description__2.is_bound()) {
ret_val.group__Channel__Description__2() = single_value->field_group__Channel__Description__2.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_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_vGCS__AMR__Configuration.is_omit()) ret_val.vGCS__AMR__Configuration() = OMIT_VALUE;
else if (single_value->field_vGCS__AMR__Configuration.is_bound()) {
ret_val.vGCS__AMR__Configuration() = single_value->field_vGCS__AMR__Configuration.valueof();
}
if (single_value->field_individual__Priorities.is_omit()) ret_val.individual__Priorities() = OMIT_VALUE;
else if (single_value->field_individual__Priorities.is_bound()) {
ret_val.individual__Priorities() = single_value->field_individual__Priorities.valueof();
}
return ret_val;
}

void PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ChannelRelease__NW__MS_template[list_length];
}

PDU__RRM__ChannelRelease__NW__MS_template& PDU__RRM__ChannelRelease__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_ChannelRelease_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_ChannelRelease_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__ChannelRelease__NW__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
return single_value->field_messageType;
}

RR__Cause__V_template& PDU__RRM__ChannelRelease__NW__MS_template::rRCause()
{
set_specific();
return single_value->field_rRCause;
}

const RR__Cause__V_template& PDU__RRM__ChannelRelease__NW__MS_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_ChannelRelease_NW_MS.");
return single_value->field_rRCause;
}

BARange__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::bARange()
{
set_specific();
return single_value->field_bARange;
}

const BARange__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::bARange() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bARange of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_bARange;
}

GroupChannelDescription__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::groupChannelDescription()
{
set_specific();
return single_value->field_groupChannelDescription;
}

const GroupChannelDescription__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::groupChannelDescription() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field groupChannelDescription of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_groupChannelDescription;
}

MobileL3__CommonIE__Types::Type1__TV_template& PDU__RRM__ChannelRelease__NW__MS_template::groupCipherKeyNumber()
{
set_specific();
return single_value->field_groupCipherKeyNumber;
}

const MobileL3__CommonIE__Types::Type1__TV_template& PDU__RRM__ChannelRelease__NW__MS_template::groupCipherKeyNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field groupCipherKeyNumber of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_groupCipherKeyNumber;
}

MobileL3__CommonIE__Types::Type1__TV_template& PDU__RRM__ChannelRelease__NW__MS_template::gPRSResumption()
{
set_specific();
return single_value->field_gPRSResumption;
}

const MobileL3__CommonIE__Types::Type1__TV_template& PDU__RRM__ChannelRelease__NW__MS_template::gPRSResumption() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gPRSResumption of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_gPRSResumption;
}

BAListPref__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::bAListPref()
{
set_specific();
return single_value->field_bAListPref;
}

const BAListPref__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::bAListPref() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bAListPref of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_bAListPref;
}

UTRANFrequencyList__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::uTRANFrequencyList()
{
set_specific();
return single_value->field_uTRANFrequencyList;
}

const UTRANFrequencyList__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::uTRANFrequencyList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uTRANFrequencyList of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_uTRANFrequencyList;
}

CellChannelDescription__TV_template& PDU__RRM__ChannelRelease__NW__MS_template::cellChannelDescr()
{
set_specific();
return single_value->field_cellChannelDescr;
}

const CellChannelDescription__TV_template& PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
return single_value->field_cellChannelDescr;
}

CellSelectionIndicatorAfterReleaseOfAll__TCH__and__SDCCH__IE_template& PDU__RRM__ChannelRelease__NW__MS_template::cellSelectionIndicator()
{
set_specific();
return single_value->field_cellSelectionIndicator;
}

const CellSelectionIndicatorAfterReleaseOfAll__TCH__and__SDCCH__IE_template& PDU__RRM__ChannelRelease__NW__MS_template::cellSelectionIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellSelectionIndicator of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_cellSelectionIndicator;
}

Enhanced__DTM__CS__Release__Indication_template& PDU__RRM__ChannelRelease__NW__MS_template::enhanced__DTM__CS__Release__Indication()
{
set_specific();
return single_value->field_enhanced__DTM__CS__Release__Indication;
}

const Enhanced__DTM__CS__Release__Indication_template& PDU__RRM__ChannelRelease__NW__MS_template::enhanced__DTM__CS__Release__Indication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field enhanced_DTM_CS_Release_Indication of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_enhanced__DTM__CS__Release__Indication;
}

VGCS__Ciphering__Parameters__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::vGCS__Ciphering__Parameters()
{
set_specific();
return single_value->field_vGCS__Ciphering__Parameters;
}

const VGCS__Ciphering__Parameters__TLV_template& PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
return single_value->field_vGCS__Ciphering__Parameters;
}

Group__Channel__Description__2__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::group__Channel__Description__2()
{
set_specific();
return single_value->field_group__Channel__Description__2;
}

const Group__Channel__Description__2__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::group__Channel__Description__2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field group_Channel_Description_2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_group__Channel__Description__2;
}

TalkerIdentity__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::talkerIdentity()
{
set_specific();
return single_value->field_talkerIdentity;
}

const TalkerIdentity__TLV_template& PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
return single_value->field_talkerIdentity;
}

TalkerPriorityStatus__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::talkerPriorityStatus()
{
set_specific();
return single_value->field_talkerPriorityStatus;
}

const TalkerPriorityStatus__TLV_template& PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS.");
return single_value->field_talkerPriorityStatus;
}

VGCS__AMR__Configuration__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::vGCS__AMR__Configuration()
{
set_specific();
return single_value->field_vGCS__AMR__Configuration;
}

const VGCS__AMR__Configuration__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::vGCS__AMR__Configuration() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vGCS_AMR_Configuration of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_vGCS__AMR__Configuration;
}

Individual__Priorities__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::individual__Priorities()
{
set_specific();
return single_value->field_individual__Priorities;
}

const Individual__Priorities__TLV_template& PDU__RRM__ChannelRelease__NW__MS_template::individual__Priorities() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field individual_Priorities of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
return single_value->field_individual__Priorities;
}

int PDU__RRM__ChannelRelease__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_bARange.is_present()) ret_val++;
      if (single_value->field_groupChannelDescription.is_present()) ret_val++;
      if (single_value->field_groupCipherKeyNumber.is_present()) ret_val++;
      if (single_value->field_gPRSResumption.is_present()) ret_val++;
      if (single_value->field_bAListPref.is_present()) ret_val++;
      if (single_value->field_uTRANFrequencyList.is_present()) ret_val++;
      if (single_value->field_cellChannelDescr.is_present()) ret_val++;
      if (single_value->field_cellSelectionIndicator.is_present()) ret_val++;
      if (single_value->field_enhanced__DTM__CS__Release__Indication.is_present()) ret_val++;
      if (single_value->field_vGCS__Ciphering__Parameters.is_present()) ret_val++;
      if (single_value->field_group__Channel__Description__2.is_present()) ret_val++;
      if (single_value->field_talkerIdentity.is_present()) ret_val++;
      if (single_value->field_talkerPriorityStatus.is_present()) ret_val++;
      if (single_value->field_vGCS__AMR__Configuration.is_present()) ret_val++;
      if (single_value->field_individual__Priorities.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_ChannelRelease_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_ChannelRelease_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_ChannelRelease_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_ChannelRelease_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_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_ChannelRelease_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS.");
  }
  return 0;
}

void PDU__RRM__ChannelRelease__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(", rRCause := ");
single_value->field_rRCause.log();
TTCN_Logger::log_event_str(", bARange := ");
single_value->field_bARange.log();
TTCN_Logger::log_event_str(", groupChannelDescription := ");
single_value->field_groupChannelDescription.log();
TTCN_Logger::log_event_str(", groupCipherKeyNumber := ");
single_value->field_groupCipherKeyNumber.log();
TTCN_Logger::log_event_str(", gPRSResumption := ");
single_value->field_gPRSResumption.log();
TTCN_Logger::log_event_str(", bAListPref := ");
single_value->field_bAListPref.log();
TTCN_Logger::log_event_str(", uTRANFrequencyList := ");
single_value->field_uTRANFrequencyList.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
single_value->field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", cellSelectionIndicator := ");
single_value->field_cellSelectionIndicator.log();
TTCN_Logger::log_event_str(", enhanced_DTM_CS_Release_Indication := ");
single_value->field_enhanced__DTM__CS__Release__Indication.log();
TTCN_Logger::log_event_str(", vGCS_Ciphering_Parameters := ");
single_value->field_vGCS__Ciphering__Parameters.log();
TTCN_Logger::log_event_str(", group_Channel_Description_2 := ");
single_value->field_group__Channel__Description__2.log();
TTCN_Logger::log_event_str(", talkerIdentity := ");
single_value->field_talkerIdentity.log();
TTCN_Logger::log_event_str(", talkerPriorityStatus := ");
single_value->field_talkerPriorityStatus.log();
TTCN_Logger::log_event_str(", vGCS_AMR_Configuration := ");
single_value->field_vGCS__AMR__Configuration.log();
TTCN_Logger::log_event_str(", individual_Priorities := ");
single_value->field_individual__Priorities.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__ChannelRelease__NW__MS_template::log_match(const PDU__RRM__ChannelRelease__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_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.bARange().ispresent()){
if(!single_value->field_bARange.match(match_value.bARange(), legacy)){
TTCN_Logger::log_logmatch_info(".bARange");
single_value->field_bARange.log_match(match_value.bARange(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bARange.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bARange := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bARange.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.groupChannelDescription().ispresent()){
if(!single_value->field_groupChannelDescription.match(match_value.groupChannelDescription(), legacy)){
TTCN_Logger::log_logmatch_info(".groupChannelDescription");
single_value->field_groupChannelDescription.log_match(match_value.groupChannelDescription(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_groupChannelDescription.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".groupChannelDescription := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_groupChannelDescription.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.groupCipherKeyNumber().ispresent()){
if(!single_value->field_groupCipherKeyNumber.match(match_value.groupCipherKeyNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".groupCipherKeyNumber");
single_value->field_groupCipherKeyNumber.log_match(match_value.groupCipherKeyNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_groupCipherKeyNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".groupCipherKeyNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_groupCipherKeyNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.gPRSResumption().ispresent()){
if(!single_value->field_gPRSResumption.match(match_value.gPRSResumption(), legacy)){
TTCN_Logger::log_logmatch_info(".gPRSResumption");
single_value->field_gPRSResumption.log_match(match_value.gPRSResumption(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gPRSResumption.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gPRSResumption := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gPRSResumption.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bAListPref().ispresent()){
if(!single_value->field_bAListPref.match(match_value.bAListPref(), legacy)){
TTCN_Logger::log_logmatch_info(".bAListPref");
single_value->field_bAListPref.log_match(match_value.bAListPref(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bAListPref.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bAListPref := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bAListPref.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.uTRANFrequencyList().ispresent()){
if(!single_value->field_uTRANFrequencyList.match(match_value.uTRANFrequencyList(), legacy)){
TTCN_Logger::log_logmatch_info(".uTRANFrequencyList");
single_value->field_uTRANFrequencyList.log_match(match_value.uTRANFrequencyList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uTRANFrequencyList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uTRANFrequencyList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uTRANFrequencyList.log();
TTCN_Logger::log_event_str(" unmatched");
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.cellSelectionIndicator().ispresent()){
if(!single_value->field_cellSelectionIndicator.match(match_value.cellSelectionIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".cellSelectionIndicator");
single_value->field_cellSelectionIndicator.log_match(match_value.cellSelectionIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellSelectionIndicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellSelectionIndicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellSelectionIndicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.enhanced__DTM__CS__Release__Indication().ispresent()){
if(!single_value->field_enhanced__DTM__CS__Release__Indication.match(match_value.enhanced__DTM__CS__Release__Indication(), legacy)){
TTCN_Logger::log_logmatch_info(".enhanced_DTM_CS_Release_Indication");
single_value->field_enhanced__DTM__CS__Release__Indication.log_match(match_value.enhanced__DTM__CS__Release__Indication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_enhanced__DTM__CS__Release__Indication.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".enhanced_DTM_CS_Release_Indication := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_enhanced__DTM__CS__Release__Indication.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.group__Channel__Description__2().ispresent()){
if(!single_value->field_group__Channel__Description__2.match(match_value.group__Channel__Description__2(), legacy)){
TTCN_Logger::log_logmatch_info(".group_Channel_Description_2");
single_value->field_group__Channel__Description__2.log_match(match_value.group__Channel__Description__2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_group__Channel__Description__2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".group_Channel_Description_2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_group__Channel__Description__2.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.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.vGCS__AMR__Configuration().ispresent()){
if(!single_value->field_vGCS__AMR__Configuration.match(match_value.vGCS__AMR__Configuration(), legacy)){
TTCN_Logger::log_logmatch_info(".vGCS_AMR_Configuration");
single_value->field_vGCS__AMR__Configuration.log_match(match_value.vGCS__AMR__Configuration(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_vGCS__AMR__Configuration.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".vGCS_AMR_Configuration := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_vGCS__AMR__Configuration.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.individual__Priorities().ispresent()){
if(!single_value->field_individual__Priorities.match(match_value.individual__Priorities(), legacy)){
TTCN_Logger::log_logmatch_info(".individual_Priorities");
single_value->field_individual__Priorities.log_match(match_value.individual__Priorities(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_individual__Priorities.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".individual_Priorities := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_individual__Priorities.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(", bARange := ");
if (match_value.bARange().ispresent()) {
single_value->field_bARange.log_match(match_value.bARange(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bARange.log();
if (single_value->field_bARange.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", groupChannelDescription := ");
if (match_value.groupChannelDescription().ispresent()) {
single_value->field_groupChannelDescription.log_match(match_value.groupChannelDescription(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_groupChannelDescription.log();
if (single_value->field_groupChannelDescription.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", groupCipherKeyNumber := ");
if (match_value.groupCipherKeyNumber().ispresent()) {
single_value->field_groupCipherKeyNumber.log_match(match_value.groupCipherKeyNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_groupCipherKeyNumber.log();
if (single_value->field_groupCipherKeyNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", gPRSResumption := ");
if (match_value.gPRSResumption().ispresent()) {
single_value->field_gPRSResumption.log_match(match_value.gPRSResumption(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gPRSResumption.log();
if (single_value->field_gPRSResumption.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bAListPref := ");
if (match_value.bAListPref().ispresent()) {
single_value->field_bAListPref.log_match(match_value.bAListPref(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bAListPref.log();
if (single_value->field_bAListPref.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", uTRANFrequencyList := ");
if (match_value.uTRANFrequencyList().ispresent()) {
single_value->field_uTRANFrequencyList.log_match(match_value.uTRANFrequencyList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uTRANFrequencyList.log();
if (single_value->field_uTRANFrequencyList.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
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(", cellSelectionIndicator := ");
if (match_value.cellSelectionIndicator().ispresent()) {
single_value->field_cellSelectionIndicator.log_match(match_value.cellSelectionIndicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellSelectionIndicator.log();
if (single_value->field_cellSelectionIndicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", enhanced_DTM_CS_Release_Indication := ");
if (match_value.enhanced__DTM__CS__Release__Indication().ispresent()) {
single_value->field_enhanced__DTM__CS__Release__Indication.log_match(match_value.enhanced__DTM__CS__Release__Indication(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_enhanced__DTM__CS__Release__Indication.log();
if (single_value->field_enhanced__DTM__CS__Release__Indication.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(", group_Channel_Description_2 := ");
if (match_value.group__Channel__Description__2().ispresent()) {
single_value->field_group__Channel__Description__2.log_match(match_value.group__Channel__Description__2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_group__Channel__Description__2.log();
if (single_value->field_group__Channel__Description__2.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(", 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(", vGCS_AMR_Configuration := ");
if (match_value.vGCS__AMR__Configuration().ispresent()) {
single_value->field_vGCS__AMR__Configuration.log_match(match_value.vGCS__AMR__Configuration(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_vGCS__AMR__Configuration.log();
if (single_value->field_vGCS__AMR__Configuration.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", individual_Priorities := ");
if (match_value.individual__Priorities().ispresent()) {
single_value->field_individual__Priorities.log_match(match_value.individual__Priorities(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_individual__Priorities.log();
if (single_value->field_individual__Priorities.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__ChannelRelease__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rRCause().is_bound()) rRCause().set_implicit_omit();
if (!bARange().is_bound()) bARange() = OMIT_VALUE;
else bARange().set_implicit_omit();
if (!groupChannelDescription().is_bound()) groupChannelDescription() = OMIT_VALUE;
else groupChannelDescription().set_implicit_omit();
if (!groupCipherKeyNumber().is_bound()) groupCipherKeyNumber() = OMIT_VALUE;
else groupCipherKeyNumber().set_implicit_omit();
if (!gPRSResumption().is_bound()) gPRSResumption() = OMIT_VALUE;
else gPRSResumption().set_implicit_omit();
if (!bAListPref().is_bound()) bAListPref() = OMIT_VALUE;
else bAListPref().set_implicit_omit();
if (!uTRANFrequencyList().is_bound()) uTRANFrequencyList() = OMIT_VALUE;
else uTRANFrequencyList().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!cellSelectionIndicator().is_bound()) cellSelectionIndicator() = OMIT_VALUE;
else cellSelectionIndicator().set_implicit_omit();
if (!enhanced__DTM__CS__Release__Indication().is_bound()) enhanced__DTM__CS__Release__Indication() = OMIT_VALUE;
else enhanced__DTM__CS__Release__Indication().set_implicit_omit();
if (!vGCS__Ciphering__Parameters().is_bound()) vGCS__Ciphering__Parameters() = OMIT_VALUE;
else vGCS__Ciphering__Parameters().set_implicit_omit();
if (!group__Channel__Description__2().is_bound()) group__Channel__Description__2() = OMIT_VALUE;
else group__Channel__Description__2().set_implicit_omit();
if (!talkerIdentity().is_bound()) talkerIdentity() = OMIT_VALUE;
else talkerIdentity().set_implicit_omit();
if (!talkerPriorityStatus().is_bound()) talkerPriorityStatus() = OMIT_VALUE;
else talkerPriorityStatus().set_implicit_omit();
if (!vGCS__AMR__Configuration().is_bound()) vGCS__AMR__Configuration() = OMIT_VALUE;
else vGCS__AMR__Configuration().set_implicit_omit();
if (!individual__Priorities().is_bound()) individual__Priorities() = OMIT_VALUE;
else individual__Priorities().set_implicit_omit();
}

void PDU__RRM__ChannelRelease__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_rRCause.encode_text(text_buf);
single_value->field_bARange.encode_text(text_buf);
single_value->field_groupChannelDescription.encode_text(text_buf);
single_value->field_groupCipherKeyNumber.encode_text(text_buf);
single_value->field_gPRSResumption.encode_text(text_buf);
single_value->field_bAListPref.encode_text(text_buf);
single_value->field_uTRANFrequencyList.encode_text(text_buf);
single_value->field_cellChannelDescr.encode_text(text_buf);
single_value->field_cellSelectionIndicator.encode_text(text_buf);
single_value->field_enhanced__DTM__CS__Release__Indication.encode_text(text_buf);
single_value->field_vGCS__Ciphering__Parameters.encode_text(text_buf);
single_value->field_group__Channel__Description__2.encode_text(text_buf);
single_value->field_talkerIdentity.encode_text(text_buf);
single_value->field_talkerPriorityStatus.encode_text(text_buf);
single_value->field_vGCS__AMR__Configuration.encode_text(text_buf);
single_value->field_individual__Priorities.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_ChannelRelease_NW_MS.");
}
}

void PDU__RRM__ChannelRelease__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_rRCause.decode_text(text_buf);
single_value->field_bARange.decode_text(text_buf);
single_value->field_groupChannelDescription.decode_text(text_buf);
single_value->field_groupCipherKeyNumber.decode_text(text_buf);
single_value->field_gPRSResumption.decode_text(text_buf);
single_value->field_bAListPref.decode_text(text_buf);
single_value->field_uTRANFrequencyList.decode_text(text_buf);
single_value->field_cellChannelDescr.decode_text(text_buf);
single_value->field_cellSelectionIndicator.decode_text(text_buf);
single_value->field_enhanced__DTM__CS__Release__Indication.decode_text(text_buf);
single_value->field_vGCS__Ciphering__Parameters.decode_text(text_buf);
single_value->field_group__Channel__Description__2.decode_text(text_buf);
single_value->field_talkerIdentity.decode_text(text_buf);
single_value->field_talkerPriorityStatus.decode_text(text_buf);
single_value->field_vGCS__AMR__Configuration.decode_text(text_buf);
single_value->field_individual__Priorities.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__ChannelRelease__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_ChannelRelease_NW_MS.");
}
}

void PDU__RRM__ChannelRelease__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__ChannelRelease__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (17<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS has 17 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rRCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bARange().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) groupChannelDescription().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) groupCipherKeyNumber().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) gPRSResumption().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) bAListPref().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) uTRANFrequencyList().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescr().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) cellSelectionIndicator().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) enhanced__DTM__CS__Release__Indication().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) vGCS__Ciphering__Parameters().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) group__Channel__Description__2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) talkerIdentity().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) talkerPriorityStatus().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) vGCS__AMR__Configuration().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) individual__Priorities().set_param(*param.get_elem(16));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "bARange")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bARange().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "groupChannelDescription")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          groupChannelDescription().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "groupCipherKeyNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          groupCipherKeyNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gPRSResumption")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPRSResumption().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bAListPref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bAListPref().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uTRANFrequencyList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRANFrequencyList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "cellSelectionIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellSelectionIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "enhanced_DTM_CS_Release_Indication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          enhanced__DTM__CS__Release__Indication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "group_Channel_Description_2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          group__Channel__Description__2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "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(), "vGCS_AMR_Configuration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vGCS__AMR__Configuration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "individual_Priorities")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          individual__Priorities().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_ChannelRelease_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ChannelRelease__NW__MS_template* precondition = new PDU__RRM__ChannelRelease__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ChannelRelease__NW__MS_template* implied_template = new PDU__RRM__ChannelRelease__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ChannelRelease__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ChannelRelease__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_ChannelRelease_NW_MS");
single_value->field_rRCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_bARange.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_groupChannelDescription.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_groupCipherKeyNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_gPRSResumption.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_bAListPref.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_uTRANFrequencyList.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_cellChannelDescr.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_cellSelectionIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_enhanced__DTM__CS__Release__Indication.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_vGCS__Ciphering__Parameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_group__Channel__Description__2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_talkerIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_talkerPriorityStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_vGCS__AMR__Configuration.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_NW_MS");
single_value->field_individual__Priorities.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ChannelRelease_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_ChannelRelease_NW_MS");
}

boolean PDU__RRM__ChannelRelease__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__ChannelRelease__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__CipheringModeCommand__NW__MS::PDU__RRM__CipheringModeCommand__NW__MS()
{
}

PDU__RRM__CipheringModeCommand__NW__MS::PDU__RRM__CipheringModeCommand__NW__MS(const BITSTRING& par_messageType,
    const CipherModeSetting__V& par_cipherModeSetting,
    const CipherModeResponse__V& par_cipherModeResponse)
  :   field_messageType(par_messageType),
  field_cipherModeSetting(par_cipherModeSetting),
  field_cipherModeResponse(par_cipherModeResponse)
{
}

PDU__RRM__CipheringModeCommand__NW__MS::PDU__RRM__CipheringModeCommand__NW__MS(const PDU__RRM__CipheringModeCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.cipherModeSetting().is_bound()) field_cipherModeSetting = other_value.cipherModeSetting();
else field_cipherModeSetting.clean_up();
if (other_value.cipherModeResponse().is_bound()) field_cipherModeResponse = other_value.cipherModeResponse();
else field_cipherModeResponse.clean_up();
}

void PDU__RRM__CipheringModeCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_cipherModeSetting.clean_up();
field_cipherModeResponse.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__CipheringModeCommand__NW__MS::get_descriptor() const { return &PDU__RRM__CipheringModeCommand__NW__MS_descr_; }
PDU__RRM__CipheringModeCommand__NW__MS& PDU__RRM__CipheringModeCommand__NW__MS::operator=(const PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.cipherModeSetting().is_bound()) field_cipherModeSetting = other_value.cipherModeSetting();
  else field_cipherModeSetting.clean_up();
  if (other_value.cipherModeResponse().is_bound()) field_cipherModeResponse = other_value.cipherModeResponse();
  else field_cipherModeResponse.clean_up();
}
return *this;
}

boolean PDU__RRM__CipheringModeCommand__NW__MS::operator==(const PDU__RRM__CipheringModeCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_cipherModeSetting==other_value.field_cipherModeSetting
  && field_cipherModeResponse==other_value.field_cipherModeResponse;
}

boolean PDU__RRM__CipheringModeCommand__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_cipherModeSetting.is_bound())
  || (field_cipherModeResponse.is_bound());
}
boolean PDU__RRM__CipheringModeCommand__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_cipherModeSetting.is_value()
  && field_cipherModeResponse.is_value();
}
void PDU__RRM__CipheringModeCommand__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(", cipherModeSetting := ");
field_cipherModeSetting.log();
TTCN_Logger::log_event_str(", cipherModeResponse := ");
field_cipherModeResponse.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__CipheringModeCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cipherModeSetting().is_bound()) cipherModeSetting().set_implicit_omit();
if (cipherModeResponse().is_bound()) cipherModeResponse().set_implicit_omit();
}

void PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_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) cipherModeSetting().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cipherModeResponse().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(), "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(), "cipherModeResponse")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipherModeResponse().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_CipheringModeCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_NW_MS");
  }
}

void PDU__RRM__CipheringModeCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_cipherModeSetting.encode_text(text_buf);
field_cipherModeResponse.encode_text(text_buf);
}

void PDU__RRM__CipheringModeCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_cipherModeSetting.decode_text(text_buf);
field_cipherModeResponse.decode_text(text_buf);
}

void PDU__RRM__CipheringModeCommand__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__CipheringModeCommand__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__CipheringModeCommand__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, CipherModeSetting__V_descr_.raw->forceomit);
  decoded_field_length = field_cipherModeSetting.RAW_decode(CipherModeSetting__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, CipherModeResponse__V_descr_.raw->forceomit);
  decoded_field_length = field_cipherModeResponse.RAW_decode(CipherModeResponse__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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__CipheringModeCommand__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, CipherModeSetting__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, CipherModeResponse__V_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cipherModeSetting.RAW_encode(CipherModeSetting__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cipherModeResponse.RAW_encode(CipherModeResponse__V_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__CipheringModeCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
CipherModeSetting__V_template field_cipherModeSetting;
CipherModeResponse__V_template field_cipherModeResponse;
};

void PDU__RRM__CipheringModeCommand__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_cipherModeSetting = ANY_VALUE;
single_value->field_cipherModeResponse = ANY_VALUE;
}
}
}

void PDU__RRM__CipheringModeCommand__NW__MS_template::copy_value(const PDU__RRM__CipheringModeCommand__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.cipherModeSetting().is_bound()) {
  single_value->field_cipherModeSetting = other_value.cipherModeSetting();
} else {
  single_value->field_cipherModeSetting.clean_up();
}
if (other_value.cipherModeResponse().is_bound()) {
  single_value->field_cipherModeResponse = other_value.cipherModeResponse();
} else {
  single_value->field_cipherModeResponse.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__CipheringModeCommand__NW__MS_template::copy_template(const PDU__RRM__CipheringModeCommand__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.cipherModeSetting().get_selection()) {
single_value->field_cipherModeSetting = other_value.cipherModeSetting();
} else {
single_value->field_cipherModeSetting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipherModeResponse().get_selection()) {
single_value->field_cipherModeResponse = other_value.cipherModeResponse();
} else {
single_value->field_cipherModeResponse.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__CipheringModeCommand__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__CipheringModeCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__CipheringModeCommand__NW__MS_template::PDU__RRM__CipheringModeCommand__NW__MS_template()
{
}

PDU__RRM__CipheringModeCommand__NW__MS_template::PDU__RRM__CipheringModeCommand__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__CipheringModeCommand__NW__MS_template::PDU__RRM__CipheringModeCommand__NW__MS_template(const PDU__RRM__CipheringModeCommand__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__CipheringModeCommand__NW__MS_template::PDU__RRM__CipheringModeCommand__NW__MS_template(const OPTIONAL<PDU__RRM__CipheringModeCommand__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_NW_MS from an unbound optional field.");
}
}

PDU__RRM__CipheringModeCommand__NW__MS_template::PDU__RRM__CipheringModeCommand__NW__MS_template(PDU__RRM__CipheringModeCommand__NW__MS_template* p_precondition, PDU__RRM__CipheringModeCommand__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__CipheringModeCommand__NW__MS_template::PDU__RRM__CipheringModeCommand__NW__MS_template(Dynamic_Match_Interface<PDU__RRM__CipheringModeCommand__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__CipheringModeCommand__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__CipheringModeCommand__NW__MS_template::PDU__RRM__CipheringModeCommand__NW__MS_template(const PDU__RRM__CipheringModeCommand__NW__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__CipheringModeCommand__NW__MS_template::~PDU__RRM__CipheringModeCommand__NW__MS_template()
{
clean_up();
}

PDU__RRM__CipheringModeCommand__NW__MS_template& PDU__RRM__CipheringModeCommand__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__CipheringModeCommand__NW__MS_template& PDU__RRM__CipheringModeCommand__NW__MS_template::operator=(const PDU__RRM__CipheringModeCommand__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__CipheringModeCommand__NW__MS_template& PDU__RRM__CipheringModeCommand__NW__MS_template::operator=(const OPTIONAL<PDU__RRM__CipheringModeCommand__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_NW_MS.");
}
return *this;
}

PDU__RRM__CipheringModeCommand__NW__MS_template& PDU__RRM__CipheringModeCommand__NW__MS_template::operator=(const PDU__RRM__CipheringModeCommand__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__CipheringModeCommand__NW__MS_template::match(const PDU__RRM__CipheringModeCommand__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.cipherModeSetting().is_bound()) return FALSE;
if(!single_value->field_cipherModeSetting.match(other_value.cipherModeSetting(), legacy))return FALSE;
if(!other_value.cipherModeResponse().is_bound()) return FALSE;
if(!single_value->field_cipherModeResponse.match(other_value.cipherModeResponse(), 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_CipheringModeCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__CipheringModeCommand__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_cipherModeSetting.is_bound()
 || single_value->field_cipherModeResponse.is_bound();
}

boolean PDU__RRM__CipheringModeCommand__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_cipherModeSetting.is_value()
 && single_value->field_cipherModeResponse.is_value();
}

void PDU__RRM__CipheringModeCommand__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__CipheringModeCommand__NW__MS PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_NW_MS.");
PDU__RRM__CipheringModeCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_cipherModeSetting.is_bound()) {
ret_val.cipherModeSetting() = single_value->field_cipherModeSetting.valueof();
}
if (single_value->field_cipherModeResponse.is_bound()) {
ret_val.cipherModeResponse() = single_value->field_cipherModeResponse.valueof();
}
return ret_val;
}

void PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__CipheringModeCommand__NW__MS_template[list_length];
}

PDU__RRM__CipheringModeCommand__NW__MS_template& PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_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_CipheringModeCommand_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__CipheringModeCommand__NW__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_NW_MS.");
return single_value->field_messageType;
}

CipherModeSetting__V_template& PDU__RRM__CipheringModeCommand__NW__MS_template::cipherModeSetting()
{
set_specific();
return single_value->field_cipherModeSetting;
}

const CipherModeSetting__V_template& PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_NW_MS.");
return single_value->field_cipherModeSetting;
}

CipherModeResponse__V_template& PDU__RRM__CipheringModeCommand__NW__MS_template::cipherModeResponse()
{
set_specific();
return single_value->field_cipherModeResponse;
}

const CipherModeResponse__V_template& PDU__RRM__CipheringModeCommand__NW__MS_template::cipherModeResponse() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipherModeResponse of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_NW_MS.");
return single_value->field_cipherModeResponse;
}

int PDU__RRM__CipheringModeCommand__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_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_CipheringModeCommand_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_CipheringModeCommand_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_CipheringModeCommand_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_CipheringModeCommand_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_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_CipheringModeCommand_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_NW_MS.");
  }
  return 0;
}

void PDU__RRM__CipheringModeCommand__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(", cipherModeSetting := ");
single_value->field_cipherModeSetting.log();
TTCN_Logger::log_event_str(", cipherModeResponse := ");
single_value->field_cipherModeResponse.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__CipheringModeCommand__NW__MS_template::log_match(const PDU__RRM__CipheringModeCommand__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_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);
}
if(!single_value->field_cipherModeResponse.match(match_value.cipherModeResponse(), legacy)){
TTCN_Logger::log_logmatch_info(".cipherModeResponse");
single_value->field_cipherModeResponse.log_match(match_value.cipherModeResponse(), 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(", cipherModeSetting := ");
single_value->field_cipherModeSetting.log_match(match_value.cipherModeSetting(), legacy);
TTCN_Logger::log_event_str(", cipherModeResponse := ");
single_value->field_cipherModeResponse.log_match(match_value.cipherModeResponse(), 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__CipheringModeCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cipherModeSetting().is_bound()) cipherModeSetting().set_implicit_omit();
if (cipherModeResponse().is_bound()) cipherModeResponse().set_implicit_omit();
}

void PDU__RRM__CipheringModeCommand__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_cipherModeSetting.encode_text(text_buf);
single_value->field_cipherModeResponse.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_CipheringModeCommand_NW_MS.");
}
}

void PDU__RRM__CipheringModeCommand__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_cipherModeSetting.decode_text(text_buf);
single_value->field_cipherModeResponse.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__CipheringModeCommand__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_CipheringModeCommand_NW_MS.");
}
}

void PDU__RRM__CipheringModeCommand__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__CipheringModeCommand__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_CipheringModeCommand_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) cipherModeSetting().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cipherModeResponse().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(), "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(), "cipherModeResponse")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipherModeResponse().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_CipheringModeCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__CipheringModeCommand__NW__MS_template* precondition = new PDU__RRM__CipheringModeCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__CipheringModeCommand__NW__MS_template* implied_template = new PDU__RRM__CipheringModeCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__CipheringModeCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__CipheringModeCommand__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_CipheringModeCommand_NW_MS");
single_value->field_cipherModeSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_NW_MS");
single_value->field_cipherModeResponse.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CipheringModeCommand_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_CipheringModeCommand_NW_MS");
}

boolean PDU__RRM__CipheringModeCommand__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__CipheringModeCommand__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__CipheringModeComplete__MS__NW::PDU__RRM__CipheringModeComplete__MS__NW()
{
}

PDU__RRM__CipheringModeComplete__MS__NW::PDU__RRM__CipheringModeComplete__MS__NW(const BITSTRING& par_messageType,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_mobileEquipmentIdentity)
  :   field_messageType(par_messageType),
  field_mobileEquipmentIdentity(par_mobileEquipmentIdentity)
{
}

PDU__RRM__CipheringModeComplete__MS__NW::PDU__RRM__CipheringModeComplete__MS__NW(const PDU__RRM__CipheringModeComplete__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.mobileEquipmentIdentity().is_bound()) field_mobileEquipmentIdentity = other_value.mobileEquipmentIdentity();
else field_mobileEquipmentIdentity.clean_up();
}

void PDU__RRM__CipheringModeComplete__MS__NW::clean_up()
{
field_messageType.clean_up();
field_mobileEquipmentIdentity.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__CipheringModeComplete__MS__NW::get_descriptor() const { return &PDU__RRM__CipheringModeComplete__MS__NW_descr_; }
PDU__RRM__CipheringModeComplete__MS__NW& PDU__RRM__CipheringModeComplete__MS__NW::operator=(const PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.mobileEquipmentIdentity().is_bound()) field_mobileEquipmentIdentity = other_value.mobileEquipmentIdentity();
  else field_mobileEquipmentIdentity.clean_up();
}
return *this;
}

boolean PDU__RRM__CipheringModeComplete__MS__NW::operator==(const PDU__RRM__CipheringModeComplete__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_mobileEquipmentIdentity==other_value.field_mobileEquipmentIdentity;
}

boolean PDU__RRM__CipheringModeComplete__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (OPTIONAL_OMIT == field_mobileEquipmentIdentity.get_selection() || field_mobileEquipmentIdentity.is_bound());
}
boolean PDU__RRM__CipheringModeComplete__MS__NW::is_value() const
{
return field_messageType.is_value()
  && (OPTIONAL_OMIT == field_mobileEquipmentIdentity.get_selection() || field_mobileEquipmentIdentity.is_value());
}
int PDU__RRM__CipheringModeComplete__MS__NW::size_of() const
{
  int ret_val = 1;
  if (field_mobileEquipmentIdentity.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__CipheringModeComplete__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(", mobileEquipmentIdentity := ");
field_mobileEquipmentIdentity.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__CipheringModeComplete__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!mobileEquipmentIdentity().is_bound()) mobileEquipmentIdentity() = OMIT_VALUE;
else mobileEquipmentIdentity().set_implicit_omit();
}

void PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_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) mobileEquipmentIdentity().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(), "mobileEquipmentIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileEquipmentIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_CipheringModeComplete_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_MS_NW");
  }
}

void PDU__RRM__CipheringModeComplete__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_mobileEquipmentIdentity.encode_text(text_buf);
}

void PDU__RRM__CipheringModeComplete__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_mobileEquipmentIdentity.decode_text(text_buf);
}

void PDU__RRM__CipheringModeComplete__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__CipheringModeComplete__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__CipheringModeComplete__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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_mobileEquipmentIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileEquipmentIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_mobileEquipmentIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileEquipmentIdentity.ispresent() || field_mobileEquipmentIdentity().elementIdentifier() !=  bs_5){
  field_mobileEquipmentIdentity=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileEquipmentIdentity=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__CipheringModeComplete__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);
  if (field_mobileEquipmentIdentity.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_mobileEquipmentIdentity.ispresent()) {
  encoded_length += field_mobileEquipmentIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_mobileEquipmentIdentity.ispresent() && (!field_mobileEquipmentIdentity.ispresent() || field_mobileEquipmentIdentity().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[]={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_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__CipheringModeComplete__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_mobileEquipmentIdentity;
};

void PDU__RRM__CipheringModeComplete__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_mobileEquipmentIdentity = ANY_OR_OMIT;
}
}
}

void PDU__RRM__CipheringModeComplete__MS__NW_template::copy_value(const PDU__RRM__CipheringModeComplete__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.mobileEquipmentIdentity().is_bound()) {
  if (other_value.mobileEquipmentIdentity().ispresent()) single_value->field_mobileEquipmentIdentity = other_value.mobileEquipmentIdentity()();
  else single_value->field_mobileEquipmentIdentity = OMIT_VALUE;
} else {
  single_value->field_mobileEquipmentIdentity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__CipheringModeComplete__MS__NW_template::copy_template(const PDU__RRM__CipheringModeComplete__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.mobileEquipmentIdentity().get_selection()) {
single_value->field_mobileEquipmentIdentity = other_value.mobileEquipmentIdentity();
} else {
single_value->field_mobileEquipmentIdentity.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__CipheringModeComplete__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__CipheringModeComplete__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__CipheringModeComplete__MS__NW_template::PDU__RRM__CipheringModeComplete__MS__NW_template()
{
}

PDU__RRM__CipheringModeComplete__MS__NW_template::PDU__RRM__CipheringModeComplete__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__CipheringModeComplete__MS__NW_template::PDU__RRM__CipheringModeComplete__MS__NW_template(const PDU__RRM__CipheringModeComplete__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__CipheringModeComplete__MS__NW_template::PDU__RRM__CipheringModeComplete__MS__NW_template(const OPTIONAL<PDU__RRM__CipheringModeComplete__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_MS_NW from an unbound optional field.");
}
}

PDU__RRM__CipheringModeComplete__MS__NW_template::PDU__RRM__CipheringModeComplete__MS__NW_template(PDU__RRM__CipheringModeComplete__MS__NW_template* p_precondition, PDU__RRM__CipheringModeComplete__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__CipheringModeComplete__MS__NW_template::PDU__RRM__CipheringModeComplete__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__CipheringModeComplete__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__CipheringModeComplete__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__CipheringModeComplete__MS__NW_template::PDU__RRM__CipheringModeComplete__MS__NW_template(const PDU__RRM__CipheringModeComplete__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__CipheringModeComplete__MS__NW_template::~PDU__RRM__CipheringModeComplete__MS__NW_template()
{
clean_up();
}

PDU__RRM__CipheringModeComplete__MS__NW_template& PDU__RRM__CipheringModeComplete__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__CipheringModeComplete__MS__NW_template& PDU__RRM__CipheringModeComplete__MS__NW_template::operator=(const PDU__RRM__CipheringModeComplete__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__CipheringModeComplete__MS__NW_template& PDU__RRM__CipheringModeComplete__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__CipheringModeComplete__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_MS_NW.");
}
return *this;
}

PDU__RRM__CipheringModeComplete__MS__NW_template& PDU__RRM__CipheringModeComplete__MS__NW_template::operator=(const PDU__RRM__CipheringModeComplete__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__CipheringModeComplete__MS__NW_template::match(const PDU__RRM__CipheringModeComplete__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.mobileEquipmentIdentity().is_bound()) return FALSE;
if((other_value.mobileEquipmentIdentity().ispresent() ? !single_value->field_mobileEquipmentIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.mobileEquipmentIdentity(), legacy) : !single_value->field_mobileEquipmentIdentity.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_CipheringModeComplete_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__CipheringModeComplete__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_mobileEquipmentIdentity.is_omit() || single_value->field_mobileEquipmentIdentity.is_bound());
}

boolean PDU__RRM__CipheringModeComplete__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_mobileEquipmentIdentity.is_omit() || single_value->field_mobileEquipmentIdentity.is_value());
}

void PDU__RRM__CipheringModeComplete__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__CipheringModeComplete__MS__NW PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_MS_NW.");
PDU__RRM__CipheringModeComplete__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_mobileEquipmentIdentity.is_omit()) ret_val.mobileEquipmentIdentity() = OMIT_VALUE;
else if (single_value->field_mobileEquipmentIdentity.is_bound()) {
ret_val.mobileEquipmentIdentity() = single_value->field_mobileEquipmentIdentity.valueof();
}
return ret_val;
}

void PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__CipheringModeComplete__MS__NW_template[list_length];
}

PDU__RRM__CipheringModeComplete__MS__NW_template& PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_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_CipheringModeComplete_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__CipheringModeComplete__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_MS_NW.");
return single_value->field_messageType;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__RRM__CipheringModeComplete__MS__NW_template::mobileEquipmentIdentity()
{
set_specific();
return single_value->field_mobileEquipmentIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__RRM__CipheringModeComplete__MS__NW_template::mobileEquipmentIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileEquipmentIdentity of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_MS_NW.");
return single_value->field_mobileEquipmentIdentity;
}

int PDU__RRM__CipheringModeComplete__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_mobileEquipmentIdentity.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_CipheringModeComplete_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_CipheringModeComplete_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_CipheringModeComplete_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_CipheringModeComplete_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_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_CipheringModeComplete_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_MS_NW.");
  }
  return 0;
}

void PDU__RRM__CipheringModeComplete__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(", mobileEquipmentIdentity := ");
single_value->field_mobileEquipmentIdentity.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__CipheringModeComplete__MS__NW_template::log_match(const PDU__RRM__CipheringModeComplete__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 (match_value.mobileEquipmentIdentity().ispresent()){
if(!single_value->field_mobileEquipmentIdentity.match(match_value.mobileEquipmentIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileEquipmentIdentity");
single_value->field_mobileEquipmentIdentity.log_match(match_value.mobileEquipmentIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileEquipmentIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileEquipmentIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileEquipmentIdentity.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(", mobileEquipmentIdentity := ");
if (match_value.mobileEquipmentIdentity().ispresent()) {
single_value->field_mobileEquipmentIdentity.log_match(match_value.mobileEquipmentIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileEquipmentIdentity.log();
if (single_value->field_mobileEquipmentIdentity.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__CipheringModeComplete__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!mobileEquipmentIdentity().is_bound()) mobileEquipmentIdentity() = OMIT_VALUE;
else mobileEquipmentIdentity().set_implicit_omit();
}

void PDU__RRM__CipheringModeComplete__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_mobileEquipmentIdentity.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_CipheringModeComplete_MS_NW.");
}
}

void PDU__RRM__CipheringModeComplete__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_mobileEquipmentIdentity.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__CipheringModeComplete__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_CipheringModeComplete_MS_NW.");
}
}

void PDU__RRM__CipheringModeComplete__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__CipheringModeComplete__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_CipheringModeComplete_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) mobileEquipmentIdentity().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(), "mobileEquipmentIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileEquipmentIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_CipheringModeComplete_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__CipheringModeComplete__MS__NW_template* precondition = new PDU__RRM__CipheringModeComplete__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__CipheringModeComplete__MS__NW_template* implied_template = new PDU__RRM__CipheringModeComplete__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__CipheringModeComplete__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__CipheringModeComplete__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_CipheringModeComplete_MS_NW");
single_value->field_mobileEquipmentIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CipheringModeComplete_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_CipheringModeComplete_MS_NW");
}

boolean PDU__RRM__CipheringModeComplete__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__CipheringModeComplete__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__ClassmarkChange__MS__NW::PDU__RRM__ClassmarkChange__MS__NW()
{
}

PDU__RRM__ClassmarkChange__MS__NW::PDU__RRM__ClassmarkChange__MS__NW(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::MobileStationClassmark2__LV& par_mobileStationClassmark2,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileStationClassmark3__TLV >& par_mobileStationClassmark3)
  :   field_messageType(par_messageType),
  field_mobileStationClassmark2(par_mobileStationClassmark2),
  field_mobileStationClassmark3(par_mobileStationClassmark3)
{
}

PDU__RRM__ClassmarkChange__MS__NW::PDU__RRM__ClassmarkChange__MS__NW(const PDU__RRM__ClassmarkChange__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
else field_mobileStationClassmark2.clean_up();
if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
else field_mobileStationClassmark3.clean_up();
}

void PDU__RRM__ClassmarkChange__MS__NW::clean_up()
{
field_messageType.clean_up();
field_mobileStationClassmark2.clean_up();
field_mobileStationClassmark3.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ClassmarkChange__MS__NW::get_descriptor() const { return &PDU__RRM__ClassmarkChange__MS__NW_descr_; }
PDU__RRM__ClassmarkChange__MS__NW& PDU__RRM__ClassmarkChange__MS__NW::operator=(const PDU__RRM__ClassmarkChange__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_ClassmarkChange_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
  else field_mobileStationClassmark2.clean_up();
  if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
  else field_mobileStationClassmark3.clean_up();
}
return *this;
}

boolean PDU__RRM__ClassmarkChange__MS__NW::operator==(const PDU__RRM__ClassmarkChange__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_mobileStationClassmark2==other_value.field_mobileStationClassmark2
  && field_mobileStationClassmark3==other_value.field_mobileStationClassmark3;
}

boolean PDU__RRM__ClassmarkChange__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_mobileStationClassmark2.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_bound());
}
boolean PDU__RRM__ClassmarkChange__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_mobileStationClassmark2.is_value()
  && (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_value());
}
int PDU__RRM__ClassmarkChange__MS__NW::size_of() const
{
  int ret_val = 2;
  if (field_mobileStationClassmark3.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__ClassmarkChange__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(", mobileStationClassmark2 := ");
field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ClassmarkChange__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (mobileStationClassmark2().is_bound()) mobileStationClassmark2().set_implicit_omit();
if (!mobileStationClassmark3().is_bound()) mobileStationClassmark3() = OMIT_VALUE;
else mobileStationClassmark3().set_implicit_omit();
}

void PDU__RRM__ClassmarkChange__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_ClassmarkChange_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) mobileStationClassmark2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().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(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_ClassmarkChange_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW");
  }
}

void PDU__RRM__ClassmarkChange__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_mobileStationClassmark2.encode_text(text_buf);
field_mobileStationClassmark3.encode_text(text_buf);
}

void PDU__RRM__ClassmarkChange__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_mobileStationClassmark2.decode_text(text_buf);
field_mobileStationClassmark3.decode_text(text_buf);
}

void PDU__RRM__ClassmarkChange__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__ClassmarkChange__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__ClassmarkChange__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_mobileStationClassmark2.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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_mobileStationClassmark3 = 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::MobileStationClassmark3__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark3().RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark3 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileStationClassmark3.ispresent() || field_mobileStationClassmark3().elementIdentifier() !=  os_34){
  field_mobileStationClassmark3=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileStationClassmark3=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__ClassmarkChange__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, MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_.raw);
  if (field_mobileStationClassmark3.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::MobileStationClassmark3__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_mobileStationClassmark2.RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark2__LV_descr_, *myleaf.body.node.nodes[1]);
  if (field_mobileStationClassmark3.ispresent()) {
  encoded_length += field_mobileStationClassmark3().RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_mobileStationClassmark3.ispresent() && (!field_mobileStationClassmark3.ispresent() || field_mobileStationClassmark3().elementIdentifier() !=  os_34)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={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_34.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ClassmarkChange__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template field_mobileStationClassmark2;
MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template field_mobileStationClassmark3;
};

void PDU__RRM__ClassmarkChange__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_mobileStationClassmark2 = ANY_VALUE;
single_value->field_mobileStationClassmark3 = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ClassmarkChange__MS__NW_template::copy_value(const PDU__RRM__ClassmarkChange__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.mobileStationClassmark2().is_bound()) {
  single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
  single_value->field_mobileStationClassmark2.clean_up();
}
if (other_value.mobileStationClassmark3().is_bound()) {
  if (other_value.mobileStationClassmark3().ispresent()) single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3()();
  else single_value->field_mobileStationClassmark3 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark3.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ClassmarkChange__MS__NW_template::copy_template(const PDU__RRM__ClassmarkChange__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.mobileStationClassmark2().get_selection()) {
single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
single_value->field_mobileStationClassmark2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark3().get_selection()) {
single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
} else {
single_value->field_mobileStationClassmark3.clean_up();
}
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__ClassmarkChange__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__ClassmarkChange__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ClassmarkChange__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_ClassmarkChange_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__ClassmarkChange__MS__NW_template::PDU__RRM__ClassmarkChange__MS__NW_template()
{
}

PDU__RRM__ClassmarkChange__MS__NW_template::PDU__RRM__ClassmarkChange__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__ClassmarkChange__MS__NW_template::PDU__RRM__ClassmarkChange__MS__NW_template(const PDU__RRM__ClassmarkChange__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__ClassmarkChange__MS__NW_template::PDU__RRM__ClassmarkChange__MS__NW_template(const OPTIONAL<PDU__RRM__ClassmarkChange__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ClassmarkChange__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_ClassmarkChange_MS_NW from an unbound optional field.");
}
}

PDU__RRM__ClassmarkChange__MS__NW_template::PDU__RRM__ClassmarkChange__MS__NW_template(PDU__RRM__ClassmarkChange__MS__NW_template* p_precondition, PDU__RRM__ClassmarkChange__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__ClassmarkChange__MS__NW_template::PDU__RRM__ClassmarkChange__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__ClassmarkChange__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__ClassmarkChange__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__ClassmarkChange__MS__NW_template::PDU__RRM__ClassmarkChange__MS__NW_template(const PDU__RRM__ClassmarkChange__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__ClassmarkChange__MS__NW_template::~PDU__RRM__ClassmarkChange__MS__NW_template()
{
clean_up();
}

PDU__RRM__ClassmarkChange__MS__NW_template& PDU__RRM__ClassmarkChange__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__ClassmarkChange__MS__NW_template& PDU__RRM__ClassmarkChange__MS__NW_template::operator=(const PDU__RRM__ClassmarkChange__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__ClassmarkChange__MS__NW_template& PDU__RRM__ClassmarkChange__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__ClassmarkChange__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ClassmarkChange__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_ClassmarkChange_MS_NW.");
}
return *this;
}

PDU__RRM__ClassmarkChange__MS__NW_template& PDU__RRM__ClassmarkChange__MS__NW_template::operator=(const PDU__RRM__ClassmarkChange__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__ClassmarkChange__MS__NW_template::match(const PDU__RRM__ClassmarkChange__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.mobileStationClassmark2().is_bound()) return FALSE;
if(!single_value->field_mobileStationClassmark2.match(other_value.mobileStationClassmark2(), legacy))return FALSE;
if(!other_value.mobileStationClassmark3().is_bound()) return FALSE;
if((other_value.mobileStationClassmark3().ispresent() ? !single_value->field_mobileStationClassmark3.match((const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV&)other_value.mobileStationClassmark3(), legacy) : !single_value->field_mobileStationClassmark3.match_omit(legacy)))return FALSE;
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_ClassmarkChange_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__ClassmarkChange__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_mobileStationClassmark2.is_bound()
 || (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_bound());
}

boolean PDU__RRM__ClassmarkChange__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_mobileStationClassmark2.is_value()
 && (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_value());
}

void PDU__RRM__ClassmarkChange__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__ClassmarkChange__MS__NW PDU__RRM__ClassmarkChange__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_ClassmarkChange_MS_NW.");
PDU__RRM__ClassmarkChange__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_mobileStationClassmark2.is_bound()) {
ret_val.mobileStationClassmark2() = single_value->field_mobileStationClassmark2.valueof();
}
if (single_value->field_mobileStationClassmark3.is_omit()) ret_val.mobileStationClassmark3() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark3.is_bound()) {
ret_val.mobileStationClassmark3() = single_value->field_mobileStationClassmark3.valueof();
}
return ret_val;
}

void PDU__RRM__ClassmarkChange__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_ClassmarkChange_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ClassmarkChange__MS__NW_template[list_length];
}

PDU__RRM__ClassmarkChange__MS__NW_template& PDU__RRM__ClassmarkChange__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_ClassmarkChange_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_ClassmarkChange_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__ClassmarkChange__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__ClassmarkChange__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_ClassmarkChange_MS_NW.");
return single_value->field_messageType;
}

MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__RRM__ClassmarkChange__MS__NW_template::mobileStationClassmark2()
{
set_specific();
return single_value->field_mobileStationClassmark2;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__LV_template& PDU__RRM__ClassmarkChange__MS__NW_template::mobileStationClassmark2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW.");
return single_value->field_mobileStationClassmark2;
}

MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__RRM__ClassmarkChange__MS__NW_template::mobileStationClassmark3()
{
set_specific();
return single_value->field_mobileStationClassmark3;
}

const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__RRM__ClassmarkChange__MS__NW_template::mobileStationClassmark3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark3 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW.");
return single_value->field_mobileStationClassmark3;
}

int PDU__RRM__ClassmarkChange__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_mobileStationClassmark3.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_ClassmarkChange_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_ClassmarkChange_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_ClassmarkChange_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_ClassmarkChange_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_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_ClassmarkChange_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW.");
  }
  return 0;
}

void PDU__RRM__ClassmarkChange__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(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
single_value->field_mobileStationClassmark3.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__ClassmarkChange__MS__NW_template::log_match(const PDU__RRM__ClassmarkChange__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_mobileStationClassmark2.match(match_value.mobileStationClassmark2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mobileStationClassmark3().ispresent()){
if(!single_value->field_mobileStationClassmark3.match(match_value.mobileStationClassmark3(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark3");
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}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(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
if (match_value.mobileStationClassmark3().ispresent()) {
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark3.log();
if (single_value->field_mobileStationClassmark3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} 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__ClassmarkChange__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (mobileStationClassmark2().is_bound()) mobileStationClassmark2().set_implicit_omit();
if (!mobileStationClassmark3().is_bound()) mobileStationClassmark3() = OMIT_VALUE;
else mobileStationClassmark3().set_implicit_omit();
}

void PDU__RRM__ClassmarkChange__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_mobileStationClassmark2.encode_text(text_buf);
single_value->field_mobileStationClassmark3.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_ClassmarkChange_MS_NW.");
}
}

void PDU__RRM__ClassmarkChange__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_mobileStationClassmark2.decode_text(text_buf);
single_value->field_mobileStationClassmark3.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__ClassmarkChange__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_ClassmarkChange_MS_NW.");
}
}

void PDU__RRM__ClassmarkChange__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__ClassmarkChange__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_ClassmarkChange_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) mobileStationClassmark2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().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(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_ClassmarkChange_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ClassmarkChange__MS__NW_template* precondition = new PDU__RRM__ClassmarkChange__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ClassmarkChange__MS__NW_template* implied_template = new PDU__RRM__ClassmarkChange__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ClassmarkChange__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ClassmarkChange__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_ClassmarkChange_MS_NW");
single_value->field_mobileStationClassmark2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_MS_NW");
single_value->field_mobileStationClassmark3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ClassmarkChange_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_ClassmarkChange_MS_NW");
}

boolean PDU__RRM__ClassmarkChange__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__ClassmarkChange__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__UTRAN__ClassmarkChange__MS__NW::PDU__RRM__UTRAN__ClassmarkChange__MS__NW()
{
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW::PDU__RRM__UTRAN__ClassmarkChange__MS__NW(const BITSTRING& par_messageType,
    const UTRAN__Classmark__LV& par_uTRAN__Classmark)
  :   field_messageType(par_messageType),
  field_uTRAN__Classmark(par_uTRAN__Classmark)
{
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW::PDU__RRM__UTRAN__ClassmarkChange__MS__NW(const PDU__RRM__UTRAN__ClassmarkChange__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.uTRAN__Classmark().is_bound()) field_uTRAN__Classmark = other_value.uTRAN__Classmark();
else field_uTRAN__Classmark.clean_up();
}

void PDU__RRM__UTRAN__ClassmarkChange__MS__NW::clean_up()
{
field_messageType.clean_up();
field_uTRAN__Classmark.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__UTRAN__ClassmarkChange__MS__NW::get_descriptor() const { return &PDU__RRM__UTRAN__ClassmarkChange__MS__NW_descr_; }
PDU__RRM__UTRAN__ClassmarkChange__MS__NW& PDU__RRM__UTRAN__ClassmarkChange__MS__NW::operator=(const PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.uTRAN__Classmark().is_bound()) field_uTRAN__Classmark = other_value.uTRAN__Classmark();
  else field_uTRAN__Classmark.clean_up();
}
return *this;
}

boolean PDU__RRM__UTRAN__ClassmarkChange__MS__NW::operator==(const PDU__RRM__UTRAN__ClassmarkChange__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_uTRAN__Classmark==other_value.field_uTRAN__Classmark;
}

boolean PDU__RRM__UTRAN__ClassmarkChange__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_uTRAN__Classmark.is_bound());
}
boolean PDU__RRM__UTRAN__ClassmarkChange__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_uTRAN__Classmark.is_value();
}
void PDU__RRM__UTRAN__ClassmarkChange__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(", uTRAN_Classmark := ");
field_uTRAN__Classmark.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__UTRAN__ClassmarkChange__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (uTRAN__Classmark().is_bound()) uTRAN__Classmark().set_implicit_omit();
}

void PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_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) uTRAN__Classmark().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(), "uTRAN_Classmark")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRAN__Classmark().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_UTRAN_ClassmarkChange_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_MS_NW");
  }
}

void PDU__RRM__UTRAN__ClassmarkChange__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_uTRAN__Classmark.encode_text(text_buf);
}

void PDU__RRM__UTRAN__ClassmarkChange__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_uTRAN__Classmark.decode_text(text_buf);
}

void PDU__RRM__UTRAN__ClassmarkChange__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__UTRAN__ClassmarkChange__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__UTRAN__ClassmarkChange__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, UTRAN__Classmark__LV_descr_.raw->forceomit);
  decoded_field_length = field_uTRAN__Classmark.RAW_decode(UTRAN__Classmark__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__UTRAN__ClassmarkChange__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, UTRAN__Classmark__LV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_uTRAN__Classmark.RAW_encode(UTRAN__Classmark__LV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
UTRAN__Classmark__LV_template field_uTRAN__Classmark;
};

void PDU__RRM__UTRAN__ClassmarkChange__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_uTRAN__Classmark = ANY_VALUE;
}
}
}

void PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::copy_value(const PDU__RRM__UTRAN__ClassmarkChange__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.uTRAN__Classmark().is_bound()) {
  single_value->field_uTRAN__Classmark = other_value.uTRAN__Classmark();
} else {
  single_value->field_uTRAN__Classmark.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::copy_template(const PDU__RRM__UTRAN__ClassmarkChange__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.uTRAN__Classmark().get_selection()) {
single_value->field_uTRAN__Classmark = other_value.uTRAN__Classmark();
} else {
single_value->field_uTRAN__Classmark.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__UTRAN__ClassmarkChange__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__UTRAN__ClassmarkChange__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template()
{
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(const PDU__RRM__UTRAN__ClassmarkChange__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(const OPTIONAL<PDU__RRM__UTRAN__ClassmarkChange__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_MS_NW from an unbound optional field.");
}
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template* p_precondition, PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__UTRAN__ClassmarkChange__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__UTRAN__ClassmarkChange__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(const PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::~PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template()
{
clean_up();
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template& PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template& PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::operator=(const PDU__RRM__UTRAN__ClassmarkChange__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template& PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__UTRAN__ClassmarkChange__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_MS_NW.");
}
return *this;
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template& PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::operator=(const PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::match(const PDU__RRM__UTRAN__ClassmarkChange__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.uTRAN__Classmark().is_bound()) return FALSE;
if(!single_value->field_uTRAN__Classmark.match(other_value.uTRAN__Classmark(), 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_UTRAN_ClassmarkChange_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__UTRAN__ClassmarkChange__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_uTRAN__Classmark.is_bound();
}

boolean PDU__RRM__UTRAN__ClassmarkChange__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_uTRAN__Classmark.is_value();
}

void PDU__RRM__UTRAN__ClassmarkChange__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__UTRAN__ClassmarkChange__MS__NW PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_MS_NW.");
PDU__RRM__UTRAN__ClassmarkChange__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_uTRAN__Classmark.is_bound()) {
ret_val.uTRAN__Classmark() = single_value->field_uTRAN__Classmark.valueof();
}
return ret_val;
}

void PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template[list_length];
}

PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template& PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_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_UTRAN_ClassmarkChange_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_MS_NW.");
return single_value->field_messageType;
}

UTRAN__Classmark__LV_template& PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::uTRAN__Classmark()
{
set_specific();
return single_value->field_uTRAN__Classmark;
}

const UTRAN__Classmark__LV_template& PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::uTRAN__Classmark() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uTRAN_Classmark of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_MS_NW.");
return single_value->field_uTRAN__Classmark;
}

int PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_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_UTRAN_ClassmarkChange_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_UTRAN_ClassmarkChange_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_UTRAN_ClassmarkChange_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_UTRAN_ClassmarkChange_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_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_UTRAN_ClassmarkChange_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_MS_NW.");
  }
  return 0;
}

void PDU__RRM__UTRAN__ClassmarkChange__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(", uTRAN_Classmark := ");
single_value->field_uTRAN__Classmark.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__UTRAN__ClassmarkChange__MS__NW_template::log_match(const PDU__RRM__UTRAN__ClassmarkChange__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_uTRAN__Classmark.match(match_value.uTRAN__Classmark(), legacy)){
TTCN_Logger::log_logmatch_info(".uTRAN_Classmark");
single_value->field_uTRAN__Classmark.log_match(match_value.uTRAN__Classmark(), 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(", uTRAN_Classmark := ");
single_value->field_uTRAN__Classmark.log_match(match_value.uTRAN__Classmark(), 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__UTRAN__ClassmarkChange__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (uTRAN__Classmark().is_bound()) uTRAN__Classmark().set_implicit_omit();
}

void PDU__RRM__UTRAN__ClassmarkChange__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_uTRAN__Classmark.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_UTRAN_ClassmarkChange_MS_NW.");
}
}

void PDU__RRM__UTRAN__ClassmarkChange__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_uTRAN__Classmark.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__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_MS_NW.");
}
}

void PDU__RRM__UTRAN__ClassmarkChange__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__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_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) uTRAN__Classmark().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(), "uTRAN_Classmark")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRAN__Classmark().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_UTRAN_ClassmarkChange_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template* precondition = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template* implied_template = new PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__UTRAN__ClassmarkChange__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_UTRAN_ClassmarkChange_MS_NW");
single_value->field_uTRAN__Classmark.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_UTRAN_ClassmarkChange_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_UTRAN_ClassmarkChange_MS_NW");
}

boolean PDU__RRM__UTRAN__ClassmarkChange__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__UTRAN__ClassmarkChange__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__CDMA2000__ClassmarkChange__MS__NW::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW()
{
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::Type4__LV& par_terminalInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_securityStatus,
    const MobileL3__CommonIE__Types::Type4__LV& par_bandClassInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_powerClassInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_operatingModeInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_serviceOptionInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_multiplexOptionInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_powerControlInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_capabilityInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_channelConfigurationCapabilityInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_extMultiplexOptionInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_bandSubclassInformation,
    const MobileL3__CommonIE__Types::Type4__LV& par_encryptionCapability)
  :   field_messageType(par_messageType),
  field_terminalInformation(par_terminalInformation),
  field_securityStatus(par_securityStatus),
  field_bandClassInformation(par_bandClassInformation),
  field_powerClassInformation(par_powerClassInformation),
  field_operatingModeInformation(par_operatingModeInformation),
  field_serviceOptionInformation(par_serviceOptionInformation),
  field_multiplexOptionInformation(par_multiplexOptionInformation),
  field_powerControlInformation(par_powerControlInformation),
  field_capabilityInformation(par_capabilityInformation),
  field_channelConfigurationCapabilityInformation(par_channelConfigurationCapabilityInformation),
  field_extMultiplexOptionInformation(par_extMultiplexOptionInformation),
  field_bandSubclassInformation(par_bandSubclassInformation),
  field_encryptionCapability(par_encryptionCapability)
{
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW(const PDU__RRM__CDMA2000__ClassmarkChange__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.terminalInformation().is_bound()) field_terminalInformation = other_value.terminalInformation();
else field_terminalInformation.clean_up();
if (other_value.securityStatus().is_bound()) field_securityStatus = other_value.securityStatus();
else field_securityStatus.clean_up();
if (other_value.bandClassInformation().is_bound()) field_bandClassInformation = other_value.bandClassInformation();
else field_bandClassInformation.clean_up();
if (other_value.powerClassInformation().is_bound()) field_powerClassInformation = other_value.powerClassInformation();
else field_powerClassInformation.clean_up();
if (other_value.operatingModeInformation().is_bound()) field_operatingModeInformation = other_value.operatingModeInformation();
else field_operatingModeInformation.clean_up();
if (other_value.serviceOptionInformation().is_bound()) field_serviceOptionInformation = other_value.serviceOptionInformation();
else field_serviceOptionInformation.clean_up();
if (other_value.multiplexOptionInformation().is_bound()) field_multiplexOptionInformation = other_value.multiplexOptionInformation();
else field_multiplexOptionInformation.clean_up();
if (other_value.powerControlInformation().is_bound()) field_powerControlInformation = other_value.powerControlInformation();
else field_powerControlInformation.clean_up();
if (other_value.capabilityInformation().is_bound()) field_capabilityInformation = other_value.capabilityInformation();
else field_capabilityInformation.clean_up();
if (other_value.channelConfigurationCapabilityInformation().is_bound()) field_channelConfigurationCapabilityInformation = other_value.channelConfigurationCapabilityInformation();
else field_channelConfigurationCapabilityInformation.clean_up();
if (other_value.extMultiplexOptionInformation().is_bound()) field_extMultiplexOptionInformation = other_value.extMultiplexOptionInformation();
else field_extMultiplexOptionInformation.clean_up();
if (other_value.bandSubclassInformation().is_bound()) field_bandSubclassInformation = other_value.bandSubclassInformation();
else field_bandSubclassInformation.clean_up();
if (other_value.encryptionCapability().is_bound()) field_encryptionCapability = other_value.encryptionCapability();
else field_encryptionCapability.clean_up();
}

void PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::clean_up()
{
field_messageType.clean_up();
field_terminalInformation.clean_up();
field_securityStatus.clean_up();
field_bandClassInformation.clean_up();
field_powerClassInformation.clean_up();
field_operatingModeInformation.clean_up();
field_serviceOptionInformation.clean_up();
field_multiplexOptionInformation.clean_up();
field_powerControlInformation.clean_up();
field_capabilityInformation.clean_up();
field_channelConfigurationCapabilityInformation.clean_up();
field_extMultiplexOptionInformation.clean_up();
field_bandSubclassInformation.clean_up();
field_encryptionCapability.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::get_descriptor() const { return &PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_descr_; }
PDU__RRM__CDMA2000__ClassmarkChange__MS__NW& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::operator=(const PDU__RRM__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.terminalInformation().is_bound()) field_terminalInformation = other_value.terminalInformation();
  else field_terminalInformation.clean_up();
  if (other_value.securityStatus().is_bound()) field_securityStatus = other_value.securityStatus();
  else field_securityStatus.clean_up();
  if (other_value.bandClassInformation().is_bound()) field_bandClassInformation = other_value.bandClassInformation();
  else field_bandClassInformation.clean_up();
  if (other_value.powerClassInformation().is_bound()) field_powerClassInformation = other_value.powerClassInformation();
  else field_powerClassInformation.clean_up();
  if (other_value.operatingModeInformation().is_bound()) field_operatingModeInformation = other_value.operatingModeInformation();
  else field_operatingModeInformation.clean_up();
  if (other_value.serviceOptionInformation().is_bound()) field_serviceOptionInformation = other_value.serviceOptionInformation();
  else field_serviceOptionInformation.clean_up();
  if (other_value.multiplexOptionInformation().is_bound()) field_multiplexOptionInformation = other_value.multiplexOptionInformation();
  else field_multiplexOptionInformation.clean_up();
  if (other_value.powerControlInformation().is_bound()) field_powerControlInformation = other_value.powerControlInformation();
  else field_powerControlInformation.clean_up();
  if (other_value.capabilityInformation().is_bound()) field_capabilityInformation = other_value.capabilityInformation();
  else field_capabilityInformation.clean_up();
  if (other_value.channelConfigurationCapabilityInformation().is_bound()) field_channelConfigurationCapabilityInformation = other_value.channelConfigurationCapabilityInformation();
  else field_channelConfigurationCapabilityInformation.clean_up();
  if (other_value.extMultiplexOptionInformation().is_bound()) field_extMultiplexOptionInformation = other_value.extMultiplexOptionInformation();
  else field_extMultiplexOptionInformation.clean_up();
  if (other_value.bandSubclassInformation().is_bound()) field_bandSubclassInformation = other_value.bandSubclassInformation();
  else field_bandSubclassInformation.clean_up();
  if (other_value.encryptionCapability().is_bound()) field_encryptionCapability = other_value.encryptionCapability();
  else field_encryptionCapability.clean_up();
}
return *this;
}

boolean PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::operator==(const PDU__RRM__CDMA2000__ClassmarkChange__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_terminalInformation==other_value.field_terminalInformation
  && field_securityStatus==other_value.field_securityStatus
  && field_bandClassInformation==other_value.field_bandClassInformation
  && field_powerClassInformation==other_value.field_powerClassInformation
  && field_operatingModeInformation==other_value.field_operatingModeInformation
  && field_serviceOptionInformation==other_value.field_serviceOptionInformation
  && field_multiplexOptionInformation==other_value.field_multiplexOptionInformation
  && field_powerControlInformation==other_value.field_powerControlInformation
  && field_capabilityInformation==other_value.field_capabilityInformation
  && field_channelConfigurationCapabilityInformation==other_value.field_channelConfigurationCapabilityInformation
  && field_extMultiplexOptionInformation==other_value.field_extMultiplexOptionInformation
  && field_bandSubclassInformation==other_value.field_bandSubclassInformation
  && field_encryptionCapability==other_value.field_encryptionCapability;
}

boolean PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_terminalInformation.is_bound())
  || (field_securityStatus.is_bound())
  || (field_bandClassInformation.is_bound())
  || (field_powerClassInformation.is_bound())
  || (field_operatingModeInformation.is_bound())
  || (field_serviceOptionInformation.is_bound())
  || (field_multiplexOptionInformation.is_bound())
  || (field_powerControlInformation.is_bound())
  || (field_capabilityInformation.is_bound())
  || (field_channelConfigurationCapabilityInformation.is_bound())
  || (field_extMultiplexOptionInformation.is_bound())
  || (field_bandSubclassInformation.is_bound())
  || (field_encryptionCapability.is_bound());
}
boolean PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_terminalInformation.is_value()
  && field_securityStatus.is_value()
  && field_bandClassInformation.is_value()
  && field_powerClassInformation.is_value()
  && field_operatingModeInformation.is_value()
  && field_serviceOptionInformation.is_value()
  && field_multiplexOptionInformation.is_value()
  && field_powerControlInformation.is_value()
  && field_capabilityInformation.is_value()
  && field_channelConfigurationCapabilityInformation.is_value()
  && field_extMultiplexOptionInformation.is_value()
  && field_bandSubclassInformation.is_value()
  && field_encryptionCapability.is_value();
}
void PDU__RRM__CDMA2000__ClassmarkChange__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(", terminalInformation := ");
field_terminalInformation.log();
TTCN_Logger::log_event_str(", securityStatus := ");
field_securityStatus.log();
TTCN_Logger::log_event_str(", bandClassInformation := ");
field_bandClassInformation.log();
TTCN_Logger::log_event_str(", powerClassInformation := ");
field_powerClassInformation.log();
TTCN_Logger::log_event_str(", operatingModeInformation := ");
field_operatingModeInformation.log();
TTCN_Logger::log_event_str(", serviceOptionInformation := ");
field_serviceOptionInformation.log();
TTCN_Logger::log_event_str(", multiplexOptionInformation := ");
field_multiplexOptionInformation.log();
TTCN_Logger::log_event_str(", powerControlInformation := ");
field_powerControlInformation.log();
TTCN_Logger::log_event_str(", capabilityInformation := ");
field_capabilityInformation.log();
TTCN_Logger::log_event_str(", channelConfigurationCapabilityInformation := ");
field_channelConfigurationCapabilityInformation.log();
TTCN_Logger::log_event_str(", extMultiplexOptionInformation := ");
field_extMultiplexOptionInformation.log();
TTCN_Logger::log_event_str(", bandSubclassInformation := ");
field_bandSubclassInformation.log();
TTCN_Logger::log_event_str(", encryptionCapability := ");
field_encryptionCapability.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (terminalInformation().is_bound()) terminalInformation().set_implicit_omit();
if (securityStatus().is_bound()) securityStatus().set_implicit_omit();
if (bandClassInformation().is_bound()) bandClassInformation().set_implicit_omit();
if (powerClassInformation().is_bound()) powerClassInformation().set_implicit_omit();
if (operatingModeInformation().is_bound()) operatingModeInformation().set_implicit_omit();
if (serviceOptionInformation().is_bound()) serviceOptionInformation().set_implicit_omit();
if (multiplexOptionInformation().is_bound()) multiplexOptionInformation().set_implicit_omit();
if (powerControlInformation().is_bound()) powerControlInformation().set_implicit_omit();
if (capabilityInformation().is_bound()) capabilityInformation().set_implicit_omit();
if (channelConfigurationCapabilityInformation().is_bound()) channelConfigurationCapabilityInformation().set_implicit_omit();
if (extMultiplexOptionInformation().is_bound()) extMultiplexOptionInformation().set_implicit_omit();
if (bandSubclassInformation().is_bound()) bandSubclassInformation().set_implicit_omit();
if (encryptionCapability().is_bound()) encryptionCapability().set_implicit_omit();
}

void PDU__RRM__CDMA2000__ClassmarkChange__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 (14<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW has 14 fields but 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) terminalInformation().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) securityStatus().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bandClassInformation().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) powerClassInformation().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) operatingModeInformation().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) serviceOptionInformation().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) multiplexOptionInformation().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) powerControlInformation().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) capabilityInformation().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) channelConfigurationCapabilityInformation().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) extMultiplexOptionInformation().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) bandSubclassInformation().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) encryptionCapability().set_param(*param.get_elem(13));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "terminalInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          terminalInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "securityStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          securityStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bandClassInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bandClassInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "powerClassInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          powerClassInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operatingModeInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operatingModeInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "serviceOptionInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          serviceOptionInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multiplexOptionInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multiplexOptionInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "powerControlInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          powerControlInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "capabilityInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          capabilityInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelConfigurationCapabilityInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelConfigurationCapabilityInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extMultiplexOptionInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extMultiplexOptionInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bandSubclassInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bandSubclassInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "encryptionCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          encryptionCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_CDMA2000_ClassmarkChange_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
  }
}

void PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_terminalInformation.encode_text(text_buf);
field_securityStatus.encode_text(text_buf);
field_bandClassInformation.encode_text(text_buf);
field_powerClassInformation.encode_text(text_buf);
field_operatingModeInformation.encode_text(text_buf);
field_serviceOptionInformation.encode_text(text_buf);
field_multiplexOptionInformation.encode_text(text_buf);
field_powerControlInformation.encode_text(text_buf);
field_capabilityInformation.encode_text(text_buf);
field_channelConfigurationCapabilityInformation.encode_text(text_buf);
field_extMultiplexOptionInformation.encode_text(text_buf);
field_bandSubclassInformation.encode_text(text_buf);
field_encryptionCapability.encode_text(text_buf);
}

void PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_terminalInformation.decode_text(text_buf);
field_securityStatus.decode_text(text_buf);
field_bandClassInformation.decode_text(text_buf);
field_powerClassInformation.decode_text(text_buf);
field_operatingModeInformation.decode_text(text_buf);
field_serviceOptionInformation.decode_text(text_buf);
field_multiplexOptionInformation.decode_text(text_buf);
field_powerControlInformation.decode_text(text_buf);
field_capabilityInformation.decode_text(text_buf);
field_channelConfigurationCapabilityInformation.decode_text(text_buf);
field_extMultiplexOptionInformation.decode_text(text_buf);
field_bandSubclassInformation.decode_text(text_buf);
field_encryptionCapability.decode_text(text_buf);
}

void PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__CDMA2000__ClassmarkChange__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__CDMA2000__ClassmarkChange__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::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_terminalInformation.RAW_decode(MobileL3__CommonIE__Types::Type4__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::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_securityStatus.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, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_bandClassInformation.RAW_decode(MobileL3__CommonIE__Types::Type4__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::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_powerClassInformation.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_operatingModeInformation.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_serviceOptionInformation.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_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_multiplexOptionInformation.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());
  RAW_Force_Omit field_8_force_omit(8, force_omit, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_powerControlInformation.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_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_capabilityInformation.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());
  RAW_Force_Omit field_10_force_omit(10, force_omit, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_channelConfigurationCapabilityInformation.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_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, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_extMultiplexOptionInformation.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_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());
  RAW_Force_Omit field_12_force_omit(12, force_omit, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_bandSubclassInformation.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_13_force_omit(13, force_omit, MobileL3__CommonIE__Types::Type4__LV_descr_.raw->forceomit);
  decoded_field_length = field_encryptionCapability.RAW_decode(MobileL3__CommonIE__Types::Type4__LV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 0) return 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__CDMA2000__ClassmarkChange__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 = 14;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(14);
  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::Type4__LV_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, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, MobileL3__CommonIE__Types::Type4__LV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_terminalInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_securityStatus.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_bandClassInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_powerClassInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_operatingModeInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_serviceOptionInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_multiplexOptionInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_powerControlInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_capabilityInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_channelConfigurationCapabilityInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[10]);
  encoded_length += field_extMultiplexOptionInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[11]);
  encoded_length += field_bandSubclassInformation.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[12]);
  encoded_length += field_encryptionCapability.RAW_encode(MobileL3__CommonIE__Types::Type4__LV_descr_, *myleaf.body.node.nodes[13]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::Type4__LV_template field_terminalInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_securityStatus;
MobileL3__CommonIE__Types::Type4__LV_template field_bandClassInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_powerClassInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_operatingModeInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_serviceOptionInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_multiplexOptionInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_powerControlInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_capabilityInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_channelConfigurationCapabilityInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_extMultiplexOptionInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_bandSubclassInformation;
MobileL3__CommonIE__Types::Type4__LV_template field_encryptionCapability;
};

void PDU__RRM__CDMA2000__ClassmarkChange__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_terminalInformation = ANY_VALUE;
single_value->field_securityStatus = ANY_VALUE;
single_value->field_bandClassInformation = ANY_VALUE;
single_value->field_powerClassInformation = ANY_VALUE;
single_value->field_operatingModeInformation = ANY_VALUE;
single_value->field_serviceOptionInformation = ANY_VALUE;
single_value->field_multiplexOptionInformation = ANY_VALUE;
single_value->field_powerControlInformation = ANY_VALUE;
single_value->field_capabilityInformation = ANY_VALUE;
single_value->field_channelConfigurationCapabilityInformation = ANY_VALUE;
single_value->field_extMultiplexOptionInformation = ANY_VALUE;
single_value->field_bandSubclassInformation = ANY_VALUE;
single_value->field_encryptionCapability = ANY_VALUE;
}
}
}

void PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::copy_value(const PDU__RRM__CDMA2000__ClassmarkChange__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.terminalInformation().is_bound()) {
  single_value->field_terminalInformation = other_value.terminalInformation();
} else {
  single_value->field_terminalInformation.clean_up();
}
if (other_value.securityStatus().is_bound()) {
  single_value->field_securityStatus = other_value.securityStatus();
} else {
  single_value->field_securityStatus.clean_up();
}
if (other_value.bandClassInformation().is_bound()) {
  single_value->field_bandClassInformation = other_value.bandClassInformation();
} else {
  single_value->field_bandClassInformation.clean_up();
}
if (other_value.powerClassInformation().is_bound()) {
  single_value->field_powerClassInformation = other_value.powerClassInformation();
} else {
  single_value->field_powerClassInformation.clean_up();
}
if (other_value.operatingModeInformation().is_bound()) {
  single_value->field_operatingModeInformation = other_value.operatingModeInformation();
} else {
  single_value->field_operatingModeInformation.clean_up();
}
if (other_value.serviceOptionInformation().is_bound()) {
  single_value->field_serviceOptionInformation = other_value.serviceOptionInformation();
} else {
  single_value->field_serviceOptionInformation.clean_up();
}
if (other_value.multiplexOptionInformation().is_bound()) {
  single_value->field_multiplexOptionInformation = other_value.multiplexOptionInformation();
} else {
  single_value->field_multiplexOptionInformation.clean_up();
}
if (other_value.powerControlInformation().is_bound()) {
  single_value->field_powerControlInformation = other_value.powerControlInformation();
} else {
  single_value->field_powerControlInformation.clean_up();
}
if (other_value.capabilityInformation().is_bound()) {
  single_value->field_capabilityInformation = other_value.capabilityInformation();
} else {
  single_value->field_capabilityInformation.clean_up();
}
if (other_value.channelConfigurationCapabilityInformation().is_bound()) {
  single_value->field_channelConfigurationCapabilityInformation = other_value.channelConfigurationCapabilityInformation();
} else {
  single_value->field_channelConfigurationCapabilityInformation.clean_up();
}
if (other_value.extMultiplexOptionInformation().is_bound()) {
  single_value->field_extMultiplexOptionInformation = other_value.extMultiplexOptionInformation();
} else {
  single_value->field_extMultiplexOptionInformation.clean_up();
}
if (other_value.bandSubclassInformation().is_bound()) {
  single_value->field_bandSubclassInformation = other_value.bandSubclassInformation();
} else {
  single_value->field_bandSubclassInformation.clean_up();
}
if (other_value.encryptionCapability().is_bound()) {
  single_value->field_encryptionCapability = other_value.encryptionCapability();
} else {
  single_value->field_encryptionCapability.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::copy_template(const PDU__RRM__CDMA2000__ClassmarkChange__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.terminalInformation().get_selection()) {
single_value->field_terminalInformation = other_value.terminalInformation();
} else {
single_value->field_terminalInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.securityStatus().get_selection()) {
single_value->field_securityStatus = other_value.securityStatus();
} else {
single_value->field_securityStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bandClassInformation().get_selection()) {
single_value->field_bandClassInformation = other_value.bandClassInformation();
} else {
single_value->field_bandClassInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.powerClassInformation().get_selection()) {
single_value->field_powerClassInformation = other_value.powerClassInformation();
} else {
single_value->field_powerClassInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.operatingModeInformation().get_selection()) {
single_value->field_operatingModeInformation = other_value.operatingModeInformation();
} else {
single_value->field_operatingModeInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.serviceOptionInformation().get_selection()) {
single_value->field_serviceOptionInformation = other_value.serviceOptionInformation();
} else {
single_value->field_serviceOptionInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multiplexOptionInformation().get_selection()) {
single_value->field_multiplexOptionInformation = other_value.multiplexOptionInformation();
} else {
single_value->field_multiplexOptionInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.powerControlInformation().get_selection()) {
single_value->field_powerControlInformation = other_value.powerControlInformation();
} else {
single_value->field_powerControlInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.capabilityInformation().get_selection()) {
single_value->field_capabilityInformation = other_value.capabilityInformation();
} else {
single_value->field_capabilityInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelConfigurationCapabilityInformation().get_selection()) {
single_value->field_channelConfigurationCapabilityInformation = other_value.channelConfigurationCapabilityInformation();
} else {
single_value->field_channelConfigurationCapabilityInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extMultiplexOptionInformation().get_selection()) {
single_value->field_extMultiplexOptionInformation = other_value.extMultiplexOptionInformation();
} else {
single_value->field_extMultiplexOptionInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bandSubclassInformation().get_selection()) {
single_value->field_bandSubclassInformation = other_value.bandSubclassInformation();
} else {
single_value->field_bandSubclassInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.encryptionCapability().get_selection()) {
single_value->field_encryptionCapability = other_value.encryptionCapability();
} else {
single_value->field_encryptionCapability.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__CDMA2000__ClassmarkChange__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__CDMA2000__ClassmarkChange__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template()
{
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(const PDU__RRM__CDMA2000__ClassmarkChange__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(const OPTIONAL<PDU__RRM__CDMA2000__ClassmarkChange__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_MS_NW from an unbound optional field.");
}
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template* p_precondition, PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__CDMA2000__ClassmarkChange__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__CDMA2000__ClassmarkChange__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(const PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::~PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template()
{
clean_up();
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::operator=(const PDU__RRM__CDMA2000__ClassmarkChange__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__CDMA2000__ClassmarkChange__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_MS_NW.");
}
return *this;
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::operator=(const PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::match(const PDU__RRM__CDMA2000__ClassmarkChange__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.terminalInformation().is_bound()) return FALSE;
if(!single_value->field_terminalInformation.match(other_value.terminalInformation(), legacy))return FALSE;
if(!other_value.securityStatus().is_bound()) return FALSE;
if(!single_value->field_securityStatus.match(other_value.securityStatus(), legacy))return FALSE;
if(!other_value.bandClassInformation().is_bound()) return FALSE;
if(!single_value->field_bandClassInformation.match(other_value.bandClassInformation(), legacy))return FALSE;
if(!other_value.powerClassInformation().is_bound()) return FALSE;
if(!single_value->field_powerClassInformation.match(other_value.powerClassInformation(), legacy))return FALSE;
if(!other_value.operatingModeInformation().is_bound()) return FALSE;
if(!single_value->field_operatingModeInformation.match(other_value.operatingModeInformation(), legacy))return FALSE;
if(!other_value.serviceOptionInformation().is_bound()) return FALSE;
if(!single_value->field_serviceOptionInformation.match(other_value.serviceOptionInformation(), legacy))return FALSE;
if(!other_value.multiplexOptionInformation().is_bound()) return FALSE;
if(!single_value->field_multiplexOptionInformation.match(other_value.multiplexOptionInformation(), legacy))return FALSE;
if(!other_value.powerControlInformation().is_bound()) return FALSE;
if(!single_value->field_powerControlInformation.match(other_value.powerControlInformation(), legacy))return FALSE;
if(!other_value.capabilityInformation().is_bound()) return FALSE;
if(!single_value->field_capabilityInformation.match(other_value.capabilityInformation(), legacy))return FALSE;
if(!other_value.channelConfigurationCapabilityInformation().is_bound()) return FALSE;
if(!single_value->field_channelConfigurationCapabilityInformation.match(other_value.channelConfigurationCapabilityInformation(), legacy))return FALSE;
if(!other_value.extMultiplexOptionInformation().is_bound()) return FALSE;
if(!single_value->field_extMultiplexOptionInformation.match(other_value.extMultiplexOptionInformation(), legacy))return FALSE;
if(!other_value.bandSubclassInformation().is_bound()) return FALSE;
if(!single_value->field_bandSubclassInformation.match(other_value.bandSubclassInformation(), legacy))return FALSE;
if(!other_value.encryptionCapability().is_bound()) return FALSE;
if(!single_value->field_encryptionCapability.match(other_value.encryptionCapability(), 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_CDMA2000_ClassmarkChange_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__CDMA2000__ClassmarkChange__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_terminalInformation.is_bound()
 || single_value->field_securityStatus.is_bound()
 || single_value->field_bandClassInformation.is_bound()
 || single_value->field_powerClassInformation.is_bound()
 || single_value->field_operatingModeInformation.is_bound()
 || single_value->field_serviceOptionInformation.is_bound()
 || single_value->field_multiplexOptionInformation.is_bound()
 || single_value->field_powerControlInformation.is_bound()
 || single_value->field_capabilityInformation.is_bound()
 || single_value->field_channelConfigurationCapabilityInformation.is_bound()
 || single_value->field_extMultiplexOptionInformation.is_bound()
 || single_value->field_bandSubclassInformation.is_bound()
 || single_value->field_encryptionCapability.is_bound();
}

boolean PDU__RRM__CDMA2000__ClassmarkChange__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_terminalInformation.is_value()
 && single_value->field_securityStatus.is_value()
 && single_value->field_bandClassInformation.is_value()
 && single_value->field_powerClassInformation.is_value()
 && single_value->field_operatingModeInformation.is_value()
 && single_value->field_serviceOptionInformation.is_value()
 && single_value->field_multiplexOptionInformation.is_value()
 && single_value->field_powerControlInformation.is_value()
 && single_value->field_capabilityInformation.is_value()
 && single_value->field_channelConfigurationCapabilityInformation.is_value()
 && single_value->field_extMultiplexOptionInformation.is_value()
 && single_value->field_bandSubclassInformation.is_value()
 && single_value->field_encryptionCapability.is_value();
}

void PDU__RRM__CDMA2000__ClassmarkChange__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__CDMA2000__ClassmarkChange__MS__NW PDU__RRM__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_MS_NW.");
PDU__RRM__CDMA2000__ClassmarkChange__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_terminalInformation.is_bound()) {
ret_val.terminalInformation() = single_value->field_terminalInformation.valueof();
}
if (single_value->field_securityStatus.is_bound()) {
ret_val.securityStatus() = single_value->field_securityStatus.valueof();
}
if (single_value->field_bandClassInformation.is_bound()) {
ret_val.bandClassInformation() = single_value->field_bandClassInformation.valueof();
}
if (single_value->field_powerClassInformation.is_bound()) {
ret_val.powerClassInformation() = single_value->field_powerClassInformation.valueof();
}
if (single_value->field_operatingModeInformation.is_bound()) {
ret_val.operatingModeInformation() = single_value->field_operatingModeInformation.valueof();
}
if (single_value->field_serviceOptionInformation.is_bound()) {
ret_val.serviceOptionInformation() = single_value->field_serviceOptionInformation.valueof();
}
if (single_value->field_multiplexOptionInformation.is_bound()) {
ret_val.multiplexOptionInformation() = single_value->field_multiplexOptionInformation.valueof();
}
if (single_value->field_powerControlInformation.is_bound()) {
ret_val.powerControlInformation() = single_value->field_powerControlInformation.valueof();
}
if (single_value->field_capabilityInformation.is_bound()) {
ret_val.capabilityInformation() = single_value->field_capabilityInformation.valueof();
}
if (single_value->field_channelConfigurationCapabilityInformation.is_bound()) {
ret_val.channelConfigurationCapabilityInformation() = single_value->field_channelConfigurationCapabilityInformation.valueof();
}
if (single_value->field_extMultiplexOptionInformation.is_bound()) {
ret_val.extMultiplexOptionInformation() = single_value->field_extMultiplexOptionInformation.valueof();
}
if (single_value->field_bandSubclassInformation.is_bound()) {
ret_val.bandSubclassInformation() = single_value->field_bandSubclassInformation.valueof();
}
if (single_value->field_encryptionCapability.is_bound()) {
ret_val.encryptionCapability() = single_value->field_encryptionCapability.valueof();
}
return ret_val;
}

void PDU__RRM__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template[list_length];
}

PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template& PDU__RRM__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_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_CDMA2000_ClassmarkChange_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_messageType;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::terminalInformation()
{
set_specific();
return single_value->field_terminalInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::terminalInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field terminalInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_terminalInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::securityStatus()
{
set_specific();
return single_value->field_securityStatus;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::securityStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field securityStatus of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_securityStatus;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::bandClassInformation()
{
set_specific();
return single_value->field_bandClassInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::bandClassInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bandClassInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_bandClassInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::powerClassInformation()
{
set_specific();
return single_value->field_powerClassInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::powerClassInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field powerClassInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_powerClassInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::operatingModeInformation()
{
set_specific();
return single_value->field_operatingModeInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::operatingModeInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field operatingModeInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_operatingModeInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::serviceOptionInformation()
{
set_specific();
return single_value->field_serviceOptionInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::serviceOptionInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field serviceOptionInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_serviceOptionInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::multiplexOptionInformation()
{
set_specific();
return single_value->field_multiplexOptionInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::multiplexOptionInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multiplexOptionInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_multiplexOptionInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::powerControlInformation()
{
set_specific();
return single_value->field_powerControlInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::powerControlInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field powerControlInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_powerControlInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::capabilityInformation()
{
set_specific();
return single_value->field_capabilityInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::capabilityInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field capabilityInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_capabilityInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::channelConfigurationCapabilityInformation()
{
set_specific();
return single_value->field_channelConfigurationCapabilityInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::channelConfigurationCapabilityInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelConfigurationCapabilityInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_channelConfigurationCapabilityInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::extMultiplexOptionInformation()
{
set_specific();
return single_value->field_extMultiplexOptionInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::extMultiplexOptionInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extMultiplexOptionInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_extMultiplexOptionInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::bandSubclassInformation()
{
set_specific();
return single_value->field_bandSubclassInformation;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::bandSubclassInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bandSubclassInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_bandSubclassInformation;
}

MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::encryptionCapability()
{
set_specific();
return single_value->field_encryptionCapability;
}

const MobileL3__CommonIE__Types::Type4__LV_template& PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::encryptionCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field encryptionCapability of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
return single_value->field_encryptionCapability;
}

int PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 14;
  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_CDMA2000_ClassmarkChange_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_CDMA2000_ClassmarkChange_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_CDMA2000_ClassmarkChange_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_CDMA2000_ClassmarkChange_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_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_CDMA2000_ClassmarkChange_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW.");
  }
  return 0;
}

void PDU__RRM__CDMA2000__ClassmarkChange__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(", terminalInformation := ");
single_value->field_terminalInformation.log();
TTCN_Logger::log_event_str(", securityStatus := ");
single_value->field_securityStatus.log();
TTCN_Logger::log_event_str(", bandClassInformation := ");
single_value->field_bandClassInformation.log();
TTCN_Logger::log_event_str(", powerClassInformation := ");
single_value->field_powerClassInformation.log();
TTCN_Logger::log_event_str(", operatingModeInformation := ");
single_value->field_operatingModeInformation.log();
TTCN_Logger::log_event_str(", serviceOptionInformation := ");
single_value->field_serviceOptionInformation.log();
TTCN_Logger::log_event_str(", multiplexOptionInformation := ");
single_value->field_multiplexOptionInformation.log();
TTCN_Logger::log_event_str(", powerControlInformation := ");
single_value->field_powerControlInformation.log();
TTCN_Logger::log_event_str(", capabilityInformation := ");
single_value->field_capabilityInformation.log();
TTCN_Logger::log_event_str(", channelConfigurationCapabilityInformation := ");
single_value->field_channelConfigurationCapabilityInformation.log();
TTCN_Logger::log_event_str(", extMultiplexOptionInformation := ");
single_value->field_extMultiplexOptionInformation.log();
TTCN_Logger::log_event_str(", bandSubclassInformation := ");
single_value->field_bandSubclassInformation.log();
TTCN_Logger::log_event_str(", encryptionCapability := ");
single_value->field_encryptionCapability.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__CDMA2000__ClassmarkChange__MS__NW_template::log_match(const PDU__RRM__CDMA2000__ClassmarkChange__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_terminalInformation.match(match_value.terminalInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".terminalInformation");
single_value->field_terminalInformation.log_match(match_value.terminalInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_securityStatus.match(match_value.securityStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".securityStatus");
single_value->field_securityStatus.log_match(match_value.securityStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bandClassInformation.match(match_value.bandClassInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".bandClassInformation");
single_value->field_bandClassInformation.log_match(match_value.bandClassInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_powerClassInformation.match(match_value.powerClassInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".powerClassInformation");
single_value->field_powerClassInformation.log_match(match_value.powerClassInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_operatingModeInformation.match(match_value.operatingModeInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".operatingModeInformation");
single_value->field_operatingModeInformation.log_match(match_value.operatingModeInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_serviceOptionInformation.match(match_value.serviceOptionInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".serviceOptionInformation");
single_value->field_serviceOptionInformation.log_match(match_value.serviceOptionInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_multiplexOptionInformation.match(match_value.multiplexOptionInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".multiplexOptionInformation");
single_value->field_multiplexOptionInformation.log_match(match_value.multiplexOptionInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_powerControlInformation.match(match_value.powerControlInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".powerControlInformation");
single_value->field_powerControlInformation.log_match(match_value.powerControlInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_capabilityInformation.match(match_value.capabilityInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".capabilityInformation");
single_value->field_capabilityInformation.log_match(match_value.capabilityInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_channelConfigurationCapabilityInformation.match(match_value.channelConfigurationCapabilityInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".channelConfigurationCapabilityInformation");
single_value->field_channelConfigurationCapabilityInformation.log_match(match_value.channelConfigurationCapabilityInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_extMultiplexOptionInformation.match(match_value.extMultiplexOptionInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".extMultiplexOptionInformation");
single_value->field_extMultiplexOptionInformation.log_match(match_value.extMultiplexOptionInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bandSubclassInformation.match(match_value.bandSubclassInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".bandSubclassInformation");
single_value->field_bandSubclassInformation.log_match(match_value.bandSubclassInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_encryptionCapability.match(match_value.encryptionCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".encryptionCapability");
single_value->field_encryptionCapability.log_match(match_value.encryptionCapability(), 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(", terminalInformation := ");
single_value->field_terminalInformation.log_match(match_value.terminalInformation(), legacy);
TTCN_Logger::log_event_str(", securityStatus := ");
single_value->field_securityStatus.log_match(match_value.securityStatus(), legacy);
TTCN_Logger::log_event_str(", bandClassInformation := ");
single_value->field_bandClassInformation.log_match(match_value.bandClassInformation(), legacy);
TTCN_Logger::log_event_str(", powerClassInformation := ");
single_value->field_powerClassInformation.log_match(match_value.powerClassInformation(), legacy);
TTCN_Logger::log_event_str(", operatingModeInformation := ");
single_value->field_operatingModeInformation.log_match(match_value.operatingModeInformation(), legacy);
TTCN_Logger::log_event_str(", serviceOptionInformation := ");
single_value->field_serviceOptionInformation.log_match(match_value.serviceOptionInformation(), legacy);
TTCN_Logger::log_event_str(", multiplexOptionInformation := ");
single_value->field_multiplexOptionInformation.log_match(match_value.multiplexOptionInformation(), legacy);
TTCN_Logger::log_event_str(", powerControlInformation := ");
single_value->field_powerControlInformation.log_match(match_value.powerControlInformation(), legacy);
TTCN_Logger::log_event_str(", capabilityInformation := ");
single_value->field_capabilityInformation.log_match(match_value.capabilityInformation(), legacy);
TTCN_Logger::log_event_str(", channelConfigurationCapabilityInformation := ");
single_value->field_channelConfigurationCapabilityInformation.log_match(match_value.channelConfigurationCapabilityInformation(), legacy);
TTCN_Logger::log_event_str(", extMultiplexOptionInformation := ");
single_value->field_extMultiplexOptionInformation.log_match(match_value.extMultiplexOptionInformation(), legacy);
TTCN_Logger::log_event_str(", bandSubclassInformation := ");
single_value->field_bandSubclassInformation.log_match(match_value.bandSubclassInformation(), legacy);
TTCN_Logger::log_event_str(", encryptionCapability := ");
single_value->field_encryptionCapability.log_match(match_value.encryptionCapability(), 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__CDMA2000__ClassmarkChange__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (terminalInformation().is_bound()) terminalInformation().set_implicit_omit();
if (securityStatus().is_bound()) securityStatus().set_implicit_omit();
if (bandClassInformation().is_bound()) bandClassInformation().set_implicit_omit();
if (powerClassInformation().is_bound()) powerClassInformation().set_implicit_omit();
if (operatingModeInformation().is_bound()) operatingModeInformation().set_implicit_omit();
if (serviceOptionInformation().is_bound()) serviceOptionInformation().set_implicit_omit();
if (multiplexOptionInformation().is_bound()) multiplexOptionInformation().set_implicit_omit();
if (powerControlInformation().is_bound()) powerControlInformation().set_implicit_omit();
if (capabilityInformation().is_bound()) capabilityInformation().set_implicit_omit();
if (channelConfigurationCapabilityInformation().is_bound()) channelConfigurationCapabilityInformation().set_implicit_omit();
if (extMultiplexOptionInformation().is_bound()) extMultiplexOptionInformation().set_implicit_omit();
if (bandSubclassInformation().is_bound()) bandSubclassInformation().set_implicit_omit();
if (encryptionCapability().is_bound()) encryptionCapability().set_implicit_omit();
}

void PDU__RRM__CDMA2000__ClassmarkChange__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_terminalInformation.encode_text(text_buf);
single_value->field_securityStatus.encode_text(text_buf);
single_value->field_bandClassInformation.encode_text(text_buf);
single_value->field_powerClassInformation.encode_text(text_buf);
single_value->field_operatingModeInformation.encode_text(text_buf);
single_value->field_serviceOptionInformation.encode_text(text_buf);
single_value->field_multiplexOptionInformation.encode_text(text_buf);
single_value->field_powerControlInformation.encode_text(text_buf);
single_value->field_capabilityInformation.encode_text(text_buf);
single_value->field_channelConfigurationCapabilityInformation.encode_text(text_buf);
single_value->field_extMultiplexOptionInformation.encode_text(text_buf);
single_value->field_bandSubclassInformation.encode_text(text_buf);
single_value->field_encryptionCapability.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_CDMA2000_ClassmarkChange_MS_NW.");
}
}

void PDU__RRM__CDMA2000__ClassmarkChange__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_terminalInformation.decode_text(text_buf);
single_value->field_securityStatus.decode_text(text_buf);
single_value->field_bandClassInformation.decode_text(text_buf);
single_value->field_powerClassInformation.decode_text(text_buf);
single_value->field_operatingModeInformation.decode_text(text_buf);
single_value->field_serviceOptionInformation.decode_text(text_buf);
single_value->field_multiplexOptionInformation.decode_text(text_buf);
single_value->field_powerControlInformation.decode_text(text_buf);
single_value->field_capabilityInformation.decode_text(text_buf);
single_value->field_channelConfigurationCapabilityInformation.decode_text(text_buf);
single_value->field_extMultiplexOptionInformation.decode_text(text_buf);
single_value->field_bandSubclassInformation.decode_text(text_buf);
single_value->field_encryptionCapability.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__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_MS_NW.");
}
}

void PDU__RRM__CDMA2000__ClassmarkChange__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__CDMA2000__ClassmarkChange__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 (14<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW has 14 fields but 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) terminalInformation().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) securityStatus().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bandClassInformation().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) powerClassInformation().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) operatingModeInformation().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) serviceOptionInformation().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) multiplexOptionInformation().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) powerControlInformation().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) capabilityInformation().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) channelConfigurationCapabilityInformation().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) extMultiplexOptionInformation().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) bandSubclassInformation().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) encryptionCapability().set_param(*param.get_elem(13));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "terminalInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          terminalInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "securityStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          securityStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bandClassInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bandClassInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "powerClassInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          powerClassInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "operatingModeInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          operatingModeInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "serviceOptionInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          serviceOptionInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multiplexOptionInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multiplexOptionInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "powerControlInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          powerControlInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "capabilityInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          capabilityInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelConfigurationCapabilityInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelConfigurationCapabilityInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extMultiplexOptionInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extMultiplexOptionInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bandSubclassInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bandSubclassInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "encryptionCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          encryptionCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_CDMA2000_ClassmarkChange_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template* precondition = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template* implied_template = new PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__CDMA2000__ClassmarkChange__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_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_terminalInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_securityStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_bandClassInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_powerClassInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_operatingModeInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_serviceOptionInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_multiplexOptionInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_powerControlInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_capabilityInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_channelConfigurationCapabilityInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_extMultiplexOptionInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_bandSubclassInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_MS_NW");
single_value->field_encryptionCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_CDMA2000_ClassmarkChange_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_CDMA2000_ClassmarkChange_MS_NW");
}

boolean PDU__RRM__CDMA2000__ClassmarkChange__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__CDMA2000__ClassmarkChange__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__GERAN__IU__ModeClassmarkChange__MS__NW::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW()
{
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW(const BITSTRING& par_messageType,
    const GERAN__IU__ModeClassmark__LV& par_gERAN__IU__ModeClassmark)
  :   field_messageType(par_messageType),
  field_gERAN__IU__ModeClassmark(par_gERAN__IU__ModeClassmark)
{
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW(const PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.gERAN__IU__ModeClassmark().is_bound()) field_gERAN__IU__ModeClassmark = other_value.gERAN__IU__ModeClassmark();
else field_gERAN__IU__ModeClassmark.clean_up();
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::clean_up()
{
field_messageType.clean_up();
field_gERAN__IU__ModeClassmark.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::get_descriptor() const { return &PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_descr_; }
PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW& PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::operator=(const PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.gERAN__IU__ModeClassmark().is_bound()) field_gERAN__IU__ModeClassmark = other_value.gERAN__IU__ModeClassmark();
  else field_gERAN__IU__ModeClassmark.clean_up();
}
return *this;
}

boolean PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::operator==(const PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_gERAN__IU__ModeClassmark==other_value.field_gERAN__IU__ModeClassmark;
}

boolean PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_gERAN__IU__ModeClassmark.is_bound());
}
boolean PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_gERAN__IU__ModeClassmark.is_value();
}
void PDU__RRM__GERAN__IU__ModeClassmarkChange__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(", gERAN_IU_ModeClassmark := ");
field_gERAN__IU__ModeClassmark.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gERAN__IU__ModeClassmark().is_bound()) gERAN__IU__ModeClassmark().set_implicit_omit();
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_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) gERAN__IU__ModeClassmark().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(), "gERAN_IU_ModeClassmark")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gERAN__IU__ModeClassmark().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_GERAN_IU_ModeClassmarkChange_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_MS_NW");
  }
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_gERAN__IU__ModeClassmark.encode_text(text_buf);
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_gERAN__IU__ModeClassmark.decode_text(text_buf);
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__GERAN__IU__ModeClassmarkChange__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, GERAN__IU__ModeClassmark__LV_descr_.raw->forceomit);
  decoded_field_length = field_gERAN__IU__ModeClassmark.RAW_decode(GERAN__IU__ModeClassmark__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__GERAN__IU__ModeClassmarkChange__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, GERAN__IU__ModeClassmark__LV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gERAN__IU__ModeClassmark.RAW_encode(GERAN__IU__ModeClassmark__LV_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
GERAN__IU__ModeClassmark__LV_template field_gERAN__IU__ModeClassmark;
};

void PDU__RRM__GERAN__IU__ModeClassmarkChange__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_gERAN__IU__ModeClassmark = ANY_VALUE;
}
}
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::copy_value(const PDU__RRM__GERAN__IU__ModeClassmarkChange__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.gERAN__IU__ModeClassmark().is_bound()) {
  single_value->field_gERAN__IU__ModeClassmark = other_value.gERAN__IU__ModeClassmark();
} else {
  single_value->field_gERAN__IU__ModeClassmark.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::copy_template(const PDU__RRM__GERAN__IU__ModeClassmarkChange__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.gERAN__IU__ModeClassmark().get_selection()) {
single_value->field_gERAN__IU__ModeClassmark = other_value.gERAN__IU__ModeClassmark();
} else {
single_value->field_gERAN__IU__ModeClassmark.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__GERAN__IU__ModeClassmarkChange__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__GERAN__IU__ModeClassmarkChange__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template()
{
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(const PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(const OPTIONAL<PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_MS_NW from an unbound optional field.");
}
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template* p_precondition, PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(const PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::~PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template()
{
clean_up();
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template& PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template& PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::operator=(const PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template& PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_MS_NW.");
}
return *this;
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template& PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::operator=(const PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::match(const PDU__RRM__GERAN__IU__ModeClassmarkChange__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.gERAN__IU__ModeClassmark().is_bound()) return FALSE;
if(!single_value->field_gERAN__IU__ModeClassmark.match(other_value.gERAN__IU__ModeClassmark(), 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_GERAN_IU_ModeClassmarkChange_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__GERAN__IU__ModeClassmarkChange__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_gERAN__IU__ModeClassmark.is_bound();
}

boolean PDU__RRM__GERAN__IU__ModeClassmarkChange__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_gERAN__IU__ModeClassmark.is_value();
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__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__GERAN__IU__ModeClassmarkChange__MS__NW PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_MS_NW.");
PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_gERAN__IU__ModeClassmark.is_bound()) {
ret_val.gERAN__IU__ModeClassmark() = single_value->field_gERAN__IU__ModeClassmark.valueof();
}
return ret_val;
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template[list_length];
}

PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template& PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_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_GERAN_IU_ModeClassmarkChange_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_MS_NW.");
return single_value->field_messageType;
}

GERAN__IU__ModeClassmark__LV_template& PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::gERAN__IU__ModeClassmark()
{
set_specific();
return single_value->field_gERAN__IU__ModeClassmark;
}

const GERAN__IU__ModeClassmark__LV_template& PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::gERAN__IU__ModeClassmark() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gERAN_IU_ModeClassmark of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_MS_NW.");
return single_value->field_gERAN__IU__ModeClassmark;
}

int PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_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_GERAN_IU_ModeClassmarkChange_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_GERAN_IU_ModeClassmarkChange_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_GERAN_IU_ModeClassmarkChange_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_GERAN_IU_ModeClassmarkChange_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_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_GERAN_IU_ModeClassmarkChange_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_MS_NW.");
  }
  return 0;
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__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(", gERAN_IU_ModeClassmark := ");
single_value->field_gERAN__IU__ModeClassmark.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__GERAN__IU__ModeClassmarkChange__MS__NW_template::log_match(const PDU__RRM__GERAN__IU__ModeClassmarkChange__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_gERAN__IU__ModeClassmark.match(match_value.gERAN__IU__ModeClassmark(), legacy)){
TTCN_Logger::log_logmatch_info(".gERAN_IU_ModeClassmark");
single_value->field_gERAN__IU__ModeClassmark.log_match(match_value.gERAN__IU__ModeClassmark(), 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(", gERAN_IU_ModeClassmark := ");
single_value->field_gERAN__IU__ModeClassmark.log_match(match_value.gERAN__IU__ModeClassmark(), 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__GERAN__IU__ModeClassmarkChange__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gERAN__IU__ModeClassmark().is_bound()) gERAN__IU__ModeClassmark().set_implicit_omit();
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__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_gERAN__IU__ModeClassmark.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_GERAN_IU_ModeClassmarkChange_MS_NW.");
}
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__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_gERAN__IU__ModeClassmark.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__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_MS_NW.");
}
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__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__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_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) gERAN__IU__ModeClassmark().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(), "gERAN_IU_ModeClassmark")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gERAN__IU__ModeClassmark().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!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_GERAN_IU_ModeClassmarkChange_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template* precondition = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template* implied_template = new PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__GERAN__IU__ModeClassmarkChange__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_GERAN_IU_ModeClassmarkChange_MS_NW");
single_value->field_gERAN__IU__ModeClassmark.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_GERAN_IU_ModeClassmarkChange_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_GERAN_IU_ModeClassmarkChange_MS_NW");
}

boolean PDU__RRM__GERAN__IU__ModeClassmarkChange__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__GERAN__IU__ModeClassmarkChange__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__ClassmarkEnquiry__NW__MS::PDU__RRM__ClassmarkEnquiry__NW__MS()
{
}

PDU__RRM__ClassmarkEnquiry__NW__MS::PDU__RRM__ClassmarkEnquiry__NW__MS(const BITSTRING& par_messageType,
    const OPTIONAL< ClassmarkEnquiryMask__TLV >& par_classmarkEnquiryMask)
  :   field_messageType(par_messageType),
  field_classmarkEnquiryMask(par_classmarkEnquiryMask)
{
}

PDU__RRM__ClassmarkEnquiry__NW__MS::PDU__RRM__ClassmarkEnquiry__NW__MS(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.classmarkEnquiryMask().is_bound()) field_classmarkEnquiryMask = other_value.classmarkEnquiryMask();
else field_classmarkEnquiryMask.clean_up();
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::clean_up()
{
field_messageType.clean_up();
field_classmarkEnquiryMask.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ClassmarkEnquiry__NW__MS::get_descriptor() const { return &PDU__RRM__ClassmarkEnquiry__NW__MS_descr_; }
PDU__RRM__ClassmarkEnquiry__NW__MS& PDU__RRM__ClassmarkEnquiry__NW__MS::operator=(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.classmarkEnquiryMask().is_bound()) field_classmarkEnquiryMask = other_value.classmarkEnquiryMask();
  else field_classmarkEnquiryMask.clean_up();
}
return *this;
}

boolean PDU__RRM__ClassmarkEnquiry__NW__MS::operator==(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_classmarkEnquiryMask==other_value.field_classmarkEnquiryMask;
}

boolean PDU__RRM__ClassmarkEnquiry__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (OPTIONAL_OMIT == field_classmarkEnquiryMask.get_selection() || field_classmarkEnquiryMask.is_bound());
}
boolean PDU__RRM__ClassmarkEnquiry__NW__MS::is_value() const
{
return field_messageType.is_value()
  && (OPTIONAL_OMIT == field_classmarkEnquiryMask.get_selection() || field_classmarkEnquiryMask.is_value());
}
int PDU__RRM__ClassmarkEnquiry__NW__MS::size_of() const
{
  int ret_val = 1;
  if (field_classmarkEnquiryMask.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", classmarkEnquiryMask := ");
field_classmarkEnquiryMask.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!classmarkEnquiryMask().is_bound()) classmarkEnquiryMask() = OMIT_VALUE;
else classmarkEnquiryMask().set_implicit_omit();
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) classmarkEnquiryMask().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "classmarkEnquiryMask")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          classmarkEnquiryMask().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS");
  }
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_classmarkEnquiryMask.encode_text(text_buf);
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_classmarkEnquiryMask.decode_text(text_buf);
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__ClassmarkEnquiry__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__ClassmarkEnquiry__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_classmarkEnquiryMask = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, ClassmarkEnquiryMask__TLV_descr_.raw->forceomit);
  decoded_field_length = field_classmarkEnquiryMask().RAW_decode(ClassmarkEnquiryMask__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_classmarkEnquiryMask = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_classmarkEnquiryMask.ispresent() || field_classmarkEnquiryMask().elementIdentifier() !=  os_5){
  field_classmarkEnquiryMask=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_classmarkEnquiryMask=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__ClassmarkEnquiry__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  if (field_classmarkEnquiryMask.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ClassmarkEnquiryMask__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_classmarkEnquiryMask.ispresent()) {
  encoded_length += field_classmarkEnquiryMask().RAW_encode(ClassmarkEnquiryMask__TLV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_classmarkEnquiryMask.ispresent() && (!field_classmarkEnquiryMask.ispresent() || field_classmarkEnquiryMask().elementIdentifier() !=  os_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ClassmarkEnquiry__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
ClassmarkEnquiryMask__TLV_template field_classmarkEnquiryMask;
};

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_classmarkEnquiryMask = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::copy_value(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.classmarkEnquiryMask().is_bound()) {
  if (other_value.classmarkEnquiryMask().ispresent()) single_value->field_classmarkEnquiryMask = other_value.classmarkEnquiryMask()();
  else single_value->field_classmarkEnquiryMask = OMIT_VALUE;
} else {
  single_value->field_classmarkEnquiryMask.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::copy_template(const PDU__RRM__ClassmarkEnquiry__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.classmarkEnquiryMask().get_selection()) {
single_value->field_classmarkEnquiryMask = other_value.classmarkEnquiryMask();
} else {
single_value->field_classmarkEnquiryMask.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__RRM__ClassmarkEnquiry__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__RRM__ClassmarkEnquiry__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ClassmarkEnquiry__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template::PDU__RRM__ClassmarkEnquiry__NW__MS_template()
{
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template::PDU__RRM__ClassmarkEnquiry__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template::PDU__RRM__ClassmarkEnquiry__NW__MS_template(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template::PDU__RRM__ClassmarkEnquiry__NW__MS_template(const OPTIONAL<PDU__RRM__ClassmarkEnquiry__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ClassmarkEnquiry__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS from an unbound optional field.");
}
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template::PDU__RRM__ClassmarkEnquiry__NW__MS_template(PDU__RRM__ClassmarkEnquiry__NW__MS_template* p_precondition, PDU__RRM__ClassmarkEnquiry__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template::PDU__RRM__ClassmarkEnquiry__NW__MS_template(Dynamic_Match_Interface<PDU__RRM__ClassmarkEnquiry__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__ClassmarkEnquiry__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template::PDU__RRM__ClassmarkEnquiry__NW__MS_template(const PDU__RRM__ClassmarkEnquiry__NW__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template::~PDU__RRM__ClassmarkEnquiry__NW__MS_template()
{
clean_up();
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::operator=(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::operator=(const OPTIONAL<PDU__RRM__ClassmarkEnquiry__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ClassmarkEnquiry__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
}
return *this;
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::operator=(const PDU__RRM__ClassmarkEnquiry__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__ClassmarkEnquiry__NW__MS_template::match(const PDU__RRM__ClassmarkEnquiry__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.classmarkEnquiryMask().is_bound()) return FALSE;
if((other_value.classmarkEnquiryMask().ispresent() ? !single_value->field_classmarkEnquiryMask.match((const ClassmarkEnquiryMask__TLV&)other_value.classmarkEnquiryMask(), legacy) : !single_value->field_classmarkEnquiryMask.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ClassmarkEnquiry__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || (single_value->field_classmarkEnquiryMask.is_omit() || single_value->field_classmarkEnquiryMask.is_bound());
}

boolean PDU__RRM__ClassmarkEnquiry__NW__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && (single_value->field_classmarkEnquiryMask.is_omit() || single_value->field_classmarkEnquiryMask.is_value());
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__RRM__ClassmarkEnquiry__NW__MS PDU__RRM__ClassmarkEnquiry__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
PDU__RRM__ClassmarkEnquiry__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_classmarkEnquiryMask.is_omit()) ret_val.classmarkEnquiryMask() = OMIT_VALUE;
else if (single_value->field_classmarkEnquiryMask.is_bound()) {
ret_val.classmarkEnquiryMask() = single_value->field_classmarkEnquiryMask.valueof();
}
return ret_val;
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ClassmarkEnquiry__NW__MS_template[list_length];
}

PDU__RRM__ClassmarkEnquiry__NW__MS_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
return single_value->field_messageType;
}

ClassmarkEnquiryMask__TLV_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::classmarkEnquiryMask()
{
set_specific();
return single_value->field_classmarkEnquiryMask;
}

const ClassmarkEnquiryMask__TLV_template& PDU__RRM__ClassmarkEnquiry__NW__MS_template::classmarkEnquiryMask() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field classmarkEnquiryMask of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
return single_value->field_classmarkEnquiryMask;
}

int PDU__RRM__ClassmarkEnquiry__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_classmarkEnquiryMask.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
  }
  return 0;
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", classmarkEnquiryMask := ");
single_value->field_classmarkEnquiryMask.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::log_match(const PDU__RRM__ClassmarkEnquiry__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.classmarkEnquiryMask().ispresent()){
if(!single_value->field_classmarkEnquiryMask.match(match_value.classmarkEnquiryMask(), legacy)){
TTCN_Logger::log_logmatch_info(".classmarkEnquiryMask");
single_value->field_classmarkEnquiryMask.log_match(match_value.classmarkEnquiryMask(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_classmarkEnquiryMask.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".classmarkEnquiryMask := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_classmarkEnquiryMask.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", classmarkEnquiryMask := ");
if (match_value.classmarkEnquiryMask().ispresent()) {
single_value->field_classmarkEnquiryMask.log_match(match_value.classmarkEnquiryMask(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_classmarkEnquiryMask.log();
if (single_value->field_classmarkEnquiryMask.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!classmarkEnquiryMask().is_bound()) classmarkEnquiryMask() = OMIT_VALUE;
else classmarkEnquiryMask().set_implicit_omit();
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_classmarkEnquiryMask.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
}
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_classmarkEnquiryMask.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__RRM__ClassmarkEnquiry__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS.");
}
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__RRM__ClassmarkEnquiry__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) classmarkEnquiryMask().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "classmarkEnquiryMask")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          classmarkEnquiryMask().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ClassmarkEnquiry__NW__MS_template* precondition = new PDU__RRM__ClassmarkEnquiry__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ClassmarkEnquiry__NW__MS_template* implied_template = new PDU__RRM__ClassmarkEnquiry__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ClassmarkEnquiry__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ClassmarkEnquiry__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS");
single_value->field_classmarkEnquiryMask.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ClassmarkEnquiry_NW_MS");
}

boolean PDU__RRM__ClassmarkEnquiry__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__ClassmarkEnquiry__NW__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__RRM__ConfigurationChangeCommand__NW__MS::PDU__RRM__ConfigurationChangeCommand__NW__MS()
{
}

PDU__RRM__ConfigurationChangeCommand__NW__MS::PDU__RRM__ConfigurationChangeCommand__NW__MS(const BITSTRING& par_messageType,
    const MultislotAllocation__LV& par_multislotAllocation,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet1,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet2,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet3,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet4,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet5,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet6,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet7,
    const OPTIONAL< ChannelMode__TV >& par_modeOfChannelSet8)
  :   field_messageType(par_messageType),
  field_multislotAllocation(par_multislotAllocation),
  field_modeOfChannelSet1(par_modeOfChannelSet1),
  field_modeOfChannelSet2(par_modeOfChannelSet2),
  field_modeOfChannelSet3(par_modeOfChannelSet3),
  field_modeOfChannelSet4(par_modeOfChannelSet4),
  field_modeOfChannelSet5(par_modeOfChannelSet5),
  field_modeOfChannelSet6(par_modeOfChannelSet6),
  field_modeOfChannelSet7(par_modeOfChannelSet7),
  field_modeOfChannelSet8(par_modeOfChannelSet8)
{
}

PDU__RRM__ConfigurationChangeCommand__NW__MS::PDU__RRM__ConfigurationChangeCommand__NW__MS(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.multislotAllocation().is_bound()) field_multislotAllocation = other_value.multislotAllocation();
else field_multislotAllocation.clean_up();
if (other_value.modeOfChannelSet1().is_bound()) field_modeOfChannelSet1 = other_value.modeOfChannelSet1();
else field_modeOfChannelSet1.clean_up();
if (other_value.modeOfChannelSet2().is_bound()) field_modeOfChannelSet2 = other_value.modeOfChannelSet2();
else field_modeOfChannelSet2.clean_up();
if (other_value.modeOfChannelSet3().is_bound()) field_modeOfChannelSet3 = other_value.modeOfChannelSet3();
else field_modeOfChannelSet3.clean_up();
if (other_value.modeOfChannelSet4().is_bound()) field_modeOfChannelSet4 = other_value.modeOfChannelSet4();
else field_modeOfChannelSet4.clean_up();
if (other_value.modeOfChannelSet5().is_bound()) field_modeOfChannelSet5 = other_value.modeOfChannelSet5();
else field_modeOfChannelSet5.clean_up();
if (other_value.modeOfChannelSet6().is_bound()) field_modeOfChannelSet6 = other_value.modeOfChannelSet6();
else field_modeOfChannelSet6.clean_up();
if (other_value.modeOfChannelSet7().is_bound()) field_modeOfChannelSet7 = other_value.modeOfChannelSet7();
else field_modeOfChannelSet7.clean_up();
if (other_value.modeOfChannelSet8().is_bound()) field_modeOfChannelSet8 = other_value.modeOfChannelSet8();
else field_modeOfChannelSet8.clean_up();
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_multislotAllocation.clean_up();
field_modeOfChannelSet1.clean_up();
field_modeOfChannelSet2.clean_up();
field_modeOfChannelSet3.clean_up();
field_modeOfChannelSet4.clean_up();
field_modeOfChannelSet5.clean_up();
field_modeOfChannelSet6.clean_up();
field_modeOfChannelSet7.clean_up();
field_modeOfChannelSet8.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ConfigurationChangeCommand__NW__MS::get_descriptor() const { return &PDU__RRM__ConfigurationChangeCommand__NW__MS_descr_; }
PDU__RRM__ConfigurationChangeCommand__NW__MS& PDU__RRM__ConfigurationChangeCommand__NW__MS::operator=(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.multislotAllocation().is_bound()) field_multislotAllocation = other_value.multislotAllocation();
  else field_multislotAllocation.clean_up();
  if (other_value.modeOfChannelSet1().is_bound()) field_modeOfChannelSet1 = other_value.modeOfChannelSet1();
  else field_modeOfChannelSet1.clean_up();
  if (other_value.modeOfChannelSet2().is_bound()) field_modeOfChannelSet2 = other_value.modeOfChannelSet2();
  else field_modeOfChannelSet2.clean_up();
  if (other_value.modeOfChannelSet3().is_bound()) field_modeOfChannelSet3 = other_value.modeOfChannelSet3();
  else field_modeOfChannelSet3.clean_up();
  if (other_value.modeOfChannelSet4().is_bound()) field_modeOfChannelSet4 = other_value.modeOfChannelSet4();
  else field_modeOfChannelSet4.clean_up();
  if (other_value.modeOfChannelSet5().is_bound()) field_modeOfChannelSet5 = other_value.modeOfChannelSet5();
  else field_modeOfChannelSet5.clean_up();
  if (other_value.modeOfChannelSet6().is_bound()) field_modeOfChannelSet6 = other_value.modeOfChannelSet6();
  else field_modeOfChannelSet6.clean_up();
  if (other_value.modeOfChannelSet7().is_bound()) field_modeOfChannelSet7 = other_value.modeOfChannelSet7();
  else field_modeOfChannelSet7.clean_up();
  if (other_value.modeOfChannelSet8().is_bound()) field_modeOfChannelSet8 = other_value.modeOfChannelSet8();
  else field_modeOfChannelSet8.clean_up();
}
return *this;
}

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS::operator==(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_multislotAllocation==other_value.field_multislotAllocation
  && field_modeOfChannelSet1==other_value.field_modeOfChannelSet1
  && field_modeOfChannelSet2==other_value.field_modeOfChannelSet2
  && field_modeOfChannelSet3==other_value.field_modeOfChannelSet3
  && field_modeOfChannelSet4==other_value.field_modeOfChannelSet4
  && field_modeOfChannelSet5==other_value.field_modeOfChannelSet5
  && field_modeOfChannelSet6==other_value.field_modeOfChannelSet6
  && field_modeOfChannelSet7==other_value.field_modeOfChannelSet7
  && field_modeOfChannelSet8==other_value.field_modeOfChannelSet8;
}

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_multislotAllocation.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet1.get_selection() || field_modeOfChannelSet1.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet2.get_selection() || field_modeOfChannelSet2.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet3.get_selection() || field_modeOfChannelSet3.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet4.get_selection() || field_modeOfChannelSet4.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet5.get_selection() || field_modeOfChannelSet5.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet6.get_selection() || field_modeOfChannelSet6.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet7.get_selection() || field_modeOfChannelSet7.is_bound())
  || (OPTIONAL_OMIT == field_modeOfChannelSet8.get_selection() || field_modeOfChannelSet8.is_bound());
}
boolean PDU__RRM__ConfigurationChangeCommand__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_multislotAllocation.is_value()
  && (OPTIONAL_OMIT == field_modeOfChannelSet1.get_selection() || field_modeOfChannelSet1.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet2.get_selection() || field_modeOfChannelSet2.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet3.get_selection() || field_modeOfChannelSet3.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet4.get_selection() || field_modeOfChannelSet4.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet5.get_selection() || field_modeOfChannelSet5.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet6.get_selection() || field_modeOfChannelSet6.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet7.get_selection() || field_modeOfChannelSet7.is_value())
  && (OPTIONAL_OMIT == field_modeOfChannelSet8.get_selection() || field_modeOfChannelSet8.is_value());
}
int PDU__RRM__ConfigurationChangeCommand__NW__MS::size_of() const
{
  int ret_val = 2;
  if (field_modeOfChannelSet1.ispresent()) ret_val++;
  if (field_modeOfChannelSet2.ispresent()) ret_val++;
  if (field_modeOfChannelSet3.ispresent()) ret_val++;
  if (field_modeOfChannelSet4.ispresent()) ret_val++;
  if (field_modeOfChannelSet5.ispresent()) ret_val++;
  if (field_modeOfChannelSet6.ispresent()) ret_val++;
  if (field_modeOfChannelSet7.ispresent()) ret_val++;
  if (field_modeOfChannelSet8.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", multislotAllocation := ");
field_multislotAllocation.log();
TTCN_Logger::log_event_str(", modeOfChannelSet1 := ");
field_modeOfChannelSet1.log();
TTCN_Logger::log_event_str(", modeOfChannelSet2 := ");
field_modeOfChannelSet2.log();
TTCN_Logger::log_event_str(", modeOfChannelSet3 := ");
field_modeOfChannelSet3.log();
TTCN_Logger::log_event_str(", modeOfChannelSet4 := ");
field_modeOfChannelSet4.log();
TTCN_Logger::log_event_str(", modeOfChannelSet5 := ");
field_modeOfChannelSet5.log();
TTCN_Logger::log_event_str(", modeOfChannelSet6 := ");
field_modeOfChannelSet6.log();
TTCN_Logger::log_event_str(", modeOfChannelSet7 := ");
field_modeOfChannelSet7.log();
TTCN_Logger::log_event_str(", modeOfChannelSet8 := ");
field_modeOfChannelSet8.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (multislotAllocation().is_bound()) multislotAllocation().set_implicit_omit();
if (!modeOfChannelSet1().is_bound()) modeOfChannelSet1() = OMIT_VALUE;
else modeOfChannelSet1().set_implicit_omit();
if (!modeOfChannelSet2().is_bound()) modeOfChannelSet2() = OMIT_VALUE;
else modeOfChannelSet2().set_implicit_omit();
if (!modeOfChannelSet3().is_bound()) modeOfChannelSet3() = OMIT_VALUE;
else modeOfChannelSet3().set_implicit_omit();
if (!modeOfChannelSet4().is_bound()) modeOfChannelSet4() = OMIT_VALUE;
else modeOfChannelSet4().set_implicit_omit();
if (!modeOfChannelSet5().is_bound()) modeOfChannelSet5() = OMIT_VALUE;
else modeOfChannelSet5().set_implicit_omit();
if (!modeOfChannelSet6().is_bound()) modeOfChannelSet6() = OMIT_VALUE;
else modeOfChannelSet6().set_implicit_omit();
if (!modeOfChannelSet7().is_bound()) modeOfChannelSet7() = OMIT_VALUE;
else modeOfChannelSet7().set_implicit_omit();
if (!modeOfChannelSet8().is_bound()) modeOfChannelSet8() = OMIT_VALUE;
else modeOfChannelSet8().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (10<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS has 10 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) multislotAllocation().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet4().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet5().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet6().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet7().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet8().set_param(*param.get_elem(9));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet6().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
  }
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_multislotAllocation.encode_text(text_buf);
field_modeOfChannelSet1.encode_text(text_buf);
field_modeOfChannelSet2.encode_text(text_buf);
field_modeOfChannelSet3.encode_text(text_buf);
field_modeOfChannelSet4.encode_text(text_buf);
field_modeOfChannelSet5.encode_text(text_buf);
field_modeOfChannelSet6.encode_text(text_buf);
field_modeOfChannelSet7.encode_text(text_buf);
field_modeOfChannelSet8.encode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_multislotAllocation.decode_text(text_buf);
field_modeOfChannelSet1.decode_text(text_buf);
field_modeOfChannelSet2.decode_text(text_buf);
field_modeOfChannelSet3.decode_text(text_buf);
field_modeOfChannelSet4.decode_text(text_buf);
field_modeOfChannelSet5.decode_text(text_buf);
field_modeOfChannelSet6.decode_text(text_buf);
field_modeOfChannelSet7.decode_text(text_buf);
field_modeOfChannelSet8.decode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__ConfigurationChangeCommand__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotAllocation__LV_descr_.raw->forceomit);
  decoded_field_length = field_multislotAllocation.RAW_decode(MultislotAllocation__LV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_modeOfChannelSet1 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet1().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet1 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet1.ispresent() || field_modeOfChannelSet1().elementIdentifier() !=  os_6){
  field_modeOfChannelSet1=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet1=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_modeOfChannelSet2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet2().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet2.ispresent() || field_modeOfChannelSet2().elementIdentifier() !=  os_7){
  field_modeOfChannelSet2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_modeOfChannelSet3 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet3().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet3 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet3.ispresent() || field_modeOfChannelSet3().elementIdentifier() !=  os_8){
  field_modeOfChannelSet3=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet3=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_modeOfChannelSet4 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet4().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet4 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet4.ispresent() || field_modeOfChannelSet4().elementIdentifier() !=  os_9){
  field_modeOfChannelSet4=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet4=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_modeOfChannelSet5 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet5().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet5 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet5.ispresent() || field_modeOfChannelSet5().elementIdentifier() !=  os_10){
  field_modeOfChannelSet5=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet5=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_modeOfChannelSet6 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet6().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet6 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet6.ispresent() || field_modeOfChannelSet6().elementIdentifier() !=  os_11){
  field_modeOfChannelSet6=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet6=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_modeOfChannelSet7 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet7().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet7 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet7.ispresent() || field_modeOfChannelSet7().elementIdentifier() !=  os_12){
  field_modeOfChannelSet7=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet7=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_modeOfChannelSet8 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_modeOfChannelSet8().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_modeOfChannelSet8 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_modeOfChannelSet8.ispresent() || field_modeOfChannelSet8().elementIdentifier() !=  os_13){
  field_modeOfChannelSet8=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_modeOfChannelSet8=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__ConfigurationChangeCommand__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 10;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(10);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotAllocation__LV_descr_.raw);
  if (field_modeOfChannelSet1.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_modeOfChannelSet2.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_modeOfChannelSet3.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_modeOfChannelSet4.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_modeOfChannelSet5.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_modeOfChannelSet6.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_modeOfChannelSet7.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_modeOfChannelSet8.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_multislotAllocation.RAW_encode(MultislotAllocation__LV_descr_, *myleaf.body.node.nodes[1]);
  if (field_modeOfChannelSet1.ispresent()) {
  encoded_length += field_modeOfChannelSet1().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_modeOfChannelSet2.ispresent()) {
  encoded_length += field_modeOfChannelSet2().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_modeOfChannelSet3.ispresent()) {
  encoded_length += field_modeOfChannelSet3().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_modeOfChannelSet4.ispresent()) {
  encoded_length += field_modeOfChannelSet4().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_modeOfChannelSet5.ispresent()) {
  encoded_length += field_modeOfChannelSet5().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_modeOfChannelSet6.ispresent()) {
  encoded_length += field_modeOfChannelSet6().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_modeOfChannelSet7.ispresent()) {
  encoded_length += field_modeOfChannelSet7().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_modeOfChannelSet8.ispresent()) {
  encoded_length += field_modeOfChannelSet8().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_modeOfChannelSet1.ispresent() && (!field_modeOfChannelSet1.ispresent() || field_modeOfChannelSet1().elementIdentifier() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOfChannelSet2.ispresent() && (!field_modeOfChannelSet2.ispresent() || field_modeOfChannelSet2().elementIdentifier() !=  os_7)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOfChannelSet3.ispresent() && (!field_modeOfChannelSet3.ispresent() || field_modeOfChannelSet3().elementIdentifier() !=  os_8)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_8.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOfChannelSet4.ispresent() && (!field_modeOfChannelSet4.ispresent() || field_modeOfChannelSet4().elementIdentifier() !=  os_9)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_9.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOfChannelSet5.ispresent() && (!field_modeOfChannelSet5.ispresent() || field_modeOfChannelSet5().elementIdentifier() !=  os_10)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_10.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOfChannelSet6.ispresent() && (!field_modeOfChannelSet6.ispresent() || field_modeOfChannelSet6().elementIdentifier() !=  os_11)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_11.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOfChannelSet7.ispresent() && (!field_modeOfChannelSet7.ispresent() || field_modeOfChannelSet7().elementIdentifier() !=  os_12)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={8,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_12.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_modeOfChannelSet8.ispresent() && (!field_modeOfChannelSet8.ispresent() || field_modeOfChannelSet8().elementIdentifier() !=  os_13)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={9,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ConfigurationChangeCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
MultislotAllocation__LV_template field_multislotAllocation;
ChannelMode__TV_template field_modeOfChannelSet1;
ChannelMode__TV_template field_modeOfChannelSet2;
ChannelMode__TV_template field_modeOfChannelSet3;
ChannelMode__TV_template field_modeOfChannelSet4;
ChannelMode__TV_template field_modeOfChannelSet5;
ChannelMode__TV_template field_modeOfChannelSet6;
ChannelMode__TV_template field_modeOfChannelSet7;
ChannelMode__TV_template field_modeOfChannelSet8;
};

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_multislotAllocation = ANY_VALUE;
single_value->field_modeOfChannelSet1 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet2 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet3 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet4 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet5 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet6 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet7 = ANY_OR_OMIT;
single_value->field_modeOfChannelSet8 = ANY_OR_OMIT;
}
}
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::copy_value(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.multislotAllocation().is_bound()) {
  single_value->field_multislotAllocation = other_value.multislotAllocation();
} else {
  single_value->field_multislotAllocation.clean_up();
}
if (other_value.modeOfChannelSet1().is_bound()) {
  if (other_value.modeOfChannelSet1().ispresent()) single_value->field_modeOfChannelSet1 = other_value.modeOfChannelSet1()();
  else single_value->field_modeOfChannelSet1 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet1.clean_up();
}
if (other_value.modeOfChannelSet2().is_bound()) {
  if (other_value.modeOfChannelSet2().ispresent()) single_value->field_modeOfChannelSet2 = other_value.modeOfChannelSet2()();
  else single_value->field_modeOfChannelSet2 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet2.clean_up();
}
if (other_value.modeOfChannelSet3().is_bound()) {
  if (other_value.modeOfChannelSet3().ispresent()) single_value->field_modeOfChannelSet3 = other_value.modeOfChannelSet3()();
  else single_value->field_modeOfChannelSet3 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet3.clean_up();
}
if (other_value.modeOfChannelSet4().is_bound()) {
  if (other_value.modeOfChannelSet4().ispresent()) single_value->field_modeOfChannelSet4 = other_value.modeOfChannelSet4()();
  else single_value->field_modeOfChannelSet4 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet4.clean_up();
}
if (other_value.modeOfChannelSet5().is_bound()) {
  if (other_value.modeOfChannelSet5().ispresent()) single_value->field_modeOfChannelSet5 = other_value.modeOfChannelSet5()();
  else single_value->field_modeOfChannelSet5 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet5.clean_up();
}
if (other_value.modeOfChannelSet6().is_bound()) {
  if (other_value.modeOfChannelSet6().ispresent()) single_value->field_modeOfChannelSet6 = other_value.modeOfChannelSet6()();
  else single_value->field_modeOfChannelSet6 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet6.clean_up();
}
if (other_value.modeOfChannelSet7().is_bound()) {
  if (other_value.modeOfChannelSet7().ispresent()) single_value->field_modeOfChannelSet7 = other_value.modeOfChannelSet7()();
  else single_value->field_modeOfChannelSet7 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet7.clean_up();
}
if (other_value.modeOfChannelSet8().is_bound()) {
  if (other_value.modeOfChannelSet8().ispresent()) single_value->field_modeOfChannelSet8 = other_value.modeOfChannelSet8()();
  else single_value->field_modeOfChannelSet8 = OMIT_VALUE;
} else {
  single_value->field_modeOfChannelSet8.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::copy_template(const PDU__RRM__ConfigurationChangeCommand__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multislotAllocation().get_selection()) {
single_value->field_multislotAllocation = other_value.multislotAllocation();
} else {
single_value->field_multislotAllocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet1().get_selection()) {
single_value->field_modeOfChannelSet1 = other_value.modeOfChannelSet1();
} else {
single_value->field_modeOfChannelSet1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet2().get_selection()) {
single_value->field_modeOfChannelSet2 = other_value.modeOfChannelSet2();
} else {
single_value->field_modeOfChannelSet2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet3().get_selection()) {
single_value->field_modeOfChannelSet3 = other_value.modeOfChannelSet3();
} else {
single_value->field_modeOfChannelSet3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet4().get_selection()) {
single_value->field_modeOfChannelSet4 = other_value.modeOfChannelSet4();
} else {
single_value->field_modeOfChannelSet4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet5().get_selection()) {
single_value->field_modeOfChannelSet5 = other_value.modeOfChannelSet5();
} else {
single_value->field_modeOfChannelSet5.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet6().get_selection()) {
single_value->field_modeOfChannelSet6 = other_value.modeOfChannelSet6();
} else {
single_value->field_modeOfChannelSet6.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet7().get_selection()) {
single_value->field_modeOfChannelSet7 = other_value.modeOfChannelSet7();
} else {
single_value->field_modeOfChannelSet7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modeOfChannelSet8().get_selection()) {
single_value->field_modeOfChannelSet8 = other_value.modeOfChannelSet8();
} else {
single_value->field_modeOfChannelSet8.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::PDU__RRM__ConfigurationChangeCommand__NW__MS_template()
{
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::PDU__RRM__ConfigurationChangeCommand__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::PDU__RRM__ConfigurationChangeCommand__NW__MS_template(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::PDU__RRM__ConfigurationChangeCommand__NW__MS_template(const OPTIONAL<PDU__RRM__ConfigurationChangeCommand__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ConfigurationChangeCommand__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS from an unbound optional field.");
}
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::PDU__RRM__ConfigurationChangeCommand__NW__MS_template(PDU__RRM__ConfigurationChangeCommand__NW__MS_template* p_precondition, PDU__RRM__ConfigurationChangeCommand__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::PDU__RRM__ConfigurationChangeCommand__NW__MS_template(Dynamic_Match_Interface<PDU__RRM__ConfigurationChangeCommand__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__ConfigurationChangeCommand__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::PDU__RRM__ConfigurationChangeCommand__NW__MS_template(const PDU__RRM__ConfigurationChangeCommand__NW__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template::~PDU__RRM__ConfigurationChangeCommand__NW__MS_template()
{
clean_up();
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::operator=(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::operator=(const OPTIONAL<PDU__RRM__ConfigurationChangeCommand__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ConfigurationChangeCommand__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
}
return *this;
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::operator=(const PDU__RRM__ConfigurationChangeCommand__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS_template::match(const PDU__RRM__ConfigurationChangeCommand__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.multislotAllocation().is_bound()) return FALSE;
if(!single_value->field_multislotAllocation.match(other_value.multislotAllocation(), legacy))return FALSE;
if(!other_value.modeOfChannelSet1().is_bound()) return FALSE;
if((other_value.modeOfChannelSet1().ispresent() ? !single_value->field_modeOfChannelSet1.match((const ChannelMode__TV&)other_value.modeOfChannelSet1(), legacy) : !single_value->field_modeOfChannelSet1.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet2().is_bound()) return FALSE;
if((other_value.modeOfChannelSet2().ispresent() ? !single_value->field_modeOfChannelSet2.match((const ChannelMode__TV&)other_value.modeOfChannelSet2(), legacy) : !single_value->field_modeOfChannelSet2.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet3().is_bound()) return FALSE;
if((other_value.modeOfChannelSet3().ispresent() ? !single_value->field_modeOfChannelSet3.match((const ChannelMode__TV&)other_value.modeOfChannelSet3(), legacy) : !single_value->field_modeOfChannelSet3.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet4().is_bound()) return FALSE;
if((other_value.modeOfChannelSet4().ispresent() ? !single_value->field_modeOfChannelSet4.match((const ChannelMode__TV&)other_value.modeOfChannelSet4(), legacy) : !single_value->field_modeOfChannelSet4.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet5().is_bound()) return FALSE;
if((other_value.modeOfChannelSet5().ispresent() ? !single_value->field_modeOfChannelSet5.match((const ChannelMode__TV&)other_value.modeOfChannelSet5(), legacy) : !single_value->field_modeOfChannelSet5.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet6().is_bound()) return FALSE;
if((other_value.modeOfChannelSet6().ispresent() ? !single_value->field_modeOfChannelSet6.match((const ChannelMode__TV&)other_value.modeOfChannelSet6(), legacy) : !single_value->field_modeOfChannelSet6.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet7().is_bound()) return FALSE;
if((other_value.modeOfChannelSet7().ispresent() ? !single_value->field_modeOfChannelSet7.match((const ChannelMode__TV&)other_value.modeOfChannelSet7(), legacy) : !single_value->field_modeOfChannelSet7.match_omit(legacy)))return FALSE;
if(!other_value.modeOfChannelSet8().is_bound()) return FALSE;
if((other_value.modeOfChannelSet8().ispresent() ? !single_value->field_modeOfChannelSet8.match((const ChannelMode__TV&)other_value.modeOfChannelSet8(), legacy) : !single_value->field_modeOfChannelSet8.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_multislotAllocation.is_bound()
 || (single_value->field_modeOfChannelSet1.is_omit() || single_value->field_modeOfChannelSet1.is_bound())
 || (single_value->field_modeOfChannelSet2.is_omit() || single_value->field_modeOfChannelSet2.is_bound())
 || (single_value->field_modeOfChannelSet3.is_omit() || single_value->field_modeOfChannelSet3.is_bound())
 || (single_value->field_modeOfChannelSet4.is_omit() || single_value->field_modeOfChannelSet4.is_bound())
 || (single_value->field_modeOfChannelSet5.is_omit() || single_value->field_modeOfChannelSet5.is_bound())
 || (single_value->field_modeOfChannelSet6.is_omit() || single_value->field_modeOfChannelSet6.is_bound())
 || (single_value->field_modeOfChannelSet7.is_omit() || single_value->field_modeOfChannelSet7.is_bound())
 || (single_value->field_modeOfChannelSet8.is_omit() || single_value->field_modeOfChannelSet8.is_bound());
}

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_multislotAllocation.is_value()
 && (single_value->field_modeOfChannelSet1.is_omit() || single_value->field_modeOfChannelSet1.is_value())
 && (single_value->field_modeOfChannelSet2.is_omit() || single_value->field_modeOfChannelSet2.is_value())
 && (single_value->field_modeOfChannelSet3.is_omit() || single_value->field_modeOfChannelSet3.is_value())
 && (single_value->field_modeOfChannelSet4.is_omit() || single_value->field_modeOfChannelSet4.is_value())
 && (single_value->field_modeOfChannelSet5.is_omit() || single_value->field_modeOfChannelSet5.is_value())
 && (single_value->field_modeOfChannelSet6.is_omit() || single_value->field_modeOfChannelSet6.is_value())
 && (single_value->field_modeOfChannelSet7.is_omit() || single_value->field_modeOfChannelSet7.is_value())
 && (single_value->field_modeOfChannelSet8.is_omit() || single_value->field_modeOfChannelSet8.is_value());
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__RRM__ConfigurationChangeCommand__NW__MS PDU__RRM__ConfigurationChangeCommand__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
PDU__RRM__ConfigurationChangeCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_multislotAllocation.is_bound()) {
ret_val.multislotAllocation() = single_value->field_multislotAllocation.valueof();
}
if (single_value->field_modeOfChannelSet1.is_omit()) ret_val.modeOfChannelSet1() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet1.is_bound()) {
ret_val.modeOfChannelSet1() = single_value->field_modeOfChannelSet1.valueof();
}
if (single_value->field_modeOfChannelSet2.is_omit()) ret_val.modeOfChannelSet2() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet2.is_bound()) {
ret_val.modeOfChannelSet2() = single_value->field_modeOfChannelSet2.valueof();
}
if (single_value->field_modeOfChannelSet3.is_omit()) ret_val.modeOfChannelSet3() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet3.is_bound()) {
ret_val.modeOfChannelSet3() = single_value->field_modeOfChannelSet3.valueof();
}
if (single_value->field_modeOfChannelSet4.is_omit()) ret_val.modeOfChannelSet4() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet4.is_bound()) {
ret_val.modeOfChannelSet4() = single_value->field_modeOfChannelSet4.valueof();
}
if (single_value->field_modeOfChannelSet5.is_omit()) ret_val.modeOfChannelSet5() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet5.is_bound()) {
ret_val.modeOfChannelSet5() = single_value->field_modeOfChannelSet5.valueof();
}
if (single_value->field_modeOfChannelSet6.is_omit()) ret_val.modeOfChannelSet6() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet6.is_bound()) {
ret_val.modeOfChannelSet6() = single_value->field_modeOfChannelSet6.valueof();
}
if (single_value->field_modeOfChannelSet7.is_omit()) ret_val.modeOfChannelSet7() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet7.is_bound()) {
ret_val.modeOfChannelSet7() = single_value->field_modeOfChannelSet7.valueof();
}
if (single_value->field_modeOfChannelSet8.is_omit()) ret_val.modeOfChannelSet8() = OMIT_VALUE;
else if (single_value->field_modeOfChannelSet8.is_bound()) {
ret_val.modeOfChannelSet8() = single_value->field_modeOfChannelSet8.valueof();
}
return ret_val;
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template[list_length];
}

PDU__RRM__ConfigurationChangeCommand__NW__MS_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_messageType;
}

MultislotAllocation__LV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::multislotAllocation()
{
set_specific();
return single_value->field_multislotAllocation;
}

const MultislotAllocation__LV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::multislotAllocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotAllocation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_multislotAllocation;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet1()
{
set_specific();
return single_value->field_modeOfChannelSet1;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet1 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet1;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet2()
{
set_specific();
return single_value->field_modeOfChannelSet2;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet2;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet3()
{
set_specific();
return single_value->field_modeOfChannelSet3;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet3 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet3;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet4()
{
set_specific();
return single_value->field_modeOfChannelSet4;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet4 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet4;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet5()
{
set_specific();
return single_value->field_modeOfChannelSet5;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet5 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet5;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet6()
{
set_specific();
return single_value->field_modeOfChannelSet6;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet6() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet6 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet6;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet7()
{
set_specific();
return single_value->field_modeOfChannelSet7;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet7 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet7;
}

ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet8()
{
set_specific();
return single_value->field_modeOfChannelSet8;
}

const ChannelMode__TV_template& PDU__RRM__ConfigurationChangeCommand__NW__MS_template::modeOfChannelSet8() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modeOfChannelSet8 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
return single_value->field_modeOfChannelSet8;
}

int PDU__RRM__ConfigurationChangeCommand__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_modeOfChannelSet1.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet2.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet3.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet4.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet5.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet6.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet7.is_present()) ret_val++;
      if (single_value->field_modeOfChannelSet8.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
  }
  return 0;
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", multislotAllocation := ");
single_value->field_multislotAllocation.log();
TTCN_Logger::log_event_str(", modeOfChannelSet1 := ");
single_value->field_modeOfChannelSet1.log();
TTCN_Logger::log_event_str(", modeOfChannelSet2 := ");
single_value->field_modeOfChannelSet2.log();
TTCN_Logger::log_event_str(", modeOfChannelSet3 := ");
single_value->field_modeOfChannelSet3.log();
TTCN_Logger::log_event_str(", modeOfChannelSet4 := ");
single_value->field_modeOfChannelSet4.log();
TTCN_Logger::log_event_str(", modeOfChannelSet5 := ");
single_value->field_modeOfChannelSet5.log();
TTCN_Logger::log_event_str(", modeOfChannelSet6 := ");
single_value->field_modeOfChannelSet6.log();
TTCN_Logger::log_event_str(", modeOfChannelSet7 := ");
single_value->field_modeOfChannelSet7.log();
TTCN_Logger::log_event_str(", modeOfChannelSet8 := ");
single_value->field_modeOfChannelSet8.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::log_match(const PDU__RRM__ConfigurationChangeCommand__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_multislotAllocation.match(match_value.multislotAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotAllocation");
single_value->field_multislotAllocation.log_match(match_value.multislotAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.modeOfChannelSet1().ispresent()){
if(!single_value->field_modeOfChannelSet1.match(match_value.modeOfChannelSet1(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet1");
single_value->field_modeOfChannelSet1.log_match(match_value.modeOfChannelSet1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet1.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet1 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet1.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet2().ispresent()){
if(!single_value->field_modeOfChannelSet2.match(match_value.modeOfChannelSet2(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet2");
single_value->field_modeOfChannelSet2.log_match(match_value.modeOfChannelSet2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet3().ispresent()){
if(!single_value->field_modeOfChannelSet3.match(match_value.modeOfChannelSet3(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet3");
single_value->field_modeOfChannelSet3.log_match(match_value.modeOfChannelSet3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet4().ispresent()){
if(!single_value->field_modeOfChannelSet4.match(match_value.modeOfChannelSet4(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet4");
single_value->field_modeOfChannelSet4.log_match(match_value.modeOfChannelSet4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet4.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet4 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet4.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet5().ispresent()){
if(!single_value->field_modeOfChannelSet5.match(match_value.modeOfChannelSet5(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet5");
single_value->field_modeOfChannelSet5.log_match(match_value.modeOfChannelSet5(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet5.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet5 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet5.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet6().ispresent()){
if(!single_value->field_modeOfChannelSet6.match(match_value.modeOfChannelSet6(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet6");
single_value->field_modeOfChannelSet6.log_match(match_value.modeOfChannelSet6(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet6.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet6 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet6.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet7().ispresent()){
if(!single_value->field_modeOfChannelSet7.match(match_value.modeOfChannelSet7(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet7");
single_value->field_modeOfChannelSet7.log_match(match_value.modeOfChannelSet7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet7.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet7 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet7.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.modeOfChannelSet8().ispresent()){
if(!single_value->field_modeOfChannelSet8.match(match_value.modeOfChannelSet8(), legacy)){
TTCN_Logger::log_logmatch_info(".modeOfChannelSet8");
single_value->field_modeOfChannelSet8.log_match(match_value.modeOfChannelSet8(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_modeOfChannelSet8.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".modeOfChannelSet8 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_modeOfChannelSet8.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", multislotAllocation := ");
single_value->field_multislotAllocation.log_match(match_value.multislotAllocation(), legacy);
TTCN_Logger::log_event_str(", modeOfChannelSet1 := ");
if (match_value.modeOfChannelSet1().ispresent()) {
single_value->field_modeOfChannelSet1.log_match(match_value.modeOfChannelSet1(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet1.log();
if (single_value->field_modeOfChannelSet1.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet2 := ");
if (match_value.modeOfChannelSet2().ispresent()) {
single_value->field_modeOfChannelSet2.log_match(match_value.modeOfChannelSet2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet2.log();
if (single_value->field_modeOfChannelSet2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet3 := ");
if (match_value.modeOfChannelSet3().ispresent()) {
single_value->field_modeOfChannelSet3.log_match(match_value.modeOfChannelSet3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet3.log();
if (single_value->field_modeOfChannelSet3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet4 := ");
if (match_value.modeOfChannelSet4().ispresent()) {
single_value->field_modeOfChannelSet4.log_match(match_value.modeOfChannelSet4(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet4.log();
if (single_value->field_modeOfChannelSet4.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet5 := ");
if (match_value.modeOfChannelSet5().ispresent()) {
single_value->field_modeOfChannelSet5.log_match(match_value.modeOfChannelSet5(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet5.log();
if (single_value->field_modeOfChannelSet5.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet6 := ");
if (match_value.modeOfChannelSet6().ispresent()) {
single_value->field_modeOfChannelSet6.log_match(match_value.modeOfChannelSet6(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet6.log();
if (single_value->field_modeOfChannelSet6.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet7 := ");
if (match_value.modeOfChannelSet7().ispresent()) {
single_value->field_modeOfChannelSet7.log_match(match_value.modeOfChannelSet7(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet7.log();
if (single_value->field_modeOfChannelSet7.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modeOfChannelSet8 := ");
if (match_value.modeOfChannelSet8().ispresent()) {
single_value->field_modeOfChannelSet8.log_match(match_value.modeOfChannelSet8(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_modeOfChannelSet8.log();
if (single_value->field_modeOfChannelSet8.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (multislotAllocation().is_bound()) multislotAllocation().set_implicit_omit();
if (!modeOfChannelSet1().is_bound()) modeOfChannelSet1() = OMIT_VALUE;
else modeOfChannelSet1().set_implicit_omit();
if (!modeOfChannelSet2().is_bound()) modeOfChannelSet2() = OMIT_VALUE;
else modeOfChannelSet2().set_implicit_omit();
if (!modeOfChannelSet3().is_bound()) modeOfChannelSet3() = OMIT_VALUE;
else modeOfChannelSet3().set_implicit_omit();
if (!modeOfChannelSet4().is_bound()) modeOfChannelSet4() = OMIT_VALUE;
else modeOfChannelSet4().set_implicit_omit();
if (!modeOfChannelSet5().is_bound()) modeOfChannelSet5() = OMIT_VALUE;
else modeOfChannelSet5().set_implicit_omit();
if (!modeOfChannelSet6().is_bound()) modeOfChannelSet6() = OMIT_VALUE;
else modeOfChannelSet6().set_implicit_omit();
if (!modeOfChannelSet7().is_bound()) modeOfChannelSet7() = OMIT_VALUE;
else modeOfChannelSet7().set_implicit_omit();
if (!modeOfChannelSet8().is_bound()) modeOfChannelSet8() = OMIT_VALUE;
else modeOfChannelSet8().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_multislotAllocation.encode_text(text_buf);
single_value->field_modeOfChannelSet1.encode_text(text_buf);
single_value->field_modeOfChannelSet2.encode_text(text_buf);
single_value->field_modeOfChannelSet3.encode_text(text_buf);
single_value->field_modeOfChannelSet4.encode_text(text_buf);
single_value->field_modeOfChannelSet5.encode_text(text_buf);
single_value->field_modeOfChannelSet6.encode_text(text_buf);
single_value->field_modeOfChannelSet7.encode_text(text_buf);
single_value->field_modeOfChannelSet8.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
}
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_multislotAllocation.decode_text(text_buf);
single_value->field_modeOfChannelSet1.decode_text(text_buf);
single_value->field_modeOfChannelSet2.decode_text(text_buf);
single_value->field_modeOfChannelSet3.decode_text(text_buf);
single_value->field_modeOfChannelSet4.decode_text(text_buf);
single_value->field_modeOfChannelSet5.decode_text(text_buf);
single_value->field_modeOfChannelSet6.decode_text(text_buf);
single_value->field_modeOfChannelSet7.decode_text(text_buf);
single_value->field_modeOfChannelSet8.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS.");
}
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__RRM__ConfigurationChangeCommand__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (10<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS has 10 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) multislotAllocation().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet4().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet5().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet6().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet7().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) modeOfChannelSet8().set_param(*param.get_elem(9));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet6")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet6().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modeOfChannelSet8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modeOfChannelSet8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ConfigurationChangeCommand__NW__MS_template* precondition = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ConfigurationChangeCommand__NW__MS_template* implied_template = new PDU__RRM__ConfigurationChangeCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ConfigurationChangeCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ConfigurationChangeCommand__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_multislotAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet1.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet3.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet4.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet5.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet6.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet7.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
single_value->field_modeOfChannelSet8.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeCommand_NW_MS");
}

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__ConfigurationChangeCommand__NW__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__RRM__ConfigurationChangeAck__MS__NW::PDU__RRM__ConfigurationChangeAck__MS__NW()
{
}

PDU__RRM__ConfigurationChangeAck__MS__NW::PDU__RRM__ConfigurationChangeAck__MS__NW(const BITSTRING& par_messageType)
  :   field_messageType(par_messageType)
{
}

PDU__RRM__ConfigurationChangeAck__MS__NW::PDU__RRM__ConfigurationChangeAck__MS__NW(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
}

void PDU__RRM__ConfigurationChangeAck__MS__NW::clean_up()
{
field_messageType.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ConfigurationChangeAck__MS__NW::get_descriptor() const { return &PDU__RRM__ConfigurationChangeAck__MS__NW_descr_; }
PDU__RRM__ConfigurationChangeAck__MS__NW& PDU__RRM__ConfigurationChangeAck__MS__NW::operator=(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
}
return *this;
}

boolean PDU__RRM__ConfigurationChangeAck__MS__NW::operator==(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType;
}

boolean PDU__RRM__ConfigurationChangeAck__MS__NW::is_bound() const
{
return (field_messageType.is_bound());
}
boolean PDU__RRM__ConfigurationChangeAck__MS__NW::is_value() const
{
return field_messageType.is_value();
}
void PDU__RRM__ConfigurationChangeAck__MS__NW::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ConfigurationChangeAck__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeAck__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW");
  }
}

void PDU__RRM__ConfigurationChangeAck__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeAck__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeAck__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__ConfigurationChangeAck__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__ConfigurationChangeAck__MS__NW::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__ConfigurationChangeAck__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 1;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(1);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ConfigurationChangeAck__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
};

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
}
}
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::copy_value(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::copy_template(const PDU__RRM__ConfigurationChangeAck__MS__NW_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__RRM__ConfigurationChangeAck__MS__NW_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__RRM__ConfigurationChangeAck__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ConfigurationChangeAck__MS__NW_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template::PDU__RRM__ConfigurationChangeAck__MS__NW_template()
{
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template::PDU__RRM__ConfigurationChangeAck__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template::PDU__RRM__ConfigurationChangeAck__MS__NW_template(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template::PDU__RRM__ConfigurationChangeAck__MS__NW_template(const OPTIONAL<PDU__RRM__ConfigurationChangeAck__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ConfigurationChangeAck__MS__NW&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW from an unbound optional field.");
}
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template::PDU__RRM__ConfigurationChangeAck__MS__NW_template(PDU__RRM__ConfigurationChangeAck__MS__NW_template* p_precondition, PDU__RRM__ConfigurationChangeAck__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template::PDU__RRM__ConfigurationChangeAck__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__ConfigurationChangeAck__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__ConfigurationChangeAck__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template::PDU__RRM__ConfigurationChangeAck__MS__NW_template(const PDU__RRM__ConfigurationChangeAck__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template::~PDU__RRM__ConfigurationChangeAck__MS__NW_template()
{
clean_up();
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template& PDU__RRM__ConfigurationChangeAck__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template& PDU__RRM__ConfigurationChangeAck__MS__NW_template::operator=(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template& PDU__RRM__ConfigurationChangeAck__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__ConfigurationChangeAck__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ConfigurationChangeAck__MS__NW&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
}
return *this;
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template& PDU__RRM__ConfigurationChangeAck__MS__NW_template::operator=(const PDU__RRM__ConfigurationChangeAck__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__ConfigurationChangeAck__MS__NW_template::match(const PDU__RRM__ConfigurationChangeAck__MS__NW& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__ConfigurationChangeAck__MS__NW_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound();
}

boolean PDU__RRM__ConfigurationChangeAck__MS__NW_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value();
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__RRM__ConfigurationChangeAck__MS__NW PDU__RRM__ConfigurationChangeAck__MS__NW_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
PDU__RRM__ConfigurationChangeAck__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
return ret_val;
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ConfigurationChangeAck__MS__NW_template[list_length];
}

PDU__RRM__ConfigurationChangeAck__MS__NW_template& PDU__RRM__ConfigurationChangeAck__MS__NW_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__ConfigurationChangeAck__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__ConfigurationChangeAck__MS__NW_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
return single_value->field_messageType;
}

int PDU__RRM__ConfigurationChangeAck__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
  }
  return 0;
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::log_match(const PDU__RRM__ConfigurationChangeAck__MS__NW& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
}
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__RRM__ConfigurationChangeAck__MS__NW_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW.");
}
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__RRM__ConfigurationChangeAck__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ConfigurationChangeAck__MS__NW_template* precondition = new PDU__RRM__ConfigurationChangeAck__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ConfigurationChangeAck__MS__NW_template* implied_template = new PDU__RRM__ConfigurationChangeAck__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ConfigurationChangeAck__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ConfigurationChangeAck__MS__NW_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeAck_MS_NW");
}

boolean PDU__RRM__ConfigurationChangeAck__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__ConfigurationChangeAck__MS__NW_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__RRM__ConfigurationChangeRej__MS__NW::PDU__RRM__ConfigurationChangeRej__MS__NW()
{
}

PDU__RRM__ConfigurationChangeRej__MS__NW::PDU__RRM__ConfigurationChangeRej__MS__NW(const BITSTRING& par_messageType,
    const RR__Cause__V& par_rR__Cause)
  :   field_messageType(par_messageType),
  field_rR__Cause(par_rR__Cause)
{
}

PDU__RRM__ConfigurationChangeRej__MS__NW::PDU__RRM__ConfigurationChangeRej__MS__NW(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.rR__Cause().is_bound()) field_rR__Cause = other_value.rR__Cause();
else field_rR__Cause.clean_up();
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::clean_up()
{
field_messageType.clean_up();
field_rR__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__ConfigurationChangeRej__MS__NW::get_descriptor() const { return &PDU__RRM__ConfigurationChangeRej__MS__NW_descr_; }
PDU__RRM__ConfigurationChangeRej__MS__NW& PDU__RRM__ConfigurationChangeRej__MS__NW::operator=(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.rR__Cause().is_bound()) field_rR__Cause = other_value.rR__Cause();
  else field_rR__Cause.clean_up();
}
return *this;
}

boolean PDU__RRM__ConfigurationChangeRej__MS__NW::operator==(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_rR__Cause==other_value.field_rR__Cause;
}

boolean PDU__RRM__ConfigurationChangeRej__MS__NW::is_bound() const
{
return (field_messageType.is_bound())
  || (field_rR__Cause.is_bound());
}
boolean PDU__RRM__ConfigurationChangeRej__MS__NW::is_value() const
{
return field_messageType.is_value()
  && field_rR__Cause.is_value();
}
void PDU__RRM__ConfigurationChangeRej__MS__NW::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", rR_Cause := ");
field_rR__Cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rR__Cause().is_bound()) rR__Cause().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rR__Cause().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rR_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rR__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW");
  }
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_rR__Cause.encode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_rR__Cause.decode_text(text_buf);
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__ConfigurationChangeRej__MS__NW::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__ConfigurationChangeRej__MS__NW::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, RR__Cause__V_descr_.raw->forceomit);
  decoded_field_length = field_rR__Cause.RAW_decode(RR__Cause__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__ConfigurationChangeRej__MS__NW::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RR__Cause__V_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rR__Cause.RAW_encode(RR__Cause__V_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__RRM__ConfigurationChangeRej__MS__NW_template::single_value_struct {
BITSTRING_template field_messageType;
RR__Cause__V_template field_rR__Cause;
};

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_rR__Cause = ANY_VALUE;
}
}
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::copy_value(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.rR__Cause().is_bound()) {
  single_value->field_rR__Cause = other_value.rR__Cause();
} else {
  single_value->field_rR__Cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::copy_template(const PDU__RRM__ConfigurationChangeRej__MS__NW_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rR__Cause().get_selection()) {
single_value->field_rR__Cause = other_value.rR__Cause();
} else {
single_value->field_rR__Cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__RRM__ConfigurationChangeRej__MS__NW_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__RRM__ConfigurationChangeRej__MS__NW_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__ConfigurationChangeRej__MS__NW_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
break;
}
set_selection(other_value);
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template::PDU__RRM__ConfigurationChangeRej__MS__NW_template()
{
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template::PDU__RRM__ConfigurationChangeRej__MS__NW_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template::PDU__RRM__ConfigurationChangeRej__MS__NW_template(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value)
{
copy_value(other_value);
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template::PDU__RRM__ConfigurationChangeRej__MS__NW_template(const OPTIONAL<PDU__RRM__ConfigurationChangeRej__MS__NW>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ConfigurationChangeRej__MS__NW&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW from an unbound optional field.");
}
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template::PDU__RRM__ConfigurationChangeRej__MS__NW_template(PDU__RRM__ConfigurationChangeRej__MS__NW_template* p_precondition, PDU__RRM__ConfigurationChangeRej__MS__NW_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template::PDU__RRM__ConfigurationChangeRej__MS__NW_template(Dynamic_Match_Interface<PDU__RRM__ConfigurationChangeRej__MS__NW>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__ConfigurationChangeRej__MS__NW>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template::PDU__RRM__ConfigurationChangeRej__MS__NW_template(const PDU__RRM__ConfigurationChangeRej__MS__NW_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template::~PDU__RRM__ConfigurationChangeRej__MS__NW_template()
{
clean_up();
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::operator=(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::operator=(const OPTIONAL<PDU__RRM__ConfigurationChangeRej__MS__NW>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__ConfigurationChangeRej__MS__NW&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
}
return *this;
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::operator=(const PDU__RRM__ConfigurationChangeRej__MS__NW_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__ConfigurationChangeRej__MS__NW_template::match(const PDU__RRM__ConfigurationChangeRej__MS__NW& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.rR__Cause().is_bound()) return FALSE;
if(!single_value->field_rR__Cause.match(other_value.rR__Cause(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
}
return FALSE;
}

boolean PDU__RRM__ConfigurationChangeRej__MS__NW_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_rR__Cause.is_bound();
}

boolean PDU__RRM__ConfigurationChangeRej__MS__NW_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_rR__Cause.is_value();
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__RRM__ConfigurationChangeRej__MS__NW PDU__RRM__ConfigurationChangeRej__MS__NW_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
PDU__RRM__ConfigurationChangeRej__MS__NW ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_rR__Cause.is_bound()) {
ret_val.rR__Cause() = single_value->field_rR__Cause.valueof();
}
return ret_val;
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__ConfigurationChangeRej__MS__NW_template[list_length];
}

PDU__RRM__ConfigurationChangeRej__MS__NW_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
return single_value->field_messageType;
}

RR__Cause__V_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::rR__Cause()
{
set_specific();
return single_value->field_rR__Cause;
}

const RR__Cause__V_template& PDU__RRM__ConfigurationChangeRej__MS__NW_template::rR__Cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rR_Cause of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
return single_value->field_rR__Cause;
}

int PDU__RRM__ConfigurationChangeRej__MS__NW_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
  }
  return 0;
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", rR_Cause := ");
single_value->field_rR__Cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::log_match(const PDU__RRM__ConfigurationChangeRej__MS__NW& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rR__Cause.match(match_value.rR__Cause(), legacy)){
TTCN_Logger::log_logmatch_info(".rR_Cause");
single_value->field_rR__Cause.log_match(match_value.rR__Cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", rR_Cause := ");
single_value->field_rR__Cause.log_match(match_value.rR__Cause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (rR__Cause().is_bound()) rR__Cause().set_implicit_omit();
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_rR__Cause.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
}
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_rR__Cause.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__RRM__ConfigurationChangeRej__MS__NW_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW.");
}
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__RRM__ConfigurationChangeRej__MS__NW_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rR__Cause().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rR_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rR__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__ConfigurationChangeRej__MS__NW_template* precondition = new PDU__RRM__ConfigurationChangeRej__MS__NW_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__ConfigurationChangeRej__MS__NW_template* implied_template = new PDU__RRM__ConfigurationChangeRej__MS__NW_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__ConfigurationChangeRej__MS__NW_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__ConfigurationChangeRej__MS__NW_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW");
single_value->field_rR__Cause.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_ConfigurationChangeRej_MS_NW");
}

boolean PDU__RRM__ConfigurationChangeRej__MS__NW_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__ConfigurationChangeRej__MS__NW_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__RRM__DTM__AssignmentCommand__NW__MS::PDU__RRM__DTM__AssignmentCommand__NW__MS()
{
}

PDU__RRM__DTM__AssignmentCommand__NW__MS::PDU__RRM__DTM__AssignmentCommand__NW__MS(const BITSTRING& par_messageType,
    const PowerCommand__V& par_cS__PowerCommand,
    const ChannelDescription__V& par_description__CS__Channel,
    const GPRS__BroadcastInformation__LV& par_gPRS__BroadcastInformation,
    const OPTIONAL< CellChannelDescription__TV >& par_cellChannelDescr,
    const OPTIONAL< ChannelMode__TV >& par_channelMode,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_frequencyList,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_mobileAllocation,
    const OPTIONAL< RR__PacketUplinkAssignment__TLV >& par_descrUplinkPacketChannelAssignment,
    const OPTIONAL< RR__PacketDownlinkAssignment__TLV >& par_descrDownlinkPacketChannelAssignment,
    const OPTIONAL< MultiRateConfiguration__TLV >& par_multiRateConfiguration,
    const OPTIONAL< CipherModeSetting__TV >& par_cipherModeSetting,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_mobileAllocationC2,
    const OPTIONAL< MobileL3__CommonIE__Types::Type4__TLV >& par_frequencyListC2,
    const OPTIONAL< RR__DualCarrierPacketDownlinkAssignment__TLV >& par_descriptionDualCarrierPacketDownlinkAssignment,
    const OPTIONAL< ChannelDescription3__TV >& par_channelDescriptionC2,
    const OPTIONAL< ExtendedTSCSet__TV >& par_extendedTSCSet)
  :   field_messageType(par_messageType),
  field_cS__PowerCommand(par_cS__PowerCommand),
  field_description__CS__Channel(par_description__CS__Channel),
  field_gPRS__BroadcastInformation(par_gPRS__BroadcastInformation),
  field_cellChannelDescr(par_cellChannelDescr),
  field_channelMode(par_channelMode),
  field_frequencyList(par_frequencyList),
  field_mobileAllocation(par_mobileAllocation),
  field_descrUplinkPacketChannelAssignment(par_descrUplinkPacketChannelAssignment),
  field_descrDownlinkPacketChannelAssignment(par_descrDownlinkPacketChannelAssignment),
  field_multiRateConfiguration(par_multiRateConfiguration),
  field_cipherModeSetting(par_cipherModeSetting),
  field_mobileAllocationC2(par_mobileAllocationC2),
  field_frequencyListC2(par_frequencyListC2),
  field_descriptionDualCarrierPacketDownlinkAssignment(par_descriptionDualCarrierPacketDownlinkAssignment),
  field_channelDescriptionC2(par_channelDescriptionC2),
  field_extendedTSCSet(par_extendedTSCSet)
{
}

PDU__RRM__DTM__AssignmentCommand__NW__MS::PDU__RRM__DTM__AssignmentCommand__NW__MS(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.cS__PowerCommand().is_bound()) field_cS__PowerCommand = other_value.cS__PowerCommand();
else field_cS__PowerCommand.clean_up();
if (other_value.description__CS__Channel().is_bound()) field_description__CS__Channel = other_value.description__CS__Channel();
else field_description__CS__Channel.clean_up();
if (other_value.gPRS__BroadcastInformation().is_bound()) field_gPRS__BroadcastInformation = other_value.gPRS__BroadcastInformation();
else field_gPRS__BroadcastInformation.clean_up();
if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
else field_cellChannelDescr.clean_up();
if (other_value.channelMode().is_bound()) field_channelMode = other_value.channelMode();
else field_channelMode.clean_up();
if (other_value.frequencyList().is_bound()) field_frequencyList = other_value.frequencyList();
else field_frequencyList.clean_up();
if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
else field_mobileAllocation.clean_up();
if (other_value.descrUplinkPacketChannelAssignment().is_bound()) field_descrUplinkPacketChannelAssignment = other_value.descrUplinkPacketChannelAssignment();
else field_descrUplinkPacketChannelAssignment.clean_up();
if (other_value.descrDownlinkPacketChannelAssignment().is_bound()) field_descrDownlinkPacketChannelAssignment = other_value.descrDownlinkPacketChannelAssignment();
else field_descrDownlinkPacketChannelAssignment.clean_up();
if (other_value.multiRateConfiguration().is_bound()) field_multiRateConfiguration = other_value.multiRateConfiguration();
else field_multiRateConfiguration.clean_up();
if (other_value.cipherModeSetting().is_bound()) field_cipherModeSetting = other_value.cipherModeSetting();
else field_cipherModeSetting.clean_up();
if (other_value.mobileAllocationC2().is_bound()) field_mobileAllocationC2 = other_value.mobileAllocationC2();
else field_mobileAllocationC2.clean_up();
if (other_value.frequencyListC2().is_bound()) field_frequencyListC2 = other_value.frequencyListC2();
else field_frequencyListC2.clean_up();
if (other_value.descriptionDualCarrierPacketDownlinkAssignment().is_bound()) field_descriptionDualCarrierPacketDownlinkAssignment = other_value.descriptionDualCarrierPacketDownlinkAssignment();
else field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
if (other_value.channelDescriptionC2().is_bound()) field_channelDescriptionC2 = other_value.channelDescriptionC2();
else field_channelDescriptionC2.clean_up();
if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
else field_extendedTSCSet.clean_up();
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::clean_up()
{
field_messageType.clean_up();
field_cS__PowerCommand.clean_up();
field_description__CS__Channel.clean_up();
field_gPRS__BroadcastInformation.clean_up();
field_cellChannelDescr.clean_up();
field_channelMode.clean_up();
field_frequencyList.clean_up();
field_mobileAllocation.clean_up();
field_descrUplinkPacketChannelAssignment.clean_up();
field_descrDownlinkPacketChannelAssignment.clean_up();
field_multiRateConfiguration.clean_up();
field_cipherModeSetting.clean_up();
field_mobileAllocationC2.clean_up();
field_frequencyListC2.clean_up();
field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
field_channelDescriptionC2.clean_up();
field_extendedTSCSet.clean_up();
}

const TTCN_Typedescriptor_t* PDU__RRM__DTM__AssignmentCommand__NW__MS::get_descriptor() const { return &PDU__RRM__DTM__AssignmentCommand__NW__MS_descr_; }
PDU__RRM__DTM__AssignmentCommand__NW__MS& PDU__RRM__DTM__AssignmentCommand__NW__MS::operator=(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.cS__PowerCommand().is_bound()) field_cS__PowerCommand = other_value.cS__PowerCommand();
  else field_cS__PowerCommand.clean_up();
  if (other_value.description__CS__Channel().is_bound()) field_description__CS__Channel = other_value.description__CS__Channel();
  else field_description__CS__Channel.clean_up();
  if (other_value.gPRS__BroadcastInformation().is_bound()) field_gPRS__BroadcastInformation = other_value.gPRS__BroadcastInformation();
  else field_gPRS__BroadcastInformation.clean_up();
  if (other_value.cellChannelDescr().is_bound()) field_cellChannelDescr = other_value.cellChannelDescr();
  else field_cellChannelDescr.clean_up();
  if (other_value.channelMode().is_bound()) field_channelMode = other_value.channelMode();
  else field_channelMode.clean_up();
  if (other_value.frequencyList().is_bound()) field_frequencyList = other_value.frequencyList();
  else field_frequencyList.clean_up();
  if (other_value.mobileAllocation().is_bound()) field_mobileAllocation = other_value.mobileAllocation();
  else field_mobileAllocation.clean_up();
  if (other_value.descrUplinkPacketChannelAssignment().is_bound()) field_descrUplinkPacketChannelAssignment = other_value.descrUplinkPacketChannelAssignment();
  else field_descrUplinkPacketChannelAssignment.clean_up();
  if (other_value.descrDownlinkPacketChannelAssignment().is_bound()) field_descrDownlinkPacketChannelAssignment = other_value.descrDownlinkPacketChannelAssignment();
  else field_descrDownlinkPacketChannelAssignment.clean_up();
  if (other_value.multiRateConfiguration().is_bound()) field_multiRateConfiguration = other_value.multiRateConfiguration();
  else field_multiRateConfiguration.clean_up();
  if (other_value.cipherModeSetting().is_bound()) field_cipherModeSetting = other_value.cipherModeSetting();
  else field_cipherModeSetting.clean_up();
  if (other_value.mobileAllocationC2().is_bound()) field_mobileAllocationC2 = other_value.mobileAllocationC2();
  else field_mobileAllocationC2.clean_up();
  if (other_value.frequencyListC2().is_bound()) field_frequencyListC2 = other_value.frequencyListC2();
  else field_frequencyListC2.clean_up();
  if (other_value.descriptionDualCarrierPacketDownlinkAssignment().is_bound()) field_descriptionDualCarrierPacketDownlinkAssignment = other_value.descriptionDualCarrierPacketDownlinkAssignment();
  else field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
  if (other_value.channelDescriptionC2().is_bound()) field_channelDescriptionC2 = other_value.channelDescriptionC2();
  else field_channelDescriptionC2.clean_up();
  if (other_value.extendedTSCSet().is_bound()) field_extendedTSCSet = other_value.extendedTSCSet();
  else field_extendedTSCSet.clean_up();
}
return *this;
}

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS::operator==(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_cS__PowerCommand==other_value.field_cS__PowerCommand
  && field_description__CS__Channel==other_value.field_description__CS__Channel
  && field_gPRS__BroadcastInformation==other_value.field_gPRS__BroadcastInformation
  && field_cellChannelDescr==other_value.field_cellChannelDescr
  && field_channelMode==other_value.field_channelMode
  && field_frequencyList==other_value.field_frequencyList
  && field_mobileAllocation==other_value.field_mobileAllocation
  && field_descrUplinkPacketChannelAssignment==other_value.field_descrUplinkPacketChannelAssignment
  && field_descrDownlinkPacketChannelAssignment==other_value.field_descrDownlinkPacketChannelAssignment
  && field_multiRateConfiguration==other_value.field_multiRateConfiguration
  && field_cipherModeSetting==other_value.field_cipherModeSetting
  && field_mobileAllocationC2==other_value.field_mobileAllocationC2
  && field_frequencyListC2==other_value.field_frequencyListC2
  && field_descriptionDualCarrierPacketDownlinkAssignment==other_value.field_descriptionDualCarrierPacketDownlinkAssignment
  && field_channelDescriptionC2==other_value.field_channelDescriptionC2
  && field_extendedTSCSet==other_value.field_extendedTSCSet;
}

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_cS__PowerCommand.is_bound())
  || (field_description__CS__Channel.is_bound())
  || (field_gPRS__BroadcastInformation.is_bound())
  || (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_bound())
  || (OPTIONAL_OMIT == field_channelMode.get_selection() || field_channelMode.is_bound())
  || (OPTIONAL_OMIT == field_frequencyList.get_selection() || field_frequencyList.is_bound())
  || (OPTIONAL_OMIT == field_mobileAllocation.get_selection() || field_mobileAllocation.is_bound())
  || (OPTIONAL_OMIT == field_descrUplinkPacketChannelAssignment.get_selection() || field_descrUplinkPacketChannelAssignment.is_bound())
  || (OPTIONAL_OMIT == field_descrDownlinkPacketChannelAssignment.get_selection() || field_descrDownlinkPacketChannelAssignment.is_bound())
  || (OPTIONAL_OMIT == field_multiRateConfiguration.get_selection() || field_multiRateConfiguration.is_bound())
  || (OPTIONAL_OMIT == field_cipherModeSetting.get_selection() || field_cipherModeSetting.is_bound())
  || (OPTIONAL_OMIT == field_mobileAllocationC2.get_selection() || field_mobileAllocationC2.is_bound())
  || (OPTIONAL_OMIT == field_frequencyListC2.get_selection() || field_frequencyListC2.is_bound())
  || (OPTIONAL_OMIT == field_descriptionDualCarrierPacketDownlinkAssignment.get_selection() || field_descriptionDualCarrierPacketDownlinkAssignment.is_bound())
  || (OPTIONAL_OMIT == field_channelDescriptionC2.get_selection() || field_channelDescriptionC2.is_bound())
  || (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_bound());
}
boolean PDU__RRM__DTM__AssignmentCommand__NW__MS::is_value() const
{
return field_messageType.is_value()
  && field_cS__PowerCommand.is_value()
  && field_description__CS__Channel.is_value()
  && field_gPRS__BroadcastInformation.is_value()
  && (OPTIONAL_OMIT == field_cellChannelDescr.get_selection() || field_cellChannelDescr.is_value())
  && (OPTIONAL_OMIT == field_channelMode.get_selection() || field_channelMode.is_value())
  && (OPTIONAL_OMIT == field_frequencyList.get_selection() || field_frequencyList.is_value())
  && (OPTIONAL_OMIT == field_mobileAllocation.get_selection() || field_mobileAllocation.is_value())
  && (OPTIONAL_OMIT == field_descrUplinkPacketChannelAssignment.get_selection() || field_descrUplinkPacketChannelAssignment.is_value())
  && (OPTIONAL_OMIT == field_descrDownlinkPacketChannelAssignment.get_selection() || field_descrDownlinkPacketChannelAssignment.is_value())
  && (OPTIONAL_OMIT == field_multiRateConfiguration.get_selection() || field_multiRateConfiguration.is_value())
  && (OPTIONAL_OMIT == field_cipherModeSetting.get_selection() || field_cipherModeSetting.is_value())
  && (OPTIONAL_OMIT == field_mobileAllocationC2.get_selection() || field_mobileAllocationC2.is_value())
  && (OPTIONAL_OMIT == field_frequencyListC2.get_selection() || field_frequencyListC2.is_value())
  && (OPTIONAL_OMIT == field_descriptionDualCarrierPacketDownlinkAssignment.get_selection() || field_descriptionDualCarrierPacketDownlinkAssignment.is_value())
  && (OPTIONAL_OMIT == field_channelDescriptionC2.get_selection() || field_channelDescriptionC2.is_value())
  && (OPTIONAL_OMIT == field_extendedTSCSet.get_selection() || field_extendedTSCSet.is_value());
}
int PDU__RRM__DTM__AssignmentCommand__NW__MS::size_of() const
{
  int ret_val = 4;
  if (field_cellChannelDescr.ispresent()) ret_val++;
  if (field_channelMode.ispresent()) ret_val++;
  if (field_frequencyList.ispresent()) ret_val++;
  if (field_mobileAllocation.ispresent()) ret_val++;
  if (field_descrUplinkPacketChannelAssignment.ispresent()) ret_val++;
  if (field_descrDownlinkPacketChannelAssignment.ispresent()) ret_val++;
  if (field_multiRateConfiguration.ispresent()) ret_val++;
  if (field_cipherModeSetting.ispresent()) ret_val++;
  if (field_mobileAllocationC2.ispresent()) ret_val++;
  if (field_frequencyListC2.ispresent()) ret_val++;
  if (field_descriptionDualCarrierPacketDownlinkAssignment.ispresent()) ret_val++;
  if (field_channelDescriptionC2.ispresent()) ret_val++;
  if (field_extendedTSCSet.ispresent()) ret_val++;
  return ret_val;
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", cS_PowerCommand := ");
field_cS__PowerCommand.log();
TTCN_Logger::log_event_str(", description_CS_Channel := ");
field_description__CS__Channel.log();
TTCN_Logger::log_event_str(", gPRS_BroadcastInformation := ");
field_gPRS__BroadcastInformation.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", channelMode := ");
field_channelMode.log();
TTCN_Logger::log_event_str(", frequencyList := ");
field_frequencyList.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
field_mobileAllocation.log();
TTCN_Logger::log_event_str(", descrUplinkPacketChannelAssignment := ");
field_descrUplinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(", descrDownlinkPacketChannelAssignment := ");
field_descrDownlinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(", multiRateConfiguration := ");
field_multiRateConfiguration.log();
TTCN_Logger::log_event_str(", cipherModeSetting := ");
field_cipherModeSetting.log();
TTCN_Logger::log_event_str(", mobileAllocationC2 := ");
field_mobileAllocationC2.log();
TTCN_Logger::log_event_str(", frequencyListC2 := ");
field_frequencyListC2.log();
TTCN_Logger::log_event_str(", descriptionDualCarrierPacketDownlinkAssignment := ");
field_descriptionDualCarrierPacketDownlinkAssignment.log();
TTCN_Logger::log_event_str(", channelDescriptionC2 := ");
field_channelDescriptionC2.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
field_extendedTSCSet.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cS__PowerCommand().is_bound()) cS__PowerCommand().set_implicit_omit();
if (description__CS__Channel().is_bound()) description__CS__Channel().set_implicit_omit();
if (gPRS__BroadcastInformation().is_bound()) gPRS__BroadcastInformation().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!channelMode().is_bound()) channelMode() = OMIT_VALUE;
else channelMode().set_implicit_omit();
if (!frequencyList().is_bound()) frequencyList() = OMIT_VALUE;
else frequencyList().set_implicit_omit();
if (!mobileAllocation().is_bound()) mobileAllocation() = OMIT_VALUE;
else mobileAllocation().set_implicit_omit();
if (!descrUplinkPacketChannelAssignment().is_bound()) descrUplinkPacketChannelAssignment() = OMIT_VALUE;
else descrUplinkPacketChannelAssignment().set_implicit_omit();
if (!descrDownlinkPacketChannelAssignment().is_bound()) descrDownlinkPacketChannelAssignment() = OMIT_VALUE;
else descrDownlinkPacketChannelAssignment().set_implicit_omit();
if (!multiRateConfiguration().is_bound()) multiRateConfiguration() = OMIT_VALUE;
else multiRateConfiguration().set_implicit_omit();
if (!cipherModeSetting().is_bound()) cipherModeSetting() = OMIT_VALUE;
else cipherModeSetting().set_implicit_omit();
if (!mobileAllocationC2().is_bound()) mobileAllocationC2() = OMIT_VALUE;
else mobileAllocationC2().set_implicit_omit();
if (!frequencyListC2().is_bound()) frequencyListC2() = OMIT_VALUE;
else frequencyListC2().set_implicit_omit();
if (!descriptionDualCarrierPacketDownlinkAssignment().is_bound()) descriptionDualCarrierPacketDownlinkAssignment() = OMIT_VALUE;
else descriptionDualCarrierPacketDownlinkAssignment().set_implicit_omit();
if (!channelDescriptionC2().is_bound()) channelDescriptionC2() = OMIT_VALUE;
else channelDescriptionC2().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (17<param.get_size()) {
      param.error("record value of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS has 17 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cS__PowerCommand().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) description__CS__Channel().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gPRS__BroadcastInformation().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescr().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) channelMode().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) frequencyList().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) descrUplinkPacketChannelAssignment().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) descrDownlinkPacketChannelAssignment().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) cipherModeSetting().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) mobileAllocationC2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) frequencyListC2().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) descriptionDualCarrierPacketDownlinkAssignment().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) channelDescriptionC2().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().set_param(*param.get_elem(16));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cS_PowerCommand")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__PowerCommand().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "description_CS_Channel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          description__CS__Channel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gPRS_BroadcastInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPRS__BroadcastInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellChannelDescr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellChannelDescr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrUplinkPacketChannelAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrUplinkPacketChannelAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrDownlinkPacketChannelAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrDownlinkPacketChannelAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multiRateConfiguration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multiRateConfiguration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipherModeSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipherModeSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocationC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocationC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyListC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyListC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descriptionDualCarrierPacketDownlinkAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descriptionDualCarrierPacketDownlinkAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescriptionC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescriptionC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
  }
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_cS__PowerCommand.encode_text(text_buf);
field_description__CS__Channel.encode_text(text_buf);
field_gPRS__BroadcastInformation.encode_text(text_buf);
field_cellChannelDescr.encode_text(text_buf);
field_channelMode.encode_text(text_buf);
field_frequencyList.encode_text(text_buf);
field_mobileAllocation.encode_text(text_buf);
field_descrUplinkPacketChannelAssignment.encode_text(text_buf);
field_descrDownlinkPacketChannelAssignment.encode_text(text_buf);
field_multiRateConfiguration.encode_text(text_buf);
field_cipherModeSetting.encode_text(text_buf);
field_mobileAllocationC2.encode_text(text_buf);
field_frequencyListC2.encode_text(text_buf);
field_descriptionDualCarrierPacketDownlinkAssignment.encode_text(text_buf);
field_channelDescriptionC2.encode_text(text_buf);
field_extendedTSCSet.encode_text(text_buf);
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_cS__PowerCommand.decode_text(text_buf);
field_description__CS__Channel.decode_text(text_buf);
field_gPRS__BroadcastInformation.decode_text(text_buf);
field_cellChannelDescr.decode_text(text_buf);
field_channelMode.decode_text(text_buf);
field_frequencyList.decode_text(text_buf);
field_mobileAllocation.decode_text(text_buf);
field_descrUplinkPacketChannelAssignment.decode_text(text_buf);
field_descrDownlinkPacketChannelAssignment.decode_text(text_buf);
field_multiRateConfiguration.decode_text(text_buf);
field_cipherModeSetting.decode_text(text_buf);
field_mobileAllocationC2.decode_text(text_buf);
field_frequencyListC2.decode_text(text_buf);
field_descriptionDualCarrierPacketDownlinkAssignment.decode_text(text_buf);
field_channelDescriptionC2.decode_text(text_buf);
field_extendedTSCSet.decode_text(text_buf);
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__RRM__DTM__AssignmentCommand__NW__MS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, PowerCommand__V_descr_.raw->forceomit);
  decoded_field_length = field_cS__PowerCommand.RAW_decode(PowerCommand__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, ChannelDescription__V_descr_.raw->forceomit);
  decoded_field_length = field_description__CS__Channel.RAW_decode(ChannelDescription__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, GPRS__BroadcastInformation__LV_descr_.raw->forceomit);
  decoded_field_length = field_gPRS__BroadcastInformation.RAW_decode(GPRS__BroadcastInformation__LV_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_cellChannelDescr = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, CellChannelDescription__TV_descr_.raw->forceomit);
  decoded_field_length = field_cellChannelDescr().RAW_decode(CellChannelDescription__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_cellChannelDescr = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cellChannelDescr.ispresent() || field_cellChannelDescr().elementIdentifier() !=  os_5){
  field_cellChannelDescr=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cellChannelDescr=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_channelMode = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, ChannelMode__TV_descr_.raw->forceomit);
  decoded_field_length = field_channelMode().RAW_decode(ChannelMode__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_channelMode = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelMode.ispresent() || field_channelMode().elementIdentifier() !=  os_7){
  field_channelMode=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelMode=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_frequencyList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyList().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyList = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyList.ispresent() || field_frequencyList().elementIdentifier() !=  os_35){
  field_frequencyList=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyList=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_mobileAllocation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocation().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_mobileAllocation = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileAllocation.ispresent() || field_mobileAllocation().elementIdentifier() !=  os_8){
  field_mobileAllocation=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileAllocation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_descrUplinkPacketChannelAssignment = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, RR__PacketUplinkAssignment__TLV_descr_.raw->forceomit);
  decoded_field_length = field_descrUplinkPacketChannelAssignment().RAW_decode(RR__PacketUplinkAssignment__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_descrUplinkPacketChannelAssignment = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descrUplinkPacketChannelAssignment.ispresent() || field_descrUplinkPacketChannelAssignment().elementIdentifier() !=  os_10){
  field_descrUplinkPacketChannelAssignment=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descrUplinkPacketChannelAssignment=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_descrDownlinkPacketChannelAssignment = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, RR__PacketDownlinkAssignment__TLV_descr_.raw->forceomit);
  decoded_field_length = field_descrDownlinkPacketChannelAssignment().RAW_decode(RR__PacketDownlinkAssignment__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_descrDownlinkPacketChannelAssignment = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descrDownlinkPacketChannelAssignment.ispresent() || field_descrDownlinkPacketChannelAssignment().elementIdentifier() !=  os_11){
  field_descrDownlinkPacketChannelAssignment=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descrDownlinkPacketChannelAssignment=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_multiRateConfiguration = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, MultiRateConfiguration__TLV_descr_.raw->forceomit);
  decoded_field_length = field_multiRateConfiguration().RAW_decode(MultiRateConfiguration__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_multiRateConfiguration = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_multiRateConfiguration.ispresent() || field_multiRateConfiguration().elementIdentifier() !=  os_12){
  field_multiRateConfiguration=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_multiRateConfiguration=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_cipherModeSetting = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, CipherModeSetting__TV_descr_.raw->forceomit);
  decoded_field_length = field_cipherModeSetting().RAW_decode(CipherModeSetting__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_cipherModeSetting = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cipherModeSetting.ispresent() || field_cipherModeSetting().elementIdentifier() !=  bs_1){
  field_cipherModeSetting=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cipherModeSetting=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_mobileAllocationC2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileAllocationC2().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_mobileAllocationC2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mobileAllocationC2.ispresent() || field_mobileAllocationC2().elementIdentifier() !=  os_13){
  field_mobileAllocationC2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_mobileAllocationC2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_frequencyListC2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw->forceomit);
  decoded_field_length = field_frequencyListC2().RAW_decode(MobileL3__CommonIE__Types::Type4__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_frequencyListC2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_frequencyListC2.ispresent() || field_frequencyListC2().elementIdentifier() !=  os_16){
  field_frequencyListC2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_frequencyListC2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_descriptionDualCarrierPacketDownlinkAssignment = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, RR__DualCarrierPacketDownlinkAssignment__TLV_descr_.raw->forceomit);
  decoded_field_length = field_descriptionDualCarrierPacketDownlinkAssignment().RAW_decode(RR__DualCarrierPacketDownlinkAssignment__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_descriptionDualCarrierPacketDownlinkAssignment = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_descriptionDualCarrierPacketDownlinkAssignment.ispresent() || field_descriptionDualCarrierPacketDownlinkAssignment().elementIdentifier() !=  os_34){
  field_descriptionDualCarrierPacketDownlinkAssignment=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_descriptionDualCarrierPacketDownlinkAssignment=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_channelDescriptionC2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, ChannelDescription3__TV_descr_.raw->forceomit);
  decoded_field_length = field_channelDescriptionC2().RAW_decode(ChannelDescription3__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_channelDescriptionC2 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_channelDescriptionC2.ispresent() || field_channelDescriptionC2().elementIdentifier() !=  os_20){
  field_channelDescriptionC2=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_channelDescriptionC2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_extendedTSCSet = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, ExtendedTSCSet__TV_descr_.raw->forceomit);
  decoded_field_length = field_extendedTSCSet().RAW_decode(ExtendedTSCSet__TV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_extendedTSCSet = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_extendedTSCSet.ispresent() || field_extendedTSCSet().elementIdentifier() !=  os_2){
  field_extendedTSCSet=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_extendedTSCSet=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__RRM__DTM__AssignmentCommand__NW__MS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 17;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(17);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PowerCommand__V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ChannelDescription__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GPRS__BroadcastInformation__LV_descr_.raw);
  if (field_cellChannelDescr.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, CellChannelDescription__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_channelMode.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ChannelMode__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_frequencyList.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_mobileAllocation.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_descrUplinkPacketChannelAssignment.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, RR__PacketUplinkAssignment__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_descrDownlinkPacketChannelAssignment.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, RR__PacketDownlinkAssignment__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_multiRateConfiguration.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, MultiRateConfiguration__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_cipherModeSetting.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, CipherModeSetting__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_mobileAllocationC2.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_frequencyListC2.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, MobileL3__CommonIE__Types::Type4__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_descriptionDualCarrierPacketDownlinkAssignment.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, RR__DualCarrierPacketDownlinkAssignment__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_channelDescriptionC2.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, ChannelDescription3__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_extendedTSCSet.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, ExtendedTSCSet__TV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cS__PowerCommand.RAW_encode(PowerCommand__V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_description__CS__Channel.RAW_encode(ChannelDescription__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_gPRS__BroadcastInformation.RAW_encode(GPRS__BroadcastInformation__LV_descr_, *myleaf.body.node.nodes[3]);
  if (field_cellChannelDescr.ispresent()) {
  encoded_length += field_cellChannelDescr().RAW_encode(CellChannelDescription__TV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_channelMode.ispresent()) {
  encoded_length += field_channelMode().RAW_encode(ChannelMode__TV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_frequencyList.ispresent()) {
  encoded_length += field_frequencyList().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_mobileAllocation.ispresent()) {
  encoded_length += field_mobileAllocation().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_descrUplinkPacketChannelAssignment.ispresent()) {
  encoded_length += field_descrUplinkPacketChannelAssignment().RAW_encode(RR__PacketUplinkAssignment__TLV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_descrDownlinkPacketChannelAssignment.ispresent()) {
  encoded_length += field_descrDownlinkPacketChannelAssignment().RAW_encode(RR__PacketDownlinkAssignment__TLV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_multiRateConfiguration.ispresent()) {
  encoded_length += field_multiRateConfiguration().RAW_encode(MultiRateConfiguration__TLV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_cipherModeSetting.ispresent()) {
  encoded_length += field_cipherModeSetting().RAW_encode(CipherModeSetting__TV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_mobileAllocationC2.ispresent()) {
  encoded_length += field_mobileAllocationC2().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_frequencyListC2.ispresent()) {
  encoded_length += field_frequencyListC2().RAW_encode(MobileL3__CommonIE__Types::Type4__TLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_descriptionDualCarrierPacketDownlinkAssignment.ispresent()) {
  encoded_length += field_descriptionDualCarrierPacketDownlinkAssignment().RAW_encode(RR__DualCarrierPacketDownlinkAssignment__TLV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_channelDescriptionC2.ispresent()) {
  encoded_length += field_channelDescriptionC2().RAW_encode(ChannelDescription3__TV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_extendedTSCSet.ispresent()) {
  encoded_length += field_extendedTSCSet().RAW_encode(ExtendedTSCSet__TV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_cellChannelDescr.ispresent() && (!field_cellChannelDescr.ispresent() || field_cellChannelDescr().elementIdentifier() !=  os_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_channelMode.ispresent() && (!field_channelMode.ispresent() || field_channelMode().elementIdentifier() !=  os_7)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_7.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_frequencyList.ispresent() && (!field_frequencyList.ispresent() || field_frequencyList().elementIdentifier() !=  os_35)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_35.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_mobileAllocation.ispresent() && (!field_mobileAllocation.ispresent() || field_mobileAllocation().elementIdentifier() !=  os_8)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_8.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_descrUplinkPacketChannelAssignment.ispresent() && (!field_descrUplinkPacketChannelAssignment.ispresent() || field_descrUplinkPacketChannelAssignment().elementIdentifier() !=  os_10)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={8,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_10.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_descrDownlinkPacketChannelAssignment.ispresent() && (!field_descrDownlinkPacketChannelAssignment.ispresent() || field_descrDownlinkPacketChannelAssignment().elementIdentifier() !=  os_11)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={9,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_11.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_multiRateConfiguration.ispresent() && (!field_multiRateConfiguration.ispresent() || field_multiRateConfiguration().elementIdentifier() !=  os_12)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={10,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_12.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_cipherModeSetting.ispresent() && (!field_cipherModeSetting.ispresent() || field_cipherModeSetting().elementIdentifier() !=  bs_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={11,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_mobileAllocationC2.ispresent() && (!field_mobileAllocationC2.ispresent() || field_mobileAllocationC2().elementIdentifier() !=  os_13)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={12,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_frequencyListC2.ispresent() && (!field_frequencyListC2.ispresent() || field_frequencyListC2().elementIdentifier() !=  os_16)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={13,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_16.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_descriptionDualCarrierPacketDownlinkAssignment.ispresent() && (!field_descriptionDualCarrierPacketDownlinkAssignment.ispresent() || field_descriptionDualCarrierPacketDownlinkAssignment().elementIdentifier() !=  os_34)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={14,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_34.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_channelDescriptionC2.ispresent() && (!field_channelDescriptionC2.ispresent() || field_channelDescriptionC2().elementIdentifier() !=  os_20)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={15,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_20.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_extendedTSCSet.ispresent() && (!field_extendedTSCSet.ispresent() || field_extendedTSCSet().elementIdentifier() !=  os_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={16,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__RRM__DTM__AssignmentCommand__NW__MS_template::single_value_struct {
BITSTRING_template field_messageType;
PowerCommand__V_template field_cS__PowerCommand;
ChannelDescription__V_template field_description__CS__Channel;
GPRS__BroadcastInformation__LV_template field_gPRS__BroadcastInformation;
CellChannelDescription__TV_template field_cellChannelDescr;
ChannelMode__TV_template field_channelMode;
MobileL3__CommonIE__Types::Type4__TLV_template field_frequencyList;
MobileL3__CommonIE__Types::Type4__TLV_template field_mobileAllocation;
RR__PacketUplinkAssignment__TLV_template field_descrUplinkPacketChannelAssignment;
RR__PacketDownlinkAssignment__TLV_template field_descrDownlinkPacketChannelAssignment;
MultiRateConfiguration__TLV_template field_multiRateConfiguration;
CipherModeSetting__TV_template field_cipherModeSetting;
MobileL3__CommonIE__Types::Type4__TLV_template field_mobileAllocationC2;
MobileL3__CommonIE__Types::Type4__TLV_template field_frequencyListC2;
RR__DualCarrierPacketDownlinkAssignment__TLV_template field_descriptionDualCarrierPacketDownlinkAssignment;
ChannelDescription3__TV_template field_channelDescriptionC2;
ExtendedTSCSet__TV_template field_extendedTSCSet;
};

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_cS__PowerCommand = ANY_VALUE;
single_value->field_description__CS__Channel = ANY_VALUE;
single_value->field_gPRS__BroadcastInformation = ANY_VALUE;
single_value->field_cellChannelDescr = ANY_OR_OMIT;
single_value->field_channelMode = ANY_OR_OMIT;
single_value->field_frequencyList = ANY_OR_OMIT;
single_value->field_mobileAllocation = ANY_OR_OMIT;
single_value->field_descrUplinkPacketChannelAssignment = ANY_OR_OMIT;
single_value->field_descrDownlinkPacketChannelAssignment = ANY_OR_OMIT;
single_value->field_multiRateConfiguration = ANY_OR_OMIT;
single_value->field_cipherModeSetting = ANY_OR_OMIT;
single_value->field_mobileAllocationC2 = ANY_OR_OMIT;
single_value->field_frequencyListC2 = ANY_OR_OMIT;
single_value->field_descriptionDualCarrierPacketDownlinkAssignment = ANY_OR_OMIT;
single_value->field_channelDescriptionC2 = ANY_OR_OMIT;
single_value->field_extendedTSCSet = ANY_OR_OMIT;
}
}
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::copy_value(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.cS__PowerCommand().is_bound()) {
  single_value->field_cS__PowerCommand = other_value.cS__PowerCommand();
} else {
  single_value->field_cS__PowerCommand.clean_up();
}
if (other_value.description__CS__Channel().is_bound()) {
  single_value->field_description__CS__Channel = other_value.description__CS__Channel();
} else {
  single_value->field_description__CS__Channel.clean_up();
}
if (other_value.gPRS__BroadcastInformation().is_bound()) {
  single_value->field_gPRS__BroadcastInformation = other_value.gPRS__BroadcastInformation();
} else {
  single_value->field_gPRS__BroadcastInformation.clean_up();
}
if (other_value.cellChannelDescr().is_bound()) {
  if (other_value.cellChannelDescr().ispresent()) single_value->field_cellChannelDescr = other_value.cellChannelDescr()();
  else single_value->field_cellChannelDescr = OMIT_VALUE;
} else {
  single_value->field_cellChannelDescr.clean_up();
}
if (other_value.channelMode().is_bound()) {
  if (other_value.channelMode().ispresent()) single_value->field_channelMode = other_value.channelMode()();
  else single_value->field_channelMode = OMIT_VALUE;
} else {
  single_value->field_channelMode.clean_up();
}
if (other_value.frequencyList().is_bound()) {
  if (other_value.frequencyList().ispresent()) single_value->field_frequencyList = other_value.frequencyList()();
  else single_value->field_frequencyList = OMIT_VALUE;
} else {
  single_value->field_frequencyList.clean_up();
}
if (other_value.mobileAllocation().is_bound()) {
  if (other_value.mobileAllocation().ispresent()) single_value->field_mobileAllocation = other_value.mobileAllocation()();
  else single_value->field_mobileAllocation = OMIT_VALUE;
} else {
  single_value->field_mobileAllocation.clean_up();
}
if (other_value.descrUplinkPacketChannelAssignment().is_bound()) {
  if (other_value.descrUplinkPacketChannelAssignment().ispresent()) single_value->field_descrUplinkPacketChannelAssignment = other_value.descrUplinkPacketChannelAssignment()();
  else single_value->field_descrUplinkPacketChannelAssignment = OMIT_VALUE;
} else {
  single_value->field_descrUplinkPacketChannelAssignment.clean_up();
}
if (other_value.descrDownlinkPacketChannelAssignment().is_bound()) {
  if (other_value.descrDownlinkPacketChannelAssignment().ispresent()) single_value->field_descrDownlinkPacketChannelAssignment = other_value.descrDownlinkPacketChannelAssignment()();
  else single_value->field_descrDownlinkPacketChannelAssignment = OMIT_VALUE;
} else {
  single_value->field_descrDownlinkPacketChannelAssignment.clean_up();
}
if (other_value.multiRateConfiguration().is_bound()) {
  if (other_value.multiRateConfiguration().ispresent()) single_value->field_multiRateConfiguration = other_value.multiRateConfiguration()();
  else single_value->field_multiRateConfiguration = OMIT_VALUE;
} else {
  single_value->field_multiRateConfiguration.clean_up();
}
if (other_value.cipherModeSetting().is_bound()) {
  if (other_value.cipherModeSetting().ispresent()) single_value->field_cipherModeSetting = other_value.cipherModeSetting()();
  else single_value->field_cipherModeSetting = OMIT_VALUE;
} else {
  single_value->field_cipherModeSetting.clean_up();
}
if (other_value.mobileAllocationC2().is_bound()) {
  if (other_value.mobileAllocationC2().ispresent()) single_value->field_mobileAllocationC2 = other_value.mobileAllocationC2()();
  else single_value->field_mobileAllocationC2 = OMIT_VALUE;
} else {
  single_value->field_mobileAllocationC2.clean_up();
}
if (other_value.frequencyListC2().is_bound()) {
  if (other_value.frequencyListC2().ispresent()) single_value->field_frequencyListC2 = other_value.frequencyListC2()();
  else single_value->field_frequencyListC2 = OMIT_VALUE;
} else {
  single_value->field_frequencyListC2.clean_up();
}
if (other_value.descriptionDualCarrierPacketDownlinkAssignment().is_bound()) {
  if (other_value.descriptionDualCarrierPacketDownlinkAssignment().ispresent()) single_value->field_descriptionDualCarrierPacketDownlinkAssignment = other_value.descriptionDualCarrierPacketDownlinkAssignment()();
  else single_value->field_descriptionDualCarrierPacketDownlinkAssignment = OMIT_VALUE;
} else {
  single_value->field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
}
if (other_value.channelDescriptionC2().is_bound()) {
  if (other_value.channelDescriptionC2().ispresent()) single_value->field_channelDescriptionC2 = other_value.channelDescriptionC2()();
  else single_value->field_channelDescriptionC2 = OMIT_VALUE;
} else {
  single_value->field_channelDescriptionC2.clean_up();
}
if (other_value.extendedTSCSet().is_bound()) {
  if (other_value.extendedTSCSet().ispresent()) single_value->field_extendedTSCSet = other_value.extendedTSCSet()();
  else single_value->field_extendedTSCSet = OMIT_VALUE;
} else {
  single_value->field_extendedTSCSet.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::copy_template(const PDU__RRM__DTM__AssignmentCommand__NW__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cS__PowerCommand().get_selection()) {
single_value->field_cS__PowerCommand = other_value.cS__PowerCommand();
} else {
single_value->field_cS__PowerCommand.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.description__CS__Channel().get_selection()) {
single_value->field_description__CS__Channel = other_value.description__CS__Channel();
} else {
single_value->field_description__CS__Channel.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gPRS__BroadcastInformation().get_selection()) {
single_value->field_gPRS__BroadcastInformation = other_value.gPRS__BroadcastInformation();
} else {
single_value->field_gPRS__BroadcastInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellChannelDescr().get_selection()) {
single_value->field_cellChannelDescr = other_value.cellChannelDescr();
} else {
single_value->field_cellChannelDescr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelMode().get_selection()) {
single_value->field_channelMode = other_value.channelMode();
} else {
single_value->field_channelMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyList().get_selection()) {
single_value->field_frequencyList = other_value.frequencyList();
} else {
single_value->field_frequencyList.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocation().get_selection()) {
single_value->field_mobileAllocation = other_value.mobileAllocation();
} else {
single_value->field_mobileAllocation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descrUplinkPacketChannelAssignment().get_selection()) {
single_value->field_descrUplinkPacketChannelAssignment = other_value.descrUplinkPacketChannelAssignment();
} else {
single_value->field_descrUplinkPacketChannelAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descrDownlinkPacketChannelAssignment().get_selection()) {
single_value->field_descrDownlinkPacketChannelAssignment = other_value.descrDownlinkPacketChannelAssignment();
} else {
single_value->field_descrDownlinkPacketChannelAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multiRateConfiguration().get_selection()) {
single_value->field_multiRateConfiguration = other_value.multiRateConfiguration();
} else {
single_value->field_multiRateConfiguration.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipherModeSetting().get_selection()) {
single_value->field_cipherModeSetting = other_value.cipherModeSetting();
} else {
single_value->field_cipherModeSetting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileAllocationC2().get_selection()) {
single_value->field_mobileAllocationC2 = other_value.mobileAllocationC2();
} else {
single_value->field_mobileAllocationC2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frequencyListC2().get_selection()) {
single_value->field_frequencyListC2 = other_value.frequencyListC2();
} else {
single_value->field_frequencyListC2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.descriptionDualCarrierPacketDownlinkAssignment().get_selection()) {
single_value->field_descriptionDualCarrierPacketDownlinkAssignment = other_value.descriptionDualCarrierPacketDownlinkAssignment();
} else {
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channelDescriptionC2().get_selection()) {
single_value->field_channelDescriptionC2 = other_value.channelDescriptionC2();
} else {
single_value->field_channelDescriptionC2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedTSCSet().get_selection()) {
single_value->field_extendedTSCSet = other_value.extendedTSCSet();
} else {
single_value->field_extendedTSCSet.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
break;
}
set_selection(other_value);
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::PDU__RRM__DTM__AssignmentCommand__NW__MS_template()
{
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::PDU__RRM__DTM__AssignmentCommand__NW__MS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::PDU__RRM__DTM__AssignmentCommand__NW__MS_template(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value)
{
copy_value(other_value);
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::PDU__RRM__DTM__AssignmentCommand__NW__MS_template(const OPTIONAL<PDU__RRM__DTM__AssignmentCommand__NW__MS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__DTM__AssignmentCommand__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS from an unbound optional field.");
}
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::PDU__RRM__DTM__AssignmentCommand__NW__MS_template(PDU__RRM__DTM__AssignmentCommand__NW__MS_template* p_precondition, PDU__RRM__DTM__AssignmentCommand__NW__MS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::PDU__RRM__DTM__AssignmentCommand__NW__MS_template(Dynamic_Match_Interface<PDU__RRM__DTM__AssignmentCommand__NW__MS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__RRM__DTM__AssignmentCommand__NW__MS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::PDU__RRM__DTM__AssignmentCommand__NW__MS_template(const PDU__RRM__DTM__AssignmentCommand__NW__MS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template::~PDU__RRM__DTM__AssignmentCommand__NW__MS_template()
{
clean_up();
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::operator=(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::operator=(const OPTIONAL<PDU__RRM__DTM__AssignmentCommand__NW__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__RRM__DTM__AssignmentCommand__NW__MS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
}
return *this;
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::operator=(const PDU__RRM__DTM__AssignmentCommand__NW__MS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS_template::match(const PDU__RRM__DTM__AssignmentCommand__NW__MS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.cS__PowerCommand().is_bound()) return FALSE;
if(!single_value->field_cS__PowerCommand.match(other_value.cS__PowerCommand(), legacy))return FALSE;
if(!other_value.description__CS__Channel().is_bound()) return FALSE;
if(!single_value->field_description__CS__Channel.match(other_value.description__CS__Channel(), legacy))return FALSE;
if(!other_value.gPRS__BroadcastInformation().is_bound()) return FALSE;
if(!single_value->field_gPRS__BroadcastInformation.match(other_value.gPRS__BroadcastInformation(), legacy))return FALSE;
if(!other_value.cellChannelDescr().is_bound()) return FALSE;
if((other_value.cellChannelDescr().ispresent() ? !single_value->field_cellChannelDescr.match((const CellChannelDescription__TV&)other_value.cellChannelDescr(), legacy) : !single_value->field_cellChannelDescr.match_omit(legacy)))return FALSE;
if(!other_value.channelMode().is_bound()) return FALSE;
if((other_value.channelMode().ispresent() ? !single_value->field_channelMode.match((const ChannelMode__TV&)other_value.channelMode(), legacy) : !single_value->field_channelMode.match_omit(legacy)))return FALSE;
if(!other_value.frequencyList().is_bound()) return FALSE;
if((other_value.frequencyList().ispresent() ? !single_value->field_frequencyList.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.frequencyList(), legacy) : !single_value->field_frequencyList.match_omit(legacy)))return FALSE;
if(!other_value.mobileAllocation().is_bound()) return FALSE;
if((other_value.mobileAllocation().ispresent() ? !single_value->field_mobileAllocation.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.mobileAllocation(), legacy) : !single_value->field_mobileAllocation.match_omit(legacy)))return FALSE;
if(!other_value.descrUplinkPacketChannelAssignment().is_bound()) return FALSE;
if((other_value.descrUplinkPacketChannelAssignment().ispresent() ? !single_value->field_descrUplinkPacketChannelAssignment.match((const RR__PacketUplinkAssignment__TLV&)other_value.descrUplinkPacketChannelAssignment(), legacy) : !single_value->field_descrUplinkPacketChannelAssignment.match_omit(legacy)))return FALSE;
if(!other_value.descrDownlinkPacketChannelAssignment().is_bound()) return FALSE;
if((other_value.descrDownlinkPacketChannelAssignment().ispresent() ? !single_value->field_descrDownlinkPacketChannelAssignment.match((const RR__PacketDownlinkAssignment__TLV&)other_value.descrDownlinkPacketChannelAssignment(), legacy) : !single_value->field_descrDownlinkPacketChannelAssignment.match_omit(legacy)))return FALSE;
if(!other_value.multiRateConfiguration().is_bound()) return FALSE;
if((other_value.multiRateConfiguration().ispresent() ? !single_value->field_multiRateConfiguration.match((const MultiRateConfiguration__TLV&)other_value.multiRateConfiguration(), legacy) : !single_value->field_multiRateConfiguration.match_omit(legacy)))return FALSE;
if(!other_value.cipherModeSetting().is_bound()) return FALSE;
if((other_value.cipherModeSetting().ispresent() ? !single_value->field_cipherModeSetting.match((const CipherModeSetting__TV&)other_value.cipherModeSetting(), legacy) : !single_value->field_cipherModeSetting.match_omit(legacy)))return FALSE;
if(!other_value.mobileAllocationC2().is_bound()) return FALSE;
if((other_value.mobileAllocationC2().ispresent() ? !single_value->field_mobileAllocationC2.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.mobileAllocationC2(), legacy) : !single_value->field_mobileAllocationC2.match_omit(legacy)))return FALSE;
if(!other_value.frequencyListC2().is_bound()) return FALSE;
if((other_value.frequencyListC2().ispresent() ? !single_value->field_frequencyListC2.match((const MobileL3__CommonIE__Types::Type4__TLV&)other_value.frequencyListC2(), legacy) : !single_value->field_frequencyListC2.match_omit(legacy)))return FALSE;
if(!other_value.descriptionDualCarrierPacketDownlinkAssignment().is_bound()) return FALSE;
if((other_value.descriptionDualCarrierPacketDownlinkAssignment().ispresent() ? !single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match((const RR__DualCarrierPacketDownlinkAssignment__TLV&)other_value.descriptionDualCarrierPacketDownlinkAssignment(), legacy) : !single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match_omit(legacy)))return FALSE;
if(!other_value.channelDescriptionC2().is_bound()) return FALSE;
if((other_value.channelDescriptionC2().ispresent() ? !single_value->field_channelDescriptionC2.match((const ChannelDescription3__TV&)other_value.channelDescriptionC2(), legacy) : !single_value->field_channelDescriptionC2.match_omit(legacy)))return FALSE;
if(!other_value.extendedTSCSet().is_bound()) return FALSE;
if((other_value.extendedTSCSet().ispresent() ? !single_value->field_extendedTSCSet.match((const ExtendedTSCSet__TV&)other_value.extendedTSCSet(), legacy) : !single_value->field_extendedTSCSet.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
}
return FALSE;
}

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_cS__PowerCommand.is_bound()
 || single_value->field_description__CS__Channel.is_bound()
 || single_value->field_gPRS__BroadcastInformation.is_bound()
 || (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_bound())
 || (single_value->field_channelMode.is_omit() || single_value->field_channelMode.is_bound())
 || (single_value->field_frequencyList.is_omit() || single_value->field_frequencyList.is_bound())
 || (single_value->field_mobileAllocation.is_omit() || single_value->field_mobileAllocation.is_bound())
 || (single_value->field_descrUplinkPacketChannelAssignment.is_omit() || single_value->field_descrUplinkPacketChannelAssignment.is_bound())
 || (single_value->field_descrDownlinkPacketChannelAssignment.is_omit() || single_value->field_descrDownlinkPacketChannelAssignment.is_bound())
 || (single_value->field_multiRateConfiguration.is_omit() || single_value->field_multiRateConfiguration.is_bound())
 || (single_value->field_cipherModeSetting.is_omit() || single_value->field_cipherModeSetting.is_bound())
 || (single_value->field_mobileAllocationC2.is_omit() || single_value->field_mobileAllocationC2.is_bound())
 || (single_value->field_frequencyListC2.is_omit() || single_value->field_frequencyListC2.is_bound())
 || (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_omit() || single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_bound())
 || (single_value->field_channelDescriptionC2.is_omit() || single_value->field_channelDescriptionC2.is_bound())
 || (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_bound());
}

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_cS__PowerCommand.is_value()
 && single_value->field_description__CS__Channel.is_value()
 && single_value->field_gPRS__BroadcastInformation.is_value()
 && (single_value->field_cellChannelDescr.is_omit() || single_value->field_cellChannelDescr.is_value())
 && (single_value->field_channelMode.is_omit() || single_value->field_channelMode.is_value())
 && (single_value->field_frequencyList.is_omit() || single_value->field_frequencyList.is_value())
 && (single_value->field_mobileAllocation.is_omit() || single_value->field_mobileAllocation.is_value())
 && (single_value->field_descrUplinkPacketChannelAssignment.is_omit() || single_value->field_descrUplinkPacketChannelAssignment.is_value())
 && (single_value->field_descrDownlinkPacketChannelAssignment.is_omit() || single_value->field_descrDownlinkPacketChannelAssignment.is_value())
 && (single_value->field_multiRateConfiguration.is_omit() || single_value->field_multiRateConfiguration.is_value())
 && (single_value->field_cipherModeSetting.is_omit() || single_value->field_cipherModeSetting.is_value())
 && (single_value->field_mobileAllocationC2.is_omit() || single_value->field_mobileAllocationC2.is_value())
 && (single_value->field_frequencyListC2.is_omit() || single_value->field_frequencyListC2.is_value())
 && (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_omit() || single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_value())
 && (single_value->field_channelDescriptionC2.is_omit() || single_value->field_channelDescriptionC2.is_value())
 && (single_value->field_extendedTSCSet.is_omit() || single_value->field_extendedTSCSet.is_value());
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__RRM__DTM__AssignmentCommand__NW__MS PDU__RRM__DTM__AssignmentCommand__NW__MS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
PDU__RRM__DTM__AssignmentCommand__NW__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_cS__PowerCommand.is_bound()) {
ret_val.cS__PowerCommand() = single_value->field_cS__PowerCommand.valueof();
}
if (single_value->field_description__CS__Channel.is_bound()) {
ret_val.description__CS__Channel() = single_value->field_description__CS__Channel.valueof();
}
if (single_value->field_gPRS__BroadcastInformation.is_bound()) {
ret_val.gPRS__BroadcastInformation() = single_value->field_gPRS__BroadcastInformation.valueof();
}
if (single_value->field_cellChannelDescr.is_omit()) ret_val.cellChannelDescr() = OMIT_VALUE;
else if (single_value->field_cellChannelDescr.is_bound()) {
ret_val.cellChannelDescr() = single_value->field_cellChannelDescr.valueof();
}
if (single_value->field_channelMode.is_omit()) ret_val.channelMode() = OMIT_VALUE;
else if (single_value->field_channelMode.is_bound()) {
ret_val.channelMode() = single_value->field_channelMode.valueof();
}
if (single_value->field_frequencyList.is_omit()) ret_val.frequencyList() = OMIT_VALUE;
else if (single_value->field_frequencyList.is_bound()) {
ret_val.frequencyList() = single_value->field_frequencyList.valueof();
}
if (single_value->field_mobileAllocation.is_omit()) ret_val.mobileAllocation() = OMIT_VALUE;
else if (single_value->field_mobileAllocation.is_bound()) {
ret_val.mobileAllocation() = single_value->field_mobileAllocation.valueof();
}
if (single_value->field_descrUplinkPacketChannelAssignment.is_omit()) ret_val.descrUplinkPacketChannelAssignment() = OMIT_VALUE;
else if (single_value->field_descrUplinkPacketChannelAssignment.is_bound()) {
ret_val.descrUplinkPacketChannelAssignment() = single_value->field_descrUplinkPacketChannelAssignment.valueof();
}
if (single_value->field_descrDownlinkPacketChannelAssignment.is_omit()) ret_val.descrDownlinkPacketChannelAssignment() = OMIT_VALUE;
else if (single_value->field_descrDownlinkPacketChannelAssignment.is_bound()) {
ret_val.descrDownlinkPacketChannelAssignment() = single_value->field_descrDownlinkPacketChannelAssignment.valueof();
}
if (single_value->field_multiRateConfiguration.is_omit()) ret_val.multiRateConfiguration() = OMIT_VALUE;
else if (single_value->field_multiRateConfiguration.is_bound()) {
ret_val.multiRateConfiguration() = single_value->field_multiRateConfiguration.valueof();
}
if (single_value->field_cipherModeSetting.is_omit()) ret_val.cipherModeSetting() = OMIT_VALUE;
else if (single_value->field_cipherModeSetting.is_bound()) {
ret_val.cipherModeSetting() = single_value->field_cipherModeSetting.valueof();
}
if (single_value->field_mobileAllocationC2.is_omit()) ret_val.mobileAllocationC2() = OMIT_VALUE;
else if (single_value->field_mobileAllocationC2.is_bound()) {
ret_val.mobileAllocationC2() = single_value->field_mobileAllocationC2.valueof();
}
if (single_value->field_frequencyListC2.is_omit()) ret_val.frequencyListC2() = OMIT_VALUE;
else if (single_value->field_frequencyListC2.is_bound()) {
ret_val.frequencyListC2() = single_value->field_frequencyListC2.valueof();
}
if (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_omit()) ret_val.descriptionDualCarrierPacketDownlinkAssignment() = OMIT_VALUE;
else if (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_bound()) {
ret_val.descriptionDualCarrierPacketDownlinkAssignment() = single_value->field_descriptionDualCarrierPacketDownlinkAssignment.valueof();
}
if (single_value->field_channelDescriptionC2.is_omit()) ret_val.channelDescriptionC2() = OMIT_VALUE;
else if (single_value->field_channelDescriptionC2.is_bound()) {
ret_val.channelDescriptionC2() = single_value->field_channelDescriptionC2.valueof();
}
if (single_value->field_extendedTSCSet.is_omit()) ret_val.extendedTSCSet() = OMIT_VALUE;
else if (single_value->field_extendedTSCSet.is_bound()) {
ret_val.extendedTSCSet() = single_value->field_extendedTSCSet.valueof();
}
return ret_val;
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template[list_length];
}

PDU__RRM__DTM__AssignmentCommand__NW__MS_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_messageType;
}

PowerCommand__V_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cS__PowerCommand()
{
set_specific();
return single_value->field_cS__PowerCommand;
}

const PowerCommand__V_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cS__PowerCommand() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cS_PowerCommand of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_cS__PowerCommand;
}

ChannelDescription__V_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::description__CS__Channel()
{
set_specific();
return single_value->field_description__CS__Channel;
}

const ChannelDescription__V_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::description__CS__Channel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field description_CS_Channel of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_description__CS__Channel;
}

GPRS__BroadcastInformation__LV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::gPRS__BroadcastInformation()
{
set_specific();
return single_value->field_gPRS__BroadcastInformation;
}

const GPRS__BroadcastInformation__LV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::gPRS__BroadcastInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gPRS_BroadcastInformation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_gPRS__BroadcastInformation;
}

CellChannelDescription__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cellChannelDescr()
{
set_specific();
return single_value->field_cellChannelDescr;
}

const CellChannelDescription__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cellChannelDescr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellChannelDescr of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_cellChannelDescr;
}

ChannelMode__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::channelMode()
{
set_specific();
return single_value->field_channelMode;
}

const ChannelMode__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::channelMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelMode of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_channelMode;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::frequencyList()
{
set_specific();
return single_value->field_frequencyList;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::frequencyList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyList of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_frequencyList;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::mobileAllocation()
{
set_specific();
return single_value->field_mobileAllocation;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::mobileAllocation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocation of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_mobileAllocation;
}

RR__PacketUplinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descrUplinkPacketChannelAssignment()
{
set_specific();
return single_value->field_descrUplinkPacketChannelAssignment;
}

const RR__PacketUplinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descrUplinkPacketChannelAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrUplinkPacketChannelAssignment of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_descrUplinkPacketChannelAssignment;
}

RR__PacketDownlinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descrDownlinkPacketChannelAssignment()
{
set_specific();
return single_value->field_descrDownlinkPacketChannelAssignment;
}

const RR__PacketDownlinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descrDownlinkPacketChannelAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descrDownlinkPacketChannelAssignment of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_descrDownlinkPacketChannelAssignment;
}

MultiRateConfiguration__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::multiRateConfiguration()
{
set_specific();
return single_value->field_multiRateConfiguration;
}

const MultiRateConfiguration__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::multiRateConfiguration() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multiRateConfiguration of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_multiRateConfiguration;
}

CipherModeSetting__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cipherModeSetting()
{
set_specific();
return single_value->field_cipherModeSetting;
}

const CipherModeSetting__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::cipherModeSetting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipherModeSetting of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_cipherModeSetting;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::mobileAllocationC2()
{
set_specific();
return single_value->field_mobileAllocationC2;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::mobileAllocationC2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileAllocationC2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_mobileAllocationC2;
}

MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::frequencyListC2()
{
set_specific();
return single_value->field_frequencyListC2;
}

const MobileL3__CommonIE__Types::Type4__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::frequencyListC2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frequencyListC2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_frequencyListC2;
}

RR__DualCarrierPacketDownlinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descriptionDualCarrierPacketDownlinkAssignment()
{
set_specific();
return single_value->field_descriptionDualCarrierPacketDownlinkAssignment;
}

const RR__DualCarrierPacketDownlinkAssignment__TLV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::descriptionDualCarrierPacketDownlinkAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field descriptionDualCarrierPacketDownlinkAssignment of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_descriptionDualCarrierPacketDownlinkAssignment;
}

ChannelDescription3__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::channelDescriptionC2()
{
set_specific();
return single_value->field_channelDescriptionC2;
}

const ChannelDescription3__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::channelDescriptionC2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channelDescriptionC2 of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_channelDescriptionC2;
}

ExtendedTSCSet__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::extendedTSCSet()
{
set_specific();
return single_value->field_extendedTSCSet;
}

const ExtendedTSCSet__TV_template& PDU__RRM__DTM__AssignmentCommand__NW__MS_template::extendedTSCSet() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedTSCSet of a non-specific template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
return single_value->field_extendedTSCSet;
}

int PDU__RRM__DTM__AssignmentCommand__NW__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 4;
      if (single_value->field_cellChannelDescr.is_present()) ret_val++;
      if (single_value->field_channelMode.is_present()) ret_val++;
      if (single_value->field_frequencyList.is_present()) ret_val++;
      if (single_value->field_mobileAllocation.is_present()) ret_val++;
      if (single_value->field_descrUplinkPacketChannelAssignment.is_present()) ret_val++;
      if (single_value->field_descrDownlinkPacketChannelAssignment.is_present()) ret_val++;
      if (single_value->field_multiRateConfiguration.is_present()) ret_val++;
      if (single_value->field_cipherModeSetting.is_present()) ret_val++;
      if (single_value->field_mobileAllocationC2.is_present()) ret_val++;
      if (single_value->field_frequencyListC2.is_present()) ret_val++;
      if (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.is_present()) ret_val++;
      if (single_value->field_channelDescriptionC2.is_present()) ret_val++;
      if (single_value->field_extendedTSCSet.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
  }
  return 0;
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", cS_PowerCommand := ");
single_value->field_cS__PowerCommand.log();
TTCN_Logger::log_event_str(", description_CS_Channel := ");
single_value->field_description__CS__Channel.log();
TTCN_Logger::log_event_str(", gPRS_BroadcastInformation := ");
single_value->field_gPRS__BroadcastInformation.log();
TTCN_Logger::log_event_str(", cellChannelDescr := ");
single_value->field_cellChannelDescr.log();
TTCN_Logger::log_event_str(", channelMode := ");
single_value->field_channelMode.log();
TTCN_Logger::log_event_str(", frequencyList := ");
single_value->field_frequencyList.log();
TTCN_Logger::log_event_str(", mobileAllocation := ");
single_value->field_mobileAllocation.log();
TTCN_Logger::log_event_str(", descrUplinkPacketChannelAssignment := ");
single_value->field_descrUplinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(", descrDownlinkPacketChannelAssignment := ");
single_value->field_descrDownlinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(", multiRateConfiguration := ");
single_value->field_multiRateConfiguration.log();
TTCN_Logger::log_event_str(", cipherModeSetting := ");
single_value->field_cipherModeSetting.log();
TTCN_Logger::log_event_str(", mobileAllocationC2 := ");
single_value->field_mobileAllocationC2.log();
TTCN_Logger::log_event_str(", frequencyListC2 := ");
single_value->field_frequencyListC2.log();
TTCN_Logger::log_event_str(", descriptionDualCarrierPacketDownlinkAssignment := ");
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log();
TTCN_Logger::log_event_str(", channelDescriptionC2 := ");
single_value->field_channelDescriptionC2.log();
TTCN_Logger::log_event_str(", extendedTSCSet := ");
single_value->field_extendedTSCSet.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::log_match(const PDU__RRM__DTM__AssignmentCommand__NW__MS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cS__PowerCommand.match(match_value.cS__PowerCommand(), legacy)){
TTCN_Logger::log_logmatch_info(".cS_PowerCommand");
single_value->field_cS__PowerCommand.log_match(match_value.cS__PowerCommand(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_description__CS__Channel.match(match_value.description__CS__Channel(), legacy)){
TTCN_Logger::log_logmatch_info(".description_CS_Channel");
single_value->field_description__CS__Channel.log_match(match_value.description__CS__Channel(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gPRS__BroadcastInformation.match(match_value.gPRS__BroadcastInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".gPRS_BroadcastInformation");
single_value->field_gPRS__BroadcastInformation.log_match(match_value.gPRS__BroadcastInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cellChannelDescr().ispresent()){
if(!single_value->field_cellChannelDescr.match(match_value.cellChannelDescr(), legacy)){
TTCN_Logger::log_logmatch_info(".cellChannelDescr");
single_value->field_cellChannelDescr.log_match(match_value.cellChannelDescr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellChannelDescr.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellChannelDescr := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellChannelDescr.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelMode().ispresent()){
if(!single_value->field_channelMode.match(match_value.channelMode(), legacy)){
TTCN_Logger::log_logmatch_info(".channelMode");
single_value->field_channelMode.log_match(match_value.channelMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelMode.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelMode := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelMode.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyList().ispresent()){
if(!single_value->field_frequencyList.match(match_value.frequencyList(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyList");
single_value->field_frequencyList.log_match(match_value.frequencyList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyList.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileAllocation().ispresent()){
if(!single_value->field_mobileAllocation.match(match_value.mobileAllocation(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocation");
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileAllocation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileAllocation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileAllocation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descrUplinkPacketChannelAssignment().ispresent()){
if(!single_value->field_descrUplinkPacketChannelAssignment.match(match_value.descrUplinkPacketChannelAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".descrUplinkPacketChannelAssignment");
single_value->field_descrUplinkPacketChannelAssignment.log_match(match_value.descrUplinkPacketChannelAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descrUplinkPacketChannelAssignment.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descrUplinkPacketChannelAssignment := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descrUplinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descrDownlinkPacketChannelAssignment().ispresent()){
if(!single_value->field_descrDownlinkPacketChannelAssignment.match(match_value.descrDownlinkPacketChannelAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".descrDownlinkPacketChannelAssignment");
single_value->field_descrDownlinkPacketChannelAssignment.log_match(match_value.descrDownlinkPacketChannelAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descrDownlinkPacketChannelAssignment.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descrDownlinkPacketChannelAssignment := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descrDownlinkPacketChannelAssignment.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.multiRateConfiguration().ispresent()){
if(!single_value->field_multiRateConfiguration.match(match_value.multiRateConfiguration(), legacy)){
TTCN_Logger::log_logmatch_info(".multiRateConfiguration");
single_value->field_multiRateConfiguration.log_match(match_value.multiRateConfiguration(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_multiRateConfiguration.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".multiRateConfiguration := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_multiRateConfiguration.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cipherModeSetting().ispresent()){
if(!single_value->field_cipherModeSetting.match(match_value.cipherModeSetting(), legacy)){
TTCN_Logger::log_logmatch_info(".cipherModeSetting");
single_value->field_cipherModeSetting.log_match(match_value.cipherModeSetting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cipherModeSetting.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cipherModeSetting := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cipherModeSetting.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileAllocationC2().ispresent()){
if(!single_value->field_mobileAllocationC2.match(match_value.mobileAllocationC2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileAllocationC2");
single_value->field_mobileAllocationC2.log_match(match_value.mobileAllocationC2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileAllocationC2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileAllocationC2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileAllocationC2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.frequencyListC2().ispresent()){
if(!single_value->field_frequencyListC2.match(match_value.frequencyListC2(), legacy)){
TTCN_Logger::log_logmatch_info(".frequencyListC2");
single_value->field_frequencyListC2.log_match(match_value.frequencyListC2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_frequencyListC2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".frequencyListC2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_frequencyListC2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.descriptionDualCarrierPacketDownlinkAssignment().ispresent()){
if(!single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match(match_value.descriptionDualCarrierPacketDownlinkAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".descriptionDualCarrierPacketDownlinkAssignment");
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log_match(match_value.descriptionDualCarrierPacketDownlinkAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".descriptionDualCarrierPacketDownlinkAssignment := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channelDescriptionC2().ispresent()){
if(!single_value->field_channelDescriptionC2.match(match_value.channelDescriptionC2(), legacy)){
TTCN_Logger::log_logmatch_info(".channelDescriptionC2");
single_value->field_channelDescriptionC2.log_match(match_value.channelDescriptionC2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channelDescriptionC2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channelDescriptionC2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channelDescriptionC2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedTSCSet().ispresent()){
if(!single_value->field_extendedTSCSet.match(match_value.extendedTSCSet(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedTSCSet");
single_value->field_extendedTSCSet.log_match(match_value.extendedTSCSet(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedTSCSet.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedTSCSet := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedTSCSet.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", cS_PowerCommand := ");
single_value->field_cS__PowerCommand.log_match(match_value.cS__PowerCommand(), legacy);
TTCN_Logger::log_event_str(", description_CS_Channel := ");
single_value->field_description__CS__Channel.log_match(match_value.description__CS__Channel(), legacy);
TTCN_Logger::log_event_str(", gPRS_BroadcastInformation := ");
single_value->field_gPRS__BroadcastInformation.log_match(match_value.gPRS__BroadcastInformation(), legacy);
TTCN_Logger::log_event_str(", cellChannelDescr := ");
if (match_value.cellChannelDescr().ispresent()) {
single_value->field_cellChannelDescr.log_match(match_value.cellChannelDescr(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellChannelDescr.log();
if (single_value->field_cellChannelDescr.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelMode := ");
if (match_value.channelMode().ispresent()) {
single_value->field_channelMode.log_match(match_value.channelMode(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelMode.log();
if (single_value->field_channelMode.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyList := ");
if (match_value.frequencyList().ispresent()) {
single_value->field_frequencyList.log_match(match_value.frequencyList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyList.log();
if (single_value->field_frequencyList.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileAllocation := ");
if (match_value.mobileAllocation().ispresent()) {
single_value->field_mobileAllocation.log_match(match_value.mobileAllocation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileAllocation.log();
if (single_value->field_mobileAllocation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descrUplinkPacketChannelAssignment := ");
if (match_value.descrUplinkPacketChannelAssignment().ispresent()) {
single_value->field_descrUplinkPacketChannelAssignment.log_match(match_value.descrUplinkPacketChannelAssignment(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descrUplinkPacketChannelAssignment.log();
if (single_value->field_descrUplinkPacketChannelAssignment.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descrDownlinkPacketChannelAssignment := ");
if (match_value.descrDownlinkPacketChannelAssignment().ispresent()) {
single_value->field_descrDownlinkPacketChannelAssignment.log_match(match_value.descrDownlinkPacketChannelAssignment(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descrDownlinkPacketChannelAssignment.log();
if (single_value->field_descrDownlinkPacketChannelAssignment.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", multiRateConfiguration := ");
if (match_value.multiRateConfiguration().ispresent()) {
single_value->field_multiRateConfiguration.log_match(match_value.multiRateConfiguration(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_multiRateConfiguration.log();
if (single_value->field_multiRateConfiguration.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cipherModeSetting := ");
if (match_value.cipherModeSetting().ispresent()) {
single_value->field_cipherModeSetting.log_match(match_value.cipherModeSetting(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cipherModeSetting.log();
if (single_value->field_cipherModeSetting.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileAllocationC2 := ");
if (match_value.mobileAllocationC2().ispresent()) {
single_value->field_mobileAllocationC2.log_match(match_value.mobileAllocationC2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileAllocationC2.log();
if (single_value->field_mobileAllocationC2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", frequencyListC2 := ");
if (match_value.frequencyListC2().ispresent()) {
single_value->field_frequencyListC2.log_match(match_value.frequencyListC2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_frequencyListC2.log();
if (single_value->field_frequencyListC2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", descriptionDualCarrierPacketDownlinkAssignment := ");
if (match_value.descriptionDualCarrierPacketDownlinkAssignment().ispresent()) {
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log_match(match_value.descriptionDualCarrierPacketDownlinkAssignment(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.log();
if (single_value->field_descriptionDualCarrierPacketDownlinkAssignment.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channelDescriptionC2 := ");
if (match_value.channelDescriptionC2().ispresent()) {
single_value->field_channelDescriptionC2.log_match(match_value.channelDescriptionC2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channelDescriptionC2.log();
if (single_value->field_channelDescriptionC2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedTSCSet := ");
if (match_value.extendedTSCSet().ispresent()) {
single_value->field_extendedTSCSet.log_match(match_value.extendedTSCSet(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedTSCSet.log();
if (single_value->field_extendedTSCSet.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cS__PowerCommand().is_bound()) cS__PowerCommand().set_implicit_omit();
if (description__CS__Channel().is_bound()) description__CS__Channel().set_implicit_omit();
if (gPRS__BroadcastInformation().is_bound()) gPRS__BroadcastInformation().set_implicit_omit();
if (!cellChannelDescr().is_bound()) cellChannelDescr() = OMIT_VALUE;
else cellChannelDescr().set_implicit_omit();
if (!channelMode().is_bound()) channelMode() = OMIT_VALUE;
else channelMode().set_implicit_omit();
if (!frequencyList().is_bound()) frequencyList() = OMIT_VALUE;
else frequencyList().set_implicit_omit();
if (!mobileAllocation().is_bound()) mobileAllocation() = OMIT_VALUE;
else mobileAllocation().set_implicit_omit();
if (!descrUplinkPacketChannelAssignment().is_bound()) descrUplinkPacketChannelAssignment() = OMIT_VALUE;
else descrUplinkPacketChannelAssignment().set_implicit_omit();
if (!descrDownlinkPacketChannelAssignment().is_bound()) descrDownlinkPacketChannelAssignment() = OMIT_VALUE;
else descrDownlinkPacketChannelAssignment().set_implicit_omit();
if (!multiRateConfiguration().is_bound()) multiRateConfiguration() = OMIT_VALUE;
else multiRateConfiguration().set_implicit_omit();
if (!cipherModeSetting().is_bound()) cipherModeSetting() = OMIT_VALUE;
else cipherModeSetting().set_implicit_omit();
if (!mobileAllocationC2().is_bound()) mobileAllocationC2() = OMIT_VALUE;
else mobileAllocationC2().set_implicit_omit();
if (!frequencyListC2().is_bound()) frequencyListC2() = OMIT_VALUE;
else frequencyListC2().set_implicit_omit();
if (!descriptionDualCarrierPacketDownlinkAssignment().is_bound()) descriptionDualCarrierPacketDownlinkAssignment() = OMIT_VALUE;
else descriptionDualCarrierPacketDownlinkAssignment().set_implicit_omit();
if (!channelDescriptionC2().is_bound()) channelDescriptionC2() = OMIT_VALUE;
else channelDescriptionC2().set_implicit_omit();
if (!extendedTSCSet().is_bound()) extendedTSCSet() = OMIT_VALUE;
else extendedTSCSet().set_implicit_omit();
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_cS__PowerCommand.encode_text(text_buf);
single_value->field_description__CS__Channel.encode_text(text_buf);
single_value->field_gPRS__BroadcastInformation.encode_text(text_buf);
single_value->field_cellChannelDescr.encode_text(text_buf);
single_value->field_channelMode.encode_text(text_buf);
single_value->field_frequencyList.encode_text(text_buf);
single_value->field_mobileAllocation.encode_text(text_buf);
single_value->field_descrUplinkPacketChannelAssignment.encode_text(text_buf);
single_value->field_descrDownlinkPacketChannelAssignment.encode_text(text_buf);
single_value->field_multiRateConfiguration.encode_text(text_buf);
single_value->field_cipherModeSetting.encode_text(text_buf);
single_value->field_mobileAllocationC2.encode_text(text_buf);
single_value->field_frequencyListC2.encode_text(text_buf);
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.encode_text(text_buf);
single_value->field_channelDescriptionC2.encode_text(text_buf);
single_value->field_extendedTSCSet.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
}
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_cS__PowerCommand.decode_text(text_buf);
single_value->field_description__CS__Channel.decode_text(text_buf);
single_value->field_gPRS__BroadcastInformation.decode_text(text_buf);
single_value->field_cellChannelDescr.decode_text(text_buf);
single_value->field_channelMode.decode_text(text_buf);
single_value->field_frequencyList.decode_text(text_buf);
single_value->field_mobileAllocation.decode_text(text_buf);
single_value->field_descrUplinkPacketChannelAssignment.decode_text(text_buf);
single_value->field_descrDownlinkPacketChannelAssignment.decode_text(text_buf);
single_value->field_multiRateConfiguration.decode_text(text_buf);
single_value->field_cipherModeSetting.decode_text(text_buf);
single_value->field_mobileAllocationC2.decode_text(text_buf);
single_value->field_frequencyListC2.decode_text(text_buf);
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.decode_text(text_buf);
single_value->field_channelDescriptionC2.decode_text(text_buf);
single_value->field_extendedTSCSet.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS.");
}
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__RRM__DTM__AssignmentCommand__NW__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (17<param.get_size()) {
      param.error("record template of type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS has 17 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cS__PowerCommand().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) description__CS__Channel().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gPRS__BroadcastInformation().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cellChannelDescr().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) channelMode().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) frequencyList().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mobileAllocation().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) descrUplinkPacketChannelAssignment().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) descrDownlinkPacketChannelAssignment().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) multiRateConfiguration().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) cipherModeSetting().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) mobileAllocationC2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) frequencyListC2().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) descriptionDualCarrierPacketDownlinkAssignment().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) channelDescriptionC2().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSet().set_param(*param.get_elem(16));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cS_PowerCommand")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__PowerCommand().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "description_CS_Channel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          description__CS__Channel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gPRS_BroadcastInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gPRS__BroadcastInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellChannelDescr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellChannelDescr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrUplinkPacketChannelAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrUplinkPacketChannelAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descrDownlinkPacketChannelAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descrDownlinkPacketChannelAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multiRateConfiguration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multiRateConfiguration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipherModeSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipherModeSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileAllocationC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileAllocationC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frequencyListC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frequencyListC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "descriptionDualCarrierPacketDownlinkAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          descriptionDualCarrierPacketDownlinkAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channelDescriptionC2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channelDescriptionC2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSet")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSet().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__RRM__DTM__AssignmentCommand__NW__MS_template* precondition = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__RRM__DTM__AssignmentCommand__NW__MS_template* implied_template = new PDU__RRM__DTM__AssignmentCommand__NW__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__RRM__DTM__AssignmentCommand__NW__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__RRM__DTM__AssignmentCommand__NW__MS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_cS__PowerCommand.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_description__CS__Channel.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_gPRS__BroadcastInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_cellChannelDescr.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_channelMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_frequencyList.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_mobileAllocation.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_descrUplinkPacketChannelAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_descrDownlinkPacketChannelAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_multiRateConfiguration.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_cipherModeSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_mobileAllocationC2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_frequencyListC2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_descriptionDualCarrierPacketDownlinkAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_channelDescriptionC2.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
single_value->field_extendedTSCSet.check_restriction(t_res, t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@MobileL3_RRM_Types.PDU_RRM_DTM_AssignmentCommand_NW_MS");
}

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__RRM__DTM__AssignmentCommand__NW__MS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


} /* end of namespace */
