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

namespace MobileL3__GMM__SM__Types {

/* Member functions of C++ classes */

MSNetworkCapabilityTLV::MSNetworkCapabilityTLV()
{
}

MSNetworkCapabilityTLV::MSNetworkCapabilityTLV(const OCTETSTRING& par_elementIdentifier,
    const MSNetworkCapabilityLV& par_mSNetworkCapabilityLV)
  :   field_elementIdentifier(par_elementIdentifier),
  field_mSNetworkCapabilityLV(par_mSNetworkCapabilityLV)
{
}

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

void MSNetworkCapabilityTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_mSNetworkCapabilityLV.clean_up();
}

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

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

boolean MSNetworkCapabilityTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_mSNetworkCapabilityLV.is_bound());
}
boolean MSNetworkCapabilityTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_mSNetworkCapabilityLV.is_value();
}
void MSNetworkCapabilityTLV::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(", mSNetworkCapabilityLV := ");
field_mSNetworkCapabilityLV.log();
TTCN_Logger::log_event_str(" }");
}

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

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

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

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

void MSNetworkCapabilityTLV::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 MSNetworkCapabilityTLV::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 MSNetworkCapabilityTLV::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, MSNetworkCapabilityLV_descr_.raw->forceomit);
  decoded_field_length = field_mSNetworkCapabilityLV.RAW_decode(MSNetworkCapabilityLV_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 (field_elementIdentifier !=  os_3) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MSNetworkCapabilityTLV::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, MSNetworkCapabilityLV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mSNetworkCapabilityLV.RAW_encode(MSNetworkCapabilityLV_descr_, *myleaf.body.node.nodes[1]);
  if (field_elementIdentifier !=  os_3) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MSNetworkCapabilityTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
MSNetworkCapabilityLV_template field_mSNetworkCapabilityLV;
};

void MSNetworkCapabilityTLV_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_mSNetworkCapabilityLV = ANY_VALUE;
}
}
}

void MSNetworkCapabilityTLV_template::copy_value(const MSNetworkCapabilityTLV& 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.mSNetworkCapabilityLV().is_bound()) {
  single_value->field_mSNetworkCapabilityLV = other_value.mSNetworkCapabilityLV();
} else {
  single_value->field_mSNetworkCapabilityLV.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MSNetworkCapabilityTLV_template::copy_template(const MSNetworkCapabilityTLV_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.mSNetworkCapabilityLV().get_selection()) {
single_value->field_mSNetworkCapabilityLV = other_value.mSNetworkCapabilityLV();
} else {
single_value->field_mSNetworkCapabilityLV.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 MSNetworkCapabilityTLV_template[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 MSNetworkCapabilityTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MSNetworkCapabilityTLV_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_GMM_SM_Types.MSNetworkCapabilityTLV.");
break;
}
set_selection(other_value);
}

MSNetworkCapabilityTLV_template::MSNetworkCapabilityTLV_template()
{
}

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

MSNetworkCapabilityTLV_template::MSNetworkCapabilityTLV_template(const MSNetworkCapabilityTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MSNetworkCapabilityTLV_template::match(const MSNetworkCapabilityTLV& 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.mSNetworkCapabilityLV().is_bound()) return FALSE;
if(!single_value->field_mSNetworkCapabilityLV.match(other_value.mSNetworkCapabilityLV(), 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_GMM_SM_Types.MSNetworkCapabilityTLV.");
}
return FALSE;
}

boolean MSNetworkCapabilityTLV_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_mSNetworkCapabilityLV.is_bound();
}

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

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

MSNetworkCapabilityTLV MSNetworkCapabilityTLV_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_GMM_SM_Types.MSNetworkCapabilityTLV.");
MSNetworkCapabilityTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_mSNetworkCapabilityLV.is_bound()) {
ret_val.mSNetworkCapabilityLV() = single_value->field_mSNetworkCapabilityLV.valueof();
}
return ret_val;
}

void MSNetworkCapabilityTLV_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_GMM_SM_Types.MSNetworkCapabilityTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MSNetworkCapabilityTLV_template[list_length];
}

MSNetworkCapabilityTLV_template& MSNetworkCapabilityTLV_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_GMM_SM_Types.MSNetworkCapabilityTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MSNetworkCapabilityTLV.");
return value_list.list_value[list_index];
}

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

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

MSNetworkCapabilityLV_template& MSNetworkCapabilityTLV_template::mSNetworkCapabilityLV()
{
set_specific();
return single_value->field_mSNetworkCapabilityLV;
}

const MSNetworkCapabilityLV_template& MSNetworkCapabilityTLV_template::mSNetworkCapabilityLV() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mSNetworkCapabilityLV of a non-specific template of type @MobileL3_GMM_SM_Types.MSNetworkCapabilityTLV.");
return single_value->field_mSNetworkCapabilityLV;
}

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

void MSNetworkCapabilityTLV_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(", mSNetworkCapabilityLV := ");
single_value->field_mSNetworkCapabilityLV.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 MSNetworkCapabilityTLV_template::log_match(const MSNetworkCapabilityTLV& 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_mSNetworkCapabilityLV.match(match_value.mSNetworkCapabilityLV(), legacy)){
TTCN_Logger::log_logmatch_info(".mSNetworkCapabilityLV");
single_value->field_mSNetworkCapabilityLV.log_match(match_value.mSNetworkCapabilityLV(), 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(", mSNetworkCapabilityLV := ");
single_value->field_mSNetworkCapabilityLV.log_match(match_value.mSNetworkCapabilityLV(), 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 MSNetworkCapabilityTLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (mSNetworkCapabilityLV().is_bound()) mSNetworkCapabilityLV().set_implicit_omit();
}

void MSNetworkCapabilityTLV_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_mSNetworkCapabilityLV.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_GMM_SM_Types.MSNetworkCapabilityTLV.");
}
}

void MSNetworkCapabilityTLV_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_mSNetworkCapabilityLV.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 MSNetworkCapabilityTLV_template[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_GMM_SM_Types.MSNetworkCapabilityTLV.");
}
}

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

void MSNetworkCapabilityTLV_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_GMM_SM_Types.MSNetworkCapabilityTLV");
single_value->field_mSNetworkCapabilityLV.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSNetworkCapabilityTLV");
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_GMM_SM_Types.MSNetworkCapabilityTLV");
}

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

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


const MSRACapabilityValuesRecord MSRadioAccessCapabilityV::UNBOUND_ELEM;
MSRadioAccessCapabilityV::MSRadioAccessCapabilityV()
{
val_ptr = NULL;
}

MSRadioAccessCapabilityV::MSRadioAccessCapabilityV(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

MSRadioAccessCapabilityV::MSRadioAccessCapabilityV(const MSRadioAccessCapabilityV& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

MSRadioAccessCapabilityV::~MSRadioAccessCapabilityV()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void MSRadioAccessCapabilityV::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

MSRadioAccessCapabilityV& MSRadioAccessCapabilityV::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

MSRadioAccessCapabilityV& MSRadioAccessCapabilityV::operator=(const MSRadioAccessCapabilityV& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean MSRadioAccessCapabilityV::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
return val_ptr->n_elements == 0 ;
}

boolean MSRadioAccessCapabilityV::operator==(const MSRadioAccessCapabilityV& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

MSRACapabilityValuesRecord& MSRadioAccessCapabilityV::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (MSRACapabilityValuesRecord**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new MSRACapabilityValuesRecord(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new MSRACapabilityValuesRecord;
}
return *val_ptr->value_elements[index_value];
}

MSRACapabilityValuesRecord& MSRadioAccessCapabilityV::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
return (*this)[(int)index_value];
}

const MSRACapabilityValuesRecord& MSRadioAccessCapabilityV::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
if (index_value < 0) TTCN_error("Accessing an element of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const MSRACapabilityValuesRecord& MSRadioAccessCapabilityV::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
return (*this)[(int)index_value];
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
MSRadioAccessCapabilityV ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new MSRACapabilityValuesRecord(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV::operator+(const MSRadioAccessCapabilityV& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
MSRadioAccessCapabilityV ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new MSRACapabilityValuesRecord(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new MSRACapabilityValuesRecord(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV","element");
MSRadioAccessCapabilityV ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new MSRACapabilityValuesRecord(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV::replace(int index, int len, const MSRadioAccessCapabilityV& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
check_replace_arguments(val_ptr->n_elements, index, len, "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV","element");
MSRadioAccessCapabilityV ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new MSRACapabilityValuesRecord(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new MSRACapabilityValuesRecord(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new MSRACapabilityValuesRecord(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV::replace(int index, int len, const MSRadioAccessCapabilityV_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void MSRadioAccessCapabilityV::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (MSRACapabilityValuesRecord**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new MSRACapabilityValuesRecord(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (MSRACapabilityValuesRecord**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (MSRACapabilityValuesRecord**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean MSRadioAccessCapabilityV::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int MSRadioAccessCapabilityV::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
return val_ptr->n_elements;
}

int MSRadioAccessCapabilityV::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void MSRadioAccessCapabilityV::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void MSRadioAccessCapabilityV::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void MSRadioAccessCapabilityV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void MSRadioAccessCapabilityV::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void MSRadioAccessCapabilityV::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
val_ptr->value_elements = (MSRACapabilityValuesRecord**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new MSRACapabilityValuesRecord;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void MSRadioAccessCapabilityV::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 MSRadioAccessCapabilityV::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 MSRadioAccessCapabilityV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean /*no_err*/, int sel_field, boolean first_call, const RAW_Force_Omit*){
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int decoded_field_length=0;
  size_t start_of_field=0;
  if(first_call) {
    clean_up();
    val_ptr=new recordof_setof_struct;
    val_ptr->ref_count=1;
    val_ptr->n_elements=0;
    val_ptr->value_elements=NULL;
  }
  int start_field=val_ptr->n_elements;
  if(p_td.raw->fieldlength || sel_field!=-1){
    int a=0;
    if(sel_field==-1) sel_field=p_td.raw->fieldlength;
    start_of_field=p_buf.get_pos_bit();
    for(a=0;a<sel_field;a++){
      decoded_field_length=(*this)[a+start_field].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE);
      if(decoded_field_length < 0){
        while(a>=0){
          delete &(*this)[a+start_field];
          a--;
          val_ptr->n_elements--;
        }
        p_buf.set_pos_bit(start_of_field);
        return decoded_field_length;
      }
      decoded_length+=decoded_field_length;
      limit-=decoded_field_length;
    }
    if(a==0) val_ptr->n_elements=0;
  } else {
    if(limit==0){
      if(!first_call) return -1;
      val_ptr->n_elements=0;
      return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
    }
    int a=start_field;
    while(limit>0){
      start_of_field=p_buf.get_pos_bit();
      decoded_field_length=(*this)[a].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE);
      if(decoded_field_length < 0){
        delete &(*this)[a];
        val_ptr->n_elements--;
        p_buf.set_pos_bit(start_of_field);
        if(a>start_field){
        return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
        } else return -1;
      }
      decoded_length+=decoded_field_length;
      limit-=decoded_field_length;
      a++;
      if (!p_buf.get_last_bit())
        return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
    }
  }
 return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
}

int MSRadioAccessCapabilityV::RAW_encode(const TTCN_Typedescriptor_t& p_td,RAW_enc_tree& myleaf) const{
  int encoded_length=0;
  int encoded_num_of_records=p_td.raw->fieldlength?smaller(val_ptr->n_elements, p_td.raw->fieldlength):val_ptr->n_elements;
  myleaf.isleaf=FALSE;
  myleaf.rec_of=TRUE;
  myleaf.body.node.num_of_nodes=encoded_num_of_records;
  myleaf.body.node.nodes=init_nodes_of_enc_tree(encoded_num_of_records);
  for(int a=0;a<encoded_num_of_records;a++){
    myleaf.body.node.nodes[a]=new RAW_enc_tree(TRUE,&myleaf,&(myleaf.curr_pos),a,p_td.oftype_descr->raw);
    encoded_length+=(*this)[a].RAW_encode(*p_td.oftype_descr,*myleaf.body.node.nodes[a]);
  }
 return myleaf.length=encoded_length;
}

void MSRadioAccessCapabilityV_template::copy_value(const MSRadioAccessCapabilityV& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (MSRACapabilityValuesRecord_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new MSRACapabilityValuesRecord_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new MSRACapabilityValuesRecord_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void MSRadioAccessCapabilityV_template::copy_template(const MSRadioAccessCapabilityV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (MSRACapabilityValuesRecord_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new MSRACapabilityValuesRecord_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new MSRACapabilityValuesRecord_template;
}
}
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 MSRadioAccessCapabilityV_template[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 MSRadioAccessCapabilityV_template(*other_value.implication_.precondition);
implication_.implied_template = new MSRadioAccessCapabilityV_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_GMM_SM_Types.MSRadioAccessCapabilityV.");
break;
}
set_selection(other_value);
}

boolean MSRadioAccessCapabilityV_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const MSRadioAccessCapabilityV_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const MSRadioAccessCapabilityV*)value_ptr)[value_index], legacy);
else return ((const MSRadioAccessCapabilityV_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

MSRadioAccessCapabilityV_template::MSRadioAccessCapabilityV_template()
{
}

MSRadioAccessCapabilityV_template::MSRadioAccessCapabilityV_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

MSRadioAccessCapabilityV_template::MSRadioAccessCapabilityV_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

MSRadioAccessCapabilityV_template::MSRadioAccessCapabilityV_template(const MSRadioAccessCapabilityV& other_value)
{
copy_value(other_value);
}

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

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

MSRadioAccessCapabilityV_template::MSRadioAccessCapabilityV_template(Dynamic_Match_Interface<MSRadioAccessCapabilityV>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<MSRadioAccessCapabilityV>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

MSRadioAccessCapabilityV_template::MSRadioAccessCapabilityV_template(const MSRadioAccessCapabilityV_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

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

void MSRadioAccessCapabilityV_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
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;
}

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

MSRadioAccessCapabilityV_template& MSRadioAccessCapabilityV_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

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

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

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

MSRACapabilityValuesRecord_template& MSRadioAccessCapabilityV_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
    break;
}
return *single_value.value_elements[index_value];
}

MSRACapabilityValuesRecord_template& MSRadioAccessCapabilityV_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
return (*this)[(int)index_value];
}

const MSRACapabilityValuesRecord_template& MSRadioAccessCapabilityV_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const MSRACapabilityValuesRecord_template& MSRadioAccessCapabilityV_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
return (*this)[(int)index_value];
}

void MSRadioAccessCapabilityV_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (MSRACapabilityValuesRecord_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new MSRACapabilityValuesRecord_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new MSRACapabilityValuesRecord_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (MSRACapabilityValuesRecord_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int MSRadioAccessCapabilityV_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int MSRadioAccessCapabilityV_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV");
}

boolean MSRadioAccessCapabilityV_template::match(const MSRadioAccessCapabilityV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
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 with an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
}
return FALSE;
}

boolean MSRadioAccessCapabilityV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV_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_GMM_SM_Types.MSRadioAccessCapabilityV.");
MSRadioAccessCapabilityV ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV_template::replace(int index, int len, const MSRadioAccessCapabilityV_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

MSRadioAccessCapabilityV MSRadioAccessCapabilityV_template::replace(int index, int len, const MSRadioAccessCapabilityV& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void MSRadioAccessCapabilityV_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new MSRadioAccessCapabilityV_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
}
set_selection(template_type);
}

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

void MSRadioAccessCapabilityV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else 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_restricted();
log_ifpresent();
}

void MSRadioAccessCapabilityV_template::log_match(const MSRadioAccessCapabilityV& 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} 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 MSRadioAccessCapabilityV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->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_GMM_SM_Types.MSRadioAccessCapabilityV.");
}
}

void MSRadioAccessCapabilityV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
single_value.value_elements = (MSRACapabilityValuesRecord_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new MSRACapabilityValuesRecord_template;
single_value.value_elements[elem_count]->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 MSRadioAccessCapabilityV_template[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 for a template of type @MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV.");
}
}

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

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

void MSRadioAccessCapabilityV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void MSRadioAccessCapabilityV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of 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: {
    MSRadioAccessCapabilityV_template temp;
    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++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MSRadioAccessCapabilityV_template* precondition = new MSRadioAccessCapabilityV_template;
    precondition->set_param(*param.get_elem(0));
    MSRadioAccessCapabilityV_template* implied_template = new MSRadioAccessCapabilityV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MSRadioAccessCapabilityV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void MSRadioAccessCapabilityV_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;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRadioAccessCapabilityV");
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_GMM_SM_Types.MSRadioAccessCapabilityV");
}

boolean MSRadioAccessCapabilityV_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
void MSRACapabilityValues::copy_value(const MSRACapabilityValues& other_value)
{
switch (other_value.union_selection) {
case ALT_mSRACapabilityValuesExclude1111:
field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111(*other_value.field_mSRACapabilityValuesExclude1111);
break;
case ALT_mSRACapabilityValues1111:
field_mSRACapabilityValues1111 = new MSRACapabilityValues1111(*other_value.field_mSRACapabilityValues1111);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean MSRACapabilityValues::operator==(const MSRACapabilityValues& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_mSRACapabilityValuesExclude1111:
return *field_mSRACapabilityValuesExclude1111 == *other_value.field_mSRACapabilityValuesExclude1111;
case ALT_mSRACapabilityValues1111:
return *field_mSRACapabilityValues1111 == *other_value.field_mSRACapabilityValues1111;
default:
return FALSE;
}
}

MSRACapabilityValuesExclude1111& MSRACapabilityValues::mSRACapabilityValuesExclude1111()
{
if (union_selection != ALT_mSRACapabilityValuesExclude1111) {
clean_up();
field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111;
union_selection = ALT_mSRACapabilityValuesExclude1111;
}
return *field_mSRACapabilityValuesExclude1111;
}

const MSRACapabilityValuesExclude1111& MSRACapabilityValues::mSRACapabilityValuesExclude1111() const
{
if (union_selection != ALT_mSRACapabilityValuesExclude1111) TTCN_error("Using non-selected field mSRACapabilityValuesExclude1111 in a value of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
return *field_mSRACapabilityValuesExclude1111;
}

MSRACapabilityValues1111& MSRACapabilityValues::mSRACapabilityValues1111()
{
if (union_selection != ALT_mSRACapabilityValues1111) {
clean_up();
field_mSRACapabilityValues1111 = new MSRACapabilityValues1111;
union_selection = ALT_mSRACapabilityValues1111;
}
return *field_mSRACapabilityValues1111;
}

const MSRACapabilityValues1111& MSRACapabilityValues::mSRACapabilityValues1111() const
{
if (union_selection != ALT_mSRACapabilityValues1111) TTCN_error("Using non-selected field mSRACapabilityValues1111 in a value of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
return *field_mSRACapabilityValues1111;
}

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

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

boolean MSRACapabilityValues::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_mSRACapabilityValuesExclude1111: return field_mSRACapabilityValuesExclude1111->is_value();
case ALT_mSRACapabilityValues1111: return field_mSRACapabilityValues1111->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void MSRACapabilityValues::clean_up()
{
switch (union_selection) {
case ALT_mSRACapabilityValuesExclude1111:
  delete field_mSRACapabilityValuesExclude1111;
  break;
case ALT_mSRACapabilityValues1111:
  delete field_mSRACapabilityValues1111;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void MSRACapabilityValues::log() const
{
switch (union_selection) {
case ALT_mSRACapabilityValuesExclude1111:
TTCN_Logger::log_event_str("{ mSRACapabilityValuesExclude1111 := ");
field_mSRACapabilityValuesExclude1111->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_mSRACapabilityValues1111:
TTCN_Logger::log_event_str("{ mSRACapabilityValues1111 := ");
field_mSRACapabilityValues1111->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void MSRACapabilityValues::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "mSRACapabilityValuesExclude1111")) {
    mSRACapabilityValuesExclude1111().set_param(*mp_last);
    if (!mSRACapabilityValuesExclude1111().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "mSRACapabilityValues1111")) {
    mSRACapabilityValues1111().set_param(*mp_last);
    if (!mSRACapabilityValues1111().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MobileL3_GMM_SM_Types.MSRACapabilityValues.", last_name);
}

void MSRACapabilityValues::set_implicit_omit()
{
switch (union_selection) {
case ALT_mSRACapabilityValuesExclude1111:
field_mSRACapabilityValuesExclude1111->set_implicit_omit(); break;
case ALT_mSRACapabilityValues1111:
field_mSRACapabilityValues1111->set_implicit_omit(); break;
default: break;
}
}

void MSRACapabilityValues::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_mSRACapabilityValuesExclude1111:
field_mSRACapabilityValuesExclude1111->encode_text(text_buf);
break;
case ALT_mSRACapabilityValues1111:
field_mSRACapabilityValues1111->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
}

void MSRACapabilityValues::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_mSRACapabilityValuesExclude1111:
mSRACapabilityValuesExclude1111().decode_text(text_buf);
break;
case ALT_mSRACapabilityValues1111:
mSRACapabilityValues1111().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
}

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

void MSRACapabilityValues::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 MSRACapabilityValues::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, MSRACapabilityValuesExclude1111_descr_.raw->forceomit);
      decoded_length = mSRACapabilityValuesExclude1111().RAW_decode(MSRACapabilityValuesExclude1111_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, MSRACapabilityValues1111_descr_.raw->forceomit);
      decoded_length = mSRACapabilityValues1111().RAW_decode(MSRACapabilityValues1111_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, MSRACapabilityValuesExclude1111_descr_.raw->forceomit);
      decoded_length = mSRACapabilityValuesExclude1111().RAW_decode(MSRACapabilityValuesExclude1111_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, MSRACapabilityValues1111_descr_.raw->forceomit);
      decoded_length = mSRACapabilityValues1111().RAW_decode(MSRACapabilityValues1111_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int MSRACapabilityValues::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  memset(myleaf.body.node.nodes, 0, 2 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_mSRACapabilityValuesExclude1111:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, MSRACapabilityValuesExclude1111_descr_.raw);
    encoded_length = field_mSRACapabilityValuesExclude1111->RAW_encode(MSRACapabilityValuesExclude1111_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &MSRACapabilityValuesExclude1111_descr_;
    break;
  case ALT_mSRACapabilityValues1111:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, MSRACapabilityValues1111_descr_.raw);
    encoded_length = field_mSRACapabilityValues1111->RAW_encode(MSRACapabilityValues1111_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &MSRACapabilityValues1111_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void MSRACapabilityValues_template::copy_value(const MSRACapabilityValues& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111_template(other_value.mSRACapabilityValuesExclude1111());
break;
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111_template(other_value.mSRACapabilityValues1111());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
set_selection(SPECIFIC_VALUE);
}

void MSRACapabilityValues_template::copy_template(const MSRACapabilityValues_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111_template(*other_value.single_value.field_mSRACapabilityValuesExclude1111);
break;
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111_template(*other_value.single_value.field_mSRACapabilityValues1111);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
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 MSRACapabilityValues_template[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 MSRACapabilityValues_template(*other_value.implication_.precondition);
implication_.implied_template = new MSRACapabilityValues_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
set_selection(other_value);
}

MSRACapabilityValues_template::MSRACapabilityValues_template()
{
}

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

MSRACapabilityValues_template::MSRACapabilityValues_template(const MSRACapabilityValues& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean MSRACapabilityValues_template::match(const MSRACapabilityValues& 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:
{
MSRACapabilityValues::union_selection_type value_selection = other_value.get_selection();
if (value_selection == MSRACapabilityValues::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
return single_value.field_mSRACapabilityValuesExclude1111->match(other_value.mSRACapabilityValuesExclude1111(), legacy);
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
return single_value.field_mSRACapabilityValues1111->match(other_value.mSRACapabilityValues1111(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
return FALSE;
}

boolean MSRACapabilityValues_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
return single_value.field_mSRACapabilityValuesExclude1111->is_value();
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
return single_value.field_mSRACapabilityValues1111->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
}

MSRACapabilityValues MSRACapabilityValues_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
MSRACapabilityValues ret_val;
switch (single_value.union_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
ret_val.mSRACapabilityValuesExclude1111() = single_value.field_mSRACapabilityValuesExclude1111->valueof();
break;
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
ret_val.mSRACapabilityValues1111() = single_value.field_mSRACapabilityValues1111->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
return ret_val;
}

MSRACapabilityValues_template& MSRACapabilityValues_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
return value_list.list_value[list_index];
}
void MSRACapabilityValues_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MSRACapabilityValues_template[list_length];
}

MSRACapabilityValuesExclude1111_template& MSRACapabilityValues_template::mSRACapabilityValuesExclude1111()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111_template(ANY_VALUE);
else single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111_template;
single_value.union_selection = MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mSRACapabilityValuesExclude1111;
}

const MSRACapabilityValuesExclude1111_template& MSRACapabilityValues_template::mSRACapabilityValuesExclude1111() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mSRACapabilityValuesExclude1111 in a non-specific template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
if (single_value.union_selection != MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111) TTCN_error("Accessing non-selected field mSRACapabilityValuesExclude1111 in a template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
return *single_value.field_mSRACapabilityValuesExclude1111;
}

MSRACapabilityValues1111_template& MSRACapabilityValues_template::mSRACapabilityValues1111()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MSRACapabilityValues::ALT_mSRACapabilityValues1111) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111_template(ANY_VALUE);
else single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111_template;
single_value.union_selection = MSRACapabilityValues::ALT_mSRACapabilityValues1111;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_mSRACapabilityValues1111;
}

const MSRACapabilityValues1111_template& MSRACapabilityValues_template::mSRACapabilityValues1111() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mSRACapabilityValues1111 in a non-specific template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
if (single_value.union_selection != MSRACapabilityValues::ALT_mSRACapabilityValues1111) TTCN_error("Accessing non-selected field mSRACapabilityValues1111 in a template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
return *single_value.field_mSRACapabilityValues1111;
}

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

void MSRACapabilityValues_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
TTCN_Logger::log_event_str("{ mSRACapabilityValuesExclude1111 := ");
single_value.field_mSRACapabilityValuesExclude1111->log();
TTCN_Logger::log_event_str(" }");
break;
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
TTCN_Logger::log_event_str("{ mSRACapabilityValues1111 := ");
single_value.field_mSRACapabilityValues1111->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void MSRACapabilityValues_template::log_match(const MSRACapabilityValues& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mSRACapabilityValuesExclude1111");
single_value.field_mSRACapabilityValuesExclude1111->log_match(match_value.mSRACapabilityValuesExclude1111(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mSRACapabilityValuesExclude1111 := ");
single_value.field_mSRACapabilityValuesExclude1111->log_match(match_value.mSRACapabilityValuesExclude1111(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".mSRACapabilityValues1111");
single_value.field_mSRACapabilityValues1111->log_match(match_value.mSRACapabilityValues1111(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ mSRACapabilityValues1111 := ");
single_value.field_mSRACapabilityValues1111->log_match(match_value.mSRACapabilityValues1111(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void MSRACapabilityValues_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
single_value.field_mSRACapabilityValuesExclude1111->set_implicit_omit(); break;
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
single_value.field_mSRACapabilityValues1111->set_implicit_omit(); break;
default: break;
}
}

void MSRACapabilityValues_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
single_value.field_mSRACapabilityValuesExclude1111->encode_text(text_buf);
break;
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
single_value.field_mSRACapabilityValues1111->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
}

void MSRACapabilityValues_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = MSRACapabilityValues::UNBOUND_VALUE;
MSRACapabilityValues::union_selection_type new_selection = (MSRACapabilityValues::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111_template;
single_value.field_mSRACapabilityValuesExclude1111->decode_text(text_buf);
break;
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111_template;
single_value.field_mSRACapabilityValues1111->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MSRACapabilityValues_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
}

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

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

void MSRACapabilityValues_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@MobileL3_GMM_SM_Types.MSRACapabilityValues'");
    }
    if (strcmp("mSRACapabilityValuesExclude1111", param_field) == 0) {
      mSRACapabilityValuesExclude1111().set_param(param);
      return;
    } else if (strcmp("mSRACapabilityValues1111", param_field) == 0) {
      mSRACapabilityValues1111().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MobileL3_GMM_SM_Types.MSRACapabilityValues'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MSRACapabilityValues_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@MobileL3_GMM_SM_Types.MSRACapabilityValues");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "mSRACapabilityValuesExclude1111")) {
      mSRACapabilityValuesExclude1111().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "mSRACapabilityValues1111")) {
      mSRACapabilityValues1111().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MobileL3_GMM_SM_Types.MSRACapabilityValues.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    MSRACapabilityValues_template* precondition = new MSRACapabilityValues_template;
    precondition->set_param(*m_p->get_elem(0));
    MSRACapabilityValues_template* implied_template = new MSRACapabilityValues_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = MSRACapabilityValues_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MobileL3_GMM_SM_Types.MSRACapabilityValues");
  }
  is_ifpresent = param.get_ifpresent();
}

void MSRACapabilityValues_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case MSRACapabilityValues::ALT_mSRACapabilityValuesExclude1111:
single_value.field_mSRACapabilityValuesExclude1111->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValues");
return;
case MSRACapabilityValues::ALT_mSRACapabilityValues1111:
single_value.field_mSRACapabilityValues1111->check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MSRACapabilityValues");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MobileL3_GMM_SM_Types.MSRACapabilityValues.");
}
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_GMM_SM_Types.MSRACapabilityValues");
}

AccessCapabilities::AccessCapabilities()
{
}

AccessCapabilities::AccessCapabilities(const BITSTRING& par_rfPowerCapability,
    const BITSTRING& par_presenceBitA5,
    const OPTIONAL< A5BITS >& par_a5bits,
    const BITSTRING& par_esind,
    const BITSTRING& par_psbit,
    const BITSTRING& par_vgcs,
    const BITSTRING& par_vbs,
    const BITSTRING& par_presenceBitMultislot,
    const OPTIONAL< MultislotCap >& par_multislotcap,
    const OPTIONAL< AccessCapAdditionsAfterRel97 >& par_accessCapAdditionsAfterRel97)
  :   field_rfPowerCapability(par_rfPowerCapability),
  field_presenceBitA5(par_presenceBitA5),
  field_a5bits(par_a5bits),
  field_esind(par_esind),
  field_psbit(par_psbit),
  field_vgcs(par_vgcs),
  field_vbs(par_vbs),
  field_presenceBitMultislot(par_presenceBitMultislot),
  field_multislotcap(par_multislotcap),
  field_accessCapAdditionsAfterRel97(par_accessCapAdditionsAfterRel97)
{
}

AccessCapabilities::AccessCapabilities(const AccessCapabilities& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
if (other_value.rfPowerCapability().is_bound()) field_rfPowerCapability = other_value.rfPowerCapability();
else field_rfPowerCapability.clean_up();
if (other_value.presenceBitA5().is_bound()) field_presenceBitA5 = other_value.presenceBitA5();
else field_presenceBitA5.clean_up();
if (other_value.a5bits().is_bound()) field_a5bits = other_value.a5bits();
else field_a5bits.clean_up();
if (other_value.esind().is_bound()) field_esind = other_value.esind();
else field_esind.clean_up();
if (other_value.psbit().is_bound()) field_psbit = other_value.psbit();
else field_psbit.clean_up();
if (other_value.vgcs().is_bound()) field_vgcs = other_value.vgcs();
else field_vgcs.clean_up();
if (other_value.vbs().is_bound()) field_vbs = other_value.vbs();
else field_vbs.clean_up();
if (other_value.presenceBitMultislot().is_bound()) field_presenceBitMultislot = other_value.presenceBitMultislot();
else field_presenceBitMultislot.clean_up();
if (other_value.multislotcap().is_bound()) field_multislotcap = other_value.multislotcap();
else field_multislotcap.clean_up();
if (other_value.accessCapAdditionsAfterRel97().is_bound()) field_accessCapAdditionsAfterRel97 = other_value.accessCapAdditionsAfterRel97();
else field_accessCapAdditionsAfterRel97.clean_up();
}

void AccessCapabilities::clean_up()
{
field_rfPowerCapability.clean_up();
field_presenceBitA5.clean_up();
field_a5bits.clean_up();
field_esind.clean_up();
field_psbit.clean_up();
field_vgcs.clean_up();
field_vbs.clean_up();
field_presenceBitMultislot.clean_up();
field_multislotcap.clean_up();
field_accessCapAdditionsAfterRel97.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapabilities::get_descriptor() const { return &AccessCapabilities_descr_; }
AccessCapabilities& AccessCapabilities::operator=(const AccessCapabilities& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
  if (other_value.rfPowerCapability().is_bound()) field_rfPowerCapability = other_value.rfPowerCapability();
  else field_rfPowerCapability.clean_up();
  if (other_value.presenceBitA5().is_bound()) field_presenceBitA5 = other_value.presenceBitA5();
  else field_presenceBitA5.clean_up();
  if (other_value.a5bits().is_bound()) field_a5bits = other_value.a5bits();
  else field_a5bits.clean_up();
  if (other_value.esind().is_bound()) field_esind = other_value.esind();
  else field_esind.clean_up();
  if (other_value.psbit().is_bound()) field_psbit = other_value.psbit();
  else field_psbit.clean_up();
  if (other_value.vgcs().is_bound()) field_vgcs = other_value.vgcs();
  else field_vgcs.clean_up();
  if (other_value.vbs().is_bound()) field_vbs = other_value.vbs();
  else field_vbs.clean_up();
  if (other_value.presenceBitMultislot().is_bound()) field_presenceBitMultislot = other_value.presenceBitMultislot();
  else field_presenceBitMultislot.clean_up();
  if (other_value.multislotcap().is_bound()) field_multislotcap = other_value.multislotcap();
  else field_multislotcap.clean_up();
  if (other_value.accessCapAdditionsAfterRel97().is_bound()) field_accessCapAdditionsAfterRel97 = other_value.accessCapAdditionsAfterRel97();
  else field_accessCapAdditionsAfterRel97.clean_up();
}
return *this;
}

boolean AccessCapabilities::operator==(const AccessCapabilities& other_value) const
{
return field_rfPowerCapability==other_value.field_rfPowerCapability
  && field_presenceBitA5==other_value.field_presenceBitA5
  && field_a5bits==other_value.field_a5bits
  && field_esind==other_value.field_esind
  && field_psbit==other_value.field_psbit
  && field_vgcs==other_value.field_vgcs
  && field_vbs==other_value.field_vbs
  && field_presenceBitMultislot==other_value.field_presenceBitMultislot
  && field_multislotcap==other_value.field_multislotcap
  && field_accessCapAdditionsAfterRel97==other_value.field_accessCapAdditionsAfterRel97;
}

boolean AccessCapabilities::is_bound() const
{
return (field_rfPowerCapability.is_bound())
  || (field_presenceBitA5.is_bound())
  || (OPTIONAL_OMIT == field_a5bits.get_selection() || field_a5bits.is_bound())
  || (field_esind.is_bound())
  || (field_psbit.is_bound())
  || (field_vgcs.is_bound())
  || (field_vbs.is_bound())
  || (field_presenceBitMultislot.is_bound())
  || (OPTIONAL_OMIT == field_multislotcap.get_selection() || field_multislotcap.is_bound())
  || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel97.get_selection() || field_accessCapAdditionsAfterRel97.is_bound());
}
boolean AccessCapabilities::is_value() const
{
return field_rfPowerCapability.is_value()
  && field_presenceBitA5.is_value()
  && (OPTIONAL_OMIT == field_a5bits.get_selection() || field_a5bits.is_value())
  && field_esind.is_value()
  && field_psbit.is_value()
  && field_vgcs.is_value()
  && field_vbs.is_value()
  && field_presenceBitMultislot.is_value()
  && (OPTIONAL_OMIT == field_multislotcap.get_selection() || field_multislotcap.is_value())
  && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel97.get_selection() || field_accessCapAdditionsAfterRel97.is_value());
}
int AccessCapabilities::size_of() const
{
  int ret_val = 7;
  if (field_a5bits.ispresent()) ret_val++;
  if (field_multislotcap.ispresent()) ret_val++;
  if (field_accessCapAdditionsAfterRel97.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapabilities::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rfPowerCapability := ");
field_rfPowerCapability.log();
TTCN_Logger::log_event_str(", presenceBitA5 := ");
field_presenceBitA5.log();
TTCN_Logger::log_event_str(", a5bits := ");
field_a5bits.log();
TTCN_Logger::log_event_str(", esind := ");
field_esind.log();
TTCN_Logger::log_event_str(", psbit := ");
field_psbit.log();
TTCN_Logger::log_event_str(", vgcs := ");
field_vgcs.log();
TTCN_Logger::log_event_str(", vbs := ");
field_vbs.log();
TTCN_Logger::log_event_str(", presenceBitMultislot := ");
field_presenceBitMultislot.log();
TTCN_Logger::log_event_str(", multislotcap := ");
field_multislotcap.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel97 := ");
field_accessCapAdditionsAfterRel97.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapabilities::set_implicit_omit()
{
if (rfPowerCapability().is_bound()) rfPowerCapability().set_implicit_omit();
if (presenceBitA5().is_bound()) presenceBitA5().set_implicit_omit();
if (!a5bits().is_bound()) a5bits() = OMIT_VALUE;
else a5bits().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (psbit().is_bound()) psbit().set_implicit_omit();
if (vgcs().is_bound()) vgcs().set_implicit_omit();
if (vbs().is_bound()) vbs().set_implicit_omit();
if (presenceBitMultislot().is_bound()) presenceBitMultislot().set_implicit_omit();
if (!multislotcap().is_bound()) multislotcap() = OMIT_VALUE;
else multislotcap().set_implicit_omit();
if (!accessCapAdditionsAfterRel97().is_bound()) accessCapAdditionsAfterRel97() = OMIT_VALUE;
else accessCapAdditionsAfterRel97().set_implicit_omit();
}

void AccessCapabilities::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_GMM_SM_Types.AccessCapabilities 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) rfPowerCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitA5().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a5bits().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) psbit().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) vgcs().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) vbs().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) presenceBitMultislot().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) multislotcap().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel97().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(), "rfPowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rfPowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitA5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitA5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5bits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5bits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "psbit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          psbit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vgcs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vbs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vbs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitMultislot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitMultislot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotcap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotcap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "accessCapAdditionsAfterRel97")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel97().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapabilities: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapabilities");
  }
}

void AccessCapabilities::encode_text(Text_Buf& text_buf) const
{
field_rfPowerCapability.encode_text(text_buf);
field_presenceBitA5.encode_text(text_buf);
field_a5bits.encode_text(text_buf);
field_esind.encode_text(text_buf);
field_psbit.encode_text(text_buf);
field_vgcs.encode_text(text_buf);
field_vbs.encode_text(text_buf);
field_presenceBitMultislot.encode_text(text_buf);
field_multislotcap.encode_text(text_buf);
field_accessCapAdditionsAfterRel97.encode_text(text_buf);
}

void AccessCapabilities::decode_text(Text_Buf& text_buf)
{
field_rfPowerCapability.decode_text(text_buf);
field_presenceBitA5.decode_text(text_buf);
field_a5bits.decode_text(text_buf);
field_esind.decode_text(text_buf);
field_psbit.decode_text(text_buf);
field_vgcs.decode_text(text_buf);
field_vbs.decode_text(text_buf);
field_presenceBitMultislot.decode_text(text_buf);
field_multislotcap.decode_text(text_buf);
field_accessCapAdditionsAfterRel97.decode_text(text_buf);
}

void AccessCapabilities::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 AccessCapabilities::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 AccessCapabilities::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, AccessCapabilities_rfPowerCapability_descr_.raw->forceomit);
  decoded_field_length = field_rfPowerCapability.RAW_decode(AccessCapabilities_rfPowerCapability_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, AccessCapabilities_presenceBitA5_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitA5.RAW_decode(AccessCapabilities_presenceBitA5_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 && field_presenceBitA5 ==  bs_2){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_a5bits = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapabilities_a5bits_descr_.raw->forceomit);
  decoded_field_length = field_a5bits().RAW_decode(AccessCapabilities_a5bits_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_a5bits = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_a5bits=OMIT_VALUE;
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapabilities_esind_descr_.raw->forceomit);
  decoded_field_length = field_esind.RAW_decode(AccessCapabilities_esind_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, AccessCapabilities_psbit_descr_.raw->forceomit);
  decoded_field_length = field_psbit.RAW_decode(AccessCapabilities_psbit_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, AccessCapabilities_vgcs_descr_.raw->forceomit);
  decoded_field_length = field_vgcs.RAW_decode(AccessCapabilities_vgcs_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, AccessCapabilities_vbs_descr_.raw->forceomit);
  decoded_field_length = field_vbs.RAW_decode(AccessCapabilities_vbs_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, AccessCapabilities_presenceBitMultislot_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitMultislot.RAW_decode(AccessCapabilities_presenceBitMultislot_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_presenceBitMultislot ==  bs_2){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_multislotcap = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, AccessCapabilities_multislotcap_descr_.raw->forceomit);
  decoded_field_length = field_multislotcap().RAW_decode(AccessCapabilities_multislotcap_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_multislotcap = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_multislotcap=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_accessCapAdditionsAfterRel97 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, AccessCapabilities_accessCapAdditionsAfterRel97_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel97().RAW_decode(AccessCapabilities_accessCapAdditionsAfterRel97_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_accessCapAdditionsAfterRel97 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_accessCapAdditionsAfterRel97=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapabilities::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, AccessCapabilities_rfPowerCapability_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapabilities_presenceBitA5_descr_.raw);
  if (field_a5bits.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapabilities_a5bits_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapabilities_esind_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapabilities_psbit_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapabilities_vgcs_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AccessCapabilities_vbs_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, AccessCapabilities_presenceBitMultislot_descr_.raw);
  if (field_multislotcap.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, AccessCapabilities_multislotcap_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_accessCapAdditionsAfterRel97.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, AccessCapabilities_accessCapAdditionsAfterRel97_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  encoded_length += field_rfPowerCapability.RAW_encode(AccessCapabilities_rfPowerCapability_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_presenceBitA5.RAW_encode(AccessCapabilities_presenceBitA5_descr_, *myleaf.body.node.nodes[1]);
  if (field_a5bits.ispresent()) {
  encoded_length += field_a5bits().RAW_encode(AccessCapabilities_a5bits_descr_, *myleaf.body.node.nodes[2]);
  }
  encoded_length += field_esind.RAW_encode(AccessCapabilities_esind_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_psbit.RAW_encode(AccessCapabilities_psbit_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_vgcs.RAW_encode(AccessCapabilities_vgcs_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_vbs.RAW_encode(AccessCapabilities_vbs_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_presenceBitMultislot.RAW_encode(AccessCapabilities_presenceBitMultislot_descr_, *myleaf.body.node.nodes[7]);
  if (field_multislotcap.ispresent()) {
  encoded_length += field_multislotcap().RAW_encode(AccessCapabilities_multislotcap_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_accessCapAdditionsAfterRel97.ispresent()) {
  encoded_length += field_accessCapAdditionsAfterRel97().RAW_encode(AccessCapabilities_accessCapAdditionsAfterRel97_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_a5bits.ispresent() && (field_presenceBitA5 !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  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_2.RAW_encode(AccessCapabilities_presenceBitA5_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_multislotcap.ispresent() && (field_presenceBitMultislot !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={7};
  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_2.RAW_encode(AccessCapabilities_presenceBitMultislot_descr_,*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 AccessCapabilities_template::single_value_struct {
BITSTRING_template field_rfPowerCapability;
BITSTRING_template field_presenceBitA5;
A5BITS_template field_a5bits;
BITSTRING_template field_esind;
BITSTRING_template field_psbit;
BITSTRING_template field_vgcs;
BITSTRING_template field_vbs;
BITSTRING_template field_presenceBitMultislot;
MultislotCap_template field_multislotcap;
AccessCapAdditionsAfterRel97_template field_accessCapAdditionsAfterRel97;
};

void AccessCapabilities_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_rfPowerCapability = ANY_VALUE;
single_value->field_presenceBitA5 = ANY_VALUE;
single_value->field_a5bits = ANY_OR_OMIT;
single_value->field_esind = ANY_VALUE;
single_value->field_psbit = ANY_VALUE;
single_value->field_vgcs = ANY_VALUE;
single_value->field_vbs = ANY_VALUE;
single_value->field_presenceBitMultislot = ANY_VALUE;
single_value->field_multislotcap = ANY_OR_OMIT;
single_value->field_accessCapAdditionsAfterRel97 = ANY_OR_OMIT;
}
}
}

void AccessCapabilities_template::copy_value(const AccessCapabilities& other_value)
{
single_value = new single_value_struct;
if (other_value.rfPowerCapability().is_bound()) {
  single_value->field_rfPowerCapability = other_value.rfPowerCapability();
} else {
  single_value->field_rfPowerCapability.clean_up();
}
if (other_value.presenceBitA5().is_bound()) {
  single_value->field_presenceBitA5 = other_value.presenceBitA5();
} else {
  single_value->field_presenceBitA5.clean_up();
}
if (other_value.a5bits().is_bound()) {
  if (other_value.a5bits().ispresent()) single_value->field_a5bits = other_value.a5bits()();
  else single_value->field_a5bits = OMIT_VALUE;
} else {
  single_value->field_a5bits.clean_up();
}
if (other_value.esind().is_bound()) {
  single_value->field_esind = other_value.esind();
} else {
  single_value->field_esind.clean_up();
}
if (other_value.psbit().is_bound()) {
  single_value->field_psbit = other_value.psbit();
} else {
  single_value->field_psbit.clean_up();
}
if (other_value.vgcs().is_bound()) {
  single_value->field_vgcs = other_value.vgcs();
} else {
  single_value->field_vgcs.clean_up();
}
if (other_value.vbs().is_bound()) {
  single_value->field_vbs = other_value.vbs();
} else {
  single_value->field_vbs.clean_up();
}
if (other_value.presenceBitMultislot().is_bound()) {
  single_value->field_presenceBitMultislot = other_value.presenceBitMultislot();
} else {
  single_value->field_presenceBitMultislot.clean_up();
}
if (other_value.multislotcap().is_bound()) {
  if (other_value.multislotcap().ispresent()) single_value->field_multislotcap = other_value.multislotcap()();
  else single_value->field_multislotcap = OMIT_VALUE;
} else {
  single_value->field_multislotcap.clean_up();
}
if (other_value.accessCapAdditionsAfterRel97().is_bound()) {
  if (other_value.accessCapAdditionsAfterRel97().ispresent()) single_value->field_accessCapAdditionsAfterRel97 = other_value.accessCapAdditionsAfterRel97()();
  else single_value->field_accessCapAdditionsAfterRel97 = OMIT_VALUE;
} else {
  single_value->field_accessCapAdditionsAfterRel97.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapabilities_template::copy_template(const AccessCapabilities_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rfPowerCapability().get_selection()) {
single_value->field_rfPowerCapability = other_value.rfPowerCapability();
} else {
single_value->field_rfPowerCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitA5().get_selection()) {
single_value->field_presenceBitA5 = other_value.presenceBitA5();
} else {
single_value->field_presenceBitA5.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a5bits().get_selection()) {
single_value->field_a5bits = other_value.a5bits();
} else {
single_value->field_a5bits.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.esind().get_selection()) {
single_value->field_esind = other_value.esind();
} else {
single_value->field_esind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.psbit().get_selection()) {
single_value->field_psbit = other_value.psbit();
} else {
single_value->field_psbit.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vgcs().get_selection()) {
single_value->field_vgcs = other_value.vgcs();
} else {
single_value->field_vgcs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vbs().get_selection()) {
single_value->field_vbs = other_value.vbs();
} else {
single_value->field_vbs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitMultislot().get_selection()) {
single_value->field_presenceBitMultislot = other_value.presenceBitMultislot();
} else {
single_value->field_presenceBitMultislot.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multislotcap().get_selection()) {
single_value->field_multislotcap = other_value.multislotcap();
} else {
single_value->field_multislotcap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel97().get_selection()) {
single_value->field_accessCapAdditionsAfterRel97 = other_value.accessCapAdditionsAfterRel97();
} else {
single_value->field_accessCapAdditionsAfterRel97.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 AccessCapabilities_template[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 AccessCapabilities_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapabilities_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_GMM_SM_Types.AccessCapabilities.");
break;
}
set_selection(other_value);
}

AccessCapabilities_template::AccessCapabilities_template()
{
}

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

AccessCapabilities_template::AccessCapabilities_template(const AccessCapabilities& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapabilities_template::match(const AccessCapabilities& 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.rfPowerCapability().is_bound()) return FALSE;
if(!single_value->field_rfPowerCapability.match(other_value.rfPowerCapability(), legacy))return FALSE;
if(!other_value.presenceBitA5().is_bound()) return FALSE;
if(!single_value->field_presenceBitA5.match(other_value.presenceBitA5(), legacy))return FALSE;
if(!other_value.a5bits().is_bound()) return FALSE;
if((other_value.a5bits().ispresent() ? !single_value->field_a5bits.match((const A5BITS&)other_value.a5bits(), legacy) : !single_value->field_a5bits.match_omit(legacy)))return FALSE;
if(!other_value.esind().is_bound()) return FALSE;
if(!single_value->field_esind.match(other_value.esind(), legacy))return FALSE;
if(!other_value.psbit().is_bound()) return FALSE;
if(!single_value->field_psbit.match(other_value.psbit(), legacy))return FALSE;
if(!other_value.vgcs().is_bound()) return FALSE;
if(!single_value->field_vgcs.match(other_value.vgcs(), legacy))return FALSE;
if(!other_value.vbs().is_bound()) return FALSE;
if(!single_value->field_vbs.match(other_value.vbs(), legacy))return FALSE;
if(!other_value.presenceBitMultislot().is_bound()) return FALSE;
if(!single_value->field_presenceBitMultislot.match(other_value.presenceBitMultislot(), legacy))return FALSE;
if(!other_value.multislotcap().is_bound()) return FALSE;
if((other_value.multislotcap().ispresent() ? !single_value->field_multislotcap.match((const MultislotCap&)other_value.multislotcap(), legacy) : !single_value->field_multislotcap.match_omit(legacy)))return FALSE;
if(!other_value.accessCapAdditionsAfterRel97().is_bound()) return FALSE;
if((other_value.accessCapAdditionsAfterRel97().ispresent() ? !single_value->field_accessCapAdditionsAfterRel97.match((const AccessCapAdditionsAfterRel97&)other_value.accessCapAdditionsAfterRel97(), legacy) : !single_value->field_accessCapAdditionsAfterRel97.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_GMM_SM_Types.AccessCapabilities.");
}
return FALSE;
}

boolean AccessCapabilities_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rfPowerCapability.is_bound()
 || single_value->field_presenceBitA5.is_bound()
 || (single_value->field_a5bits.is_omit() || single_value->field_a5bits.is_bound())
 || single_value->field_esind.is_bound()
 || single_value->field_psbit.is_bound()
 || single_value->field_vgcs.is_bound()
 || single_value->field_vbs.is_bound()
 || single_value->field_presenceBitMultislot.is_bound()
 || (single_value->field_multislotcap.is_omit() || single_value->field_multislotcap.is_bound())
 || (single_value->field_accessCapAdditionsAfterRel97.is_omit() || single_value->field_accessCapAdditionsAfterRel97.is_bound());
}

boolean AccessCapabilities_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rfPowerCapability.is_value()
 && single_value->field_presenceBitA5.is_value()
 && (single_value->field_a5bits.is_omit() || single_value->field_a5bits.is_value())
 && single_value->field_esind.is_value()
 && single_value->field_psbit.is_value()
 && single_value->field_vgcs.is_value()
 && single_value->field_vbs.is_value()
 && single_value->field_presenceBitMultislot.is_value()
 && (single_value->field_multislotcap.is_omit() || single_value->field_multislotcap.is_value())
 && (single_value->field_accessCapAdditionsAfterRel97.is_omit() || single_value->field_accessCapAdditionsAfterRel97.is_value());
}

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

AccessCapabilities AccessCapabilities_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_GMM_SM_Types.AccessCapabilities.");
AccessCapabilities ret_val;
if (single_value->field_rfPowerCapability.is_bound()) {
ret_val.rfPowerCapability() = single_value->field_rfPowerCapability.valueof();
}
if (single_value->field_presenceBitA5.is_bound()) {
ret_val.presenceBitA5() = single_value->field_presenceBitA5.valueof();
}
if (single_value->field_a5bits.is_omit()) ret_val.a5bits() = OMIT_VALUE;
else if (single_value->field_a5bits.is_bound()) {
ret_val.a5bits() = single_value->field_a5bits.valueof();
}
if (single_value->field_esind.is_bound()) {
ret_val.esind() = single_value->field_esind.valueof();
}
if (single_value->field_psbit.is_bound()) {
ret_val.psbit() = single_value->field_psbit.valueof();
}
if (single_value->field_vgcs.is_bound()) {
ret_val.vgcs() = single_value->field_vgcs.valueof();
}
if (single_value->field_vbs.is_bound()) {
ret_val.vbs() = single_value->field_vbs.valueof();
}
if (single_value->field_presenceBitMultislot.is_bound()) {
ret_val.presenceBitMultislot() = single_value->field_presenceBitMultislot.valueof();
}
if (single_value->field_multislotcap.is_omit()) ret_val.multislotcap() = OMIT_VALUE;
else if (single_value->field_multislotcap.is_bound()) {
ret_val.multislotcap() = single_value->field_multislotcap.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel97.is_omit()) ret_val.accessCapAdditionsAfterRel97() = OMIT_VALUE;
else if (single_value->field_accessCapAdditionsAfterRel97.is_bound()) {
ret_val.accessCapAdditionsAfterRel97() = single_value->field_accessCapAdditionsAfterRel97.valueof();
}
return ret_val;
}

void AccessCapabilities_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_GMM_SM_Types.AccessCapabilities.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapabilities_template[list_length];
}

AccessCapabilities_template& AccessCapabilities_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_GMM_SM_Types.AccessCapabilities.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapabilities_template::rfPowerCapability()
{
set_specific();
return single_value->field_rfPowerCapability;
}

const BITSTRING_template& AccessCapabilities_template::rfPowerCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rfPowerCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_rfPowerCapability;
}

BITSTRING_template& AccessCapabilities_template::presenceBitA5()
{
set_specific();
return single_value->field_presenceBitA5;
}

const BITSTRING_template& AccessCapabilities_template::presenceBitA5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitA5 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_presenceBitA5;
}

A5BITS_template& AccessCapabilities_template::a5bits()
{
set_specific();
return single_value->field_a5bits;
}

const A5BITS_template& AccessCapabilities_template::a5bits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a5bits of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_a5bits;
}

BITSTRING_template& AccessCapabilities_template::esind()
{
set_specific();
return single_value->field_esind;
}

const BITSTRING_template& AccessCapabilities_template::esind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field esind of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_esind;
}

BITSTRING_template& AccessCapabilities_template::psbit()
{
set_specific();
return single_value->field_psbit;
}

const BITSTRING_template& AccessCapabilities_template::psbit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field psbit of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_psbit;
}

BITSTRING_template& AccessCapabilities_template::vgcs()
{
set_specific();
return single_value->field_vgcs;
}

const BITSTRING_template& AccessCapabilities_template::vgcs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vgcs of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_vgcs;
}

BITSTRING_template& AccessCapabilities_template::vbs()
{
set_specific();
return single_value->field_vbs;
}

const BITSTRING_template& AccessCapabilities_template::vbs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vbs of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_vbs;
}

BITSTRING_template& AccessCapabilities_template::presenceBitMultislot()
{
set_specific();
return single_value->field_presenceBitMultislot;
}

const BITSTRING_template& AccessCapabilities_template::presenceBitMultislot() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitMultislot of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_presenceBitMultislot;
}

MultislotCap_template& AccessCapabilities_template::multislotcap()
{
set_specific();
return single_value->field_multislotcap;
}

const MultislotCap_template& AccessCapabilities_template::multislotcap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotcap of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_multislotcap;
}

AccessCapAdditionsAfterRel97_template& AccessCapabilities_template::accessCapAdditionsAfterRel97()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel97;
}

const AccessCapAdditionsAfterRel97_template& AccessCapabilities_template::accessCapAdditionsAfterRel97() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel97 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapabilities.");
return single_value->field_accessCapAdditionsAfterRel97;
}

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

void AccessCapabilities_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rfPowerCapability := ");
single_value->field_rfPowerCapability.log();
TTCN_Logger::log_event_str(", presenceBitA5 := ");
single_value->field_presenceBitA5.log();
TTCN_Logger::log_event_str(", a5bits := ");
single_value->field_a5bits.log();
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log();
TTCN_Logger::log_event_str(", psbit := ");
single_value->field_psbit.log();
TTCN_Logger::log_event_str(", vgcs := ");
single_value->field_vgcs.log();
TTCN_Logger::log_event_str(", vbs := ");
single_value->field_vbs.log();
TTCN_Logger::log_event_str(", presenceBitMultislot := ");
single_value->field_presenceBitMultislot.log();
TTCN_Logger::log_event_str(", multislotcap := ");
single_value->field_multislotcap.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel97 := ");
single_value->field_accessCapAdditionsAfterRel97.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 AccessCapabilities_template::log_match(const AccessCapabilities& 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_rfPowerCapability.match(match_value.rfPowerCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".rfPowerCapability");
single_value->field_rfPowerCapability.log_match(match_value.rfPowerCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitA5.match(match_value.presenceBitA5(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitA5");
single_value->field_presenceBitA5.log_match(match_value.presenceBitA5(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.a5bits().ispresent()){
if(!single_value->field_a5bits.match(match_value.a5bits(), legacy)){
TTCN_Logger::log_logmatch_info(".a5bits");
single_value->field_a5bits.log_match(match_value.a5bits(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_a5bits.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".a5bits := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_a5bits.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_esind.match(match_value.esind(), legacy)){
TTCN_Logger::log_logmatch_info(".esind");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_psbit.match(match_value.psbit(), legacy)){
TTCN_Logger::log_logmatch_info(".psbit");
single_value->field_psbit.log_match(match_value.psbit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_vgcs.match(match_value.vgcs(), legacy)){
TTCN_Logger::log_logmatch_info(".vgcs");
single_value->field_vgcs.log_match(match_value.vgcs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_vbs.match(match_value.vbs(), legacy)){
TTCN_Logger::log_logmatch_info(".vbs");
single_value->field_vbs.log_match(match_value.vbs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitMultislot.match(match_value.presenceBitMultislot(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitMultislot");
single_value->field_presenceBitMultislot.log_match(match_value.presenceBitMultislot(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.multislotcap().ispresent()){
if(!single_value->field_multislotcap.match(match_value.multislotcap(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotcap");
single_value->field_multislotcap.log_match(match_value.multislotcap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_multislotcap.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".multislotcap := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_multislotcap.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.accessCapAdditionsAfterRel97().ispresent()){
if(!single_value->field_accessCapAdditionsAfterRel97.match(match_value.accessCapAdditionsAfterRel97(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel97");
single_value->field_accessCapAdditionsAfterRel97.log_match(match_value.accessCapAdditionsAfterRel97(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_accessCapAdditionsAfterRel97.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel97 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_accessCapAdditionsAfterRel97.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("{ rfPowerCapability := ");
single_value->field_rfPowerCapability.log_match(match_value.rfPowerCapability(), legacy);
TTCN_Logger::log_event_str(", presenceBitA5 := ");
single_value->field_presenceBitA5.log_match(match_value.presenceBitA5(), legacy);
TTCN_Logger::log_event_str(", a5bits := ");
if (match_value.a5bits().ispresent()) {
single_value->field_a5bits.log_match(match_value.a5bits(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_a5bits.log();
if (single_value->field_a5bits.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", esind := ");
single_value->field_esind.log_match(match_value.esind(), legacy);
TTCN_Logger::log_event_str(", psbit := ");
single_value->field_psbit.log_match(match_value.psbit(), legacy);
TTCN_Logger::log_event_str(", vgcs := ");
single_value->field_vgcs.log_match(match_value.vgcs(), legacy);
TTCN_Logger::log_event_str(", vbs := ");
single_value->field_vbs.log_match(match_value.vbs(), legacy);
TTCN_Logger::log_event_str(", presenceBitMultislot := ");
single_value->field_presenceBitMultislot.log_match(match_value.presenceBitMultislot(), legacy);
TTCN_Logger::log_event_str(", multislotcap := ");
if (match_value.multislotcap().ispresent()) {
single_value->field_multislotcap.log_match(match_value.multislotcap(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_multislotcap.log();
if (single_value->field_multislotcap.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel97 := ");
if (match_value.accessCapAdditionsAfterRel97().ispresent()) {
single_value->field_accessCapAdditionsAfterRel97.log_match(match_value.accessCapAdditionsAfterRel97(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_accessCapAdditionsAfterRel97.log();
if (single_value->field_accessCapAdditionsAfterRel97.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 AccessCapabilities_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rfPowerCapability().is_bound()) rfPowerCapability().set_implicit_omit();
if (presenceBitA5().is_bound()) presenceBitA5().set_implicit_omit();
if (!a5bits().is_bound()) a5bits() = OMIT_VALUE;
else a5bits().set_implicit_omit();
if (esind().is_bound()) esind().set_implicit_omit();
if (psbit().is_bound()) psbit().set_implicit_omit();
if (vgcs().is_bound()) vgcs().set_implicit_omit();
if (vbs().is_bound()) vbs().set_implicit_omit();
if (presenceBitMultislot().is_bound()) presenceBitMultislot().set_implicit_omit();
if (!multislotcap().is_bound()) multislotcap() = OMIT_VALUE;
else multislotcap().set_implicit_omit();
if (!accessCapAdditionsAfterRel97().is_bound()) accessCapAdditionsAfterRel97() = OMIT_VALUE;
else accessCapAdditionsAfterRel97().set_implicit_omit();
}

void AccessCapabilities_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rfPowerCapability.encode_text(text_buf);
single_value->field_presenceBitA5.encode_text(text_buf);
single_value->field_a5bits.encode_text(text_buf);
single_value->field_esind.encode_text(text_buf);
single_value->field_psbit.encode_text(text_buf);
single_value->field_vgcs.encode_text(text_buf);
single_value->field_vbs.encode_text(text_buf);
single_value->field_presenceBitMultislot.encode_text(text_buf);
single_value->field_multislotcap.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel97.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_GMM_SM_Types.AccessCapabilities.");
}
}

void AccessCapabilities_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_rfPowerCapability.decode_text(text_buf);
single_value->field_presenceBitA5.decode_text(text_buf);
single_value->field_a5bits.decode_text(text_buf);
single_value->field_esind.decode_text(text_buf);
single_value->field_psbit.decode_text(text_buf);
single_value->field_vgcs.decode_text(text_buf);
single_value->field_vbs.decode_text(text_buf);
single_value->field_presenceBitMultislot.decode_text(text_buf);
single_value->field_multislotcap.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel97.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 AccessCapabilities_template[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_GMM_SM_Types.AccessCapabilities.");
}
}

void AccessCapabilities_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: {
    AccessCapabilities_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_GMM_SM_Types.AccessCapabilities 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) rfPowerCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitA5().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a5bits().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) psbit().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) vgcs().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) vbs().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) presenceBitMultislot().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) multislotcap().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel97().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(), "rfPowerCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rfPowerCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitA5")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitA5().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a5bits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a5bits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "esind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          esind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "psbit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          psbit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vgcs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vbs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vbs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitMultislot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitMultislot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotcap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotcap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "accessCapAdditionsAfterRel97")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          accessCapAdditionsAfterRel97().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapabilities: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapabilities_template* precondition = new AccessCapabilities_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapabilities_template* implied_template = new AccessCapabilities_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapabilities_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapabilities");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapabilities_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_rfPowerCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
single_value->field_presenceBitA5.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
single_value->field_a5bits.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
single_value->field_esind.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
single_value->field_psbit.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
single_value->field_vgcs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
single_value->field_vbs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
single_value->field_presenceBitMultislot.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
single_value->field_multislotcap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
single_value->field_accessCapAdditionsAfterRel97.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapabilities");
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_GMM_SM_Types.AccessCapabilities");
}

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

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

A5BITS::A5BITS()
{
}

A5BITS::A5BITS(const BITSTRING& par_a51,
    const BITSTRING& par_a52,
    const BITSTRING& par_a53,
    const BITSTRING& par_a54,
    const BITSTRING& par_a55,
    const BITSTRING& par_a56,
    const BITSTRING& par_a57)
  :   field_a51(par_a51),
  field_a52(par_a52),
  field_a53(par_a53),
  field_a54(par_a54),
  field_a55(par_a55),
  field_a56(par_a56),
  field_a57(par_a57)
{
}

A5BITS::A5BITS(const A5BITS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.A5BITS.");
if (other_value.a51().is_bound()) field_a51 = other_value.a51();
else field_a51.clean_up();
if (other_value.a52().is_bound()) field_a52 = other_value.a52();
else field_a52.clean_up();
if (other_value.a53().is_bound()) field_a53 = other_value.a53();
else field_a53.clean_up();
if (other_value.a54().is_bound()) field_a54 = other_value.a54();
else field_a54.clean_up();
if (other_value.a55().is_bound()) field_a55 = other_value.a55();
else field_a55.clean_up();
if (other_value.a56().is_bound()) field_a56 = other_value.a56();
else field_a56.clean_up();
if (other_value.a57().is_bound()) field_a57 = other_value.a57();
else field_a57.clean_up();
}

void A5BITS::clean_up()
{
field_a51.clean_up();
field_a52.clean_up();
field_a53.clean_up();
field_a54.clean_up();
field_a55.clean_up();
field_a56.clean_up();
field_a57.clean_up();
}

const TTCN_Typedescriptor_t* A5BITS::get_descriptor() const { return &A5BITS_descr_; }
A5BITS& A5BITS::operator=(const A5BITS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.A5BITS.");
  if (other_value.a51().is_bound()) field_a51 = other_value.a51();
  else field_a51.clean_up();
  if (other_value.a52().is_bound()) field_a52 = other_value.a52();
  else field_a52.clean_up();
  if (other_value.a53().is_bound()) field_a53 = other_value.a53();
  else field_a53.clean_up();
  if (other_value.a54().is_bound()) field_a54 = other_value.a54();
  else field_a54.clean_up();
  if (other_value.a55().is_bound()) field_a55 = other_value.a55();
  else field_a55.clean_up();
  if (other_value.a56().is_bound()) field_a56 = other_value.a56();
  else field_a56.clean_up();
  if (other_value.a57().is_bound()) field_a57 = other_value.a57();
  else field_a57.clean_up();
}
return *this;
}

boolean A5BITS::operator==(const A5BITS& other_value) const
{
return field_a51==other_value.field_a51
  && field_a52==other_value.field_a52
  && field_a53==other_value.field_a53
  && field_a54==other_value.field_a54
  && field_a55==other_value.field_a55
  && field_a56==other_value.field_a56
  && field_a57==other_value.field_a57;
}

boolean A5BITS::is_bound() const
{
return (field_a51.is_bound())
  || (field_a52.is_bound())
  || (field_a53.is_bound())
  || (field_a54.is_bound())
  || (field_a55.is_bound())
  || (field_a56.is_bound())
  || (field_a57.is_bound());
}
boolean A5BITS::is_value() const
{
return field_a51.is_value()
  && field_a52.is_value()
  && field_a53.is_value()
  && field_a54.is_value()
  && field_a55.is_value()
  && field_a56.is_value()
  && field_a57.is_value();
}
void A5BITS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ a51 := ");
field_a51.log();
TTCN_Logger::log_event_str(", a52 := ");
field_a52.log();
TTCN_Logger::log_event_str(", a53 := ");
field_a53.log();
TTCN_Logger::log_event_str(", a54 := ");
field_a54.log();
TTCN_Logger::log_event_str(", a55 := ");
field_a55.log();
TTCN_Logger::log_event_str(", a56 := ");
field_a56.log();
TTCN_Logger::log_event_str(", a57 := ");
field_a57.log();
TTCN_Logger::log_event_str(" }");
}

void A5BITS::set_implicit_omit()
{
if (a51().is_bound()) a51().set_implicit_omit();
if (a52().is_bound()) a52().set_implicit_omit();
if (a53().is_bound()) a53().set_implicit_omit();
if (a54().is_bound()) a54().set_implicit_omit();
if (a55().is_bound()) a55().set_implicit_omit();
if (a56().is_bound()) a56().set_implicit_omit();
if (a57().is_bound()) a57().set_implicit_omit();
}

void A5BITS::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_GMM_SM_Types.A5BITS 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) a51().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) a52().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a53().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) a54().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) a55().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) a56().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) a57().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(), "a51")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a51().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a52")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a52().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a53")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a53().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a54")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a54().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a55")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a55().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a56")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a56().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a57")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a57().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.A5BITS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.A5BITS");
  }
}

void A5BITS::encode_text(Text_Buf& text_buf) const
{
field_a51.encode_text(text_buf);
field_a52.encode_text(text_buf);
field_a53.encode_text(text_buf);
field_a54.encode_text(text_buf);
field_a55.encode_text(text_buf);
field_a56.encode_text(text_buf);
field_a57.encode_text(text_buf);
}

void A5BITS::decode_text(Text_Buf& text_buf)
{
field_a51.decode_text(text_buf);
field_a52.decode_text(text_buf);
field_a53.decode_text(text_buf);
field_a54.decode_text(text_buf);
field_a55.decode_text(text_buf);
field_a56.decode_text(text_buf);
field_a57.decode_text(text_buf);
}

void A5BITS::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 A5BITS::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 A5BITS::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, A5BITS_a51_descr_.raw->forceomit);
  decoded_field_length = field_a51.RAW_decode(A5BITS_a51_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, A5BITS_a52_descr_.raw->forceomit);
  decoded_field_length = field_a52.RAW_decode(A5BITS_a52_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, A5BITS_a53_descr_.raw->forceomit);
  decoded_field_length = field_a53.RAW_decode(A5BITS_a53_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, A5BITS_a54_descr_.raw->forceomit);
  decoded_field_length = field_a54.RAW_decode(A5BITS_a54_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, A5BITS_a55_descr_.raw->forceomit);
  decoded_field_length = field_a55.RAW_decode(A5BITS_a55_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, A5BITS_a56_descr_.raw->forceomit);
  decoded_field_length = field_a56.RAW_decode(A5BITS_a56_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, A5BITS_a57_descr_.raw->forceomit);
  decoded_field_length = field_a57.RAW_decode(A5BITS_a57_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int A5BITS::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, A5BITS_a51_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, A5BITS_a52_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, A5BITS_a53_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, A5BITS_a54_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, A5BITS_a55_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, A5BITS_a56_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, A5BITS_a57_descr_.raw);
  encoded_length += field_a51.RAW_encode(A5BITS_a51_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_a52.RAW_encode(A5BITS_a52_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_a53.RAW_encode(A5BITS_a53_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_a54.RAW_encode(A5BITS_a54_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_a55.RAW_encode(A5BITS_a55_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_a56.RAW_encode(A5BITS_a56_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_a57.RAW_encode(A5BITS_a57_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct A5BITS_template::single_value_struct {
BITSTRING_template field_a51;
BITSTRING_template field_a52;
BITSTRING_template field_a53;
BITSTRING_template field_a54;
BITSTRING_template field_a55;
BITSTRING_template field_a56;
BITSTRING_template field_a57;
};

void A5BITS_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_a51 = ANY_VALUE;
single_value->field_a52 = ANY_VALUE;
single_value->field_a53 = ANY_VALUE;
single_value->field_a54 = ANY_VALUE;
single_value->field_a55 = ANY_VALUE;
single_value->field_a56 = ANY_VALUE;
single_value->field_a57 = ANY_VALUE;
}
}
}

void A5BITS_template::copy_value(const A5BITS& other_value)
{
single_value = new single_value_struct;
if (other_value.a51().is_bound()) {
  single_value->field_a51 = other_value.a51();
} else {
  single_value->field_a51.clean_up();
}
if (other_value.a52().is_bound()) {
  single_value->field_a52 = other_value.a52();
} else {
  single_value->field_a52.clean_up();
}
if (other_value.a53().is_bound()) {
  single_value->field_a53 = other_value.a53();
} else {
  single_value->field_a53.clean_up();
}
if (other_value.a54().is_bound()) {
  single_value->field_a54 = other_value.a54();
} else {
  single_value->field_a54.clean_up();
}
if (other_value.a55().is_bound()) {
  single_value->field_a55 = other_value.a55();
} else {
  single_value->field_a55.clean_up();
}
if (other_value.a56().is_bound()) {
  single_value->field_a56 = other_value.a56();
} else {
  single_value->field_a56.clean_up();
}
if (other_value.a57().is_bound()) {
  single_value->field_a57 = other_value.a57();
} else {
  single_value->field_a57.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void A5BITS_template::copy_template(const A5BITS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.a51().get_selection()) {
single_value->field_a51 = other_value.a51();
} else {
single_value->field_a51.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a52().get_selection()) {
single_value->field_a52 = other_value.a52();
} else {
single_value->field_a52.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a53().get_selection()) {
single_value->field_a53 = other_value.a53();
} else {
single_value->field_a53.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a54().get_selection()) {
single_value->field_a54 = other_value.a54();
} else {
single_value->field_a54.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a55().get_selection()) {
single_value->field_a55 = other_value.a55();
} else {
single_value->field_a55.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a56().get_selection()) {
single_value->field_a56 = other_value.a56();
} else {
single_value->field_a56.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a57().get_selection()) {
single_value->field_a57 = other_value.a57();
} else {
single_value->field_a57.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 A5BITS_template[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 A5BITS_template(*other_value.implication_.precondition);
implication_.implied_template = new A5BITS_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_GMM_SM_Types.A5BITS.");
break;
}
set_selection(other_value);
}

A5BITS_template::A5BITS_template()
{
}

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

A5BITS_template::A5BITS_template(const A5BITS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean A5BITS_template::match(const A5BITS& 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.a51().is_bound()) return FALSE;
if(!single_value->field_a51.match(other_value.a51(), legacy))return FALSE;
if(!other_value.a52().is_bound()) return FALSE;
if(!single_value->field_a52.match(other_value.a52(), legacy))return FALSE;
if(!other_value.a53().is_bound()) return FALSE;
if(!single_value->field_a53.match(other_value.a53(), legacy))return FALSE;
if(!other_value.a54().is_bound()) return FALSE;
if(!single_value->field_a54.match(other_value.a54(), legacy))return FALSE;
if(!other_value.a55().is_bound()) return FALSE;
if(!single_value->field_a55.match(other_value.a55(), legacy))return FALSE;
if(!other_value.a56().is_bound()) return FALSE;
if(!single_value->field_a56.match(other_value.a56(), legacy))return FALSE;
if(!other_value.a57().is_bound()) return FALSE;
if(!single_value->field_a57.match(other_value.a57(), 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_GMM_SM_Types.A5BITS.");
}
return FALSE;
}

boolean A5BITS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_a51.is_bound()
 || single_value->field_a52.is_bound()
 || single_value->field_a53.is_bound()
 || single_value->field_a54.is_bound()
 || single_value->field_a55.is_bound()
 || single_value->field_a56.is_bound()
 || single_value->field_a57.is_bound();
}

boolean A5BITS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_a51.is_value()
 && single_value->field_a52.is_value()
 && single_value->field_a53.is_value()
 && single_value->field_a54.is_value()
 && single_value->field_a55.is_value()
 && single_value->field_a56.is_value()
 && single_value->field_a57.is_value();
}

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

A5BITS A5BITS_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_GMM_SM_Types.A5BITS.");
A5BITS ret_val;
if (single_value->field_a51.is_bound()) {
ret_val.a51() = single_value->field_a51.valueof();
}
if (single_value->field_a52.is_bound()) {
ret_val.a52() = single_value->field_a52.valueof();
}
if (single_value->field_a53.is_bound()) {
ret_val.a53() = single_value->field_a53.valueof();
}
if (single_value->field_a54.is_bound()) {
ret_val.a54() = single_value->field_a54.valueof();
}
if (single_value->field_a55.is_bound()) {
ret_val.a55() = single_value->field_a55.valueof();
}
if (single_value->field_a56.is_bound()) {
ret_val.a56() = single_value->field_a56.valueof();
}
if (single_value->field_a57.is_bound()) {
ret_val.a57() = single_value->field_a57.valueof();
}
return ret_val;
}

void A5BITS_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_GMM_SM_Types.A5BITS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new A5BITS_template[list_length];
}

A5BITS_template& A5BITS_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_GMM_SM_Types.A5BITS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.A5BITS.");
return value_list.list_value[list_index];
}

BITSTRING_template& A5BITS_template::a51()
{
set_specific();
return single_value->field_a51;
}

const BITSTRING_template& A5BITS_template::a51() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a51 of a non-specific template of type @MobileL3_GMM_SM_Types.A5BITS.");
return single_value->field_a51;
}

BITSTRING_template& A5BITS_template::a52()
{
set_specific();
return single_value->field_a52;
}

const BITSTRING_template& A5BITS_template::a52() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a52 of a non-specific template of type @MobileL3_GMM_SM_Types.A5BITS.");
return single_value->field_a52;
}

BITSTRING_template& A5BITS_template::a53()
{
set_specific();
return single_value->field_a53;
}

const BITSTRING_template& A5BITS_template::a53() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a53 of a non-specific template of type @MobileL3_GMM_SM_Types.A5BITS.");
return single_value->field_a53;
}

BITSTRING_template& A5BITS_template::a54()
{
set_specific();
return single_value->field_a54;
}

const BITSTRING_template& A5BITS_template::a54() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a54 of a non-specific template of type @MobileL3_GMM_SM_Types.A5BITS.");
return single_value->field_a54;
}

BITSTRING_template& A5BITS_template::a55()
{
set_specific();
return single_value->field_a55;
}

const BITSTRING_template& A5BITS_template::a55() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a55 of a non-specific template of type @MobileL3_GMM_SM_Types.A5BITS.");
return single_value->field_a55;
}

BITSTRING_template& A5BITS_template::a56()
{
set_specific();
return single_value->field_a56;
}

const BITSTRING_template& A5BITS_template::a56() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a56 of a non-specific template of type @MobileL3_GMM_SM_Types.A5BITS.");
return single_value->field_a56;
}

BITSTRING_template& A5BITS_template::a57()
{
set_specific();
return single_value->field_a57;
}

const BITSTRING_template& A5BITS_template::a57() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a57 of a non-specific template of type @MobileL3_GMM_SM_Types.A5BITS.");
return single_value->field_a57;
}

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

void A5BITS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ a51 := ");
single_value->field_a51.log();
TTCN_Logger::log_event_str(", a52 := ");
single_value->field_a52.log();
TTCN_Logger::log_event_str(", a53 := ");
single_value->field_a53.log();
TTCN_Logger::log_event_str(", a54 := ");
single_value->field_a54.log();
TTCN_Logger::log_event_str(", a55 := ");
single_value->field_a55.log();
TTCN_Logger::log_event_str(", a56 := ");
single_value->field_a56.log();
TTCN_Logger::log_event_str(", a57 := ");
single_value->field_a57.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 A5BITS_template::log_match(const A5BITS& 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_a51.match(match_value.a51(), legacy)){
TTCN_Logger::log_logmatch_info(".a51");
single_value->field_a51.log_match(match_value.a51(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a52.match(match_value.a52(), legacy)){
TTCN_Logger::log_logmatch_info(".a52");
single_value->field_a52.log_match(match_value.a52(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a53.match(match_value.a53(), legacy)){
TTCN_Logger::log_logmatch_info(".a53");
single_value->field_a53.log_match(match_value.a53(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a54.match(match_value.a54(), legacy)){
TTCN_Logger::log_logmatch_info(".a54");
single_value->field_a54.log_match(match_value.a54(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a55.match(match_value.a55(), legacy)){
TTCN_Logger::log_logmatch_info(".a55");
single_value->field_a55.log_match(match_value.a55(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a56.match(match_value.a56(), legacy)){
TTCN_Logger::log_logmatch_info(".a56");
single_value->field_a56.log_match(match_value.a56(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a57.match(match_value.a57(), legacy)){
TTCN_Logger::log_logmatch_info(".a57");
single_value->field_a57.log_match(match_value.a57(), 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("{ a51 := ");
single_value->field_a51.log_match(match_value.a51(), legacy);
TTCN_Logger::log_event_str(", a52 := ");
single_value->field_a52.log_match(match_value.a52(), legacy);
TTCN_Logger::log_event_str(", a53 := ");
single_value->field_a53.log_match(match_value.a53(), legacy);
TTCN_Logger::log_event_str(", a54 := ");
single_value->field_a54.log_match(match_value.a54(), legacy);
TTCN_Logger::log_event_str(", a55 := ");
single_value->field_a55.log_match(match_value.a55(), legacy);
TTCN_Logger::log_event_str(", a56 := ");
single_value->field_a56.log_match(match_value.a56(), legacy);
TTCN_Logger::log_event_str(", a57 := ");
single_value->field_a57.log_match(match_value.a57(), 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 A5BITS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (a51().is_bound()) a51().set_implicit_omit();
if (a52().is_bound()) a52().set_implicit_omit();
if (a53().is_bound()) a53().set_implicit_omit();
if (a54().is_bound()) a54().set_implicit_omit();
if (a55().is_bound()) a55().set_implicit_omit();
if (a56().is_bound()) a56().set_implicit_omit();
if (a57().is_bound()) a57().set_implicit_omit();
}

void A5BITS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_a51.encode_text(text_buf);
single_value->field_a52.encode_text(text_buf);
single_value->field_a53.encode_text(text_buf);
single_value->field_a54.encode_text(text_buf);
single_value->field_a55.encode_text(text_buf);
single_value->field_a56.encode_text(text_buf);
single_value->field_a57.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_GMM_SM_Types.A5BITS.");
}
}

void A5BITS_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_a51.decode_text(text_buf);
single_value->field_a52.decode_text(text_buf);
single_value->field_a53.decode_text(text_buf);
single_value->field_a54.decode_text(text_buf);
single_value->field_a55.decode_text(text_buf);
single_value->field_a56.decode_text(text_buf);
single_value->field_a57.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 A5BITS_template[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_GMM_SM_Types.A5BITS.");
}
}

void A5BITS_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: {
    A5BITS_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_GMM_SM_Types.A5BITS 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) a51().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) a52().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a53().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) a54().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) a55().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) a56().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) a57().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(), "a51")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a51().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a52")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a52().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a53")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a53().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a54")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a54().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a55")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a55().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a56")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a56().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "a57")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          a57().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.A5BITS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    A5BITS_template* precondition = new A5BITS_template;
    precondition->set_param(*param.get_elem(0));
    A5BITS_template* implied_template = new A5BITS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = A5BITS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.A5BITS");
  }
  is_ifpresent = param.get_ifpresent();
}

void A5BITS_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_a51.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.A5BITS");
single_value->field_a52.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.A5BITS");
single_value->field_a53.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.A5BITS");
single_value->field_a54.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.A5BITS");
single_value->field_a55.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.A5BITS");
single_value->field_a56.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.A5BITS");
single_value->field_a57.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.A5BITS");
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_GMM_SM_Types.A5BITS");
}

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

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

MultislotCap::MultislotCap()
{
}

MultislotCap::MultislotCap(const BITSTRING& par_presenceBitHscsd,
    const OPTIONAL< BITSTRING >& par_hscsdmultislotclass,
    const BITSTRING& par_presenceBitGprs,
    const OPTIONAL< MultislotCap__GPRS >& par_gprsmultislot,
    const BITSTRING& par_presenceBitSms,
    const OPTIONAL< MultislotCap__SMS >& par_multislotCap__SMS,
    const OPTIONAL< MultislotCapAdditionsAfterRel97 >& par_multislotCapAdditionsAfterRel97)
  :   field_presenceBitHscsd(par_presenceBitHscsd),
  field_hscsdmultislotclass(par_hscsdmultislotclass),
  field_presenceBitGprs(par_presenceBitGprs),
  field_gprsmultislot(par_gprsmultislot),
  field_presenceBitSms(par_presenceBitSms),
  field_multislotCap__SMS(par_multislotCap__SMS),
  field_multislotCapAdditionsAfterRel97(par_multislotCapAdditionsAfterRel97)
{
}

MultislotCap::MultislotCap(const MultislotCap& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap.");
if (other_value.presenceBitHscsd().is_bound()) field_presenceBitHscsd = other_value.presenceBitHscsd();
else field_presenceBitHscsd.clean_up();
if (other_value.hscsdmultislotclass().is_bound()) field_hscsdmultislotclass = other_value.hscsdmultislotclass();
else field_hscsdmultislotclass.clean_up();
if (other_value.presenceBitGprs().is_bound()) field_presenceBitGprs = other_value.presenceBitGprs();
else field_presenceBitGprs.clean_up();
if (other_value.gprsmultislot().is_bound()) field_gprsmultislot = other_value.gprsmultislot();
else field_gprsmultislot.clean_up();
if (other_value.presenceBitSms().is_bound()) field_presenceBitSms = other_value.presenceBitSms();
else field_presenceBitSms.clean_up();
if (other_value.multislotCap__SMS().is_bound()) field_multislotCap__SMS = other_value.multislotCap__SMS();
else field_multislotCap__SMS.clean_up();
if (other_value.multislotCapAdditionsAfterRel97().is_bound()) field_multislotCapAdditionsAfterRel97 = other_value.multislotCapAdditionsAfterRel97();
else field_multislotCapAdditionsAfterRel97.clean_up();
}

void MultislotCap::clean_up()
{
field_presenceBitHscsd.clean_up();
field_hscsdmultislotclass.clean_up();
field_presenceBitGprs.clean_up();
field_gprsmultislot.clean_up();
field_presenceBitSms.clean_up();
field_multislotCap__SMS.clean_up();
field_multislotCapAdditionsAfterRel97.clean_up();
}

const TTCN_Typedescriptor_t* MultislotCap::get_descriptor() const { return &MultislotCap_descr_; }
MultislotCap& MultislotCap::operator=(const MultislotCap& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap.");
  if (other_value.presenceBitHscsd().is_bound()) field_presenceBitHscsd = other_value.presenceBitHscsd();
  else field_presenceBitHscsd.clean_up();
  if (other_value.hscsdmultislotclass().is_bound()) field_hscsdmultislotclass = other_value.hscsdmultislotclass();
  else field_hscsdmultislotclass.clean_up();
  if (other_value.presenceBitGprs().is_bound()) field_presenceBitGprs = other_value.presenceBitGprs();
  else field_presenceBitGprs.clean_up();
  if (other_value.gprsmultislot().is_bound()) field_gprsmultislot = other_value.gprsmultislot();
  else field_gprsmultislot.clean_up();
  if (other_value.presenceBitSms().is_bound()) field_presenceBitSms = other_value.presenceBitSms();
  else field_presenceBitSms.clean_up();
  if (other_value.multislotCap__SMS().is_bound()) field_multislotCap__SMS = other_value.multislotCap__SMS();
  else field_multislotCap__SMS.clean_up();
  if (other_value.multislotCapAdditionsAfterRel97().is_bound()) field_multislotCapAdditionsAfterRel97 = other_value.multislotCapAdditionsAfterRel97();
  else field_multislotCapAdditionsAfterRel97.clean_up();
}
return *this;
}

boolean MultislotCap::operator==(const MultislotCap& other_value) const
{
return field_presenceBitHscsd==other_value.field_presenceBitHscsd
  && field_hscsdmultislotclass==other_value.field_hscsdmultislotclass
  && field_presenceBitGprs==other_value.field_presenceBitGprs
  && field_gprsmultislot==other_value.field_gprsmultislot
  && field_presenceBitSms==other_value.field_presenceBitSms
  && field_multislotCap__SMS==other_value.field_multislotCap__SMS
  && field_multislotCapAdditionsAfterRel97==other_value.field_multislotCapAdditionsAfterRel97;
}

boolean MultislotCap::is_bound() const
{
return (field_presenceBitHscsd.is_bound())
  || (OPTIONAL_OMIT == field_hscsdmultislotclass.get_selection() || field_hscsdmultislotclass.is_bound())
  || (field_presenceBitGprs.is_bound())
  || (OPTIONAL_OMIT == field_gprsmultislot.get_selection() || field_gprsmultislot.is_bound())
  || (field_presenceBitSms.is_bound())
  || (OPTIONAL_OMIT == field_multislotCap__SMS.get_selection() || field_multislotCap__SMS.is_bound())
  || (OPTIONAL_OMIT == field_multislotCapAdditionsAfterRel97.get_selection() || field_multislotCapAdditionsAfterRel97.is_bound());
}
boolean MultislotCap::is_value() const
{
return field_presenceBitHscsd.is_value()
  && (OPTIONAL_OMIT == field_hscsdmultislotclass.get_selection() || field_hscsdmultislotclass.is_value())
  && field_presenceBitGprs.is_value()
  && (OPTIONAL_OMIT == field_gprsmultislot.get_selection() || field_gprsmultislot.is_value())
  && field_presenceBitSms.is_value()
  && (OPTIONAL_OMIT == field_multislotCap__SMS.get_selection() || field_multislotCap__SMS.is_value())
  && (OPTIONAL_OMIT == field_multislotCapAdditionsAfterRel97.get_selection() || field_multislotCapAdditionsAfterRel97.is_value());
}
int MultislotCap::size_of() const
{
  int ret_val = 3;
  if (field_hscsdmultislotclass.ispresent()) ret_val++;
  if (field_gprsmultislot.ispresent()) ret_val++;
  if (field_multislotCap__SMS.ispresent()) ret_val++;
  if (field_multislotCapAdditionsAfterRel97.ispresent()) ret_val++;
  return ret_val;
}

void MultislotCap::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ presenceBitHscsd := ");
field_presenceBitHscsd.log();
TTCN_Logger::log_event_str(", hscsdmultislotclass := ");
field_hscsdmultislotclass.log();
TTCN_Logger::log_event_str(", presenceBitGprs := ");
field_presenceBitGprs.log();
TTCN_Logger::log_event_str(", gprsmultislot := ");
field_gprsmultislot.log();
TTCN_Logger::log_event_str(", presenceBitSms := ");
field_presenceBitSms.log();
TTCN_Logger::log_event_str(", multislotCap_SMS := ");
field_multislotCap__SMS.log();
TTCN_Logger::log_event_str(", multislotCapAdditionsAfterRel97 := ");
field_multislotCapAdditionsAfterRel97.log();
TTCN_Logger::log_event_str(" }");
}

void MultislotCap::set_implicit_omit()
{
if (presenceBitHscsd().is_bound()) presenceBitHscsd().set_implicit_omit();
if (!hscsdmultislotclass().is_bound()) hscsdmultislotclass() = OMIT_VALUE;
else hscsdmultislotclass().set_implicit_omit();
if (presenceBitGprs().is_bound()) presenceBitGprs().set_implicit_omit();
if (!gprsmultislot().is_bound()) gprsmultislot() = OMIT_VALUE;
else gprsmultislot().set_implicit_omit();
if (presenceBitSms().is_bound()) presenceBitSms().set_implicit_omit();
if (!multislotCap__SMS().is_bound()) multislotCap__SMS() = OMIT_VALUE;
else multislotCap__SMS().set_implicit_omit();
if (!multislotCapAdditionsAfterRel97().is_bound()) multislotCapAdditionsAfterRel97() = OMIT_VALUE;
else multislotCapAdditionsAfterRel97().set_implicit_omit();
}

void MultislotCap::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_GMM_SM_Types.MultislotCap 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) presenceBitHscsd().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) hscsdmultislotclass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitGprs().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gprsmultislot().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitSms().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) multislotCap__SMS().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) multislotCapAdditionsAfterRel97().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(), "presenceBitHscsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitHscsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hscsdmultislotclass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hscsdmultislotclass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitGprs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitGprs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsmultislot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsmultislot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitSms")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitSms().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotCap_SMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCap__SMS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotCapAdditionsAfterRel97")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCapAdditionsAfterRel97().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MultislotCap: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.MultislotCap");
  }
}

void MultislotCap::encode_text(Text_Buf& text_buf) const
{
field_presenceBitHscsd.encode_text(text_buf);
field_hscsdmultislotclass.encode_text(text_buf);
field_presenceBitGprs.encode_text(text_buf);
field_gprsmultislot.encode_text(text_buf);
field_presenceBitSms.encode_text(text_buf);
field_multislotCap__SMS.encode_text(text_buf);
field_multislotCapAdditionsAfterRel97.encode_text(text_buf);
}

void MultislotCap::decode_text(Text_Buf& text_buf)
{
field_presenceBitHscsd.decode_text(text_buf);
field_hscsdmultislotclass.decode_text(text_buf);
field_presenceBitGprs.decode_text(text_buf);
field_gprsmultislot.decode_text(text_buf);
field_presenceBitSms.decode_text(text_buf);
field_multislotCap__SMS.decode_text(text_buf);
field_multislotCapAdditionsAfterRel97.decode_text(text_buf);
}

void MultislotCap::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 MultislotCap::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 MultislotCap::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, MultislotCap_presenceBitHscsd_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitHscsd.RAW_decode(MultislotCap_presenceBitHscsd_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 && field_presenceBitHscsd ==  bs_2){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_hscsdmultislotclass = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotCap_hscsdmultislotclass_descr_.raw->forceomit);
  decoded_field_length = field_hscsdmultislotclass().RAW_decode(MultislotCap_hscsdmultislotclass_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_hscsdmultislotclass = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_hscsdmultislotclass=OMIT_VALUE;
  RAW_Force_Omit field_2_force_omit(2, force_omit, MultislotCap_presenceBitGprs_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitGprs.RAW_decode(MultislotCap_presenceBitGprs_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_presenceBitGprs ==  bs_2){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_gprsmultislot = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MultislotCap_gprsmultislot_descr_.raw->forceomit);
  decoded_field_length = field_gprsmultislot().RAW_decode(MultislotCap_gprsmultislot_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_gprsmultislot = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_gprsmultislot=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, MultislotCap_presenceBitSms_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitSms.RAW_decode(MultislotCap_presenceBitSms_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_presenceBitSms ==  bs_2){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_multislotCap__SMS = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MultislotCap_multislotCap__SMS_descr_.raw->forceomit);
  decoded_field_length = field_multislotCap__SMS().RAW_decode(MultislotCap_multislotCap__SMS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_multislotCap__SMS = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_multislotCap__SMS=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_multislotCapAdditionsAfterRel97 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MultislotCap_multislotCapAdditionsAfterRel97_descr_.raw->forceomit);
  decoded_field_length = field_multislotCapAdditionsAfterRel97().RAW_decode(MultislotCap_multislotCapAdditionsAfterRel97_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_multislotCapAdditionsAfterRel97 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_multislotCapAdditionsAfterRel97=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MultislotCap::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, MultislotCap_presenceBitHscsd_descr_.raw);
  if (field_hscsdmultislotclass.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap_hscsdmultislotclass_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MultislotCap_presenceBitGprs_descr_.raw);
  if (field_gprsmultislot.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MultislotCap_gprsmultislot_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MultislotCap_presenceBitSms_descr_.raw);
  if (field_multislotCap__SMS.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MultislotCap_multislotCap__SMS_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_multislotCapAdditionsAfterRel97.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MultislotCap_multislotCapAdditionsAfterRel97_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_presenceBitHscsd.RAW_encode(MultislotCap_presenceBitHscsd_descr_, *myleaf.body.node.nodes[0]);
  if (field_hscsdmultislotclass.ispresent()) {
  encoded_length += field_hscsdmultislotclass().RAW_encode(MultislotCap_hscsdmultislotclass_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_presenceBitGprs.RAW_encode(MultislotCap_presenceBitGprs_descr_, *myleaf.body.node.nodes[2]);
  if (field_gprsmultislot.ispresent()) {
  encoded_length += field_gprsmultislot().RAW_encode(MultislotCap_gprsmultislot_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_presenceBitSms.RAW_encode(MultislotCap_presenceBitSms_descr_, *myleaf.body.node.nodes[4]);
  if (field_multislotCap__SMS.ispresent()) {
  encoded_length += field_multislotCap__SMS().RAW_encode(MultislotCap_multislotCap__SMS_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_multislotCapAdditionsAfterRel97.ispresent()) {
  encoded_length += field_multislotCapAdditionsAfterRel97().RAW_encode(MultislotCap_multislotCapAdditionsAfterRel97_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_hscsdmultislotclass.ispresent() && (field_presenceBitHscsd !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  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_2.RAW_encode(MultislotCap_presenceBitHscsd_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_gprsmultislot.ispresent() && (field_presenceBitGprs !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  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_2.RAW_encode(MultislotCap_presenceBitGprs_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_multislotCap__SMS.ispresent() && (field_presenceBitSms !=  bs_2)) {
  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_2.RAW_encode(MultislotCap_presenceBitSms_descr_,*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 MultislotCap_template::single_value_struct {
BITSTRING_template field_presenceBitHscsd;
BITSTRING_template field_hscsdmultislotclass;
BITSTRING_template field_presenceBitGprs;
MultislotCap__GPRS_template field_gprsmultislot;
BITSTRING_template field_presenceBitSms;
MultislotCap__SMS_template field_multislotCap__SMS;
MultislotCapAdditionsAfterRel97_template field_multislotCapAdditionsAfterRel97;
};

void MultislotCap_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_presenceBitHscsd = ANY_VALUE;
single_value->field_hscsdmultislotclass = ANY_OR_OMIT;
single_value->field_presenceBitGprs = ANY_VALUE;
single_value->field_gprsmultislot = ANY_OR_OMIT;
single_value->field_presenceBitSms = ANY_VALUE;
single_value->field_multislotCap__SMS = ANY_OR_OMIT;
single_value->field_multislotCapAdditionsAfterRel97 = ANY_OR_OMIT;
}
}
}

void MultislotCap_template::copy_value(const MultislotCap& other_value)
{
single_value = new single_value_struct;
if (other_value.presenceBitHscsd().is_bound()) {
  single_value->field_presenceBitHscsd = other_value.presenceBitHscsd();
} else {
  single_value->field_presenceBitHscsd.clean_up();
}
if (other_value.hscsdmultislotclass().is_bound()) {
  if (other_value.hscsdmultislotclass().ispresent()) single_value->field_hscsdmultislotclass = other_value.hscsdmultislotclass()();
  else single_value->field_hscsdmultislotclass = OMIT_VALUE;
} else {
  single_value->field_hscsdmultislotclass.clean_up();
}
if (other_value.presenceBitGprs().is_bound()) {
  single_value->field_presenceBitGprs = other_value.presenceBitGprs();
} else {
  single_value->field_presenceBitGprs.clean_up();
}
if (other_value.gprsmultislot().is_bound()) {
  if (other_value.gprsmultislot().ispresent()) single_value->field_gprsmultislot = other_value.gprsmultislot()();
  else single_value->field_gprsmultislot = OMIT_VALUE;
} else {
  single_value->field_gprsmultislot.clean_up();
}
if (other_value.presenceBitSms().is_bound()) {
  single_value->field_presenceBitSms = other_value.presenceBitSms();
} else {
  single_value->field_presenceBitSms.clean_up();
}
if (other_value.multislotCap__SMS().is_bound()) {
  if (other_value.multislotCap__SMS().ispresent()) single_value->field_multislotCap__SMS = other_value.multislotCap__SMS()();
  else single_value->field_multislotCap__SMS = OMIT_VALUE;
} else {
  single_value->field_multislotCap__SMS.clean_up();
}
if (other_value.multislotCapAdditionsAfterRel97().is_bound()) {
  if (other_value.multislotCapAdditionsAfterRel97().ispresent()) single_value->field_multislotCapAdditionsAfterRel97 = other_value.multislotCapAdditionsAfterRel97()();
  else single_value->field_multislotCapAdditionsAfterRel97 = OMIT_VALUE;
} else {
  single_value->field_multislotCapAdditionsAfterRel97.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MultislotCap_template::copy_template(const MultislotCap_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitHscsd().get_selection()) {
single_value->field_presenceBitHscsd = other_value.presenceBitHscsd();
} else {
single_value->field_presenceBitHscsd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.hscsdmultislotclass().get_selection()) {
single_value->field_hscsdmultislotclass = other_value.hscsdmultislotclass();
} else {
single_value->field_hscsdmultislotclass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitGprs().get_selection()) {
single_value->field_presenceBitGprs = other_value.presenceBitGprs();
} else {
single_value->field_presenceBitGprs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gprsmultislot().get_selection()) {
single_value->field_gprsmultislot = other_value.gprsmultislot();
} else {
single_value->field_gprsmultislot.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitSms().get_selection()) {
single_value->field_presenceBitSms = other_value.presenceBitSms();
} else {
single_value->field_presenceBitSms.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multislotCap__SMS().get_selection()) {
single_value->field_multislotCap__SMS = other_value.multislotCap__SMS();
} else {
single_value->field_multislotCap__SMS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multislotCapAdditionsAfterRel97().get_selection()) {
single_value->field_multislotCapAdditionsAfterRel97 = other_value.multislotCapAdditionsAfterRel97();
} else {
single_value->field_multislotCapAdditionsAfterRel97.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 MultislotCap_template[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 MultislotCap_template(*other_value.implication_.precondition);
implication_.implied_template = new MultislotCap_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_GMM_SM_Types.MultislotCap.");
break;
}
set_selection(other_value);
}

MultislotCap_template::MultislotCap_template()
{
}

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

MultislotCap_template::MultislotCap_template(const MultislotCap& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MultislotCap_template::match(const MultislotCap& 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.presenceBitHscsd().is_bound()) return FALSE;
if(!single_value->field_presenceBitHscsd.match(other_value.presenceBitHscsd(), legacy))return FALSE;
if(!other_value.hscsdmultislotclass().is_bound()) return FALSE;
if((other_value.hscsdmultislotclass().ispresent() ? !single_value->field_hscsdmultislotclass.match((const BITSTRING&)other_value.hscsdmultislotclass(), legacy) : !single_value->field_hscsdmultislotclass.match_omit(legacy)))return FALSE;
if(!other_value.presenceBitGprs().is_bound()) return FALSE;
if(!single_value->field_presenceBitGprs.match(other_value.presenceBitGprs(), legacy))return FALSE;
if(!other_value.gprsmultislot().is_bound()) return FALSE;
if((other_value.gprsmultislot().ispresent() ? !single_value->field_gprsmultislot.match((const MultislotCap__GPRS&)other_value.gprsmultislot(), legacy) : !single_value->field_gprsmultislot.match_omit(legacy)))return FALSE;
if(!other_value.presenceBitSms().is_bound()) return FALSE;
if(!single_value->field_presenceBitSms.match(other_value.presenceBitSms(), legacy))return FALSE;
if(!other_value.multislotCap__SMS().is_bound()) return FALSE;
if((other_value.multislotCap__SMS().ispresent() ? !single_value->field_multislotCap__SMS.match((const MultislotCap__SMS&)other_value.multislotCap__SMS(), legacy) : !single_value->field_multislotCap__SMS.match_omit(legacy)))return FALSE;
if(!other_value.multislotCapAdditionsAfterRel97().is_bound()) return FALSE;
if((other_value.multislotCapAdditionsAfterRel97().ispresent() ? !single_value->field_multislotCapAdditionsAfterRel97.match((const MultislotCapAdditionsAfterRel97&)other_value.multislotCapAdditionsAfterRel97(), legacy) : !single_value->field_multislotCapAdditionsAfterRel97.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_GMM_SM_Types.MultislotCap.");
}
return FALSE;
}

boolean MultislotCap_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_presenceBitHscsd.is_bound()
 || (single_value->field_hscsdmultislotclass.is_omit() || single_value->field_hscsdmultislotclass.is_bound())
 || single_value->field_presenceBitGprs.is_bound()
 || (single_value->field_gprsmultislot.is_omit() || single_value->field_gprsmultislot.is_bound())
 || single_value->field_presenceBitSms.is_bound()
 || (single_value->field_multislotCap__SMS.is_omit() || single_value->field_multislotCap__SMS.is_bound())
 || (single_value->field_multislotCapAdditionsAfterRel97.is_omit() || single_value->field_multislotCapAdditionsAfterRel97.is_bound());
}

boolean MultislotCap_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_presenceBitHscsd.is_value()
 && (single_value->field_hscsdmultislotclass.is_omit() || single_value->field_hscsdmultislotclass.is_value())
 && single_value->field_presenceBitGprs.is_value()
 && (single_value->field_gprsmultislot.is_omit() || single_value->field_gprsmultislot.is_value())
 && single_value->field_presenceBitSms.is_value()
 && (single_value->field_multislotCap__SMS.is_omit() || single_value->field_multislotCap__SMS.is_value())
 && (single_value->field_multislotCapAdditionsAfterRel97.is_omit() || single_value->field_multislotCapAdditionsAfterRel97.is_value());
}

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

MultislotCap MultislotCap_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_GMM_SM_Types.MultislotCap.");
MultislotCap ret_val;
if (single_value->field_presenceBitHscsd.is_bound()) {
ret_val.presenceBitHscsd() = single_value->field_presenceBitHscsd.valueof();
}
if (single_value->field_hscsdmultislotclass.is_omit()) ret_val.hscsdmultislotclass() = OMIT_VALUE;
else if (single_value->field_hscsdmultislotclass.is_bound()) {
ret_val.hscsdmultislotclass() = single_value->field_hscsdmultislotclass.valueof();
}
if (single_value->field_presenceBitGprs.is_bound()) {
ret_val.presenceBitGprs() = single_value->field_presenceBitGprs.valueof();
}
if (single_value->field_gprsmultislot.is_omit()) ret_val.gprsmultislot() = OMIT_VALUE;
else if (single_value->field_gprsmultislot.is_bound()) {
ret_val.gprsmultislot() = single_value->field_gprsmultislot.valueof();
}
if (single_value->field_presenceBitSms.is_bound()) {
ret_val.presenceBitSms() = single_value->field_presenceBitSms.valueof();
}
if (single_value->field_multislotCap__SMS.is_omit()) ret_val.multislotCap__SMS() = OMIT_VALUE;
else if (single_value->field_multislotCap__SMS.is_bound()) {
ret_val.multislotCap__SMS() = single_value->field_multislotCap__SMS.valueof();
}
if (single_value->field_multislotCapAdditionsAfterRel97.is_omit()) ret_val.multislotCapAdditionsAfterRel97() = OMIT_VALUE;
else if (single_value->field_multislotCapAdditionsAfterRel97.is_bound()) {
ret_val.multislotCapAdditionsAfterRel97() = single_value->field_multislotCapAdditionsAfterRel97.valueof();
}
return ret_val;
}

void MultislotCap_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_GMM_SM_Types.MultislotCap.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MultislotCap_template[list_length];
}

MultislotCap_template& MultislotCap_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_GMM_SM_Types.MultislotCap.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MultislotCap.");
return value_list.list_value[list_index];
}

BITSTRING_template& MultislotCap_template::presenceBitHscsd()
{
set_specific();
return single_value->field_presenceBitHscsd;
}

const BITSTRING_template& MultislotCap_template::presenceBitHscsd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitHscsd of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap.");
return single_value->field_presenceBitHscsd;
}

BITSTRING_template& MultislotCap_template::hscsdmultislotclass()
{
set_specific();
return single_value->field_hscsdmultislotclass;
}

const BITSTRING_template& MultislotCap_template::hscsdmultislotclass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field hscsdmultislotclass of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap.");
return single_value->field_hscsdmultislotclass;
}

BITSTRING_template& MultislotCap_template::presenceBitGprs()
{
set_specific();
return single_value->field_presenceBitGprs;
}

const BITSTRING_template& MultislotCap_template::presenceBitGprs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitGprs of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap.");
return single_value->field_presenceBitGprs;
}

MultislotCap__GPRS_template& MultislotCap_template::gprsmultislot()
{
set_specific();
return single_value->field_gprsmultislot;
}

const MultislotCap__GPRS_template& MultislotCap_template::gprsmultislot() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsmultislot of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap.");
return single_value->field_gprsmultislot;
}

BITSTRING_template& MultislotCap_template::presenceBitSms()
{
set_specific();
return single_value->field_presenceBitSms;
}

const BITSTRING_template& MultislotCap_template::presenceBitSms() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitSms of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap.");
return single_value->field_presenceBitSms;
}

MultislotCap__SMS_template& MultislotCap_template::multislotCap__SMS()
{
set_specific();
return single_value->field_multislotCap__SMS;
}

const MultislotCap__SMS_template& MultislotCap_template::multislotCap__SMS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotCap_SMS of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap.");
return single_value->field_multislotCap__SMS;
}

MultislotCapAdditionsAfterRel97_template& MultislotCap_template::multislotCapAdditionsAfterRel97()
{
set_specific();
return single_value->field_multislotCapAdditionsAfterRel97;
}

const MultislotCapAdditionsAfterRel97_template& MultislotCap_template::multislotCapAdditionsAfterRel97() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotCapAdditionsAfterRel97 of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap.");
return single_value->field_multislotCapAdditionsAfterRel97;
}

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

void MultislotCap_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ presenceBitHscsd := ");
single_value->field_presenceBitHscsd.log();
TTCN_Logger::log_event_str(", hscsdmultislotclass := ");
single_value->field_hscsdmultislotclass.log();
TTCN_Logger::log_event_str(", presenceBitGprs := ");
single_value->field_presenceBitGprs.log();
TTCN_Logger::log_event_str(", gprsmultislot := ");
single_value->field_gprsmultislot.log();
TTCN_Logger::log_event_str(", presenceBitSms := ");
single_value->field_presenceBitSms.log();
TTCN_Logger::log_event_str(", multislotCap_SMS := ");
single_value->field_multislotCap__SMS.log();
TTCN_Logger::log_event_str(", multislotCapAdditionsAfterRel97 := ");
single_value->field_multislotCapAdditionsAfterRel97.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 MultislotCap_template::log_match(const MultislotCap& 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_presenceBitHscsd.match(match_value.presenceBitHscsd(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitHscsd");
single_value->field_presenceBitHscsd.log_match(match_value.presenceBitHscsd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.hscsdmultislotclass().ispresent()){
if(!single_value->field_hscsdmultislotclass.match(match_value.hscsdmultislotclass(), legacy)){
TTCN_Logger::log_logmatch_info(".hscsdmultislotclass");
single_value->field_hscsdmultislotclass.log_match(match_value.hscsdmultislotclass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_hscsdmultislotclass.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".hscsdmultislotclass := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_hscsdmultislotclass.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_presenceBitGprs.match(match_value.presenceBitGprs(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitGprs");
single_value->field_presenceBitGprs.log_match(match_value.presenceBitGprs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.gprsmultislot().ispresent()){
if(!single_value->field_gprsmultislot.match(match_value.gprsmultislot(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsmultislot");
single_value->field_gprsmultislot.log_match(match_value.gprsmultislot(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gprsmultislot.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gprsmultislot := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gprsmultislot.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_presenceBitSms.match(match_value.presenceBitSms(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitSms");
single_value->field_presenceBitSms.log_match(match_value.presenceBitSms(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.multislotCap__SMS().ispresent()){
if(!single_value->field_multislotCap__SMS.match(match_value.multislotCap__SMS(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotCap_SMS");
single_value->field_multislotCap__SMS.log_match(match_value.multislotCap__SMS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_multislotCap__SMS.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".multislotCap_SMS := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_multislotCap__SMS.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.multislotCapAdditionsAfterRel97().ispresent()){
if(!single_value->field_multislotCapAdditionsAfterRel97.match(match_value.multislotCapAdditionsAfterRel97(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotCapAdditionsAfterRel97");
single_value->field_multislotCapAdditionsAfterRel97.log_match(match_value.multislotCapAdditionsAfterRel97(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_multislotCapAdditionsAfterRel97.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".multislotCapAdditionsAfterRel97 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_multislotCapAdditionsAfterRel97.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("{ presenceBitHscsd := ");
single_value->field_presenceBitHscsd.log_match(match_value.presenceBitHscsd(), legacy);
TTCN_Logger::log_event_str(", hscsdmultislotclass := ");
if (match_value.hscsdmultislotclass().ispresent()) {
single_value->field_hscsdmultislotclass.log_match(match_value.hscsdmultislotclass(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_hscsdmultislotclass.log();
if (single_value->field_hscsdmultislotclass.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", presenceBitGprs := ");
single_value->field_presenceBitGprs.log_match(match_value.presenceBitGprs(), legacy);
TTCN_Logger::log_event_str(", gprsmultislot := ");
if (match_value.gprsmultislot().ispresent()) {
single_value->field_gprsmultislot.log_match(match_value.gprsmultislot(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gprsmultislot.log();
if (single_value->field_gprsmultislot.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", presenceBitSms := ");
single_value->field_presenceBitSms.log_match(match_value.presenceBitSms(), legacy);
TTCN_Logger::log_event_str(", multislotCap_SMS := ");
if (match_value.multislotCap__SMS().ispresent()) {
single_value->field_multislotCap__SMS.log_match(match_value.multislotCap__SMS(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_multislotCap__SMS.log();
if (single_value->field_multislotCap__SMS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", multislotCapAdditionsAfterRel97 := ");
if (match_value.multislotCapAdditionsAfterRel97().ispresent()) {
single_value->field_multislotCapAdditionsAfterRel97.log_match(match_value.multislotCapAdditionsAfterRel97(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_multislotCapAdditionsAfterRel97.log();
if (single_value->field_multislotCapAdditionsAfterRel97.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 MultislotCap_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (presenceBitHscsd().is_bound()) presenceBitHscsd().set_implicit_omit();
if (!hscsdmultislotclass().is_bound()) hscsdmultislotclass() = OMIT_VALUE;
else hscsdmultislotclass().set_implicit_omit();
if (presenceBitGprs().is_bound()) presenceBitGprs().set_implicit_omit();
if (!gprsmultislot().is_bound()) gprsmultislot() = OMIT_VALUE;
else gprsmultislot().set_implicit_omit();
if (presenceBitSms().is_bound()) presenceBitSms().set_implicit_omit();
if (!multislotCap__SMS().is_bound()) multislotCap__SMS() = OMIT_VALUE;
else multislotCap__SMS().set_implicit_omit();
if (!multislotCapAdditionsAfterRel97().is_bound()) multislotCapAdditionsAfterRel97() = OMIT_VALUE;
else multislotCapAdditionsAfterRel97().set_implicit_omit();
}

void MultislotCap_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_presenceBitHscsd.encode_text(text_buf);
single_value->field_hscsdmultislotclass.encode_text(text_buf);
single_value->field_presenceBitGprs.encode_text(text_buf);
single_value->field_gprsmultislot.encode_text(text_buf);
single_value->field_presenceBitSms.encode_text(text_buf);
single_value->field_multislotCap__SMS.encode_text(text_buf);
single_value->field_multislotCapAdditionsAfterRel97.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_GMM_SM_Types.MultislotCap.");
}
}

void MultislotCap_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_presenceBitHscsd.decode_text(text_buf);
single_value->field_hscsdmultislotclass.decode_text(text_buf);
single_value->field_presenceBitGprs.decode_text(text_buf);
single_value->field_gprsmultislot.decode_text(text_buf);
single_value->field_presenceBitSms.decode_text(text_buf);
single_value->field_multislotCap__SMS.decode_text(text_buf);
single_value->field_multislotCapAdditionsAfterRel97.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 MultislotCap_template[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_GMM_SM_Types.MultislotCap.");
}
}

void MultislotCap_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: {
    MultislotCap_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_GMM_SM_Types.MultislotCap 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) presenceBitHscsd().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) hscsdmultislotclass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitGprs().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gprsmultislot().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitSms().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) multislotCap__SMS().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) multislotCapAdditionsAfterRel97().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(), "presenceBitHscsd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitHscsd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hscsdmultislotclass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hscsdmultislotclass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitGprs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitGprs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsmultislot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsmultislot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitSms")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitSms().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotCap_SMS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCap__SMS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotCapAdditionsAfterRel97")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCapAdditionsAfterRel97().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MultislotCap: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MultislotCap_template* precondition = new MultislotCap_template;
    precondition->set_param(*param.get_elem(0));
    MultislotCap_template* implied_template = new MultislotCap_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MultislotCap_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MultislotCap");
  }
  is_ifpresent = param.get_ifpresent();
}

void MultislotCap_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_presenceBitHscsd.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap");
single_value->field_hscsdmultislotclass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap");
single_value->field_presenceBitGprs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap");
single_value->field_gprsmultislot.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap");
single_value->field_presenceBitSms.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap");
single_value->field_multislotCap__SMS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap");
single_value->field_multislotCapAdditionsAfterRel97.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap");
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_GMM_SM_Types.MultislotCap");
}

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

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

MultislotCap__GPRS::MultislotCap__GPRS()
{
}

MultislotCap__GPRS::MultislotCap__GPRS(const BITSTRING& par_gprsmultislotclass,
    const BITSTRING& par_gprsextendeddynalloccap)
  :   field_gprsmultislotclass(par_gprsmultislotclass),
  field_gprsextendeddynalloccap(par_gprsextendeddynalloccap)
{
}

MultislotCap__GPRS::MultislotCap__GPRS(const MultislotCap__GPRS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap_GPRS.");
if (other_value.gprsmultislotclass().is_bound()) field_gprsmultislotclass = other_value.gprsmultislotclass();
else field_gprsmultislotclass.clean_up();
if (other_value.gprsextendeddynalloccap().is_bound()) field_gprsextendeddynalloccap = other_value.gprsextendeddynalloccap();
else field_gprsextendeddynalloccap.clean_up();
}

void MultislotCap__GPRS::clean_up()
{
field_gprsmultislotclass.clean_up();
field_gprsextendeddynalloccap.clean_up();
}

const TTCN_Typedescriptor_t* MultislotCap__GPRS::get_descriptor() const { return &MultislotCap__GPRS_descr_; }
MultislotCap__GPRS& MultislotCap__GPRS::operator=(const MultislotCap__GPRS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap_GPRS.");
  if (other_value.gprsmultislotclass().is_bound()) field_gprsmultislotclass = other_value.gprsmultislotclass();
  else field_gprsmultislotclass.clean_up();
  if (other_value.gprsextendeddynalloccap().is_bound()) field_gprsextendeddynalloccap = other_value.gprsextendeddynalloccap();
  else field_gprsextendeddynalloccap.clean_up();
}
return *this;
}

boolean MultislotCap__GPRS::operator==(const MultislotCap__GPRS& other_value) const
{
return field_gprsmultislotclass==other_value.field_gprsmultislotclass
  && field_gprsextendeddynalloccap==other_value.field_gprsextendeddynalloccap;
}

boolean MultislotCap__GPRS::is_bound() const
{
return (field_gprsmultislotclass.is_bound())
  || (field_gprsextendeddynalloccap.is_bound());
}
boolean MultislotCap__GPRS::is_value() const
{
return field_gprsmultislotclass.is_value()
  && field_gprsextendeddynalloccap.is_value();
}
void MultislotCap__GPRS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ gprsmultislotclass := ");
field_gprsmultislotclass.log();
TTCN_Logger::log_event_str(", gprsextendeddynalloccap := ");
field_gprsextendeddynalloccap.log();
TTCN_Logger::log_event_str(" }");
}

void MultislotCap__GPRS::set_implicit_omit()
{
if (gprsmultislotclass().is_bound()) gprsmultislotclass().set_implicit_omit();
if (gprsextendeddynalloccap().is_bound()) gprsextendeddynalloccap().set_implicit_omit();
}

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

void MultislotCap__GPRS::encode_text(Text_Buf& text_buf) const
{
field_gprsmultislotclass.encode_text(text_buf);
field_gprsextendeddynalloccap.encode_text(text_buf);
}

void MultislotCap__GPRS::decode_text(Text_Buf& text_buf)
{
field_gprsmultislotclass.decode_text(text_buf);
field_gprsextendeddynalloccap.decode_text(text_buf);
}

void MultislotCap__GPRS::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 MultislotCap__GPRS::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 MultislotCap__GPRS::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, MultislotCap__GPRS_gprsmultislotclass_descr_.raw->forceomit);
  decoded_field_length = field_gprsmultislotclass.RAW_decode(MultislotCap__GPRS_gprsmultislotclass_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, MultislotCap__GPRS_gprsextendeddynalloccap_descr_.raw->forceomit);
  decoded_field_length = field_gprsextendeddynalloccap.RAW_decode(MultislotCap__GPRS_gprsextendeddynalloccap_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 MultislotCap__GPRS::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, MultislotCap__GPRS_gprsmultislotclass_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap__GPRS_gprsextendeddynalloccap_descr_.raw);
  encoded_length += field_gprsmultislotclass.RAW_encode(MultislotCap__GPRS_gprsmultislotclass_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gprsextendeddynalloccap.RAW_encode(MultislotCap__GPRS_gprsextendeddynalloccap_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct MultislotCap__GPRS_template::single_value_struct {
BITSTRING_template field_gprsmultislotclass;
BITSTRING_template field_gprsextendeddynalloccap;
};

void MultislotCap__GPRS_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_gprsmultislotclass = ANY_VALUE;
single_value->field_gprsextendeddynalloccap = ANY_VALUE;
}
}
}

void MultislotCap__GPRS_template::copy_value(const MultislotCap__GPRS& other_value)
{
single_value = new single_value_struct;
if (other_value.gprsmultislotclass().is_bound()) {
  single_value->field_gprsmultislotclass = other_value.gprsmultislotclass();
} else {
  single_value->field_gprsmultislotclass.clean_up();
}
if (other_value.gprsextendeddynalloccap().is_bound()) {
  single_value->field_gprsextendeddynalloccap = other_value.gprsextendeddynalloccap();
} else {
  single_value->field_gprsextendeddynalloccap.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MultislotCap__GPRS_template::copy_template(const MultislotCap__GPRS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.gprsmultislotclass().get_selection()) {
single_value->field_gprsmultislotclass = other_value.gprsmultislotclass();
} else {
single_value->field_gprsmultislotclass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gprsextendeddynalloccap().get_selection()) {
single_value->field_gprsextendeddynalloccap = other_value.gprsextendeddynalloccap();
} else {
single_value->field_gprsextendeddynalloccap.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 MultislotCap__GPRS_template[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 MultislotCap__GPRS_template(*other_value.implication_.precondition);
implication_.implied_template = new MultislotCap__GPRS_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_GMM_SM_Types.MultislotCap_GPRS.");
break;
}
set_selection(other_value);
}

MultislotCap__GPRS_template::MultislotCap__GPRS_template()
{
}

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

MultislotCap__GPRS_template::MultislotCap__GPRS_template(const MultislotCap__GPRS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MultislotCap__GPRS_template::match(const MultislotCap__GPRS& 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.gprsmultislotclass().is_bound()) return FALSE;
if(!single_value->field_gprsmultislotclass.match(other_value.gprsmultislotclass(), legacy))return FALSE;
if(!other_value.gprsextendeddynalloccap().is_bound()) return FALSE;
if(!single_value->field_gprsextendeddynalloccap.match(other_value.gprsextendeddynalloccap(), 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_GMM_SM_Types.MultislotCap_GPRS.");
}
return FALSE;
}

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

boolean MultislotCap__GPRS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_gprsmultislotclass.is_value()
 && single_value->field_gprsextendeddynalloccap.is_value();
}

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

MultislotCap__GPRS MultislotCap__GPRS_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_GMM_SM_Types.MultislotCap_GPRS.");
MultislotCap__GPRS ret_val;
if (single_value->field_gprsmultislotclass.is_bound()) {
ret_val.gprsmultislotclass() = single_value->field_gprsmultislotclass.valueof();
}
if (single_value->field_gprsextendeddynalloccap.is_bound()) {
ret_val.gprsextendeddynalloccap() = single_value->field_gprsextendeddynalloccap.valueof();
}
return ret_val;
}

void MultislotCap__GPRS_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_GMM_SM_Types.MultislotCap_GPRS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MultislotCap__GPRS_template[list_length];
}

MultislotCap__GPRS_template& MultislotCap__GPRS_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_GMM_SM_Types.MultislotCap_GPRS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MultislotCap_GPRS.");
return value_list.list_value[list_index];
}

BITSTRING_template& MultislotCap__GPRS_template::gprsmultislotclass()
{
set_specific();
return single_value->field_gprsmultislotclass;
}

const BITSTRING_template& MultislotCap__GPRS_template::gprsmultislotclass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsmultislotclass of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_GPRS.");
return single_value->field_gprsmultislotclass;
}

BITSTRING_template& MultislotCap__GPRS_template::gprsextendeddynalloccap()
{
set_specific();
return single_value->field_gprsextendeddynalloccap;
}

const BITSTRING_template& MultislotCap__GPRS_template::gprsextendeddynalloccap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsextendeddynalloccap of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_GPRS.");
return single_value->field_gprsextendeddynalloccap;
}

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

void MultislotCap__GPRS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ gprsmultislotclass := ");
single_value->field_gprsmultislotclass.log();
TTCN_Logger::log_event_str(", gprsextendeddynalloccap := ");
single_value->field_gprsextendeddynalloccap.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 MultislotCap__GPRS_template::log_match(const MultislotCap__GPRS& 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_gprsmultislotclass.match(match_value.gprsmultislotclass(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsmultislotclass");
single_value->field_gprsmultislotclass.log_match(match_value.gprsmultislotclass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gprsextendeddynalloccap.match(match_value.gprsextendeddynalloccap(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsextendeddynalloccap");
single_value->field_gprsextendeddynalloccap.log_match(match_value.gprsextendeddynalloccap(), 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("{ gprsmultislotclass := ");
single_value->field_gprsmultislotclass.log_match(match_value.gprsmultislotclass(), legacy);
TTCN_Logger::log_event_str(", gprsextendeddynalloccap := ");
single_value->field_gprsextendeddynalloccap.log_match(match_value.gprsextendeddynalloccap(), 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 MultislotCap__GPRS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (gprsmultislotclass().is_bound()) gprsmultislotclass().set_implicit_omit();
if (gprsextendeddynalloccap().is_bound()) gprsextendeddynalloccap().set_implicit_omit();
}

void MultislotCap__GPRS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_gprsmultislotclass.encode_text(text_buf);
single_value->field_gprsextendeddynalloccap.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_GMM_SM_Types.MultislotCap_GPRS.");
}
}

void MultislotCap__GPRS_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_gprsmultislotclass.decode_text(text_buf);
single_value->field_gprsextendeddynalloccap.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 MultislotCap__GPRS_template[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_GMM_SM_Types.MultislotCap_GPRS.");
}
}

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

void MultislotCap__GPRS_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_gprsmultislotclass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_GPRS");
single_value->field_gprsextendeddynalloccap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_GPRS");
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_GMM_SM_Types.MultislotCap_GPRS");
}

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

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

MultislotCap__SMS::MultislotCap__SMS()
{
}

MultislotCap__SMS::MultislotCap__SMS(const BITSTRING& par_smsValue,
    const BITSTRING& par_smValue)
  :   field_smsValue(par_smsValue),
  field_smValue(par_smValue)
{
}

MultislotCap__SMS::MultislotCap__SMS(const MultislotCap__SMS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap_SMS.");
if (other_value.smsValue().is_bound()) field_smsValue = other_value.smsValue();
else field_smsValue.clean_up();
if (other_value.smValue().is_bound()) field_smValue = other_value.smValue();
else field_smValue.clean_up();
}

void MultislotCap__SMS::clean_up()
{
field_smsValue.clean_up();
field_smValue.clean_up();
}

const TTCN_Typedescriptor_t* MultislotCap__SMS::get_descriptor() const { return &MultislotCap__SMS_descr_; }
MultislotCap__SMS& MultislotCap__SMS::operator=(const MultislotCap__SMS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap_SMS.");
  if (other_value.smsValue().is_bound()) field_smsValue = other_value.smsValue();
  else field_smsValue.clean_up();
  if (other_value.smValue().is_bound()) field_smValue = other_value.smValue();
  else field_smValue.clean_up();
}
return *this;
}

boolean MultislotCap__SMS::operator==(const MultislotCap__SMS& other_value) const
{
return field_smsValue==other_value.field_smsValue
  && field_smValue==other_value.field_smValue;
}

boolean MultislotCap__SMS::is_bound() const
{
return (field_smsValue.is_bound())
  || (field_smValue.is_bound());
}
boolean MultislotCap__SMS::is_value() const
{
return field_smsValue.is_value()
  && field_smValue.is_value();
}
void MultislotCap__SMS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ smsValue := ");
field_smsValue.log();
TTCN_Logger::log_event_str(", smValue := ");
field_smValue.log();
TTCN_Logger::log_event_str(" }");
}

void MultislotCap__SMS::set_implicit_omit()
{
if (smsValue().is_bound()) smsValue().set_implicit_omit();
if (smValue().is_bound()) smValue().set_implicit_omit();
}

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

void MultislotCap__SMS::encode_text(Text_Buf& text_buf) const
{
field_smsValue.encode_text(text_buf);
field_smValue.encode_text(text_buf);
}

void MultislotCap__SMS::decode_text(Text_Buf& text_buf)
{
field_smsValue.decode_text(text_buf);
field_smValue.decode_text(text_buf);
}

void MultislotCap__SMS::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 MultislotCap__SMS::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 MultislotCap__SMS::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, MultislotCap__SMS_smsValue_descr_.raw->forceomit);
  decoded_field_length = field_smsValue.RAW_decode(MultislotCap__SMS_smsValue_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, MultislotCap__SMS_smValue_descr_.raw->forceomit);
  decoded_field_length = field_smValue.RAW_decode(MultislotCap__SMS_smValue_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 MultislotCap__SMS::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, MultislotCap__SMS_smsValue_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap__SMS_smValue_descr_.raw);
  encoded_length += field_smsValue.RAW_encode(MultislotCap__SMS_smsValue_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_smValue.RAW_encode(MultislotCap__SMS_smValue_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct MultislotCap__SMS_template::single_value_struct {
BITSTRING_template field_smsValue;
BITSTRING_template field_smValue;
};

void MultislotCap__SMS_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_smsValue = ANY_VALUE;
single_value->field_smValue = ANY_VALUE;
}
}
}

void MultislotCap__SMS_template::copy_value(const MultislotCap__SMS& other_value)
{
single_value = new single_value_struct;
if (other_value.smsValue().is_bound()) {
  single_value->field_smsValue = other_value.smsValue();
} else {
  single_value->field_smsValue.clean_up();
}
if (other_value.smValue().is_bound()) {
  single_value->field_smValue = other_value.smValue();
} else {
  single_value->field_smValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MultislotCap__SMS_template::copy_template(const MultislotCap__SMS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.smsValue().get_selection()) {
single_value->field_smsValue = other_value.smsValue();
} else {
single_value->field_smsValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.smValue().get_selection()) {
single_value->field_smValue = other_value.smValue();
} else {
single_value->field_smValue.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 MultislotCap__SMS_template[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 MultislotCap__SMS_template(*other_value.implication_.precondition);
implication_.implied_template = new MultislotCap__SMS_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_GMM_SM_Types.MultislotCap_SMS.");
break;
}
set_selection(other_value);
}

MultislotCap__SMS_template::MultislotCap__SMS_template()
{
}

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

MultislotCap__SMS_template::MultislotCap__SMS_template(const MultislotCap__SMS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MultislotCap__SMS_template::match(const MultislotCap__SMS& 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.smsValue().is_bound()) return FALSE;
if(!single_value->field_smsValue.match(other_value.smsValue(), legacy))return FALSE;
if(!other_value.smValue().is_bound()) return FALSE;
if(!single_value->field_smValue.match(other_value.smValue(), 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_GMM_SM_Types.MultislotCap_SMS.");
}
return FALSE;
}

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

boolean MultislotCap__SMS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_smsValue.is_value()
 && single_value->field_smValue.is_value();
}

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

MultislotCap__SMS MultislotCap__SMS_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_GMM_SM_Types.MultislotCap_SMS.");
MultislotCap__SMS ret_val;
if (single_value->field_smsValue.is_bound()) {
ret_val.smsValue() = single_value->field_smsValue.valueof();
}
if (single_value->field_smValue.is_bound()) {
ret_val.smValue() = single_value->field_smValue.valueof();
}
return ret_val;
}

void MultislotCap__SMS_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_GMM_SM_Types.MultislotCap_SMS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MultislotCap__SMS_template[list_length];
}

MultislotCap__SMS_template& MultislotCap__SMS_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_GMM_SM_Types.MultislotCap_SMS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MultislotCap_SMS.");
return value_list.list_value[list_index];
}

BITSTRING_template& MultislotCap__SMS_template::smsValue()
{
set_specific();
return single_value->field_smsValue;
}

const BITSTRING_template& MultislotCap__SMS_template::smsValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field smsValue of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_SMS.");
return single_value->field_smsValue;
}

BITSTRING_template& MultislotCap__SMS_template::smValue()
{
set_specific();
return single_value->field_smValue;
}

const BITSTRING_template& MultislotCap__SMS_template::smValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field smValue of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_SMS.");
return single_value->field_smValue;
}

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

void MultislotCap__SMS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ smsValue := ");
single_value->field_smsValue.log();
TTCN_Logger::log_event_str(", smValue := ");
single_value->field_smValue.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 MultislotCap__SMS_template::log_match(const MultislotCap__SMS& 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_smsValue.match(match_value.smsValue(), legacy)){
TTCN_Logger::log_logmatch_info(".smsValue");
single_value->field_smsValue.log_match(match_value.smsValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_smValue.match(match_value.smValue(), legacy)){
TTCN_Logger::log_logmatch_info(".smValue");
single_value->field_smValue.log_match(match_value.smValue(), 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("{ smsValue := ");
single_value->field_smsValue.log_match(match_value.smsValue(), legacy);
TTCN_Logger::log_event_str(", smValue := ");
single_value->field_smValue.log_match(match_value.smValue(), 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 MultislotCap__SMS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (smsValue().is_bound()) smsValue().set_implicit_omit();
if (smValue().is_bound()) smValue().set_implicit_omit();
}

void MultislotCap__SMS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_smsValue.encode_text(text_buf);
single_value->field_smValue.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_GMM_SM_Types.MultislotCap_SMS.");
}
}

void MultislotCap__SMS_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_smsValue.decode_text(text_buf);
single_value->field_smValue.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 MultislotCap__SMS_template[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_GMM_SM_Types.MultislotCap_SMS.");
}
}

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

void MultislotCap__SMS_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_smsValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_SMS");
single_value->field_smValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_SMS");
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_GMM_SM_Types.MultislotCap_SMS");
}

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

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

MultislotCapAdditionsAfterRel97::MultislotCapAdditionsAfterRel97()
{
}

MultislotCapAdditionsAfterRel97::MultislotCapAdditionsAfterRel97(const BITSTRING& par_presenceBitEcsdmulti,
    const OPTIONAL< BITSTRING >& par_ecsdmultislotclass,
    const BITSTRING& par_presenceBitEgprsmulti,
    const OPTIONAL< MultislotCap__EGPRS >& par_multislotCap__EGPRS,
    const BITSTRING& par_presenceBitDtmGprsmulti,
    const OPTIONAL< MultislotCap__dtmgprsmultislotsubclass >& par_multislotCapdtmgprsmultislotsubclass)
  :   field_presenceBitEcsdmulti(par_presenceBitEcsdmulti),
  field_ecsdmultislotclass(par_ecsdmultislotclass),
  field_presenceBitEgprsmulti(par_presenceBitEgprsmulti),
  field_multislotCap__EGPRS(par_multislotCap__EGPRS),
  field_presenceBitDtmGprsmulti(par_presenceBitDtmGprsmulti),
  field_multislotCapdtmgprsmultislotsubclass(par_multislotCapdtmgprsmultislotsubclass)
{
}

MultislotCapAdditionsAfterRel97::MultislotCapAdditionsAfterRel97(const MultislotCapAdditionsAfterRel97& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
if (other_value.presenceBitEcsdmulti().is_bound()) field_presenceBitEcsdmulti = other_value.presenceBitEcsdmulti();
else field_presenceBitEcsdmulti.clean_up();
if (other_value.ecsdmultislotclass().is_bound()) field_ecsdmultislotclass = other_value.ecsdmultislotclass();
else field_ecsdmultislotclass.clean_up();
if (other_value.presenceBitEgprsmulti().is_bound()) field_presenceBitEgprsmulti = other_value.presenceBitEgprsmulti();
else field_presenceBitEgprsmulti.clean_up();
if (other_value.multislotCap__EGPRS().is_bound()) field_multislotCap__EGPRS = other_value.multislotCap__EGPRS();
else field_multislotCap__EGPRS.clean_up();
if (other_value.presenceBitDtmGprsmulti().is_bound()) field_presenceBitDtmGprsmulti = other_value.presenceBitDtmGprsmulti();
else field_presenceBitDtmGprsmulti.clean_up();
if (other_value.multislotCapdtmgprsmultislotsubclass().is_bound()) field_multislotCapdtmgprsmultislotsubclass = other_value.multislotCapdtmgprsmultislotsubclass();
else field_multislotCapdtmgprsmultislotsubclass.clean_up();
}

void MultislotCapAdditionsAfterRel97::clean_up()
{
field_presenceBitEcsdmulti.clean_up();
field_ecsdmultislotclass.clean_up();
field_presenceBitEgprsmulti.clean_up();
field_multislotCap__EGPRS.clean_up();
field_presenceBitDtmGprsmulti.clean_up();
field_multislotCapdtmgprsmultislotsubclass.clean_up();
}

const TTCN_Typedescriptor_t* MultislotCapAdditionsAfterRel97::get_descriptor() const { return &MultislotCapAdditionsAfterRel97_descr_; }
MultislotCapAdditionsAfterRel97& MultislotCapAdditionsAfterRel97::operator=(const MultislotCapAdditionsAfterRel97& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
  if (other_value.presenceBitEcsdmulti().is_bound()) field_presenceBitEcsdmulti = other_value.presenceBitEcsdmulti();
  else field_presenceBitEcsdmulti.clean_up();
  if (other_value.ecsdmultislotclass().is_bound()) field_ecsdmultislotclass = other_value.ecsdmultislotclass();
  else field_ecsdmultislotclass.clean_up();
  if (other_value.presenceBitEgprsmulti().is_bound()) field_presenceBitEgprsmulti = other_value.presenceBitEgprsmulti();
  else field_presenceBitEgprsmulti.clean_up();
  if (other_value.multislotCap__EGPRS().is_bound()) field_multislotCap__EGPRS = other_value.multislotCap__EGPRS();
  else field_multislotCap__EGPRS.clean_up();
  if (other_value.presenceBitDtmGprsmulti().is_bound()) field_presenceBitDtmGprsmulti = other_value.presenceBitDtmGprsmulti();
  else field_presenceBitDtmGprsmulti.clean_up();
  if (other_value.multislotCapdtmgprsmultislotsubclass().is_bound()) field_multislotCapdtmgprsmultislotsubclass = other_value.multislotCapdtmgprsmultislotsubclass();
  else field_multislotCapdtmgprsmultislotsubclass.clean_up();
}
return *this;
}

boolean MultislotCapAdditionsAfterRel97::operator==(const MultislotCapAdditionsAfterRel97& other_value) const
{
return field_presenceBitEcsdmulti==other_value.field_presenceBitEcsdmulti
  && field_ecsdmultislotclass==other_value.field_ecsdmultislotclass
  && field_presenceBitEgprsmulti==other_value.field_presenceBitEgprsmulti
  && field_multislotCap__EGPRS==other_value.field_multislotCap__EGPRS
  && field_presenceBitDtmGprsmulti==other_value.field_presenceBitDtmGprsmulti
  && field_multislotCapdtmgprsmultislotsubclass==other_value.field_multislotCapdtmgprsmultislotsubclass;
}

boolean MultislotCapAdditionsAfterRel97::is_bound() const
{
return (field_presenceBitEcsdmulti.is_bound())
  || (OPTIONAL_OMIT == field_ecsdmultislotclass.get_selection() || field_ecsdmultislotclass.is_bound())
  || (field_presenceBitEgprsmulti.is_bound())
  || (OPTIONAL_OMIT == field_multislotCap__EGPRS.get_selection() || field_multislotCap__EGPRS.is_bound())
  || (field_presenceBitDtmGprsmulti.is_bound())
  || (OPTIONAL_OMIT == field_multislotCapdtmgprsmultislotsubclass.get_selection() || field_multislotCapdtmgprsmultislotsubclass.is_bound());
}
boolean MultislotCapAdditionsAfterRel97::is_value() const
{
return field_presenceBitEcsdmulti.is_value()
  && (OPTIONAL_OMIT == field_ecsdmultislotclass.get_selection() || field_ecsdmultislotclass.is_value())
  && field_presenceBitEgprsmulti.is_value()
  && (OPTIONAL_OMIT == field_multislotCap__EGPRS.get_selection() || field_multislotCap__EGPRS.is_value())
  && field_presenceBitDtmGprsmulti.is_value()
  && (OPTIONAL_OMIT == field_multislotCapdtmgprsmultislotsubclass.get_selection() || field_multislotCapdtmgprsmultislotsubclass.is_value());
}
int MultislotCapAdditionsAfterRel97::size_of() const
{
  int ret_val = 3;
  if (field_ecsdmultislotclass.ispresent()) ret_val++;
  if (field_multislotCap__EGPRS.ispresent()) ret_val++;
  if (field_multislotCapdtmgprsmultislotsubclass.ispresent()) ret_val++;
  return ret_val;
}

void MultislotCapAdditionsAfterRel97::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ presenceBitEcsdmulti := ");
field_presenceBitEcsdmulti.log();
TTCN_Logger::log_event_str(", ecsdmultislotclass := ");
field_ecsdmultislotclass.log();
TTCN_Logger::log_event_str(", presenceBitEgprsmulti := ");
field_presenceBitEgprsmulti.log();
TTCN_Logger::log_event_str(", multislotCap_EGPRS := ");
field_multislotCap__EGPRS.log();
TTCN_Logger::log_event_str(", presenceBitDtmGprsmulti := ");
field_presenceBitDtmGprsmulti.log();
TTCN_Logger::log_event_str(", multislotCapdtmgprsmultislotsubclass := ");
field_multislotCapdtmgprsmultislotsubclass.log();
TTCN_Logger::log_event_str(" }");
}

void MultislotCapAdditionsAfterRel97::set_implicit_omit()
{
if (presenceBitEcsdmulti().is_bound()) presenceBitEcsdmulti().set_implicit_omit();
if (!ecsdmultislotclass().is_bound()) ecsdmultislotclass() = OMIT_VALUE;
else ecsdmultislotclass().set_implicit_omit();
if (presenceBitEgprsmulti().is_bound()) presenceBitEgprsmulti().set_implicit_omit();
if (!multislotCap__EGPRS().is_bound()) multislotCap__EGPRS() = OMIT_VALUE;
else multislotCap__EGPRS().set_implicit_omit();
if (presenceBitDtmGprsmulti().is_bound()) presenceBitDtmGprsmulti().set_implicit_omit();
if (!multislotCapdtmgprsmultislotsubclass().is_bound()) multislotCapdtmgprsmultislotsubclass() = OMIT_VALUE;
else multislotCapdtmgprsmultislotsubclass().set_implicit_omit();
}

void MultislotCapAdditionsAfterRel97::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_GMM_SM_Types.MultislotCapAdditionsAfterRel97 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) presenceBitEcsdmulti().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ecsdmultislotclass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitEgprsmulti().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) multislotCap__EGPRS().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitDtmGprsmulti().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) multislotCapdtmgprsmultislotsubclass().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(), "presenceBitEcsdmulti")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitEcsdmulti().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ecsdmultislotclass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ecsdmultislotclass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitEgprsmulti")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitEgprsmulti().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotCap_EGPRS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCap__EGPRS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitDtmGprsmulti")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDtmGprsmulti().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotCapdtmgprsmultislotsubclass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCapdtmgprsmultislotsubclass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97");
  }
}

void MultislotCapAdditionsAfterRel97::encode_text(Text_Buf& text_buf) const
{
field_presenceBitEcsdmulti.encode_text(text_buf);
field_ecsdmultislotclass.encode_text(text_buf);
field_presenceBitEgprsmulti.encode_text(text_buf);
field_multislotCap__EGPRS.encode_text(text_buf);
field_presenceBitDtmGprsmulti.encode_text(text_buf);
field_multislotCapdtmgprsmultislotsubclass.encode_text(text_buf);
}

void MultislotCapAdditionsAfterRel97::decode_text(Text_Buf& text_buf)
{
field_presenceBitEcsdmulti.decode_text(text_buf);
field_ecsdmultislotclass.decode_text(text_buf);
field_presenceBitEgprsmulti.decode_text(text_buf);
field_multislotCap__EGPRS.decode_text(text_buf);
field_presenceBitDtmGprsmulti.decode_text(text_buf);
field_multislotCapdtmgprsmultislotsubclass.decode_text(text_buf);
}

void MultislotCapAdditionsAfterRel97::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 MultislotCapAdditionsAfterRel97::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 MultislotCapAdditionsAfterRel97::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, MultislotCapAdditionsAfterRel97_presenceBitEcsdmulti_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitEcsdmulti.RAW_decode(MultislotCapAdditionsAfterRel97_presenceBitEcsdmulti_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 && field_presenceBitEcsdmulti ==  bs_2){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_ecsdmultislotclass = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotCapAdditionsAfterRel97_ecsdmultislotclass_descr_.raw->forceomit);
  decoded_field_length = field_ecsdmultislotclass().RAW_decode(MultislotCapAdditionsAfterRel97_ecsdmultislotclass_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_ecsdmultislotclass = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_ecsdmultislotclass=OMIT_VALUE;
  RAW_Force_Omit field_2_force_omit(2, force_omit, MultislotCapAdditionsAfterRel97_presenceBitEgprsmulti_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitEgprsmulti.RAW_decode(MultislotCapAdditionsAfterRel97_presenceBitEgprsmulti_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_presenceBitEgprsmulti ==  bs_2){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_multislotCap__EGPRS = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MultislotCapAdditionsAfterRel97_multislotCap__EGPRS_descr_.raw->forceomit);
  decoded_field_length = field_multislotCap__EGPRS().RAW_decode(MultislotCapAdditionsAfterRel97_multislotCap__EGPRS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_multislotCap__EGPRS = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_multislotCap__EGPRS=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, MultislotCapAdditionsAfterRel97_presenceBitDtmGprsmulti_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitDtmGprsmulti.RAW_decode(MultislotCapAdditionsAfterRel97_presenceBitDtmGprsmulti_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_presenceBitDtmGprsmulti ==  bs_2){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_multislotCapdtmgprsmultislotsubclass = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MultislotCapAdditionsAfterRel97_multislotCapdtmgprsmultislotsubclass_descr_.raw->forceomit);
  decoded_field_length = field_multislotCapdtmgprsmultislotsubclass().RAW_decode(MultislotCapAdditionsAfterRel97_multislotCapdtmgprsmultislotsubclass_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_multislotCapdtmgprsmultislotsubclass = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_multislotCapdtmgprsmultislotsubclass=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MultislotCapAdditionsAfterRel97::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, MultislotCapAdditionsAfterRel97_presenceBitEcsdmulti_descr_.raw);
  if (field_ecsdmultislotclass.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCapAdditionsAfterRel97_ecsdmultislotclass_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MultislotCapAdditionsAfterRel97_presenceBitEgprsmulti_descr_.raw);
  if (field_multislotCap__EGPRS.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MultislotCapAdditionsAfterRel97_multislotCap__EGPRS_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MultislotCapAdditionsAfterRel97_presenceBitDtmGprsmulti_descr_.raw);
  if (field_multislotCapdtmgprsmultislotsubclass.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MultislotCapAdditionsAfterRel97_multislotCapdtmgprsmultislotsubclass_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_presenceBitEcsdmulti.RAW_encode(MultislotCapAdditionsAfterRel97_presenceBitEcsdmulti_descr_, *myleaf.body.node.nodes[0]);
  if (field_ecsdmultislotclass.ispresent()) {
  encoded_length += field_ecsdmultislotclass().RAW_encode(MultislotCapAdditionsAfterRel97_ecsdmultislotclass_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_presenceBitEgprsmulti.RAW_encode(MultislotCapAdditionsAfterRel97_presenceBitEgprsmulti_descr_, *myleaf.body.node.nodes[2]);
  if (field_multislotCap__EGPRS.ispresent()) {
  encoded_length += field_multislotCap__EGPRS().RAW_encode(MultislotCapAdditionsAfterRel97_multislotCap__EGPRS_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_presenceBitDtmGprsmulti.RAW_encode(MultislotCapAdditionsAfterRel97_presenceBitDtmGprsmulti_descr_, *myleaf.body.node.nodes[4]);
  if (field_multislotCapdtmgprsmultislotsubclass.ispresent()) {
  encoded_length += field_multislotCapdtmgprsmultislotsubclass().RAW_encode(MultislotCapAdditionsAfterRel97_multislotCapdtmgprsmultislotsubclass_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_ecsdmultislotclass.ispresent() && (field_presenceBitEcsdmulti !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  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_2.RAW_encode(MultislotCapAdditionsAfterRel97_presenceBitEcsdmulti_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_multislotCap__EGPRS.ispresent() && (field_presenceBitEgprsmulti !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  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_2.RAW_encode(MultislotCapAdditionsAfterRel97_presenceBitEgprsmulti_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_multislotCapdtmgprsmultislotsubclass.ispresent() && (field_presenceBitDtmGprsmulti !=  bs_2)) {
  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_2.RAW_encode(MultislotCapAdditionsAfterRel97_presenceBitDtmGprsmulti_descr_,*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 MultislotCapAdditionsAfterRel97_template::single_value_struct {
BITSTRING_template field_presenceBitEcsdmulti;
BITSTRING_template field_ecsdmultislotclass;
BITSTRING_template field_presenceBitEgprsmulti;
MultislotCap__EGPRS_template field_multislotCap__EGPRS;
BITSTRING_template field_presenceBitDtmGprsmulti;
MultislotCap__dtmgprsmultislotsubclass_template field_multislotCapdtmgprsmultislotsubclass;
};

void MultislotCapAdditionsAfterRel97_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_presenceBitEcsdmulti = ANY_VALUE;
single_value->field_ecsdmultislotclass = ANY_OR_OMIT;
single_value->field_presenceBitEgprsmulti = ANY_VALUE;
single_value->field_multislotCap__EGPRS = ANY_OR_OMIT;
single_value->field_presenceBitDtmGprsmulti = ANY_VALUE;
single_value->field_multislotCapdtmgprsmultislotsubclass = ANY_OR_OMIT;
}
}
}

void MultislotCapAdditionsAfterRel97_template::copy_value(const MultislotCapAdditionsAfterRel97& other_value)
{
single_value = new single_value_struct;
if (other_value.presenceBitEcsdmulti().is_bound()) {
  single_value->field_presenceBitEcsdmulti = other_value.presenceBitEcsdmulti();
} else {
  single_value->field_presenceBitEcsdmulti.clean_up();
}
if (other_value.ecsdmultislotclass().is_bound()) {
  if (other_value.ecsdmultislotclass().ispresent()) single_value->field_ecsdmultislotclass = other_value.ecsdmultislotclass()();
  else single_value->field_ecsdmultislotclass = OMIT_VALUE;
} else {
  single_value->field_ecsdmultislotclass.clean_up();
}
if (other_value.presenceBitEgprsmulti().is_bound()) {
  single_value->field_presenceBitEgprsmulti = other_value.presenceBitEgprsmulti();
} else {
  single_value->field_presenceBitEgprsmulti.clean_up();
}
if (other_value.multislotCap__EGPRS().is_bound()) {
  if (other_value.multislotCap__EGPRS().ispresent()) single_value->field_multislotCap__EGPRS = other_value.multislotCap__EGPRS()();
  else single_value->field_multislotCap__EGPRS = OMIT_VALUE;
} else {
  single_value->field_multislotCap__EGPRS.clean_up();
}
if (other_value.presenceBitDtmGprsmulti().is_bound()) {
  single_value->field_presenceBitDtmGprsmulti = other_value.presenceBitDtmGprsmulti();
} else {
  single_value->field_presenceBitDtmGprsmulti.clean_up();
}
if (other_value.multislotCapdtmgprsmultislotsubclass().is_bound()) {
  if (other_value.multislotCapdtmgprsmultislotsubclass().ispresent()) single_value->field_multislotCapdtmgprsmultislotsubclass = other_value.multislotCapdtmgprsmultislotsubclass()();
  else single_value->field_multislotCapdtmgprsmultislotsubclass = OMIT_VALUE;
} else {
  single_value->field_multislotCapdtmgprsmultislotsubclass.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MultislotCapAdditionsAfterRel97_template::copy_template(const MultislotCapAdditionsAfterRel97_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitEcsdmulti().get_selection()) {
single_value->field_presenceBitEcsdmulti = other_value.presenceBitEcsdmulti();
} else {
single_value->field_presenceBitEcsdmulti.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ecsdmultislotclass().get_selection()) {
single_value->field_ecsdmultislotclass = other_value.ecsdmultislotclass();
} else {
single_value->field_ecsdmultislotclass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitEgprsmulti().get_selection()) {
single_value->field_presenceBitEgprsmulti = other_value.presenceBitEgprsmulti();
} else {
single_value->field_presenceBitEgprsmulti.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multislotCap__EGPRS().get_selection()) {
single_value->field_multislotCap__EGPRS = other_value.multislotCap__EGPRS();
} else {
single_value->field_multislotCap__EGPRS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDtmGprsmulti().get_selection()) {
single_value->field_presenceBitDtmGprsmulti = other_value.presenceBitDtmGprsmulti();
} else {
single_value->field_presenceBitDtmGprsmulti.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.multislotCapdtmgprsmultislotsubclass().get_selection()) {
single_value->field_multislotCapdtmgprsmultislotsubclass = other_value.multislotCapdtmgprsmultislotsubclass();
} else {
single_value->field_multislotCapdtmgprsmultislotsubclass.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 MultislotCapAdditionsAfterRel97_template[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 MultislotCapAdditionsAfterRel97_template(*other_value.implication_.precondition);
implication_.implied_template = new MultislotCapAdditionsAfterRel97_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_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
break;
}
set_selection(other_value);
}

MultislotCapAdditionsAfterRel97_template::MultislotCapAdditionsAfterRel97_template()
{
}

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

MultislotCapAdditionsAfterRel97_template::MultislotCapAdditionsAfterRel97_template(const MultislotCapAdditionsAfterRel97& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MultislotCapAdditionsAfterRel97_template::match(const MultislotCapAdditionsAfterRel97& 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.presenceBitEcsdmulti().is_bound()) return FALSE;
if(!single_value->field_presenceBitEcsdmulti.match(other_value.presenceBitEcsdmulti(), legacy))return FALSE;
if(!other_value.ecsdmultislotclass().is_bound()) return FALSE;
if((other_value.ecsdmultislotclass().ispresent() ? !single_value->field_ecsdmultislotclass.match((const BITSTRING&)other_value.ecsdmultislotclass(), legacy) : !single_value->field_ecsdmultislotclass.match_omit(legacy)))return FALSE;
if(!other_value.presenceBitEgprsmulti().is_bound()) return FALSE;
if(!single_value->field_presenceBitEgprsmulti.match(other_value.presenceBitEgprsmulti(), legacy))return FALSE;
if(!other_value.multislotCap__EGPRS().is_bound()) return FALSE;
if((other_value.multislotCap__EGPRS().ispresent() ? !single_value->field_multislotCap__EGPRS.match((const MultislotCap__EGPRS&)other_value.multislotCap__EGPRS(), legacy) : !single_value->field_multislotCap__EGPRS.match_omit(legacy)))return FALSE;
if(!other_value.presenceBitDtmGprsmulti().is_bound()) return FALSE;
if(!single_value->field_presenceBitDtmGprsmulti.match(other_value.presenceBitDtmGprsmulti(), legacy))return FALSE;
if(!other_value.multislotCapdtmgprsmultislotsubclass().is_bound()) return FALSE;
if((other_value.multislotCapdtmgprsmultislotsubclass().ispresent() ? !single_value->field_multislotCapdtmgprsmultislotsubclass.match((const MultislotCap__dtmgprsmultislotsubclass&)other_value.multislotCapdtmgprsmultislotsubclass(), legacy) : !single_value->field_multislotCapdtmgprsmultislotsubclass.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_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
}
return FALSE;
}

boolean MultislotCapAdditionsAfterRel97_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_presenceBitEcsdmulti.is_bound()
 || (single_value->field_ecsdmultislotclass.is_omit() || single_value->field_ecsdmultislotclass.is_bound())
 || single_value->field_presenceBitEgprsmulti.is_bound()
 || (single_value->field_multislotCap__EGPRS.is_omit() || single_value->field_multislotCap__EGPRS.is_bound())
 || single_value->field_presenceBitDtmGprsmulti.is_bound()
 || (single_value->field_multislotCapdtmgprsmultislotsubclass.is_omit() || single_value->field_multislotCapdtmgprsmultislotsubclass.is_bound());
}

boolean MultislotCapAdditionsAfterRel97_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_presenceBitEcsdmulti.is_value()
 && (single_value->field_ecsdmultislotclass.is_omit() || single_value->field_ecsdmultislotclass.is_value())
 && single_value->field_presenceBitEgprsmulti.is_value()
 && (single_value->field_multislotCap__EGPRS.is_omit() || single_value->field_multislotCap__EGPRS.is_value())
 && single_value->field_presenceBitDtmGprsmulti.is_value()
 && (single_value->field_multislotCapdtmgprsmultislotsubclass.is_omit() || single_value->field_multislotCapdtmgprsmultislotsubclass.is_value());
}

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

MultislotCapAdditionsAfterRel97 MultislotCapAdditionsAfterRel97_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_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
MultislotCapAdditionsAfterRel97 ret_val;
if (single_value->field_presenceBitEcsdmulti.is_bound()) {
ret_val.presenceBitEcsdmulti() = single_value->field_presenceBitEcsdmulti.valueof();
}
if (single_value->field_ecsdmultislotclass.is_omit()) ret_val.ecsdmultislotclass() = OMIT_VALUE;
else if (single_value->field_ecsdmultislotclass.is_bound()) {
ret_val.ecsdmultislotclass() = single_value->field_ecsdmultislotclass.valueof();
}
if (single_value->field_presenceBitEgprsmulti.is_bound()) {
ret_val.presenceBitEgprsmulti() = single_value->field_presenceBitEgprsmulti.valueof();
}
if (single_value->field_multislotCap__EGPRS.is_omit()) ret_val.multislotCap__EGPRS() = OMIT_VALUE;
else if (single_value->field_multislotCap__EGPRS.is_bound()) {
ret_val.multislotCap__EGPRS() = single_value->field_multislotCap__EGPRS.valueof();
}
if (single_value->field_presenceBitDtmGprsmulti.is_bound()) {
ret_val.presenceBitDtmGprsmulti() = single_value->field_presenceBitDtmGprsmulti.valueof();
}
if (single_value->field_multislotCapdtmgprsmultislotsubclass.is_omit()) ret_val.multislotCapdtmgprsmultislotsubclass() = OMIT_VALUE;
else if (single_value->field_multislotCapdtmgprsmultislotsubclass.is_bound()) {
ret_val.multislotCapdtmgprsmultislotsubclass() = single_value->field_multislotCapdtmgprsmultislotsubclass.valueof();
}
return ret_val;
}

void MultislotCapAdditionsAfterRel97_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_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MultislotCapAdditionsAfterRel97_template[list_length];
}

MultislotCapAdditionsAfterRel97_template& MultislotCapAdditionsAfterRel97_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_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
return value_list.list_value[list_index];
}

BITSTRING_template& MultislotCapAdditionsAfterRel97_template::presenceBitEcsdmulti()
{
set_specific();
return single_value->field_presenceBitEcsdmulti;
}

const BITSTRING_template& MultislotCapAdditionsAfterRel97_template::presenceBitEcsdmulti() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitEcsdmulti of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
return single_value->field_presenceBitEcsdmulti;
}

BITSTRING_template& MultislotCapAdditionsAfterRel97_template::ecsdmultislotclass()
{
set_specific();
return single_value->field_ecsdmultislotclass;
}

const BITSTRING_template& MultislotCapAdditionsAfterRel97_template::ecsdmultislotclass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ecsdmultislotclass of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
return single_value->field_ecsdmultislotclass;
}

BITSTRING_template& MultislotCapAdditionsAfterRel97_template::presenceBitEgprsmulti()
{
set_specific();
return single_value->field_presenceBitEgprsmulti;
}

const BITSTRING_template& MultislotCapAdditionsAfterRel97_template::presenceBitEgprsmulti() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitEgprsmulti of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
return single_value->field_presenceBitEgprsmulti;
}

MultislotCap__EGPRS_template& MultislotCapAdditionsAfterRel97_template::multislotCap__EGPRS()
{
set_specific();
return single_value->field_multislotCap__EGPRS;
}

const MultislotCap__EGPRS_template& MultislotCapAdditionsAfterRel97_template::multislotCap__EGPRS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotCap_EGPRS of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
return single_value->field_multislotCap__EGPRS;
}

BITSTRING_template& MultislotCapAdditionsAfterRel97_template::presenceBitDtmGprsmulti()
{
set_specific();
return single_value->field_presenceBitDtmGprsmulti;
}

const BITSTRING_template& MultislotCapAdditionsAfterRel97_template::presenceBitDtmGprsmulti() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitDtmGprsmulti of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
return single_value->field_presenceBitDtmGprsmulti;
}

MultislotCap__dtmgprsmultislotsubclass_template& MultislotCapAdditionsAfterRel97_template::multislotCapdtmgprsmultislotsubclass()
{
set_specific();
return single_value->field_multislotCapdtmgprsmultislotsubclass;
}

const MultislotCap__dtmgprsmultislotsubclass_template& MultislotCapAdditionsAfterRel97_template::multislotCapdtmgprsmultislotsubclass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotCapdtmgprsmultislotsubclass of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
return single_value->field_multislotCapdtmgprsmultislotsubclass;
}

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

void MultislotCapAdditionsAfterRel97_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ presenceBitEcsdmulti := ");
single_value->field_presenceBitEcsdmulti.log();
TTCN_Logger::log_event_str(", ecsdmultislotclass := ");
single_value->field_ecsdmultislotclass.log();
TTCN_Logger::log_event_str(", presenceBitEgprsmulti := ");
single_value->field_presenceBitEgprsmulti.log();
TTCN_Logger::log_event_str(", multislotCap_EGPRS := ");
single_value->field_multislotCap__EGPRS.log();
TTCN_Logger::log_event_str(", presenceBitDtmGprsmulti := ");
single_value->field_presenceBitDtmGprsmulti.log();
TTCN_Logger::log_event_str(", multislotCapdtmgprsmultislotsubclass := ");
single_value->field_multislotCapdtmgprsmultislotsubclass.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 MultislotCapAdditionsAfterRel97_template::log_match(const MultislotCapAdditionsAfterRel97& 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_presenceBitEcsdmulti.match(match_value.presenceBitEcsdmulti(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitEcsdmulti");
single_value->field_presenceBitEcsdmulti.log_match(match_value.presenceBitEcsdmulti(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.ecsdmultislotclass().ispresent()){
if(!single_value->field_ecsdmultislotclass.match(match_value.ecsdmultislotclass(), legacy)){
TTCN_Logger::log_logmatch_info(".ecsdmultislotclass");
single_value->field_ecsdmultislotclass.log_match(match_value.ecsdmultislotclass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ecsdmultislotclass.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ecsdmultislotclass := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ecsdmultislotclass.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_presenceBitEgprsmulti.match(match_value.presenceBitEgprsmulti(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitEgprsmulti");
single_value->field_presenceBitEgprsmulti.log_match(match_value.presenceBitEgprsmulti(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.multislotCap__EGPRS().ispresent()){
if(!single_value->field_multislotCap__EGPRS.match(match_value.multislotCap__EGPRS(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotCap_EGPRS");
single_value->field_multislotCap__EGPRS.log_match(match_value.multislotCap__EGPRS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_multislotCap__EGPRS.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".multislotCap_EGPRS := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_multislotCap__EGPRS.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_presenceBitDtmGprsmulti.match(match_value.presenceBitDtmGprsmulti(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitDtmGprsmulti");
single_value->field_presenceBitDtmGprsmulti.log_match(match_value.presenceBitDtmGprsmulti(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.multislotCapdtmgprsmultislotsubclass().ispresent()){
if(!single_value->field_multislotCapdtmgprsmultislotsubclass.match(match_value.multislotCapdtmgprsmultislotsubclass(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotCapdtmgprsmultislotsubclass");
single_value->field_multislotCapdtmgprsmultislotsubclass.log_match(match_value.multislotCapdtmgprsmultislotsubclass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_multislotCapdtmgprsmultislotsubclass.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".multislotCapdtmgprsmultislotsubclass := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_multislotCapdtmgprsmultislotsubclass.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("{ presenceBitEcsdmulti := ");
single_value->field_presenceBitEcsdmulti.log_match(match_value.presenceBitEcsdmulti(), legacy);
TTCN_Logger::log_event_str(", ecsdmultislotclass := ");
if (match_value.ecsdmultislotclass().ispresent()) {
single_value->field_ecsdmultislotclass.log_match(match_value.ecsdmultislotclass(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ecsdmultislotclass.log();
if (single_value->field_ecsdmultislotclass.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", presenceBitEgprsmulti := ");
single_value->field_presenceBitEgprsmulti.log_match(match_value.presenceBitEgprsmulti(), legacy);
TTCN_Logger::log_event_str(", multislotCap_EGPRS := ");
if (match_value.multislotCap__EGPRS().ispresent()) {
single_value->field_multislotCap__EGPRS.log_match(match_value.multislotCap__EGPRS(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_multislotCap__EGPRS.log();
if (single_value->field_multislotCap__EGPRS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", presenceBitDtmGprsmulti := ");
single_value->field_presenceBitDtmGprsmulti.log_match(match_value.presenceBitDtmGprsmulti(), legacy);
TTCN_Logger::log_event_str(", multislotCapdtmgprsmultislotsubclass := ");
if (match_value.multislotCapdtmgprsmultislotsubclass().ispresent()) {
single_value->field_multislotCapdtmgprsmultislotsubclass.log_match(match_value.multislotCapdtmgprsmultislotsubclass(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_multislotCapdtmgprsmultislotsubclass.log();
if (single_value->field_multislotCapdtmgprsmultislotsubclass.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 MultislotCapAdditionsAfterRel97_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (presenceBitEcsdmulti().is_bound()) presenceBitEcsdmulti().set_implicit_omit();
if (!ecsdmultislotclass().is_bound()) ecsdmultislotclass() = OMIT_VALUE;
else ecsdmultislotclass().set_implicit_omit();
if (presenceBitEgprsmulti().is_bound()) presenceBitEgprsmulti().set_implicit_omit();
if (!multislotCap__EGPRS().is_bound()) multislotCap__EGPRS() = OMIT_VALUE;
else multislotCap__EGPRS().set_implicit_omit();
if (presenceBitDtmGprsmulti().is_bound()) presenceBitDtmGprsmulti().set_implicit_omit();
if (!multislotCapdtmgprsmultislotsubclass().is_bound()) multislotCapdtmgprsmultislotsubclass() = OMIT_VALUE;
else multislotCapdtmgprsmultislotsubclass().set_implicit_omit();
}

void MultislotCapAdditionsAfterRel97_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_presenceBitEcsdmulti.encode_text(text_buf);
single_value->field_ecsdmultislotclass.encode_text(text_buf);
single_value->field_presenceBitEgprsmulti.encode_text(text_buf);
single_value->field_multislotCap__EGPRS.encode_text(text_buf);
single_value->field_presenceBitDtmGprsmulti.encode_text(text_buf);
single_value->field_multislotCapdtmgprsmultislotsubclass.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_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
}
}

void MultislotCapAdditionsAfterRel97_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_presenceBitEcsdmulti.decode_text(text_buf);
single_value->field_ecsdmultislotclass.decode_text(text_buf);
single_value->field_presenceBitEgprsmulti.decode_text(text_buf);
single_value->field_multislotCap__EGPRS.decode_text(text_buf);
single_value->field_presenceBitDtmGprsmulti.decode_text(text_buf);
single_value->field_multislotCapdtmgprsmultislotsubclass.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 MultislotCapAdditionsAfterRel97_template[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_GMM_SM_Types.MultislotCapAdditionsAfterRel97.");
}
}

void MultislotCapAdditionsAfterRel97_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: {
    MultislotCapAdditionsAfterRel97_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_GMM_SM_Types.MultislotCapAdditionsAfterRel97 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) presenceBitEcsdmulti().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ecsdmultislotclass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitEgprsmulti().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) multislotCap__EGPRS().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitDtmGprsmulti().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) multislotCapdtmgprsmultislotsubclass().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(), "presenceBitEcsdmulti")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitEcsdmulti().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ecsdmultislotclass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ecsdmultislotclass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitEgprsmulti")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitEgprsmulti().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotCap_EGPRS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCap__EGPRS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitDtmGprsmulti")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDtmGprsmulti().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "multislotCapdtmgprsmultislotsubclass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multislotCapdtmgprsmultislotsubclass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MultislotCapAdditionsAfterRel97_template* precondition = new MultislotCapAdditionsAfterRel97_template;
    precondition->set_param(*param.get_elem(0));
    MultislotCapAdditionsAfterRel97_template* implied_template = new MultislotCapAdditionsAfterRel97_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MultislotCapAdditionsAfterRel97_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97");
  }
  is_ifpresent = param.get_ifpresent();
}

void MultislotCapAdditionsAfterRel97_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_presenceBitEcsdmulti.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97");
single_value->field_ecsdmultislotclass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97");
single_value->field_presenceBitEgprsmulti.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97");
single_value->field_multislotCap__EGPRS.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97");
single_value->field_presenceBitDtmGprsmulti.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97");
single_value->field_multislotCapdtmgprsmultislotsubclass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCapAdditionsAfterRel97");
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_GMM_SM_Types.MultislotCapAdditionsAfterRel97");
}

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

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

MultislotCap__EGPRS::MultislotCap__EGPRS()
{
}

MultislotCap__EGPRS::MultislotCap__EGPRS(const BITSTRING& par_egprsmultislotclass,
    const BITSTRING& par_egprsextendeddynalloccap)
  :   field_egprsmultislotclass(par_egprsmultislotclass),
  field_egprsextendeddynalloccap(par_egprsextendeddynalloccap)
{
}

MultislotCap__EGPRS::MultislotCap__EGPRS(const MultislotCap__EGPRS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap_EGPRS.");
if (other_value.egprsmultislotclass().is_bound()) field_egprsmultislotclass = other_value.egprsmultislotclass();
else field_egprsmultislotclass.clean_up();
if (other_value.egprsextendeddynalloccap().is_bound()) field_egprsextendeddynalloccap = other_value.egprsextendeddynalloccap();
else field_egprsextendeddynalloccap.clean_up();
}

void MultislotCap__EGPRS::clean_up()
{
field_egprsmultislotclass.clean_up();
field_egprsextendeddynalloccap.clean_up();
}

const TTCN_Typedescriptor_t* MultislotCap__EGPRS::get_descriptor() const { return &MultislotCap__EGPRS_descr_; }
MultislotCap__EGPRS& MultislotCap__EGPRS::operator=(const MultislotCap__EGPRS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap_EGPRS.");
  if (other_value.egprsmultislotclass().is_bound()) field_egprsmultislotclass = other_value.egprsmultislotclass();
  else field_egprsmultislotclass.clean_up();
  if (other_value.egprsextendeddynalloccap().is_bound()) field_egprsextendeddynalloccap = other_value.egprsextendeddynalloccap();
  else field_egprsextendeddynalloccap.clean_up();
}
return *this;
}

boolean MultislotCap__EGPRS::operator==(const MultislotCap__EGPRS& other_value) const
{
return field_egprsmultislotclass==other_value.field_egprsmultislotclass
  && field_egprsextendeddynalloccap==other_value.field_egprsextendeddynalloccap;
}

boolean MultislotCap__EGPRS::is_bound() const
{
return (field_egprsmultislotclass.is_bound())
  || (field_egprsextendeddynalloccap.is_bound());
}
boolean MultislotCap__EGPRS::is_value() const
{
return field_egprsmultislotclass.is_value()
  && field_egprsextendeddynalloccap.is_value();
}
void MultislotCap__EGPRS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ egprsmultislotclass := ");
field_egprsmultislotclass.log();
TTCN_Logger::log_event_str(", egprsextendeddynalloccap := ");
field_egprsextendeddynalloccap.log();
TTCN_Logger::log_event_str(" }");
}

void MultislotCap__EGPRS::set_implicit_omit()
{
if (egprsmultislotclass().is_bound()) egprsmultislotclass().set_implicit_omit();
if (egprsextendeddynalloccap().is_bound()) egprsextendeddynalloccap().set_implicit_omit();
}

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

void MultislotCap__EGPRS::encode_text(Text_Buf& text_buf) const
{
field_egprsmultislotclass.encode_text(text_buf);
field_egprsextendeddynalloccap.encode_text(text_buf);
}

void MultislotCap__EGPRS::decode_text(Text_Buf& text_buf)
{
field_egprsmultislotclass.decode_text(text_buf);
field_egprsextendeddynalloccap.decode_text(text_buf);
}

void MultislotCap__EGPRS::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 MultislotCap__EGPRS::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 MultislotCap__EGPRS::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, MultislotCap__EGPRS_egprsmultislotclass_descr_.raw->forceomit);
  decoded_field_length = field_egprsmultislotclass.RAW_decode(MultislotCap__EGPRS_egprsmultislotclass_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, MultislotCap__EGPRS_egprsextendeddynalloccap_descr_.raw->forceomit);
  decoded_field_length = field_egprsextendeddynalloccap.RAW_decode(MultislotCap__EGPRS_egprsextendeddynalloccap_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 MultislotCap__EGPRS::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, MultislotCap__EGPRS_egprsmultislotclass_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap__EGPRS_egprsextendeddynalloccap_descr_.raw);
  encoded_length += field_egprsmultislotclass.RAW_encode(MultislotCap__EGPRS_egprsmultislotclass_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_egprsextendeddynalloccap.RAW_encode(MultislotCap__EGPRS_egprsextendeddynalloccap_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct MultislotCap__EGPRS_template::single_value_struct {
BITSTRING_template field_egprsmultislotclass;
BITSTRING_template field_egprsextendeddynalloccap;
};

void MultislotCap__EGPRS_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_egprsmultislotclass = ANY_VALUE;
single_value->field_egprsextendeddynalloccap = ANY_VALUE;
}
}
}

void MultislotCap__EGPRS_template::copy_value(const MultislotCap__EGPRS& other_value)
{
single_value = new single_value_struct;
if (other_value.egprsmultislotclass().is_bound()) {
  single_value->field_egprsmultislotclass = other_value.egprsmultislotclass();
} else {
  single_value->field_egprsmultislotclass.clean_up();
}
if (other_value.egprsextendeddynalloccap().is_bound()) {
  single_value->field_egprsextendeddynalloccap = other_value.egprsextendeddynalloccap();
} else {
  single_value->field_egprsextendeddynalloccap.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MultislotCap__EGPRS_template::copy_template(const MultislotCap__EGPRS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.egprsmultislotclass().get_selection()) {
single_value->field_egprsmultislotclass = other_value.egprsmultislotclass();
} else {
single_value->field_egprsmultislotclass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.egprsextendeddynalloccap().get_selection()) {
single_value->field_egprsextendeddynalloccap = other_value.egprsextendeddynalloccap();
} else {
single_value->field_egprsextendeddynalloccap.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 MultislotCap__EGPRS_template[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 MultislotCap__EGPRS_template(*other_value.implication_.precondition);
implication_.implied_template = new MultislotCap__EGPRS_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_GMM_SM_Types.MultislotCap_EGPRS.");
break;
}
set_selection(other_value);
}

MultislotCap__EGPRS_template::MultislotCap__EGPRS_template()
{
}

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

MultislotCap__EGPRS_template::MultislotCap__EGPRS_template(const MultislotCap__EGPRS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MultislotCap__EGPRS_template::match(const MultislotCap__EGPRS& 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.egprsmultislotclass().is_bound()) return FALSE;
if(!single_value->field_egprsmultislotclass.match(other_value.egprsmultislotclass(), legacy))return FALSE;
if(!other_value.egprsextendeddynalloccap().is_bound()) return FALSE;
if(!single_value->field_egprsextendeddynalloccap.match(other_value.egprsextendeddynalloccap(), 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_GMM_SM_Types.MultislotCap_EGPRS.");
}
return FALSE;
}

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

boolean MultislotCap__EGPRS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_egprsmultislotclass.is_value()
 && single_value->field_egprsextendeddynalloccap.is_value();
}

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

MultislotCap__EGPRS MultislotCap__EGPRS_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_GMM_SM_Types.MultislotCap_EGPRS.");
MultislotCap__EGPRS ret_val;
if (single_value->field_egprsmultislotclass.is_bound()) {
ret_val.egprsmultislotclass() = single_value->field_egprsmultislotclass.valueof();
}
if (single_value->field_egprsextendeddynalloccap.is_bound()) {
ret_val.egprsextendeddynalloccap() = single_value->field_egprsextendeddynalloccap.valueof();
}
return ret_val;
}

void MultislotCap__EGPRS_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_GMM_SM_Types.MultislotCap_EGPRS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MultislotCap__EGPRS_template[list_length];
}

MultislotCap__EGPRS_template& MultislotCap__EGPRS_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_GMM_SM_Types.MultislotCap_EGPRS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MultislotCap_EGPRS.");
return value_list.list_value[list_index];
}

BITSTRING_template& MultislotCap__EGPRS_template::egprsmultislotclass()
{
set_specific();
return single_value->field_egprsmultislotclass;
}

const BITSTRING_template& MultislotCap__EGPRS_template::egprsmultislotclass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field egprsmultislotclass of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_EGPRS.");
return single_value->field_egprsmultislotclass;
}

BITSTRING_template& MultislotCap__EGPRS_template::egprsextendeddynalloccap()
{
set_specific();
return single_value->field_egprsextendeddynalloccap;
}

const BITSTRING_template& MultislotCap__EGPRS_template::egprsextendeddynalloccap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field egprsextendeddynalloccap of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_EGPRS.");
return single_value->field_egprsextendeddynalloccap;
}

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

void MultislotCap__EGPRS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ egprsmultislotclass := ");
single_value->field_egprsmultislotclass.log();
TTCN_Logger::log_event_str(", egprsextendeddynalloccap := ");
single_value->field_egprsextendeddynalloccap.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 MultislotCap__EGPRS_template::log_match(const MultislotCap__EGPRS& 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_egprsmultislotclass.match(match_value.egprsmultislotclass(), legacy)){
TTCN_Logger::log_logmatch_info(".egprsmultislotclass");
single_value->field_egprsmultislotclass.log_match(match_value.egprsmultislotclass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_egprsextendeddynalloccap.match(match_value.egprsextendeddynalloccap(), legacy)){
TTCN_Logger::log_logmatch_info(".egprsextendeddynalloccap");
single_value->field_egprsextendeddynalloccap.log_match(match_value.egprsextendeddynalloccap(), 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("{ egprsmultislotclass := ");
single_value->field_egprsmultislotclass.log_match(match_value.egprsmultislotclass(), legacy);
TTCN_Logger::log_event_str(", egprsextendeddynalloccap := ");
single_value->field_egprsextendeddynalloccap.log_match(match_value.egprsextendeddynalloccap(), 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 MultislotCap__EGPRS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (egprsmultislotclass().is_bound()) egprsmultislotclass().set_implicit_omit();
if (egprsextendeddynalloccap().is_bound()) egprsextendeddynalloccap().set_implicit_omit();
}

void MultislotCap__EGPRS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_egprsmultislotclass.encode_text(text_buf);
single_value->field_egprsextendeddynalloccap.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_GMM_SM_Types.MultislotCap_EGPRS.");
}
}

void MultislotCap__EGPRS_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_egprsmultislotclass.decode_text(text_buf);
single_value->field_egprsextendeddynalloccap.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 MultislotCap__EGPRS_template[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_GMM_SM_Types.MultislotCap_EGPRS.");
}
}

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

void MultislotCap__EGPRS_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_egprsmultislotclass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_EGPRS");
single_value->field_egprsextendeddynalloccap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_EGPRS");
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_GMM_SM_Types.MultislotCap_EGPRS");
}

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

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

MultislotCap__dtmgprsmultislotsubclass::MultislotCap__dtmgprsmultislotsubclass()
{
}

MultislotCap__dtmgprsmultislotsubclass::MultislotCap__dtmgprsmultislotsubclass(const BITSTRING& par_dtmgprsmultislotsubclass,
    const BITSTRING& par_singleSlotDTM,
    const BITSTRING& par_presenceBitDTM__EGPRSMultiSlot,
    const OPTIONAL< BITSTRING >& par_dTM__EGPRSMultiSlot)
  :   field_dtmgprsmultislotsubclass(par_dtmgprsmultislotsubclass),
  field_singleSlotDTM(par_singleSlotDTM),
  field_presenceBitDTM__EGPRSMultiSlot(par_presenceBitDTM__EGPRSMultiSlot),
  field_dTM__EGPRSMultiSlot(par_dTM__EGPRSMultiSlot)
{
}

MultislotCap__dtmgprsmultislotsubclass::MultislotCap__dtmgprsmultislotsubclass(const MultislotCap__dtmgprsmultislotsubclass& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
if (other_value.dtmgprsmultislotsubclass().is_bound()) field_dtmgprsmultislotsubclass = other_value.dtmgprsmultislotsubclass();
else field_dtmgprsmultislotsubclass.clean_up();
if (other_value.singleSlotDTM().is_bound()) field_singleSlotDTM = other_value.singleSlotDTM();
else field_singleSlotDTM.clean_up();
if (other_value.presenceBitDTM__EGPRSMultiSlot().is_bound()) field_presenceBitDTM__EGPRSMultiSlot = other_value.presenceBitDTM__EGPRSMultiSlot();
else field_presenceBitDTM__EGPRSMultiSlot.clean_up();
if (other_value.dTM__EGPRSMultiSlot().is_bound()) field_dTM__EGPRSMultiSlot = other_value.dTM__EGPRSMultiSlot();
else field_dTM__EGPRSMultiSlot.clean_up();
}

void MultislotCap__dtmgprsmultislotsubclass::clean_up()
{
field_dtmgprsmultislotsubclass.clean_up();
field_singleSlotDTM.clean_up();
field_presenceBitDTM__EGPRSMultiSlot.clean_up();
field_dTM__EGPRSMultiSlot.clean_up();
}

const TTCN_Typedescriptor_t* MultislotCap__dtmgprsmultislotsubclass::get_descriptor() const { return &MultislotCap__dtmgprsmultislotsubclass_descr_; }
MultislotCap__dtmgprsmultislotsubclass& MultislotCap__dtmgprsmultislotsubclass::operator=(const MultislotCap__dtmgprsmultislotsubclass& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
  if (other_value.dtmgprsmultislotsubclass().is_bound()) field_dtmgprsmultislotsubclass = other_value.dtmgprsmultislotsubclass();
  else field_dtmgprsmultislotsubclass.clean_up();
  if (other_value.singleSlotDTM().is_bound()) field_singleSlotDTM = other_value.singleSlotDTM();
  else field_singleSlotDTM.clean_up();
  if (other_value.presenceBitDTM__EGPRSMultiSlot().is_bound()) field_presenceBitDTM__EGPRSMultiSlot = other_value.presenceBitDTM__EGPRSMultiSlot();
  else field_presenceBitDTM__EGPRSMultiSlot.clean_up();
  if (other_value.dTM__EGPRSMultiSlot().is_bound()) field_dTM__EGPRSMultiSlot = other_value.dTM__EGPRSMultiSlot();
  else field_dTM__EGPRSMultiSlot.clean_up();
}
return *this;
}

boolean MultislotCap__dtmgprsmultislotsubclass::operator==(const MultislotCap__dtmgprsmultislotsubclass& other_value) const
{
return field_dtmgprsmultislotsubclass==other_value.field_dtmgprsmultislotsubclass
  && field_singleSlotDTM==other_value.field_singleSlotDTM
  && field_presenceBitDTM__EGPRSMultiSlot==other_value.field_presenceBitDTM__EGPRSMultiSlot
  && field_dTM__EGPRSMultiSlot==other_value.field_dTM__EGPRSMultiSlot;
}

boolean MultislotCap__dtmgprsmultislotsubclass::is_bound() const
{
return (field_dtmgprsmultislotsubclass.is_bound())
  || (field_singleSlotDTM.is_bound())
  || (field_presenceBitDTM__EGPRSMultiSlot.is_bound())
  || (OPTIONAL_OMIT == field_dTM__EGPRSMultiSlot.get_selection() || field_dTM__EGPRSMultiSlot.is_bound());
}
boolean MultislotCap__dtmgprsmultislotsubclass::is_value() const
{
return field_dtmgprsmultislotsubclass.is_value()
  && field_singleSlotDTM.is_value()
  && field_presenceBitDTM__EGPRSMultiSlot.is_value()
  && (OPTIONAL_OMIT == field_dTM__EGPRSMultiSlot.get_selection() || field_dTM__EGPRSMultiSlot.is_value());
}
int MultislotCap__dtmgprsmultislotsubclass::size_of() const
{
  int ret_val = 3;
  if (field_dTM__EGPRSMultiSlot.ispresent()) ret_val++;
  return ret_val;
}

void MultislotCap__dtmgprsmultislotsubclass::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dtmgprsmultislotsubclass := ");
field_dtmgprsmultislotsubclass.log();
TTCN_Logger::log_event_str(", singleSlotDTM := ");
field_singleSlotDTM.log();
TTCN_Logger::log_event_str(", presenceBitDTM_EGPRSMultiSlot := ");
field_presenceBitDTM__EGPRSMultiSlot.log();
TTCN_Logger::log_event_str(", dTM_EGPRSMultiSlot := ");
field_dTM__EGPRSMultiSlot.log();
TTCN_Logger::log_event_str(" }");
}

void MultislotCap__dtmgprsmultislotsubclass::set_implicit_omit()
{
if (dtmgprsmultislotsubclass().is_bound()) dtmgprsmultislotsubclass().set_implicit_omit();
if (singleSlotDTM().is_bound()) singleSlotDTM().set_implicit_omit();
if (presenceBitDTM__EGPRSMultiSlot().is_bound()) presenceBitDTM__EGPRSMultiSlot().set_implicit_omit();
if (!dTM__EGPRSMultiSlot().is_bound()) dTM__EGPRSMultiSlot() = OMIT_VALUE;
else dTM__EGPRSMultiSlot().set_implicit_omit();
}

void MultislotCap__dtmgprsmultislotsubclass::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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass 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) dtmgprsmultislotsubclass().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) singleSlotDTM().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTM__EGPRSMultiSlot().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dTM__EGPRSMultiSlot().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(), "dtmgprsmultislotsubclass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtmgprsmultislotsubclass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "singleSlotDTM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          singleSlotDTM().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitDTM_EGPRSMultiSlot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDTM__EGPRSMultiSlot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTM_EGPRSMultiSlot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTM__EGPRSMultiSlot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass");
  }
}

void MultislotCap__dtmgprsmultislotsubclass::encode_text(Text_Buf& text_buf) const
{
field_dtmgprsmultislotsubclass.encode_text(text_buf);
field_singleSlotDTM.encode_text(text_buf);
field_presenceBitDTM__EGPRSMultiSlot.encode_text(text_buf);
field_dTM__EGPRSMultiSlot.encode_text(text_buf);
}

void MultislotCap__dtmgprsmultislotsubclass::decode_text(Text_Buf& text_buf)
{
field_dtmgprsmultislotsubclass.decode_text(text_buf);
field_singleSlotDTM.decode_text(text_buf);
field_presenceBitDTM__EGPRSMultiSlot.decode_text(text_buf);
field_dTM__EGPRSMultiSlot.decode_text(text_buf);
}

void MultislotCap__dtmgprsmultislotsubclass::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 MultislotCap__dtmgprsmultislotsubclass::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 MultislotCap__dtmgprsmultislotsubclass::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, MultislotCap__dtmgprsmultislotsubclass_dtmgprsmultislotsubclass_descr_.raw->forceomit);
  decoded_field_length = field_dtmgprsmultislotsubclass.RAW_decode(MultislotCap__dtmgprsmultislotsubclass_dtmgprsmultislotsubclass_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, MultislotCap__dtmgprsmultislotsubclass_singleSlotDTM_descr_.raw->forceomit);
  decoded_field_length = field_singleSlotDTM.RAW_decode(MultislotCap__dtmgprsmultislotsubclass_singleSlotDTM_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, MultislotCap__dtmgprsmultislotsubclass_presenceBitDTM__EGPRSMultiSlot_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitDTM__EGPRSMultiSlot.RAW_decode(MultislotCap__dtmgprsmultislotsubclass_presenceBitDTM__EGPRSMultiSlot_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_presenceBitDTM__EGPRSMultiSlot ==  bs_2){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_dTM__EGPRSMultiSlot = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MultislotCap__dtmgprsmultislotsubclass_dTM__EGPRSMultiSlot_descr_.raw->forceomit);
  decoded_field_length = field_dTM__EGPRSMultiSlot().RAW_decode(MultislotCap__dtmgprsmultislotsubclass_dTM__EGPRSMultiSlot_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_dTM__EGPRSMultiSlot = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dTM__EGPRSMultiSlot=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MultislotCap__dtmgprsmultislotsubclass::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, MultislotCap__dtmgprsmultislotsubclass_dtmgprsmultislotsubclass_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap__dtmgprsmultislotsubclass_singleSlotDTM_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MultislotCap__dtmgprsmultislotsubclass_presenceBitDTM__EGPRSMultiSlot_descr_.raw);
  if (field_dTM__EGPRSMultiSlot.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MultislotCap__dtmgprsmultislotsubclass_dTM__EGPRSMultiSlot_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_dtmgprsmultislotsubclass.RAW_encode(MultislotCap__dtmgprsmultislotsubclass_dtmgprsmultislotsubclass_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_singleSlotDTM.RAW_encode(MultislotCap__dtmgprsmultislotsubclass_singleSlotDTM_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_presenceBitDTM__EGPRSMultiSlot.RAW_encode(MultislotCap__dtmgprsmultislotsubclass_presenceBitDTM__EGPRSMultiSlot_descr_, *myleaf.body.node.nodes[2]);
  if (field_dTM__EGPRSMultiSlot.ispresent()) {
  encoded_length += field_dTM__EGPRSMultiSlot().RAW_encode(MultislotCap__dtmgprsmultislotsubclass_dTM__EGPRSMultiSlot_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_dTM__EGPRSMultiSlot.ispresent() && (field_presenceBitDTM__EGPRSMultiSlot !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  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_2.RAW_encode(MultislotCap__dtmgprsmultislotsubclass_presenceBitDTM__EGPRSMultiSlot_descr_,*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 MultislotCap__dtmgprsmultislotsubclass_template::single_value_struct {
BITSTRING_template field_dtmgprsmultislotsubclass;
BITSTRING_template field_singleSlotDTM;
BITSTRING_template field_presenceBitDTM__EGPRSMultiSlot;
BITSTRING_template field_dTM__EGPRSMultiSlot;
};

void MultislotCap__dtmgprsmultislotsubclass_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_dtmgprsmultislotsubclass = ANY_VALUE;
single_value->field_singleSlotDTM = ANY_VALUE;
single_value->field_presenceBitDTM__EGPRSMultiSlot = ANY_VALUE;
single_value->field_dTM__EGPRSMultiSlot = ANY_OR_OMIT;
}
}
}

void MultislotCap__dtmgprsmultislotsubclass_template::copy_value(const MultislotCap__dtmgprsmultislotsubclass& other_value)
{
single_value = new single_value_struct;
if (other_value.dtmgprsmultislotsubclass().is_bound()) {
  single_value->field_dtmgprsmultislotsubclass = other_value.dtmgprsmultislotsubclass();
} else {
  single_value->field_dtmgprsmultislotsubclass.clean_up();
}
if (other_value.singleSlotDTM().is_bound()) {
  single_value->field_singleSlotDTM = other_value.singleSlotDTM();
} else {
  single_value->field_singleSlotDTM.clean_up();
}
if (other_value.presenceBitDTM__EGPRSMultiSlot().is_bound()) {
  single_value->field_presenceBitDTM__EGPRSMultiSlot = other_value.presenceBitDTM__EGPRSMultiSlot();
} else {
  single_value->field_presenceBitDTM__EGPRSMultiSlot.clean_up();
}
if (other_value.dTM__EGPRSMultiSlot().is_bound()) {
  if (other_value.dTM__EGPRSMultiSlot().ispresent()) single_value->field_dTM__EGPRSMultiSlot = other_value.dTM__EGPRSMultiSlot()();
  else single_value->field_dTM__EGPRSMultiSlot = OMIT_VALUE;
} else {
  single_value->field_dTM__EGPRSMultiSlot.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MultislotCap__dtmgprsmultislotsubclass_template::copy_template(const MultislotCap__dtmgprsmultislotsubclass_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dtmgprsmultislotsubclass().get_selection()) {
single_value->field_dtmgprsmultislotsubclass = other_value.dtmgprsmultislotsubclass();
} else {
single_value->field_dtmgprsmultislotsubclass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.singleSlotDTM().get_selection()) {
single_value->field_singleSlotDTM = other_value.singleSlotDTM();
} else {
single_value->field_singleSlotDTM.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDTM__EGPRSMultiSlot().get_selection()) {
single_value->field_presenceBitDTM__EGPRSMultiSlot = other_value.presenceBitDTM__EGPRSMultiSlot();
} else {
single_value->field_presenceBitDTM__EGPRSMultiSlot.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dTM__EGPRSMultiSlot().get_selection()) {
single_value->field_dTM__EGPRSMultiSlot = other_value.dTM__EGPRSMultiSlot();
} else {
single_value->field_dTM__EGPRSMultiSlot.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 MultislotCap__dtmgprsmultislotsubclass_template[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 MultislotCap__dtmgprsmultislotsubclass_template(*other_value.implication_.precondition);
implication_.implied_template = new MultislotCap__dtmgprsmultislotsubclass_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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
break;
}
set_selection(other_value);
}

MultislotCap__dtmgprsmultislotsubclass_template::MultislotCap__dtmgprsmultislotsubclass_template()
{
}

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

MultislotCap__dtmgprsmultislotsubclass_template::MultislotCap__dtmgprsmultislotsubclass_template(const MultislotCap__dtmgprsmultislotsubclass& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MultislotCap__dtmgprsmultislotsubclass_template::match(const MultislotCap__dtmgprsmultislotsubclass& 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.dtmgprsmultislotsubclass().is_bound()) return FALSE;
if(!single_value->field_dtmgprsmultislotsubclass.match(other_value.dtmgprsmultislotsubclass(), legacy))return FALSE;
if(!other_value.singleSlotDTM().is_bound()) return FALSE;
if(!single_value->field_singleSlotDTM.match(other_value.singleSlotDTM(), legacy))return FALSE;
if(!other_value.presenceBitDTM__EGPRSMultiSlot().is_bound()) return FALSE;
if(!single_value->field_presenceBitDTM__EGPRSMultiSlot.match(other_value.presenceBitDTM__EGPRSMultiSlot(), legacy))return FALSE;
if(!other_value.dTM__EGPRSMultiSlot().is_bound()) return FALSE;
if((other_value.dTM__EGPRSMultiSlot().ispresent() ? !single_value->field_dTM__EGPRSMultiSlot.match((const BITSTRING&)other_value.dTM__EGPRSMultiSlot(), legacy) : !single_value->field_dTM__EGPRSMultiSlot.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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
}
return FALSE;
}

boolean MultislotCap__dtmgprsmultislotsubclass_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dtmgprsmultislotsubclass.is_bound()
 || single_value->field_singleSlotDTM.is_bound()
 || single_value->field_presenceBitDTM__EGPRSMultiSlot.is_bound()
 || (single_value->field_dTM__EGPRSMultiSlot.is_omit() || single_value->field_dTM__EGPRSMultiSlot.is_bound());
}

boolean MultislotCap__dtmgprsmultislotsubclass_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dtmgprsmultislotsubclass.is_value()
 && single_value->field_singleSlotDTM.is_value()
 && single_value->field_presenceBitDTM__EGPRSMultiSlot.is_value()
 && (single_value->field_dTM__EGPRSMultiSlot.is_omit() || single_value->field_dTM__EGPRSMultiSlot.is_value());
}

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

MultislotCap__dtmgprsmultislotsubclass MultislotCap__dtmgprsmultislotsubclass_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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
MultislotCap__dtmgprsmultislotsubclass ret_val;
if (single_value->field_dtmgprsmultislotsubclass.is_bound()) {
ret_val.dtmgprsmultislotsubclass() = single_value->field_dtmgprsmultislotsubclass.valueof();
}
if (single_value->field_singleSlotDTM.is_bound()) {
ret_val.singleSlotDTM() = single_value->field_singleSlotDTM.valueof();
}
if (single_value->field_presenceBitDTM__EGPRSMultiSlot.is_bound()) {
ret_val.presenceBitDTM__EGPRSMultiSlot() = single_value->field_presenceBitDTM__EGPRSMultiSlot.valueof();
}
if (single_value->field_dTM__EGPRSMultiSlot.is_omit()) ret_val.dTM__EGPRSMultiSlot() = OMIT_VALUE;
else if (single_value->field_dTM__EGPRSMultiSlot.is_bound()) {
ret_val.dTM__EGPRSMultiSlot() = single_value->field_dTM__EGPRSMultiSlot.valueof();
}
return ret_val;
}

void MultislotCap__dtmgprsmultislotsubclass_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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MultislotCap__dtmgprsmultislotsubclass_template[list_length];
}

MultislotCap__dtmgprsmultislotsubclass_template& MultislotCap__dtmgprsmultislotsubclass_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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
return value_list.list_value[list_index];
}

BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass_template::dtmgprsmultislotsubclass()
{
set_specific();
return single_value->field_dtmgprsmultislotsubclass;
}

const BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass_template::dtmgprsmultislotsubclass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dtmgprsmultislotsubclass of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
return single_value->field_dtmgprsmultislotsubclass;
}

BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass_template::singleSlotDTM()
{
set_specific();
return single_value->field_singleSlotDTM;
}

const BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass_template::singleSlotDTM() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field singleSlotDTM of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
return single_value->field_singleSlotDTM;
}

BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass_template::presenceBitDTM__EGPRSMultiSlot()
{
set_specific();
return single_value->field_presenceBitDTM__EGPRSMultiSlot;
}

const BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass_template::presenceBitDTM__EGPRSMultiSlot() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitDTM_EGPRSMultiSlot of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
return single_value->field_presenceBitDTM__EGPRSMultiSlot;
}

BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass_template::dTM__EGPRSMultiSlot()
{
set_specific();
return single_value->field_dTM__EGPRSMultiSlot;
}

const BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass_template::dTM__EGPRSMultiSlot() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTM_EGPRSMultiSlot of a non-specific template of type @MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
return single_value->field_dTM__EGPRSMultiSlot;
}

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

void MultislotCap__dtmgprsmultislotsubclass_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dtmgprsmultislotsubclass := ");
single_value->field_dtmgprsmultislotsubclass.log();
TTCN_Logger::log_event_str(", singleSlotDTM := ");
single_value->field_singleSlotDTM.log();
TTCN_Logger::log_event_str(", presenceBitDTM_EGPRSMultiSlot := ");
single_value->field_presenceBitDTM__EGPRSMultiSlot.log();
TTCN_Logger::log_event_str(", dTM_EGPRSMultiSlot := ");
single_value->field_dTM__EGPRSMultiSlot.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 MultislotCap__dtmgprsmultislotsubclass_template::log_match(const MultislotCap__dtmgprsmultislotsubclass& 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_dtmgprsmultislotsubclass.match(match_value.dtmgprsmultislotsubclass(), legacy)){
TTCN_Logger::log_logmatch_info(".dtmgprsmultislotsubclass");
single_value->field_dtmgprsmultislotsubclass.log_match(match_value.dtmgprsmultislotsubclass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_singleSlotDTM.match(match_value.singleSlotDTM(), legacy)){
TTCN_Logger::log_logmatch_info(".singleSlotDTM");
single_value->field_singleSlotDTM.log_match(match_value.singleSlotDTM(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitDTM__EGPRSMultiSlot.match(match_value.presenceBitDTM__EGPRSMultiSlot(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitDTM_EGPRSMultiSlot");
single_value->field_presenceBitDTM__EGPRSMultiSlot.log_match(match_value.presenceBitDTM__EGPRSMultiSlot(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dTM__EGPRSMultiSlot().ispresent()){
if(!single_value->field_dTM__EGPRSMultiSlot.match(match_value.dTM__EGPRSMultiSlot(), legacy)){
TTCN_Logger::log_logmatch_info(".dTM_EGPRSMultiSlot");
single_value->field_dTM__EGPRSMultiSlot.log_match(match_value.dTM__EGPRSMultiSlot(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dTM__EGPRSMultiSlot.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dTM_EGPRSMultiSlot := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dTM__EGPRSMultiSlot.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("{ dtmgprsmultislotsubclass := ");
single_value->field_dtmgprsmultislotsubclass.log_match(match_value.dtmgprsmultislotsubclass(), legacy);
TTCN_Logger::log_event_str(", singleSlotDTM := ");
single_value->field_singleSlotDTM.log_match(match_value.singleSlotDTM(), legacy);
TTCN_Logger::log_event_str(", presenceBitDTM_EGPRSMultiSlot := ");
single_value->field_presenceBitDTM__EGPRSMultiSlot.log_match(match_value.presenceBitDTM__EGPRSMultiSlot(), legacy);
TTCN_Logger::log_event_str(", dTM_EGPRSMultiSlot := ");
if (match_value.dTM__EGPRSMultiSlot().ispresent()) {
single_value->field_dTM__EGPRSMultiSlot.log_match(match_value.dTM__EGPRSMultiSlot(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dTM__EGPRSMultiSlot.log();
if (single_value->field_dTM__EGPRSMultiSlot.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 MultislotCap__dtmgprsmultislotsubclass_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dtmgprsmultislotsubclass().is_bound()) dtmgprsmultislotsubclass().set_implicit_omit();
if (singleSlotDTM().is_bound()) singleSlotDTM().set_implicit_omit();
if (presenceBitDTM__EGPRSMultiSlot().is_bound()) presenceBitDTM__EGPRSMultiSlot().set_implicit_omit();
if (!dTM__EGPRSMultiSlot().is_bound()) dTM__EGPRSMultiSlot() = OMIT_VALUE;
else dTM__EGPRSMultiSlot().set_implicit_omit();
}

void MultislotCap__dtmgprsmultislotsubclass_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dtmgprsmultislotsubclass.encode_text(text_buf);
single_value->field_singleSlotDTM.encode_text(text_buf);
single_value->field_presenceBitDTM__EGPRSMultiSlot.encode_text(text_buf);
single_value->field_dTM__EGPRSMultiSlot.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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
}
}

void MultislotCap__dtmgprsmultislotsubclass_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_dtmgprsmultislotsubclass.decode_text(text_buf);
single_value->field_singleSlotDTM.decode_text(text_buf);
single_value->field_presenceBitDTM__EGPRSMultiSlot.decode_text(text_buf);
single_value->field_dTM__EGPRSMultiSlot.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 MultislotCap__dtmgprsmultislotsubclass_template[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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass.");
}
}

void MultislotCap__dtmgprsmultislotsubclass_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: {
    MultislotCap__dtmgprsmultislotsubclass_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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass 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) dtmgprsmultislotsubclass().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) singleSlotDTM().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTM__EGPRSMultiSlot().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dTM__EGPRSMultiSlot().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(), "dtmgprsmultislotsubclass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtmgprsmultislotsubclass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "singleSlotDTM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          singleSlotDTM().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitDTM_EGPRSMultiSlot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDTM__EGPRSMultiSlot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTM_EGPRSMultiSlot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTM__EGPRSMultiSlot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MultislotCap__dtmgprsmultislotsubclass_template* precondition = new MultislotCap__dtmgprsmultislotsubclass_template;
    precondition->set_param(*param.get_elem(0));
    MultislotCap__dtmgprsmultislotsubclass_template* implied_template = new MultislotCap__dtmgprsmultislotsubclass_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MultislotCap__dtmgprsmultislotsubclass_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass");
  }
  is_ifpresent = param.get_ifpresent();
}

void MultislotCap__dtmgprsmultislotsubclass_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_dtmgprsmultislotsubclass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass");
single_value->field_singleSlotDTM.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass");
single_value->field_presenceBitDTM__EGPRSMultiSlot.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass");
single_value->field_dTM__EGPRSMultiSlot.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass");
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_GMM_SM_Types.MultislotCap_dtmgprsmultislotsubclass");
}

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

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

AccessCapAdditionsRel99::AccessCapAdditionsRel99()
{
}

AccessCapAdditionsRel99::AccessCapAdditionsRel99(const BITSTRING& par_presenceBitPskpow,
    const OPTIONAL< BITSTRING >& par_pskpowercap,
    const BITSTRING& par_compactIntMeasurCap,
    const BITSTRING& par_revisionLevelInd,
    const BITSTRING& par_umtsfddRadAccTechCap,
    const BITSTRING& par_umtstddRadAccTechCap,
    const BITSTRING& par_cdma2kRadAccTechCap)
  :   field_presenceBitPskpow(par_presenceBitPskpow),
  field_pskpowercap(par_pskpowercap),
  field_compactIntMeasurCap(par_compactIntMeasurCap),
  field_revisionLevelInd(par_revisionLevelInd),
  field_umtsfddRadAccTechCap(par_umtsfddRadAccTechCap),
  field_umtstddRadAccTechCap(par_umtstddRadAccTechCap),
  field_cdma2kRadAccTechCap(par_cdma2kRadAccTechCap)
{
}

AccessCapAdditionsRel99::AccessCapAdditionsRel99(const AccessCapAdditionsRel99& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
if (other_value.presenceBitPskpow().is_bound()) field_presenceBitPskpow = other_value.presenceBitPskpow();
else field_presenceBitPskpow.clean_up();
if (other_value.pskpowercap().is_bound()) field_pskpowercap = other_value.pskpowercap();
else field_pskpowercap.clean_up();
if (other_value.compactIntMeasurCap().is_bound()) field_compactIntMeasurCap = other_value.compactIntMeasurCap();
else field_compactIntMeasurCap.clean_up();
if (other_value.revisionLevelInd().is_bound()) field_revisionLevelInd = other_value.revisionLevelInd();
else field_revisionLevelInd.clean_up();
if (other_value.umtsfddRadAccTechCap().is_bound()) field_umtsfddRadAccTechCap = other_value.umtsfddRadAccTechCap();
else field_umtsfddRadAccTechCap.clean_up();
if (other_value.umtstddRadAccTechCap().is_bound()) field_umtstddRadAccTechCap = other_value.umtstddRadAccTechCap();
else field_umtstddRadAccTechCap.clean_up();
if (other_value.cdma2kRadAccTechCap().is_bound()) field_cdma2kRadAccTechCap = other_value.cdma2kRadAccTechCap();
else field_cdma2kRadAccTechCap.clean_up();
}

void AccessCapAdditionsRel99::clean_up()
{
field_presenceBitPskpow.clean_up();
field_pskpowercap.clean_up();
field_compactIntMeasurCap.clean_up();
field_revisionLevelInd.clean_up();
field_umtsfddRadAccTechCap.clean_up();
field_umtstddRadAccTechCap.clean_up();
field_cdma2kRadAccTechCap.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel99::get_descriptor() const { return &AccessCapAdditionsRel99_descr_; }
AccessCapAdditionsRel99& AccessCapAdditionsRel99::operator=(const AccessCapAdditionsRel99& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
  if (other_value.presenceBitPskpow().is_bound()) field_presenceBitPskpow = other_value.presenceBitPskpow();
  else field_presenceBitPskpow.clean_up();
  if (other_value.pskpowercap().is_bound()) field_pskpowercap = other_value.pskpowercap();
  else field_pskpowercap.clean_up();
  if (other_value.compactIntMeasurCap().is_bound()) field_compactIntMeasurCap = other_value.compactIntMeasurCap();
  else field_compactIntMeasurCap.clean_up();
  if (other_value.revisionLevelInd().is_bound()) field_revisionLevelInd = other_value.revisionLevelInd();
  else field_revisionLevelInd.clean_up();
  if (other_value.umtsfddRadAccTechCap().is_bound()) field_umtsfddRadAccTechCap = other_value.umtsfddRadAccTechCap();
  else field_umtsfddRadAccTechCap.clean_up();
  if (other_value.umtstddRadAccTechCap().is_bound()) field_umtstddRadAccTechCap = other_value.umtstddRadAccTechCap();
  else field_umtstddRadAccTechCap.clean_up();
  if (other_value.cdma2kRadAccTechCap().is_bound()) field_cdma2kRadAccTechCap = other_value.cdma2kRadAccTechCap();
  else field_cdma2kRadAccTechCap.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel99::operator==(const AccessCapAdditionsRel99& other_value) const
{
return field_presenceBitPskpow==other_value.field_presenceBitPskpow
  && field_pskpowercap==other_value.field_pskpowercap
  && field_compactIntMeasurCap==other_value.field_compactIntMeasurCap
  && field_revisionLevelInd==other_value.field_revisionLevelInd
  && field_umtsfddRadAccTechCap==other_value.field_umtsfddRadAccTechCap
  && field_umtstddRadAccTechCap==other_value.field_umtstddRadAccTechCap
  && field_cdma2kRadAccTechCap==other_value.field_cdma2kRadAccTechCap;
}

boolean AccessCapAdditionsRel99::is_bound() const
{
return (field_presenceBitPskpow.is_bound())
  || (OPTIONAL_OMIT == field_pskpowercap.get_selection() || field_pskpowercap.is_bound())
  || (field_compactIntMeasurCap.is_bound())
  || (field_revisionLevelInd.is_bound())
  || (field_umtsfddRadAccTechCap.is_bound())
  || (field_umtstddRadAccTechCap.is_bound())
  || (field_cdma2kRadAccTechCap.is_bound());
}
boolean AccessCapAdditionsRel99::is_value() const
{
return field_presenceBitPskpow.is_value()
  && (OPTIONAL_OMIT == field_pskpowercap.get_selection() || field_pskpowercap.is_value())
  && field_compactIntMeasurCap.is_value()
  && field_revisionLevelInd.is_value()
  && field_umtsfddRadAccTechCap.is_value()
  && field_umtstddRadAccTechCap.is_value()
  && field_cdma2kRadAccTechCap.is_value();
}
int AccessCapAdditionsRel99::size_of() const
{
  int ret_val = 6;
  if (field_pskpowercap.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsRel99::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ presenceBitPskpow := ");
field_presenceBitPskpow.log();
TTCN_Logger::log_event_str(", pskpowercap := ");
field_pskpowercap.log();
TTCN_Logger::log_event_str(", compactIntMeasurCap := ");
field_compactIntMeasurCap.log();
TTCN_Logger::log_event_str(", revisionLevelInd := ");
field_revisionLevelInd.log();
TTCN_Logger::log_event_str(", umtsfddRadAccTechCap := ");
field_umtsfddRadAccTechCap.log();
TTCN_Logger::log_event_str(", umtstddRadAccTechCap := ");
field_umtstddRadAccTechCap.log();
TTCN_Logger::log_event_str(", cdma2kRadAccTechCap := ");
field_cdma2kRadAccTechCap.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel99::set_implicit_omit()
{
if (presenceBitPskpow().is_bound()) presenceBitPskpow().set_implicit_omit();
if (!pskpowercap().is_bound()) pskpowercap() = OMIT_VALUE;
else pskpowercap().set_implicit_omit();
if (compactIntMeasurCap().is_bound()) compactIntMeasurCap().set_implicit_omit();
if (revisionLevelInd().is_bound()) revisionLevelInd().set_implicit_omit();
if (umtsfddRadAccTechCap().is_bound()) umtsfddRadAccTechCap().set_implicit_omit();
if (umtstddRadAccTechCap().is_bound()) umtstddRadAccTechCap().set_implicit_omit();
if (cdma2kRadAccTechCap().is_bound()) cdma2kRadAccTechCap().set_implicit_omit();
}

void AccessCapAdditionsRel99::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_GMM_SM_Types.AccessCapAdditionsRel99 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) presenceBitPskpow().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pskpowercap().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) compactIntMeasurCap().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) revisionLevelInd().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) umtsfddRadAccTechCap().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) umtstddRadAccTechCap().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cdma2kRadAccTechCap().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(), "presenceBitPskpow")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitPskpow().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pskpowercap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pskpowercap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "compactIntMeasurCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          compactIntMeasurCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevelInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevelInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "umtsfddRadAccTechCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          umtsfddRadAccTechCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "umtstddRadAccTechCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          umtstddRadAccTechCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cdma2kRadAccTechCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cdma2kRadAccTechCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel99");
  }
}

void AccessCapAdditionsRel99::encode_text(Text_Buf& text_buf) const
{
field_presenceBitPskpow.encode_text(text_buf);
field_pskpowercap.encode_text(text_buf);
field_compactIntMeasurCap.encode_text(text_buf);
field_revisionLevelInd.encode_text(text_buf);
field_umtsfddRadAccTechCap.encode_text(text_buf);
field_umtstddRadAccTechCap.encode_text(text_buf);
field_cdma2kRadAccTechCap.encode_text(text_buf);
}

void AccessCapAdditionsRel99::decode_text(Text_Buf& text_buf)
{
field_presenceBitPskpow.decode_text(text_buf);
field_pskpowercap.decode_text(text_buf);
field_compactIntMeasurCap.decode_text(text_buf);
field_revisionLevelInd.decode_text(text_buf);
field_umtsfddRadAccTechCap.decode_text(text_buf);
field_umtstddRadAccTechCap.decode_text(text_buf);
field_cdma2kRadAccTechCap.decode_text(text_buf);
}

void AccessCapAdditionsRel99::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 AccessCapAdditionsRel99::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 AccessCapAdditionsRel99::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, AccessCapAdditionsRel99_presenceBitPskpow_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitPskpow.RAW_decode(AccessCapAdditionsRel99_presenceBitPskpow_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 && field_presenceBitPskpow ==  bs_2){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_pskpowercap = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel99_pskpowercap_descr_.raw->forceomit);
  decoded_field_length = field_pskpowercap().RAW_decode(AccessCapAdditionsRel99_pskpowercap_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_pskpowercap = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pskpowercap=OMIT_VALUE;
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel99_compactIntMeasurCap_descr_.raw->forceomit);
  decoded_field_length = field_compactIntMeasurCap.RAW_decode(AccessCapAdditionsRel99_compactIntMeasurCap_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, AccessCapAdditionsRel99_revisionLevelInd_descr_.raw->forceomit);
  decoded_field_length = field_revisionLevelInd.RAW_decode(AccessCapAdditionsRel99_revisionLevelInd_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, AccessCapAdditionsRel99_umtsfddRadAccTechCap_descr_.raw->forceomit);
  decoded_field_length = field_umtsfddRadAccTechCap.RAW_decode(AccessCapAdditionsRel99_umtsfddRadAccTechCap_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, AccessCapAdditionsRel99_umtstddRadAccTechCap_descr_.raw->forceomit);
  decoded_field_length = field_umtstddRadAccTechCap.RAW_decode(AccessCapAdditionsRel99_umtstddRadAccTechCap_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, AccessCapAdditionsRel99_cdma2kRadAccTechCap_descr_.raw->forceomit);
  decoded_field_length = field_cdma2kRadAccTechCap.RAW_decode(AccessCapAdditionsRel99_cdma2kRadAccTechCap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel99::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, AccessCapAdditionsRel99_presenceBitPskpow_descr_.raw);
  if (field_pskpowercap.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel99_pskpowercap_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel99_compactIntMeasurCap_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel99_revisionLevelInd_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel99_umtsfddRadAccTechCap_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel99_umtstddRadAccTechCap_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AccessCapAdditionsRel99_cdma2kRadAccTechCap_descr_.raw);
  encoded_length += field_presenceBitPskpow.RAW_encode(AccessCapAdditionsRel99_presenceBitPskpow_descr_, *myleaf.body.node.nodes[0]);
  if (field_pskpowercap.ispresent()) {
  encoded_length += field_pskpowercap().RAW_encode(AccessCapAdditionsRel99_pskpowercap_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_compactIntMeasurCap.RAW_encode(AccessCapAdditionsRel99_compactIntMeasurCap_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_revisionLevelInd.RAW_encode(AccessCapAdditionsRel99_revisionLevelInd_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_umtsfddRadAccTechCap.RAW_encode(AccessCapAdditionsRel99_umtsfddRadAccTechCap_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_umtstddRadAccTechCap.RAW_encode(AccessCapAdditionsRel99_umtstddRadAccTechCap_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_cdma2kRadAccTechCap.RAW_encode(AccessCapAdditionsRel99_cdma2kRadAccTechCap_descr_, *myleaf.body.node.nodes[6]);
  if (field_pskpowercap.ispresent() && (field_presenceBitPskpow !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  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_2.RAW_encode(AccessCapAdditionsRel99_presenceBitPskpow_descr_,*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 AccessCapAdditionsRel99_template::single_value_struct {
BITSTRING_template field_presenceBitPskpow;
BITSTRING_template field_pskpowercap;
BITSTRING_template field_compactIntMeasurCap;
BITSTRING_template field_revisionLevelInd;
BITSTRING_template field_umtsfddRadAccTechCap;
BITSTRING_template field_umtstddRadAccTechCap;
BITSTRING_template field_cdma2kRadAccTechCap;
};

void AccessCapAdditionsRel99_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_presenceBitPskpow = ANY_VALUE;
single_value->field_pskpowercap = ANY_OR_OMIT;
single_value->field_compactIntMeasurCap = ANY_VALUE;
single_value->field_revisionLevelInd = ANY_VALUE;
single_value->field_umtsfddRadAccTechCap = ANY_VALUE;
single_value->field_umtstddRadAccTechCap = ANY_VALUE;
single_value->field_cdma2kRadAccTechCap = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel99_template::copy_value(const AccessCapAdditionsRel99& other_value)
{
single_value = new single_value_struct;
if (other_value.presenceBitPskpow().is_bound()) {
  single_value->field_presenceBitPskpow = other_value.presenceBitPskpow();
} else {
  single_value->field_presenceBitPskpow.clean_up();
}
if (other_value.pskpowercap().is_bound()) {
  if (other_value.pskpowercap().ispresent()) single_value->field_pskpowercap = other_value.pskpowercap()();
  else single_value->field_pskpowercap = OMIT_VALUE;
} else {
  single_value->field_pskpowercap.clean_up();
}
if (other_value.compactIntMeasurCap().is_bound()) {
  single_value->field_compactIntMeasurCap = other_value.compactIntMeasurCap();
} else {
  single_value->field_compactIntMeasurCap.clean_up();
}
if (other_value.revisionLevelInd().is_bound()) {
  single_value->field_revisionLevelInd = other_value.revisionLevelInd();
} else {
  single_value->field_revisionLevelInd.clean_up();
}
if (other_value.umtsfddRadAccTechCap().is_bound()) {
  single_value->field_umtsfddRadAccTechCap = other_value.umtsfddRadAccTechCap();
} else {
  single_value->field_umtsfddRadAccTechCap.clean_up();
}
if (other_value.umtstddRadAccTechCap().is_bound()) {
  single_value->field_umtstddRadAccTechCap = other_value.umtstddRadAccTechCap();
} else {
  single_value->field_umtstddRadAccTechCap.clean_up();
}
if (other_value.cdma2kRadAccTechCap().is_bound()) {
  single_value->field_cdma2kRadAccTechCap = other_value.cdma2kRadAccTechCap();
} else {
  single_value->field_cdma2kRadAccTechCap.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel99_template::copy_template(const AccessCapAdditionsRel99_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitPskpow().get_selection()) {
single_value->field_presenceBitPskpow = other_value.presenceBitPskpow();
} else {
single_value->field_presenceBitPskpow.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pskpowercap().get_selection()) {
single_value->field_pskpowercap = other_value.pskpowercap();
} else {
single_value->field_pskpowercap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.compactIntMeasurCap().get_selection()) {
single_value->field_compactIntMeasurCap = other_value.compactIntMeasurCap();
} else {
single_value->field_compactIntMeasurCap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.revisionLevelInd().get_selection()) {
single_value->field_revisionLevelInd = other_value.revisionLevelInd();
} else {
single_value->field_revisionLevelInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.umtsfddRadAccTechCap().get_selection()) {
single_value->field_umtsfddRadAccTechCap = other_value.umtsfddRadAccTechCap();
} else {
single_value->field_umtsfddRadAccTechCap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.umtstddRadAccTechCap().get_selection()) {
single_value->field_umtstddRadAccTechCap = other_value.umtstddRadAccTechCap();
} else {
single_value->field_umtstddRadAccTechCap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cdma2kRadAccTechCap().get_selection()) {
single_value->field_cdma2kRadAccTechCap = other_value.cdma2kRadAccTechCap();
} else {
single_value->field_cdma2kRadAccTechCap.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 AccessCapAdditionsRel99_template[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 AccessCapAdditionsRel99_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel99_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_GMM_SM_Types.AccessCapAdditionsRel99.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel99_template::AccessCapAdditionsRel99_template()
{
}

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

AccessCapAdditionsRel99_template::AccessCapAdditionsRel99_template(const AccessCapAdditionsRel99& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel99_template::match(const AccessCapAdditionsRel99& 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.presenceBitPskpow().is_bound()) return FALSE;
if(!single_value->field_presenceBitPskpow.match(other_value.presenceBitPskpow(), legacy))return FALSE;
if(!other_value.pskpowercap().is_bound()) return FALSE;
if((other_value.pskpowercap().ispresent() ? !single_value->field_pskpowercap.match((const BITSTRING&)other_value.pskpowercap(), legacy) : !single_value->field_pskpowercap.match_omit(legacy)))return FALSE;
if(!other_value.compactIntMeasurCap().is_bound()) return FALSE;
if(!single_value->field_compactIntMeasurCap.match(other_value.compactIntMeasurCap(), legacy))return FALSE;
if(!other_value.revisionLevelInd().is_bound()) return FALSE;
if(!single_value->field_revisionLevelInd.match(other_value.revisionLevelInd(), legacy))return FALSE;
if(!other_value.umtsfddRadAccTechCap().is_bound()) return FALSE;
if(!single_value->field_umtsfddRadAccTechCap.match(other_value.umtsfddRadAccTechCap(), legacy))return FALSE;
if(!other_value.umtstddRadAccTechCap().is_bound()) return FALSE;
if(!single_value->field_umtstddRadAccTechCap.match(other_value.umtstddRadAccTechCap(), legacy))return FALSE;
if(!other_value.cdma2kRadAccTechCap().is_bound()) return FALSE;
if(!single_value->field_cdma2kRadAccTechCap.match(other_value.cdma2kRadAccTechCap(), 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_GMM_SM_Types.AccessCapAdditionsRel99.");
}
return FALSE;
}

boolean AccessCapAdditionsRel99_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_presenceBitPskpow.is_bound()
 || (single_value->field_pskpowercap.is_omit() || single_value->field_pskpowercap.is_bound())
 || single_value->field_compactIntMeasurCap.is_bound()
 || single_value->field_revisionLevelInd.is_bound()
 || single_value->field_umtsfddRadAccTechCap.is_bound()
 || single_value->field_umtstddRadAccTechCap.is_bound()
 || single_value->field_cdma2kRadAccTechCap.is_bound();
}

boolean AccessCapAdditionsRel99_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_presenceBitPskpow.is_value()
 && (single_value->field_pskpowercap.is_omit() || single_value->field_pskpowercap.is_value())
 && single_value->field_compactIntMeasurCap.is_value()
 && single_value->field_revisionLevelInd.is_value()
 && single_value->field_umtsfddRadAccTechCap.is_value()
 && single_value->field_umtstddRadAccTechCap.is_value()
 && single_value->field_cdma2kRadAccTechCap.is_value();
}

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

AccessCapAdditionsRel99 AccessCapAdditionsRel99_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_GMM_SM_Types.AccessCapAdditionsRel99.");
AccessCapAdditionsRel99 ret_val;
if (single_value->field_presenceBitPskpow.is_bound()) {
ret_val.presenceBitPskpow() = single_value->field_presenceBitPskpow.valueof();
}
if (single_value->field_pskpowercap.is_omit()) ret_val.pskpowercap() = OMIT_VALUE;
else if (single_value->field_pskpowercap.is_bound()) {
ret_val.pskpowercap() = single_value->field_pskpowercap.valueof();
}
if (single_value->field_compactIntMeasurCap.is_bound()) {
ret_val.compactIntMeasurCap() = single_value->field_compactIntMeasurCap.valueof();
}
if (single_value->field_revisionLevelInd.is_bound()) {
ret_val.revisionLevelInd() = single_value->field_revisionLevelInd.valueof();
}
if (single_value->field_umtsfddRadAccTechCap.is_bound()) {
ret_val.umtsfddRadAccTechCap() = single_value->field_umtsfddRadAccTechCap.valueof();
}
if (single_value->field_umtstddRadAccTechCap.is_bound()) {
ret_val.umtstddRadAccTechCap() = single_value->field_umtstddRadAccTechCap.valueof();
}
if (single_value->field_cdma2kRadAccTechCap.is_bound()) {
ret_val.cdma2kRadAccTechCap() = single_value->field_cdma2kRadAccTechCap.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel99_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_GMM_SM_Types.AccessCapAdditionsRel99.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel99_template[list_length];
}

AccessCapAdditionsRel99_template& AccessCapAdditionsRel99_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_GMM_SM_Types.AccessCapAdditionsRel99.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel99_template::presenceBitPskpow()
{
set_specific();
return single_value->field_presenceBitPskpow;
}

const BITSTRING_template& AccessCapAdditionsRel99_template::presenceBitPskpow() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitPskpow of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
return single_value->field_presenceBitPskpow;
}

BITSTRING_template& AccessCapAdditionsRel99_template::pskpowercap()
{
set_specific();
return single_value->field_pskpowercap;
}

const BITSTRING_template& AccessCapAdditionsRel99_template::pskpowercap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pskpowercap of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
return single_value->field_pskpowercap;
}

BITSTRING_template& AccessCapAdditionsRel99_template::compactIntMeasurCap()
{
set_specific();
return single_value->field_compactIntMeasurCap;
}

const BITSTRING_template& AccessCapAdditionsRel99_template::compactIntMeasurCap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field compactIntMeasurCap of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
return single_value->field_compactIntMeasurCap;
}

BITSTRING_template& AccessCapAdditionsRel99_template::revisionLevelInd()
{
set_specific();
return single_value->field_revisionLevelInd;
}

const BITSTRING_template& AccessCapAdditionsRel99_template::revisionLevelInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field revisionLevelInd of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
return single_value->field_revisionLevelInd;
}

BITSTRING_template& AccessCapAdditionsRel99_template::umtsfddRadAccTechCap()
{
set_specific();
return single_value->field_umtsfddRadAccTechCap;
}

const BITSTRING_template& AccessCapAdditionsRel99_template::umtsfddRadAccTechCap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field umtsfddRadAccTechCap of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
return single_value->field_umtsfddRadAccTechCap;
}

BITSTRING_template& AccessCapAdditionsRel99_template::umtstddRadAccTechCap()
{
set_specific();
return single_value->field_umtstddRadAccTechCap;
}

const BITSTRING_template& AccessCapAdditionsRel99_template::umtstddRadAccTechCap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field umtstddRadAccTechCap of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
return single_value->field_umtstddRadAccTechCap;
}

BITSTRING_template& AccessCapAdditionsRel99_template::cdma2kRadAccTechCap()
{
set_specific();
return single_value->field_cdma2kRadAccTechCap;
}

const BITSTRING_template& AccessCapAdditionsRel99_template::cdma2kRadAccTechCap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cdma2kRadAccTechCap of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99.");
return single_value->field_cdma2kRadAccTechCap;
}

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

void AccessCapAdditionsRel99_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ presenceBitPskpow := ");
single_value->field_presenceBitPskpow.log();
TTCN_Logger::log_event_str(", pskpowercap := ");
single_value->field_pskpowercap.log();
TTCN_Logger::log_event_str(", compactIntMeasurCap := ");
single_value->field_compactIntMeasurCap.log();
TTCN_Logger::log_event_str(", revisionLevelInd := ");
single_value->field_revisionLevelInd.log();
TTCN_Logger::log_event_str(", umtsfddRadAccTechCap := ");
single_value->field_umtsfddRadAccTechCap.log();
TTCN_Logger::log_event_str(", umtstddRadAccTechCap := ");
single_value->field_umtstddRadAccTechCap.log();
TTCN_Logger::log_event_str(", cdma2kRadAccTechCap := ");
single_value->field_cdma2kRadAccTechCap.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 AccessCapAdditionsRel99_template::log_match(const AccessCapAdditionsRel99& 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_presenceBitPskpow.match(match_value.presenceBitPskpow(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitPskpow");
single_value->field_presenceBitPskpow.log_match(match_value.presenceBitPskpow(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pskpowercap().ispresent()){
if(!single_value->field_pskpowercap.match(match_value.pskpowercap(), legacy)){
TTCN_Logger::log_logmatch_info(".pskpowercap");
single_value->field_pskpowercap.log_match(match_value.pskpowercap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pskpowercap.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pskpowercap := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pskpowercap.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_compactIntMeasurCap.match(match_value.compactIntMeasurCap(), legacy)){
TTCN_Logger::log_logmatch_info(".compactIntMeasurCap");
single_value->field_compactIntMeasurCap.log_match(match_value.compactIntMeasurCap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_revisionLevelInd.match(match_value.revisionLevelInd(), legacy)){
TTCN_Logger::log_logmatch_info(".revisionLevelInd");
single_value->field_revisionLevelInd.log_match(match_value.revisionLevelInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_umtsfddRadAccTechCap.match(match_value.umtsfddRadAccTechCap(), legacy)){
TTCN_Logger::log_logmatch_info(".umtsfddRadAccTechCap");
single_value->field_umtsfddRadAccTechCap.log_match(match_value.umtsfddRadAccTechCap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_umtstddRadAccTechCap.match(match_value.umtstddRadAccTechCap(), legacy)){
TTCN_Logger::log_logmatch_info(".umtstddRadAccTechCap");
single_value->field_umtstddRadAccTechCap.log_match(match_value.umtstddRadAccTechCap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cdma2kRadAccTechCap.match(match_value.cdma2kRadAccTechCap(), legacy)){
TTCN_Logger::log_logmatch_info(".cdma2kRadAccTechCap");
single_value->field_cdma2kRadAccTechCap.log_match(match_value.cdma2kRadAccTechCap(), 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("{ presenceBitPskpow := ");
single_value->field_presenceBitPskpow.log_match(match_value.presenceBitPskpow(), legacy);
TTCN_Logger::log_event_str(", pskpowercap := ");
if (match_value.pskpowercap().ispresent()) {
single_value->field_pskpowercap.log_match(match_value.pskpowercap(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pskpowercap.log();
if (single_value->field_pskpowercap.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", compactIntMeasurCap := ");
single_value->field_compactIntMeasurCap.log_match(match_value.compactIntMeasurCap(), legacy);
TTCN_Logger::log_event_str(", revisionLevelInd := ");
single_value->field_revisionLevelInd.log_match(match_value.revisionLevelInd(), legacy);
TTCN_Logger::log_event_str(", umtsfddRadAccTechCap := ");
single_value->field_umtsfddRadAccTechCap.log_match(match_value.umtsfddRadAccTechCap(), legacy);
TTCN_Logger::log_event_str(", umtstddRadAccTechCap := ");
single_value->field_umtstddRadAccTechCap.log_match(match_value.umtstddRadAccTechCap(), legacy);
TTCN_Logger::log_event_str(", cdma2kRadAccTechCap := ");
single_value->field_cdma2kRadAccTechCap.log_match(match_value.cdma2kRadAccTechCap(), 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 AccessCapAdditionsRel99_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (presenceBitPskpow().is_bound()) presenceBitPskpow().set_implicit_omit();
if (!pskpowercap().is_bound()) pskpowercap() = OMIT_VALUE;
else pskpowercap().set_implicit_omit();
if (compactIntMeasurCap().is_bound()) compactIntMeasurCap().set_implicit_omit();
if (revisionLevelInd().is_bound()) revisionLevelInd().set_implicit_omit();
if (umtsfddRadAccTechCap().is_bound()) umtsfddRadAccTechCap().set_implicit_omit();
if (umtstddRadAccTechCap().is_bound()) umtstddRadAccTechCap().set_implicit_omit();
if (cdma2kRadAccTechCap().is_bound()) cdma2kRadAccTechCap().set_implicit_omit();
}

void AccessCapAdditionsRel99_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_presenceBitPskpow.encode_text(text_buf);
single_value->field_pskpowercap.encode_text(text_buf);
single_value->field_compactIntMeasurCap.encode_text(text_buf);
single_value->field_revisionLevelInd.encode_text(text_buf);
single_value->field_umtsfddRadAccTechCap.encode_text(text_buf);
single_value->field_umtstddRadAccTechCap.encode_text(text_buf);
single_value->field_cdma2kRadAccTechCap.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_GMM_SM_Types.AccessCapAdditionsRel99.");
}
}

void AccessCapAdditionsRel99_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_presenceBitPskpow.decode_text(text_buf);
single_value->field_pskpowercap.decode_text(text_buf);
single_value->field_compactIntMeasurCap.decode_text(text_buf);
single_value->field_revisionLevelInd.decode_text(text_buf);
single_value->field_umtsfddRadAccTechCap.decode_text(text_buf);
single_value->field_umtstddRadAccTechCap.decode_text(text_buf);
single_value->field_cdma2kRadAccTechCap.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 AccessCapAdditionsRel99_template[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_GMM_SM_Types.AccessCapAdditionsRel99.");
}
}

void AccessCapAdditionsRel99_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: {
    AccessCapAdditionsRel99_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_GMM_SM_Types.AccessCapAdditionsRel99 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) presenceBitPskpow().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pskpowercap().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) compactIntMeasurCap().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) revisionLevelInd().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) umtsfddRadAccTechCap().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) umtstddRadAccTechCap().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cdma2kRadAccTechCap().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(), "presenceBitPskpow")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitPskpow().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pskpowercap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pskpowercap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "compactIntMeasurCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          compactIntMeasurCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "revisionLevelInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          revisionLevelInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "umtsfddRadAccTechCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          umtsfddRadAccTechCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "umtstddRadAccTechCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          umtstddRadAccTechCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cdma2kRadAccTechCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cdma2kRadAccTechCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel99: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel99_template* precondition = new AccessCapAdditionsRel99_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel99_template* implied_template = new AccessCapAdditionsRel99_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel99_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel99");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel99_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_presenceBitPskpow.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel99");
single_value->field_pskpowercap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel99");
single_value->field_compactIntMeasurCap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel99");
single_value->field_revisionLevelInd.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel99");
single_value->field_umtsfddRadAccTechCap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel99");
single_value->field_umtstddRadAccTechCap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel99");
single_value->field_cdma2kRadAccTechCap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel99");
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_GMM_SM_Types.AccessCapAdditionsRel99");
}

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

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

AccessCapAdditionsAfterRel97::AccessCapAdditionsAfterRel97()
{
}

AccessCapAdditionsAfterRel97::AccessCapAdditionsAfterRel97(const AccessCapAdditionsRel99& par_accessCapAdditionsRel99,
    const OPTIONAL< AccessCapAdditionsAfterRel99 >& par_accessCapAdditionsAfterRel99)
  :   field_accessCapAdditionsRel99(par_accessCapAdditionsRel99),
  field_accessCapAdditionsAfterRel99(par_accessCapAdditionsAfterRel99)
{
}

AccessCapAdditionsAfterRel97::AccessCapAdditionsAfterRel97(const AccessCapAdditionsAfterRel97& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
if (other_value.accessCapAdditionsRel99().is_bound()) field_accessCapAdditionsRel99 = other_value.accessCapAdditionsRel99();
else field_accessCapAdditionsRel99.clean_up();
if (other_value.accessCapAdditionsAfterRel99().is_bound()) field_accessCapAdditionsAfterRel99 = other_value.accessCapAdditionsAfterRel99();
else field_accessCapAdditionsAfterRel99.clean_up();
}

void AccessCapAdditionsAfterRel97::clean_up()
{
field_accessCapAdditionsRel99.clean_up();
field_accessCapAdditionsAfterRel99.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel97::get_descriptor() const { return &AccessCapAdditionsAfterRel97_descr_; }
AccessCapAdditionsAfterRel97& AccessCapAdditionsAfterRel97::operator=(const AccessCapAdditionsAfterRel97& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
  if (other_value.accessCapAdditionsRel99().is_bound()) field_accessCapAdditionsRel99 = other_value.accessCapAdditionsRel99();
  else field_accessCapAdditionsRel99.clean_up();
  if (other_value.accessCapAdditionsAfterRel99().is_bound()) field_accessCapAdditionsAfterRel99 = other_value.accessCapAdditionsAfterRel99();
  else field_accessCapAdditionsAfterRel99.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel97::operator==(const AccessCapAdditionsAfterRel97& other_value) const
{
return field_accessCapAdditionsRel99==other_value.field_accessCapAdditionsRel99
  && field_accessCapAdditionsAfterRel99==other_value.field_accessCapAdditionsAfterRel99;
}

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

void AccessCapAdditionsAfterRel97::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel99 := ");
field_accessCapAdditionsRel99.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel99 := ");
field_accessCapAdditionsAfterRel99.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel97::set_implicit_omit()
{
if (accessCapAdditionsRel99().is_bound()) accessCapAdditionsRel99().set_implicit_omit();
if (!accessCapAdditionsAfterRel99().is_bound()) accessCapAdditionsAfterRel99() = OMIT_VALUE;
else accessCapAdditionsAfterRel99().set_implicit_omit();
}

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

void AccessCapAdditionsAfterRel97::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel99.encode_text(text_buf);
field_accessCapAdditionsAfterRel99.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel97::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel99.decode_text(text_buf);
field_accessCapAdditionsAfterRel99.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel97::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 AccessCapAdditionsAfterRel97::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 AccessCapAdditionsAfterRel97::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, AccessCapAdditionsAfterRel97_accessCapAdditionsRel99_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel99.RAW_decode(AccessCapAdditionsAfterRel97_accessCapAdditionsRel99_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_accessCapAdditionsAfterRel99 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel97_accessCapAdditionsAfterRel99_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel99().RAW_decode(AccessCapAdditionsAfterRel97_accessCapAdditionsAfterRel99_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_accessCapAdditionsAfterRel99 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_accessCapAdditionsAfterRel99=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel97::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, AccessCapAdditionsAfterRel97_accessCapAdditionsRel99_descr_.raw);
  if (field_accessCapAdditionsAfterRel99.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel97_accessCapAdditionsAfterRel99_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_accessCapAdditionsRel99.RAW_encode(AccessCapAdditionsAfterRel97_accessCapAdditionsRel99_descr_, *myleaf.body.node.nodes[0]);
  if (field_accessCapAdditionsAfterRel99.ispresent()) {
  encoded_length += field_accessCapAdditionsAfterRel99().RAW_encode(AccessCapAdditionsAfterRel97_accessCapAdditionsAfterRel99_descr_, *myleaf.body.node.nodes[1]);
  }
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel97_template::single_value_struct {
AccessCapAdditionsRel99_template field_accessCapAdditionsRel99;
AccessCapAdditionsAfterRel99_template field_accessCapAdditionsAfterRel99;
};

void AccessCapAdditionsAfterRel97_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_accessCapAdditionsRel99 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel99 = ANY_OR_OMIT;
}
}
}

void AccessCapAdditionsAfterRel97_template::copy_value(const AccessCapAdditionsAfterRel97& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel99().is_bound()) {
  single_value->field_accessCapAdditionsRel99 = other_value.accessCapAdditionsRel99();
} else {
  single_value->field_accessCapAdditionsRel99.clean_up();
}
if (other_value.accessCapAdditionsAfterRel99().is_bound()) {
  if (other_value.accessCapAdditionsAfterRel99().ispresent()) single_value->field_accessCapAdditionsAfterRel99 = other_value.accessCapAdditionsAfterRel99()();
  else single_value->field_accessCapAdditionsAfterRel99 = OMIT_VALUE;
} else {
  single_value->field_accessCapAdditionsAfterRel99.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel97_template::copy_template(const AccessCapAdditionsAfterRel97_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel99().get_selection()) {
single_value->field_accessCapAdditionsRel99 = other_value.accessCapAdditionsRel99();
} else {
single_value->field_accessCapAdditionsRel99.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel99().get_selection()) {
single_value->field_accessCapAdditionsAfterRel99 = other_value.accessCapAdditionsAfterRel99();
} else {
single_value->field_accessCapAdditionsAfterRel99.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 AccessCapAdditionsAfterRel97_template[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 AccessCapAdditionsAfterRel97_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel97_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_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel97_template::AccessCapAdditionsAfterRel97_template()
{
}

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

AccessCapAdditionsAfterRel97_template::AccessCapAdditionsAfterRel97_template(const AccessCapAdditionsAfterRel97& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsAfterRel97_template::match(const AccessCapAdditionsAfterRel97& 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.accessCapAdditionsRel99().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel99.match(other_value.accessCapAdditionsRel99(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel99().is_bound()) return FALSE;
if((other_value.accessCapAdditionsAfterRel99().ispresent() ? !single_value->field_accessCapAdditionsAfterRel99.match((const AccessCapAdditionsAfterRel99&)other_value.accessCapAdditionsAfterRel99(), legacy) : !single_value->field_accessCapAdditionsAfterRel99.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_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel97_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel99.is_bound()
 || (single_value->field_accessCapAdditionsAfterRel99.is_omit() || single_value->field_accessCapAdditionsAfterRel99.is_bound());
}

boolean AccessCapAdditionsAfterRel97_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel99.is_value()
 && (single_value->field_accessCapAdditionsAfterRel99.is_omit() || single_value->field_accessCapAdditionsAfterRel99.is_value());
}

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

AccessCapAdditionsAfterRel97 AccessCapAdditionsAfterRel97_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_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
AccessCapAdditionsAfterRel97 ret_val;
if (single_value->field_accessCapAdditionsRel99.is_bound()) {
ret_val.accessCapAdditionsRel99() = single_value->field_accessCapAdditionsRel99.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel99.is_omit()) ret_val.accessCapAdditionsAfterRel99() = OMIT_VALUE;
else if (single_value->field_accessCapAdditionsAfterRel99.is_bound()) {
ret_val.accessCapAdditionsAfterRel99() = single_value->field_accessCapAdditionsAfterRel99.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel97_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_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel97_template[list_length];
}

AccessCapAdditionsAfterRel97_template& AccessCapAdditionsAfterRel97_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_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel99_template& AccessCapAdditionsAfterRel97_template::accessCapAdditionsRel99()
{
set_specific();
return single_value->field_accessCapAdditionsRel99;
}

const AccessCapAdditionsRel99_template& AccessCapAdditionsAfterRel97_template::accessCapAdditionsRel99() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel99 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
return single_value->field_accessCapAdditionsRel99;
}

AccessCapAdditionsAfterRel99_template& AccessCapAdditionsAfterRel97_template::accessCapAdditionsAfterRel99()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel99;
}

const AccessCapAdditionsAfterRel99_template& AccessCapAdditionsAfterRel97_template::accessCapAdditionsAfterRel99() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel99 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
return single_value->field_accessCapAdditionsAfterRel99;
}

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

void AccessCapAdditionsAfterRel97_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel99 := ");
single_value->field_accessCapAdditionsRel99.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel99 := ");
single_value->field_accessCapAdditionsAfterRel99.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 AccessCapAdditionsAfterRel97_template::log_match(const AccessCapAdditionsAfterRel97& 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_accessCapAdditionsRel99.match(match_value.accessCapAdditionsRel99(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel99");
single_value->field_accessCapAdditionsRel99.log_match(match_value.accessCapAdditionsRel99(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.accessCapAdditionsAfterRel99().ispresent()){
if(!single_value->field_accessCapAdditionsAfterRel99.match(match_value.accessCapAdditionsAfterRel99(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel99");
single_value->field_accessCapAdditionsAfterRel99.log_match(match_value.accessCapAdditionsAfterRel99(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_accessCapAdditionsAfterRel99.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel99 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_accessCapAdditionsAfterRel99.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("{ accessCapAdditionsRel99 := ");
single_value->field_accessCapAdditionsRel99.log_match(match_value.accessCapAdditionsRel99(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel99 := ");
if (match_value.accessCapAdditionsAfterRel99().ispresent()) {
single_value->field_accessCapAdditionsAfterRel99.log_match(match_value.accessCapAdditionsAfterRel99(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_accessCapAdditionsAfterRel99.log();
if (single_value->field_accessCapAdditionsAfterRel99.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 AccessCapAdditionsAfterRel97_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (accessCapAdditionsRel99().is_bound()) accessCapAdditionsRel99().set_implicit_omit();
if (!accessCapAdditionsAfterRel99().is_bound()) accessCapAdditionsAfterRel99() = OMIT_VALUE;
else accessCapAdditionsAfterRel99().set_implicit_omit();
}

void AccessCapAdditionsAfterRel97_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel99.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel99.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_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
}
}

void AccessCapAdditionsAfterRel97_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_accessCapAdditionsRel99.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel99.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 AccessCapAdditionsAfterRel97_template[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_GMM_SM_Types.AccessCapAdditionsAfterRel97.");
}
}

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

void AccessCapAdditionsAfterRel97_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_accessCapAdditionsRel99.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel97");
single_value->field_accessCapAdditionsAfterRel99.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel97");
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_GMM_SM_Types.AccessCapAdditionsAfterRel97");
}

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

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

AccessCapAdditionsRel4::AccessCapAdditionsRel4()
{
}

AccessCapAdditionsRel4::AccessCapAdditionsRel4(const BITSTRING& par_umts128RadAccTechCap,
    const BITSTRING& par_geranFeaturePackage,
    const BITSTRING& par_presenceBitExtendedDTM,
    const OPTIONAL< ExtendedDTM >& par_extendedDTM,
    const BITSTRING& par_modulationBasedMultislotClass)
  :   field_umts128RadAccTechCap(par_umts128RadAccTechCap),
  field_geranFeaturePackage(par_geranFeaturePackage),
  field_presenceBitExtendedDTM(par_presenceBitExtendedDTM),
  field_extendedDTM(par_extendedDTM),
  field_modulationBasedMultislotClass(par_modulationBasedMultislotClass)
{
}

AccessCapAdditionsRel4::AccessCapAdditionsRel4(const AccessCapAdditionsRel4& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel4.");
if (other_value.umts128RadAccTechCap().is_bound()) field_umts128RadAccTechCap = other_value.umts128RadAccTechCap();
else field_umts128RadAccTechCap.clean_up();
if (other_value.geranFeaturePackage().is_bound()) field_geranFeaturePackage = other_value.geranFeaturePackage();
else field_geranFeaturePackage.clean_up();
if (other_value.presenceBitExtendedDTM().is_bound()) field_presenceBitExtendedDTM = other_value.presenceBitExtendedDTM();
else field_presenceBitExtendedDTM.clean_up();
if (other_value.extendedDTM().is_bound()) field_extendedDTM = other_value.extendedDTM();
else field_extendedDTM.clean_up();
if (other_value.modulationBasedMultislotClass().is_bound()) field_modulationBasedMultislotClass = other_value.modulationBasedMultislotClass();
else field_modulationBasedMultislotClass.clean_up();
}

void AccessCapAdditionsRel4::clean_up()
{
field_umts128RadAccTechCap.clean_up();
field_geranFeaturePackage.clean_up();
field_presenceBitExtendedDTM.clean_up();
field_extendedDTM.clean_up();
field_modulationBasedMultislotClass.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel4::get_descriptor() const { return &AccessCapAdditionsRel4_descr_; }
AccessCapAdditionsRel4& AccessCapAdditionsRel4::operator=(const AccessCapAdditionsRel4& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel4.");
  if (other_value.umts128RadAccTechCap().is_bound()) field_umts128RadAccTechCap = other_value.umts128RadAccTechCap();
  else field_umts128RadAccTechCap.clean_up();
  if (other_value.geranFeaturePackage().is_bound()) field_geranFeaturePackage = other_value.geranFeaturePackage();
  else field_geranFeaturePackage.clean_up();
  if (other_value.presenceBitExtendedDTM().is_bound()) field_presenceBitExtendedDTM = other_value.presenceBitExtendedDTM();
  else field_presenceBitExtendedDTM.clean_up();
  if (other_value.extendedDTM().is_bound()) field_extendedDTM = other_value.extendedDTM();
  else field_extendedDTM.clean_up();
  if (other_value.modulationBasedMultislotClass().is_bound()) field_modulationBasedMultislotClass = other_value.modulationBasedMultislotClass();
  else field_modulationBasedMultislotClass.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel4::operator==(const AccessCapAdditionsRel4& other_value) const
{
return field_umts128RadAccTechCap==other_value.field_umts128RadAccTechCap
  && field_geranFeaturePackage==other_value.field_geranFeaturePackage
  && field_presenceBitExtendedDTM==other_value.field_presenceBitExtendedDTM
  && field_extendedDTM==other_value.field_extendedDTM
  && field_modulationBasedMultislotClass==other_value.field_modulationBasedMultislotClass;
}

boolean AccessCapAdditionsRel4::is_bound() const
{
return (field_umts128RadAccTechCap.is_bound())
  || (field_geranFeaturePackage.is_bound())
  || (field_presenceBitExtendedDTM.is_bound())
  || (OPTIONAL_OMIT == field_extendedDTM.get_selection() || field_extendedDTM.is_bound())
  || (field_modulationBasedMultislotClass.is_bound());
}
boolean AccessCapAdditionsRel4::is_value() const
{
return field_umts128RadAccTechCap.is_value()
  && field_geranFeaturePackage.is_value()
  && field_presenceBitExtendedDTM.is_value()
  && (OPTIONAL_OMIT == field_extendedDTM.get_selection() || field_extendedDTM.is_value())
  && field_modulationBasedMultislotClass.is_value();
}
int AccessCapAdditionsRel4::size_of() const
{
  int ret_val = 4;
  if (field_extendedDTM.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsRel4::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ umts128RadAccTechCap := ");
field_umts128RadAccTechCap.log();
TTCN_Logger::log_event_str(", geranFeaturePackage := ");
field_geranFeaturePackage.log();
TTCN_Logger::log_event_str(", presenceBitExtendedDTM := ");
field_presenceBitExtendedDTM.log();
TTCN_Logger::log_event_str(", extendedDTM := ");
field_extendedDTM.log();
TTCN_Logger::log_event_str(", modulationBasedMultislotClass := ");
field_modulationBasedMultislotClass.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel4::set_implicit_omit()
{
if (umts128RadAccTechCap().is_bound()) umts128RadAccTechCap().set_implicit_omit();
if (geranFeaturePackage().is_bound()) geranFeaturePackage().set_implicit_omit();
if (presenceBitExtendedDTM().is_bound()) presenceBitExtendedDTM().set_implicit_omit();
if (!extendedDTM().is_bound()) extendedDTM() = OMIT_VALUE;
else extendedDTM().set_implicit_omit();
if (modulationBasedMultislotClass().is_bound()) modulationBasedMultislotClass().set_implicit_omit();
}

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

void AccessCapAdditionsRel4::encode_text(Text_Buf& text_buf) const
{
field_umts128RadAccTechCap.encode_text(text_buf);
field_geranFeaturePackage.encode_text(text_buf);
field_presenceBitExtendedDTM.encode_text(text_buf);
field_extendedDTM.encode_text(text_buf);
field_modulationBasedMultislotClass.encode_text(text_buf);
}

void AccessCapAdditionsRel4::decode_text(Text_Buf& text_buf)
{
field_umts128RadAccTechCap.decode_text(text_buf);
field_geranFeaturePackage.decode_text(text_buf);
field_presenceBitExtendedDTM.decode_text(text_buf);
field_extendedDTM.decode_text(text_buf);
field_modulationBasedMultislotClass.decode_text(text_buf);
}

void AccessCapAdditionsRel4::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 AccessCapAdditionsRel4::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 AccessCapAdditionsRel4::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, AccessCapAdditionsRel4_umts128RadAccTechCap_descr_.raw->forceomit);
  decoded_field_length = field_umts128RadAccTechCap.RAW_decode(AccessCapAdditionsRel4_umts128RadAccTechCap_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, AccessCapAdditionsRel4_geranFeaturePackage_descr_.raw->forceomit);
  decoded_field_length = field_geranFeaturePackage.RAW_decode(AccessCapAdditionsRel4_geranFeaturePackage_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, AccessCapAdditionsRel4_presenceBitExtendedDTM_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitExtendedDTM.RAW_decode(AccessCapAdditionsRel4_presenceBitExtendedDTM_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_presenceBitExtendedDTM ==  bs_2){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_extendedDTM = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel4_extendedDTM_descr_.raw->forceomit);
  decoded_field_length = field_extendedDTM().RAW_decode(AccessCapAdditionsRel4_extendedDTM_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_extendedDTM = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_extendedDTM=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel4_modulationBasedMultislotClass_descr_.raw->forceomit);
  decoded_field_length = field_modulationBasedMultislotClass.RAW_decode(AccessCapAdditionsRel4_modulationBasedMultislotClass_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel4::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, AccessCapAdditionsRel4_umts128RadAccTechCap_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel4_geranFeaturePackage_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel4_presenceBitExtendedDTM_descr_.raw);
  if (field_extendedDTM.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel4_extendedDTM_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel4_modulationBasedMultislotClass_descr_.raw);
  encoded_length += field_umts128RadAccTechCap.RAW_encode(AccessCapAdditionsRel4_umts128RadAccTechCap_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_geranFeaturePackage.RAW_encode(AccessCapAdditionsRel4_geranFeaturePackage_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_presenceBitExtendedDTM.RAW_encode(AccessCapAdditionsRel4_presenceBitExtendedDTM_descr_, *myleaf.body.node.nodes[2]);
  if (field_extendedDTM.ispresent()) {
  encoded_length += field_extendedDTM().RAW_encode(AccessCapAdditionsRel4_extendedDTM_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_modulationBasedMultislotClass.RAW_encode(AccessCapAdditionsRel4_modulationBasedMultislotClass_descr_, *myleaf.body.node.nodes[4]);
  if (field_extendedDTM.ispresent() && (field_presenceBitExtendedDTM !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  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_2.RAW_encode(AccessCapAdditionsRel4_presenceBitExtendedDTM_descr_,*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 AccessCapAdditionsRel4_template::single_value_struct {
BITSTRING_template field_umts128RadAccTechCap;
BITSTRING_template field_geranFeaturePackage;
BITSTRING_template field_presenceBitExtendedDTM;
ExtendedDTM_template field_extendedDTM;
BITSTRING_template field_modulationBasedMultislotClass;
};

void AccessCapAdditionsRel4_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_umts128RadAccTechCap = ANY_VALUE;
single_value->field_geranFeaturePackage = ANY_VALUE;
single_value->field_presenceBitExtendedDTM = ANY_VALUE;
single_value->field_extendedDTM = ANY_OR_OMIT;
single_value->field_modulationBasedMultislotClass = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel4_template::copy_value(const AccessCapAdditionsRel4& other_value)
{
single_value = new single_value_struct;
if (other_value.umts128RadAccTechCap().is_bound()) {
  single_value->field_umts128RadAccTechCap = other_value.umts128RadAccTechCap();
} else {
  single_value->field_umts128RadAccTechCap.clean_up();
}
if (other_value.geranFeaturePackage().is_bound()) {
  single_value->field_geranFeaturePackage = other_value.geranFeaturePackage();
} else {
  single_value->field_geranFeaturePackage.clean_up();
}
if (other_value.presenceBitExtendedDTM().is_bound()) {
  single_value->field_presenceBitExtendedDTM = other_value.presenceBitExtendedDTM();
} else {
  single_value->field_presenceBitExtendedDTM.clean_up();
}
if (other_value.extendedDTM().is_bound()) {
  if (other_value.extendedDTM().ispresent()) single_value->field_extendedDTM = other_value.extendedDTM()();
  else single_value->field_extendedDTM = OMIT_VALUE;
} else {
  single_value->field_extendedDTM.clean_up();
}
if (other_value.modulationBasedMultislotClass().is_bound()) {
  single_value->field_modulationBasedMultislotClass = other_value.modulationBasedMultislotClass();
} else {
  single_value->field_modulationBasedMultislotClass.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel4_template::copy_template(const AccessCapAdditionsRel4_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.umts128RadAccTechCap().get_selection()) {
single_value->field_umts128RadAccTechCap = other_value.umts128RadAccTechCap();
} else {
single_value->field_umts128RadAccTechCap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.geranFeaturePackage().get_selection()) {
single_value->field_geranFeaturePackage = other_value.geranFeaturePackage();
} else {
single_value->field_geranFeaturePackage.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitExtendedDTM().get_selection()) {
single_value->field_presenceBitExtendedDTM = other_value.presenceBitExtendedDTM();
} else {
single_value->field_presenceBitExtendedDTM.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedDTM().get_selection()) {
single_value->field_extendedDTM = other_value.extendedDTM();
} else {
single_value->field_extendedDTM.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.modulationBasedMultislotClass().get_selection()) {
single_value->field_modulationBasedMultislotClass = other_value.modulationBasedMultislotClass();
} else {
single_value->field_modulationBasedMultislotClass.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 AccessCapAdditionsRel4_template[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 AccessCapAdditionsRel4_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel4_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_GMM_SM_Types.AccessCapAdditionsRel4.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel4_template::AccessCapAdditionsRel4_template()
{
}

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

AccessCapAdditionsRel4_template::AccessCapAdditionsRel4_template(const AccessCapAdditionsRel4& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel4_template::match(const AccessCapAdditionsRel4& 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.umts128RadAccTechCap().is_bound()) return FALSE;
if(!single_value->field_umts128RadAccTechCap.match(other_value.umts128RadAccTechCap(), legacy))return FALSE;
if(!other_value.geranFeaturePackage().is_bound()) return FALSE;
if(!single_value->field_geranFeaturePackage.match(other_value.geranFeaturePackage(), legacy))return FALSE;
if(!other_value.presenceBitExtendedDTM().is_bound()) return FALSE;
if(!single_value->field_presenceBitExtendedDTM.match(other_value.presenceBitExtendedDTM(), legacy))return FALSE;
if(!other_value.extendedDTM().is_bound()) return FALSE;
if((other_value.extendedDTM().ispresent() ? !single_value->field_extendedDTM.match((const ExtendedDTM&)other_value.extendedDTM(), legacy) : !single_value->field_extendedDTM.match_omit(legacy)))return FALSE;
if(!other_value.modulationBasedMultislotClass().is_bound()) return FALSE;
if(!single_value->field_modulationBasedMultislotClass.match(other_value.modulationBasedMultislotClass(), 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_GMM_SM_Types.AccessCapAdditionsRel4.");
}
return FALSE;
}

boolean AccessCapAdditionsRel4_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_umts128RadAccTechCap.is_bound()
 || single_value->field_geranFeaturePackage.is_bound()
 || single_value->field_presenceBitExtendedDTM.is_bound()
 || (single_value->field_extendedDTM.is_omit() || single_value->field_extendedDTM.is_bound())
 || single_value->field_modulationBasedMultislotClass.is_bound();
}

boolean AccessCapAdditionsRel4_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_umts128RadAccTechCap.is_value()
 && single_value->field_geranFeaturePackage.is_value()
 && single_value->field_presenceBitExtendedDTM.is_value()
 && (single_value->field_extendedDTM.is_omit() || single_value->field_extendedDTM.is_value())
 && single_value->field_modulationBasedMultislotClass.is_value();
}

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

AccessCapAdditionsRel4 AccessCapAdditionsRel4_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_GMM_SM_Types.AccessCapAdditionsRel4.");
AccessCapAdditionsRel4 ret_val;
if (single_value->field_umts128RadAccTechCap.is_bound()) {
ret_val.umts128RadAccTechCap() = single_value->field_umts128RadAccTechCap.valueof();
}
if (single_value->field_geranFeaturePackage.is_bound()) {
ret_val.geranFeaturePackage() = single_value->field_geranFeaturePackage.valueof();
}
if (single_value->field_presenceBitExtendedDTM.is_bound()) {
ret_val.presenceBitExtendedDTM() = single_value->field_presenceBitExtendedDTM.valueof();
}
if (single_value->field_extendedDTM.is_omit()) ret_val.extendedDTM() = OMIT_VALUE;
else if (single_value->field_extendedDTM.is_bound()) {
ret_val.extendedDTM() = single_value->field_extendedDTM.valueof();
}
if (single_value->field_modulationBasedMultislotClass.is_bound()) {
ret_val.modulationBasedMultislotClass() = single_value->field_modulationBasedMultislotClass.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel4_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_GMM_SM_Types.AccessCapAdditionsRel4.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel4_template[list_length];
}

AccessCapAdditionsRel4_template& AccessCapAdditionsRel4_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_GMM_SM_Types.AccessCapAdditionsRel4.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel4.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel4_template::umts128RadAccTechCap()
{
set_specific();
return single_value->field_umts128RadAccTechCap;
}

const BITSTRING_template& AccessCapAdditionsRel4_template::umts128RadAccTechCap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field umts128RadAccTechCap of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel4.");
return single_value->field_umts128RadAccTechCap;
}

BITSTRING_template& AccessCapAdditionsRel4_template::geranFeaturePackage()
{
set_specific();
return single_value->field_geranFeaturePackage;
}

const BITSTRING_template& AccessCapAdditionsRel4_template::geranFeaturePackage() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field geranFeaturePackage of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel4.");
return single_value->field_geranFeaturePackage;
}

BITSTRING_template& AccessCapAdditionsRel4_template::presenceBitExtendedDTM()
{
set_specific();
return single_value->field_presenceBitExtendedDTM;
}

const BITSTRING_template& AccessCapAdditionsRel4_template::presenceBitExtendedDTM() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitExtendedDTM of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel4.");
return single_value->field_presenceBitExtendedDTM;
}

ExtendedDTM_template& AccessCapAdditionsRel4_template::extendedDTM()
{
set_specific();
return single_value->field_extendedDTM;
}

const ExtendedDTM_template& AccessCapAdditionsRel4_template::extendedDTM() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedDTM of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel4.");
return single_value->field_extendedDTM;
}

BITSTRING_template& AccessCapAdditionsRel4_template::modulationBasedMultislotClass()
{
set_specific();
return single_value->field_modulationBasedMultislotClass;
}

const BITSTRING_template& AccessCapAdditionsRel4_template::modulationBasedMultislotClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field modulationBasedMultislotClass of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel4.");
return single_value->field_modulationBasedMultislotClass;
}

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

void AccessCapAdditionsRel4_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ umts128RadAccTechCap := ");
single_value->field_umts128RadAccTechCap.log();
TTCN_Logger::log_event_str(", geranFeaturePackage := ");
single_value->field_geranFeaturePackage.log();
TTCN_Logger::log_event_str(", presenceBitExtendedDTM := ");
single_value->field_presenceBitExtendedDTM.log();
TTCN_Logger::log_event_str(", extendedDTM := ");
single_value->field_extendedDTM.log();
TTCN_Logger::log_event_str(", modulationBasedMultislotClass := ");
single_value->field_modulationBasedMultislotClass.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 AccessCapAdditionsRel4_template::log_match(const AccessCapAdditionsRel4& 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_umts128RadAccTechCap.match(match_value.umts128RadAccTechCap(), legacy)){
TTCN_Logger::log_logmatch_info(".umts128RadAccTechCap");
single_value->field_umts128RadAccTechCap.log_match(match_value.umts128RadAccTechCap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_geranFeaturePackage.match(match_value.geranFeaturePackage(), legacy)){
TTCN_Logger::log_logmatch_info(".geranFeaturePackage");
single_value->field_geranFeaturePackage.log_match(match_value.geranFeaturePackage(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitExtendedDTM.match(match_value.presenceBitExtendedDTM(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitExtendedDTM");
single_value->field_presenceBitExtendedDTM.log_match(match_value.presenceBitExtendedDTM(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.extendedDTM().ispresent()){
if(!single_value->field_extendedDTM.match(match_value.extendedDTM(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedDTM");
single_value->field_extendedDTM.log_match(match_value.extendedDTM(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedDTM.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedDTM := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedDTM.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_modulationBasedMultislotClass.match(match_value.modulationBasedMultislotClass(), legacy)){
TTCN_Logger::log_logmatch_info(".modulationBasedMultislotClass");
single_value->field_modulationBasedMultislotClass.log_match(match_value.modulationBasedMultislotClass(), 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("{ umts128RadAccTechCap := ");
single_value->field_umts128RadAccTechCap.log_match(match_value.umts128RadAccTechCap(), legacy);
TTCN_Logger::log_event_str(", geranFeaturePackage := ");
single_value->field_geranFeaturePackage.log_match(match_value.geranFeaturePackage(), legacy);
TTCN_Logger::log_event_str(", presenceBitExtendedDTM := ");
single_value->field_presenceBitExtendedDTM.log_match(match_value.presenceBitExtendedDTM(), legacy);
TTCN_Logger::log_event_str(", extendedDTM := ");
if (match_value.extendedDTM().ispresent()) {
single_value->field_extendedDTM.log_match(match_value.extendedDTM(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedDTM.log();
if (single_value->field_extendedDTM.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", modulationBasedMultislotClass := ");
single_value->field_modulationBasedMultislotClass.log_match(match_value.modulationBasedMultislotClass(), 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 AccessCapAdditionsRel4_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (umts128RadAccTechCap().is_bound()) umts128RadAccTechCap().set_implicit_omit();
if (geranFeaturePackage().is_bound()) geranFeaturePackage().set_implicit_omit();
if (presenceBitExtendedDTM().is_bound()) presenceBitExtendedDTM().set_implicit_omit();
if (!extendedDTM().is_bound()) extendedDTM() = OMIT_VALUE;
else extendedDTM().set_implicit_omit();
if (modulationBasedMultislotClass().is_bound()) modulationBasedMultislotClass().set_implicit_omit();
}

void AccessCapAdditionsRel4_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_umts128RadAccTechCap.encode_text(text_buf);
single_value->field_geranFeaturePackage.encode_text(text_buf);
single_value->field_presenceBitExtendedDTM.encode_text(text_buf);
single_value->field_extendedDTM.encode_text(text_buf);
single_value->field_modulationBasedMultislotClass.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_GMM_SM_Types.AccessCapAdditionsRel4.");
}
}

void AccessCapAdditionsRel4_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_umts128RadAccTechCap.decode_text(text_buf);
single_value->field_geranFeaturePackage.decode_text(text_buf);
single_value->field_presenceBitExtendedDTM.decode_text(text_buf);
single_value->field_extendedDTM.decode_text(text_buf);
single_value->field_modulationBasedMultislotClass.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 AccessCapAdditionsRel4_template[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_GMM_SM_Types.AccessCapAdditionsRel4.");
}
}

void AccessCapAdditionsRel4_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: {
    AccessCapAdditionsRel4_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_GMM_SM_Types.AccessCapAdditionsRel4 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) umts128RadAccTechCap().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) geranFeaturePackage().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitExtendedDTM().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) extendedDTM().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) modulationBasedMultislotClass().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(), "umts128RadAccTechCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          umts128RadAccTechCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "geranFeaturePackage")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          geranFeaturePackage().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitExtendedDTM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitExtendedDTM().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDTM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDTM().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "modulationBasedMultislotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          modulationBasedMultislotClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel4: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel4_template* precondition = new AccessCapAdditionsRel4_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel4_template* implied_template = new AccessCapAdditionsRel4_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel4_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel4");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel4_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_umts128RadAccTechCap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel4");
single_value->field_geranFeaturePackage.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel4");
single_value->field_presenceBitExtendedDTM.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel4");
single_value->field_extendedDTM.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel4");
single_value->field_modulationBasedMultislotClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel4");
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_GMM_SM_Types.AccessCapAdditionsRel4");
}

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

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

ExtendedDTM::ExtendedDTM()
{
}

ExtendedDTM::ExtendedDTM(const BITSTRING& par_ExtendedDTM__GPRSMultislot,
    const BITSTRING& par_ExtendedDTM__EGPRSMultislot)
  :   field_ExtendedDTM__GPRSMultislot(par_ExtendedDTM__GPRSMultislot),
  field_ExtendedDTM__EGPRSMultislot(par_ExtendedDTM__EGPRSMultislot)
{
}

ExtendedDTM::ExtendedDTM(const ExtendedDTM& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.ExtendedDTM.");
if (other_value.ExtendedDTM__GPRSMultislot().is_bound()) field_ExtendedDTM__GPRSMultislot = other_value.ExtendedDTM__GPRSMultislot();
else field_ExtendedDTM__GPRSMultislot.clean_up();
if (other_value.ExtendedDTM__EGPRSMultislot().is_bound()) field_ExtendedDTM__EGPRSMultislot = other_value.ExtendedDTM__EGPRSMultislot();
else field_ExtendedDTM__EGPRSMultislot.clean_up();
}

void ExtendedDTM::clean_up()
{
field_ExtendedDTM__GPRSMultislot.clean_up();
field_ExtendedDTM__EGPRSMultislot.clean_up();
}

const TTCN_Typedescriptor_t* ExtendedDTM::get_descriptor() const { return &ExtendedDTM_descr_; }
ExtendedDTM& ExtendedDTM::operator=(const ExtendedDTM& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.ExtendedDTM.");
  if (other_value.ExtendedDTM__GPRSMultislot().is_bound()) field_ExtendedDTM__GPRSMultislot = other_value.ExtendedDTM__GPRSMultislot();
  else field_ExtendedDTM__GPRSMultislot.clean_up();
  if (other_value.ExtendedDTM__EGPRSMultislot().is_bound()) field_ExtendedDTM__EGPRSMultislot = other_value.ExtendedDTM__EGPRSMultislot();
  else field_ExtendedDTM__EGPRSMultislot.clean_up();
}
return *this;
}

boolean ExtendedDTM::operator==(const ExtendedDTM& other_value) const
{
return field_ExtendedDTM__GPRSMultislot==other_value.field_ExtendedDTM__GPRSMultislot
  && field_ExtendedDTM__EGPRSMultislot==other_value.field_ExtendedDTM__EGPRSMultislot;
}

boolean ExtendedDTM::is_bound() const
{
return (field_ExtendedDTM__GPRSMultislot.is_bound())
  || (field_ExtendedDTM__EGPRSMultislot.is_bound());
}
boolean ExtendedDTM::is_value() const
{
return field_ExtendedDTM__GPRSMultislot.is_value()
  && field_ExtendedDTM__EGPRSMultislot.is_value();
}
void ExtendedDTM::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ ExtendedDTM_GPRSMultislot := ");
field_ExtendedDTM__GPRSMultislot.log();
TTCN_Logger::log_event_str(", ExtendedDTM_EGPRSMultislot := ");
field_ExtendedDTM__EGPRSMultislot.log();
TTCN_Logger::log_event_str(" }");
}

void ExtendedDTM::set_implicit_omit()
{
if (ExtendedDTM__GPRSMultislot().is_bound()) ExtendedDTM__GPRSMultislot().set_implicit_omit();
if (ExtendedDTM__EGPRSMultislot().is_bound()) ExtendedDTM__EGPRSMultislot().set_implicit_omit();
}

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

void ExtendedDTM::encode_text(Text_Buf& text_buf) const
{
field_ExtendedDTM__GPRSMultislot.encode_text(text_buf);
field_ExtendedDTM__EGPRSMultislot.encode_text(text_buf);
}

void ExtendedDTM::decode_text(Text_Buf& text_buf)
{
field_ExtendedDTM__GPRSMultislot.decode_text(text_buf);
field_ExtendedDTM__EGPRSMultislot.decode_text(text_buf);
}

void ExtendedDTM::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 ExtendedDTM::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 ExtendedDTM::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, ExtendedDTM_ExtendedDTM__GPRSMultislot_descr_.raw->forceomit);
  decoded_field_length = field_ExtendedDTM__GPRSMultislot.RAW_decode(ExtendedDTM_ExtendedDTM__GPRSMultislot_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, ExtendedDTM_ExtendedDTM__EGPRSMultislot_descr_.raw->forceomit);
  decoded_field_length = field_ExtendedDTM__EGPRSMultislot.RAW_decode(ExtendedDTM_ExtendedDTM__EGPRSMultislot_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 ExtendedDTM::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, ExtendedDTM_ExtendedDTM__GPRSMultislot_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ExtendedDTM_ExtendedDTM__EGPRSMultislot_descr_.raw);
  encoded_length += field_ExtendedDTM__GPRSMultislot.RAW_encode(ExtendedDTM_ExtendedDTM__GPRSMultislot_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ExtendedDTM__EGPRSMultislot.RAW_encode(ExtendedDTM_ExtendedDTM__EGPRSMultislot_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct ExtendedDTM_template::single_value_struct {
BITSTRING_template field_ExtendedDTM__GPRSMultislot;
BITSTRING_template field_ExtendedDTM__EGPRSMultislot;
};

void ExtendedDTM_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_ExtendedDTM__GPRSMultislot = ANY_VALUE;
single_value->field_ExtendedDTM__EGPRSMultislot = ANY_VALUE;
}
}
}

void ExtendedDTM_template::copy_value(const ExtendedDTM& other_value)
{
single_value = new single_value_struct;
if (other_value.ExtendedDTM__GPRSMultislot().is_bound()) {
  single_value->field_ExtendedDTM__GPRSMultislot = other_value.ExtendedDTM__GPRSMultislot();
} else {
  single_value->field_ExtendedDTM__GPRSMultislot.clean_up();
}
if (other_value.ExtendedDTM__EGPRSMultislot().is_bound()) {
  single_value->field_ExtendedDTM__EGPRSMultislot = other_value.ExtendedDTM__EGPRSMultislot();
} else {
  single_value->field_ExtendedDTM__EGPRSMultislot.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ExtendedDTM_template::copy_template(const ExtendedDTM_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.ExtendedDTM__GPRSMultislot().get_selection()) {
single_value->field_ExtendedDTM__GPRSMultislot = other_value.ExtendedDTM__GPRSMultislot();
} else {
single_value->field_ExtendedDTM__GPRSMultislot.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ExtendedDTM__EGPRSMultislot().get_selection()) {
single_value->field_ExtendedDTM__EGPRSMultislot = other_value.ExtendedDTM__EGPRSMultislot();
} else {
single_value->field_ExtendedDTM__EGPRSMultislot.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 ExtendedDTM_template[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 ExtendedDTM_template(*other_value.implication_.precondition);
implication_.implied_template = new ExtendedDTM_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_GMM_SM_Types.ExtendedDTM.");
break;
}
set_selection(other_value);
}

ExtendedDTM_template::ExtendedDTM_template()
{
}

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

ExtendedDTM_template::ExtendedDTM_template(const ExtendedDTM& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ExtendedDTM_template::match(const ExtendedDTM& 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.ExtendedDTM__GPRSMultislot().is_bound()) return FALSE;
if(!single_value->field_ExtendedDTM__GPRSMultislot.match(other_value.ExtendedDTM__GPRSMultislot(), legacy))return FALSE;
if(!other_value.ExtendedDTM__EGPRSMultislot().is_bound()) return FALSE;
if(!single_value->field_ExtendedDTM__EGPRSMultislot.match(other_value.ExtendedDTM__EGPRSMultislot(), 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_GMM_SM_Types.ExtendedDTM.");
}
return FALSE;
}

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

boolean ExtendedDTM_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_ExtendedDTM__GPRSMultislot.is_value()
 && single_value->field_ExtendedDTM__EGPRSMultislot.is_value();
}

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

ExtendedDTM ExtendedDTM_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_GMM_SM_Types.ExtendedDTM.");
ExtendedDTM ret_val;
if (single_value->field_ExtendedDTM__GPRSMultislot.is_bound()) {
ret_val.ExtendedDTM__GPRSMultislot() = single_value->field_ExtendedDTM__GPRSMultislot.valueof();
}
if (single_value->field_ExtendedDTM__EGPRSMultislot.is_bound()) {
ret_val.ExtendedDTM__EGPRSMultislot() = single_value->field_ExtendedDTM__EGPRSMultislot.valueof();
}
return ret_val;
}

void ExtendedDTM_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_GMM_SM_Types.ExtendedDTM.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ExtendedDTM_template[list_length];
}

ExtendedDTM_template& ExtendedDTM_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_GMM_SM_Types.ExtendedDTM.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.ExtendedDTM.");
return value_list.list_value[list_index];
}

BITSTRING_template& ExtendedDTM_template::ExtendedDTM__GPRSMultislot()
{
set_specific();
return single_value->field_ExtendedDTM__GPRSMultislot;
}

const BITSTRING_template& ExtendedDTM_template::ExtendedDTM__GPRSMultislot() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ExtendedDTM_GPRSMultislot of a non-specific template of type @MobileL3_GMM_SM_Types.ExtendedDTM.");
return single_value->field_ExtendedDTM__GPRSMultislot;
}

BITSTRING_template& ExtendedDTM_template::ExtendedDTM__EGPRSMultislot()
{
set_specific();
return single_value->field_ExtendedDTM__EGPRSMultislot;
}

const BITSTRING_template& ExtendedDTM_template::ExtendedDTM__EGPRSMultislot() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ExtendedDTM_EGPRSMultislot of a non-specific template of type @MobileL3_GMM_SM_Types.ExtendedDTM.");
return single_value->field_ExtendedDTM__EGPRSMultislot;
}

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

void ExtendedDTM_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ ExtendedDTM_GPRSMultislot := ");
single_value->field_ExtendedDTM__GPRSMultislot.log();
TTCN_Logger::log_event_str(", ExtendedDTM_EGPRSMultislot := ");
single_value->field_ExtendedDTM__EGPRSMultislot.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 ExtendedDTM_template::log_match(const ExtendedDTM& 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_ExtendedDTM__GPRSMultislot.match(match_value.ExtendedDTM__GPRSMultislot(), legacy)){
TTCN_Logger::log_logmatch_info(".ExtendedDTM_GPRSMultislot");
single_value->field_ExtendedDTM__GPRSMultislot.log_match(match_value.ExtendedDTM__GPRSMultislot(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ExtendedDTM__EGPRSMultislot.match(match_value.ExtendedDTM__EGPRSMultislot(), legacy)){
TTCN_Logger::log_logmatch_info(".ExtendedDTM_EGPRSMultislot");
single_value->field_ExtendedDTM__EGPRSMultislot.log_match(match_value.ExtendedDTM__EGPRSMultislot(), 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("{ ExtendedDTM_GPRSMultislot := ");
single_value->field_ExtendedDTM__GPRSMultislot.log_match(match_value.ExtendedDTM__GPRSMultislot(), legacy);
TTCN_Logger::log_event_str(", ExtendedDTM_EGPRSMultislot := ");
single_value->field_ExtendedDTM__EGPRSMultislot.log_match(match_value.ExtendedDTM__EGPRSMultislot(), 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 ExtendedDTM_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (ExtendedDTM__GPRSMultislot().is_bound()) ExtendedDTM__GPRSMultislot().set_implicit_omit();
if (ExtendedDTM__EGPRSMultislot().is_bound()) ExtendedDTM__EGPRSMultislot().set_implicit_omit();
}

void ExtendedDTM_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_ExtendedDTM__GPRSMultislot.encode_text(text_buf);
single_value->field_ExtendedDTM__EGPRSMultislot.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_GMM_SM_Types.ExtendedDTM.");
}
}

void ExtendedDTM_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_ExtendedDTM__GPRSMultislot.decode_text(text_buf);
single_value->field_ExtendedDTM__EGPRSMultislot.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 ExtendedDTM_template[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_GMM_SM_Types.ExtendedDTM.");
}
}

void ExtendedDTM_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: {
    ExtendedDTM_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_GMM_SM_Types.ExtendedDTM 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) ExtendedDTM__GPRSMultislot().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ExtendedDTM__EGPRSMultislot().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(), "ExtendedDTM_GPRSMultislot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ExtendedDTM__GPRSMultislot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ExtendedDTM_EGPRSMultislot")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ExtendedDTM__EGPRSMultislot().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.ExtendedDTM: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ExtendedDTM_template* precondition = new ExtendedDTM_template;
    precondition->set_param(*param.get_elem(0));
    ExtendedDTM_template* implied_template = new ExtendedDTM_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ExtendedDTM_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.ExtendedDTM");
  }
  is_ifpresent = param.get_ifpresent();
}

void ExtendedDTM_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_ExtendedDTM__GPRSMultislot.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ExtendedDTM");
single_value->field_ExtendedDTM__EGPRSMultislot.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.ExtendedDTM");
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_GMM_SM_Types.ExtendedDTM");
}

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

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

AccessCapAdditionsAfterRel99::AccessCapAdditionsAfterRel99()
{
}

AccessCapAdditionsAfterRel99::AccessCapAdditionsAfterRel99(const AccessCapAdditionsRel4& par_accessCapAdditionsRel4,
    const OPTIONAL< AccessCapAdditionsAfterRel4 >& par_accessCapAdditionsAfterRel4)
  :   field_accessCapAdditionsRel4(par_accessCapAdditionsRel4),
  field_accessCapAdditionsAfterRel4(par_accessCapAdditionsAfterRel4)
{
}

AccessCapAdditionsAfterRel99::AccessCapAdditionsAfterRel99(const AccessCapAdditionsAfterRel99& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
if (other_value.accessCapAdditionsRel4().is_bound()) field_accessCapAdditionsRel4 = other_value.accessCapAdditionsRel4();
else field_accessCapAdditionsRel4.clean_up();
if (other_value.accessCapAdditionsAfterRel4().is_bound()) field_accessCapAdditionsAfterRel4 = other_value.accessCapAdditionsAfterRel4();
else field_accessCapAdditionsAfterRel4.clean_up();
}

void AccessCapAdditionsAfterRel99::clean_up()
{
field_accessCapAdditionsRel4.clean_up();
field_accessCapAdditionsAfterRel4.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel99::get_descriptor() const { return &AccessCapAdditionsAfterRel99_descr_; }
AccessCapAdditionsAfterRel99& AccessCapAdditionsAfterRel99::operator=(const AccessCapAdditionsAfterRel99& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
  if (other_value.accessCapAdditionsRel4().is_bound()) field_accessCapAdditionsRel4 = other_value.accessCapAdditionsRel4();
  else field_accessCapAdditionsRel4.clean_up();
  if (other_value.accessCapAdditionsAfterRel4().is_bound()) field_accessCapAdditionsAfterRel4 = other_value.accessCapAdditionsAfterRel4();
  else field_accessCapAdditionsAfterRel4.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel99::operator==(const AccessCapAdditionsAfterRel99& other_value) const
{
return field_accessCapAdditionsRel4==other_value.field_accessCapAdditionsRel4
  && field_accessCapAdditionsAfterRel4==other_value.field_accessCapAdditionsAfterRel4;
}

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

void AccessCapAdditionsAfterRel99::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel4 := ");
field_accessCapAdditionsRel4.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel4 := ");
field_accessCapAdditionsAfterRel4.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel99::set_implicit_omit()
{
if (accessCapAdditionsRel4().is_bound()) accessCapAdditionsRel4().set_implicit_omit();
if (!accessCapAdditionsAfterRel4().is_bound()) accessCapAdditionsAfterRel4() = OMIT_VALUE;
else accessCapAdditionsAfterRel4().set_implicit_omit();
}

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

void AccessCapAdditionsAfterRel99::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel4.encode_text(text_buf);
field_accessCapAdditionsAfterRel4.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel99::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel4.decode_text(text_buf);
field_accessCapAdditionsAfterRel4.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel99::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 AccessCapAdditionsAfterRel99::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 AccessCapAdditionsAfterRel99::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, AccessCapAdditionsAfterRel99_accessCapAdditionsRel4_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel4.RAW_decode(AccessCapAdditionsAfterRel99_accessCapAdditionsRel4_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_accessCapAdditionsAfterRel4 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel99_accessCapAdditionsAfterRel4_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel4().RAW_decode(AccessCapAdditionsAfterRel99_accessCapAdditionsAfterRel4_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_accessCapAdditionsAfterRel4 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_accessCapAdditionsAfterRel4=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel99::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, AccessCapAdditionsAfterRel99_accessCapAdditionsRel4_descr_.raw);
  if (field_accessCapAdditionsAfterRel4.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel99_accessCapAdditionsAfterRel4_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_accessCapAdditionsRel4.RAW_encode(AccessCapAdditionsAfterRel99_accessCapAdditionsRel4_descr_, *myleaf.body.node.nodes[0]);
  if (field_accessCapAdditionsAfterRel4.ispresent()) {
  encoded_length += field_accessCapAdditionsAfterRel4().RAW_encode(AccessCapAdditionsAfterRel99_accessCapAdditionsAfterRel4_descr_, *myleaf.body.node.nodes[1]);
  }
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel99_template::single_value_struct {
AccessCapAdditionsRel4_template field_accessCapAdditionsRel4;
AccessCapAdditionsAfterRel4_template field_accessCapAdditionsAfterRel4;
};

void AccessCapAdditionsAfterRel99_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_accessCapAdditionsRel4 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel4 = ANY_OR_OMIT;
}
}
}

void AccessCapAdditionsAfterRel99_template::copy_value(const AccessCapAdditionsAfterRel99& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel4().is_bound()) {
  single_value->field_accessCapAdditionsRel4 = other_value.accessCapAdditionsRel4();
} else {
  single_value->field_accessCapAdditionsRel4.clean_up();
}
if (other_value.accessCapAdditionsAfterRel4().is_bound()) {
  if (other_value.accessCapAdditionsAfterRel4().ispresent()) single_value->field_accessCapAdditionsAfterRel4 = other_value.accessCapAdditionsAfterRel4()();
  else single_value->field_accessCapAdditionsAfterRel4 = OMIT_VALUE;
} else {
  single_value->field_accessCapAdditionsAfterRel4.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel99_template::copy_template(const AccessCapAdditionsAfterRel99_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel4().get_selection()) {
single_value->field_accessCapAdditionsRel4 = other_value.accessCapAdditionsRel4();
} else {
single_value->field_accessCapAdditionsRel4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel4().get_selection()) {
single_value->field_accessCapAdditionsAfterRel4 = other_value.accessCapAdditionsAfterRel4();
} else {
single_value->field_accessCapAdditionsAfterRel4.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 AccessCapAdditionsAfterRel99_template[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 AccessCapAdditionsAfterRel99_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel99_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_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel99_template::AccessCapAdditionsAfterRel99_template()
{
}

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

AccessCapAdditionsAfterRel99_template::AccessCapAdditionsAfterRel99_template(const AccessCapAdditionsAfterRel99& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsAfterRel99_template::match(const AccessCapAdditionsAfterRel99& 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.accessCapAdditionsRel4().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel4.match(other_value.accessCapAdditionsRel4(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel4().is_bound()) return FALSE;
if((other_value.accessCapAdditionsAfterRel4().ispresent() ? !single_value->field_accessCapAdditionsAfterRel4.match((const AccessCapAdditionsAfterRel4&)other_value.accessCapAdditionsAfterRel4(), legacy) : !single_value->field_accessCapAdditionsAfterRel4.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_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel99_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel4.is_bound()
 || (single_value->field_accessCapAdditionsAfterRel4.is_omit() || single_value->field_accessCapAdditionsAfterRel4.is_bound());
}

boolean AccessCapAdditionsAfterRel99_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel4.is_value()
 && (single_value->field_accessCapAdditionsAfterRel4.is_omit() || single_value->field_accessCapAdditionsAfterRel4.is_value());
}

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

AccessCapAdditionsAfterRel99 AccessCapAdditionsAfterRel99_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_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
AccessCapAdditionsAfterRel99 ret_val;
if (single_value->field_accessCapAdditionsRel4.is_bound()) {
ret_val.accessCapAdditionsRel4() = single_value->field_accessCapAdditionsRel4.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel4.is_omit()) ret_val.accessCapAdditionsAfterRel4() = OMIT_VALUE;
else if (single_value->field_accessCapAdditionsAfterRel4.is_bound()) {
ret_val.accessCapAdditionsAfterRel4() = single_value->field_accessCapAdditionsAfterRel4.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel99_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_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel99_template[list_length];
}

AccessCapAdditionsAfterRel99_template& AccessCapAdditionsAfterRel99_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_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel4_template& AccessCapAdditionsAfterRel99_template::accessCapAdditionsRel4()
{
set_specific();
return single_value->field_accessCapAdditionsRel4;
}

const AccessCapAdditionsRel4_template& AccessCapAdditionsAfterRel99_template::accessCapAdditionsRel4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel4 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
return single_value->field_accessCapAdditionsRel4;
}

AccessCapAdditionsAfterRel4_template& AccessCapAdditionsAfterRel99_template::accessCapAdditionsAfterRel4()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel4;
}

const AccessCapAdditionsAfterRel4_template& AccessCapAdditionsAfterRel99_template::accessCapAdditionsAfterRel4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel4 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
return single_value->field_accessCapAdditionsAfterRel4;
}

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

void AccessCapAdditionsAfterRel99_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel4 := ");
single_value->field_accessCapAdditionsRel4.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel4 := ");
single_value->field_accessCapAdditionsAfterRel4.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 AccessCapAdditionsAfterRel99_template::log_match(const AccessCapAdditionsAfterRel99& 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_accessCapAdditionsRel4.match(match_value.accessCapAdditionsRel4(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel4");
single_value->field_accessCapAdditionsRel4.log_match(match_value.accessCapAdditionsRel4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.accessCapAdditionsAfterRel4().ispresent()){
if(!single_value->field_accessCapAdditionsAfterRel4.match(match_value.accessCapAdditionsAfterRel4(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel4");
single_value->field_accessCapAdditionsAfterRel4.log_match(match_value.accessCapAdditionsAfterRel4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_accessCapAdditionsAfterRel4.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel4 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_accessCapAdditionsAfterRel4.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("{ accessCapAdditionsRel4 := ");
single_value->field_accessCapAdditionsRel4.log_match(match_value.accessCapAdditionsRel4(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel4 := ");
if (match_value.accessCapAdditionsAfterRel4().ispresent()) {
single_value->field_accessCapAdditionsAfterRel4.log_match(match_value.accessCapAdditionsAfterRel4(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_accessCapAdditionsAfterRel4.log();
if (single_value->field_accessCapAdditionsAfterRel4.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 AccessCapAdditionsAfterRel99_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (accessCapAdditionsRel4().is_bound()) accessCapAdditionsRel4().set_implicit_omit();
if (!accessCapAdditionsAfterRel4().is_bound()) accessCapAdditionsAfterRel4() = OMIT_VALUE;
else accessCapAdditionsAfterRel4().set_implicit_omit();
}

void AccessCapAdditionsAfterRel99_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel4.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel4.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_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
}
}

void AccessCapAdditionsAfterRel99_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_accessCapAdditionsRel4.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel4.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 AccessCapAdditionsAfterRel99_template[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_GMM_SM_Types.AccessCapAdditionsAfterRel99.");
}
}

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

void AccessCapAdditionsAfterRel99_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_accessCapAdditionsRel4.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel99");
single_value->field_accessCapAdditionsAfterRel4.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel99");
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_GMM_SM_Types.AccessCapAdditionsAfterRel99");
}

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

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

AccessCapAdditionsRel5::AccessCapAdditionsRel5()
{
}

AccessCapAdditionsRel5::AccessCapAdditionsRel5(const BITSTRING& par_presenceBitHighMultislotCapability,
    const OPTIONAL< BITSTRING >& par_highMultislotCapability,
    const BITSTRING& par_presenceBitGeranIuModeCapability,
    const BITSTRING& par_gMSKMultislotPowerProfile,
    const BITSTRING& par_eightPSKMultislotPowerProfile)
  :   field_presenceBitHighMultislotCapability(par_presenceBitHighMultislotCapability),
  field_highMultislotCapability(par_highMultislotCapability),
  field_presenceBitGeranIuModeCapability(par_presenceBitGeranIuModeCapability),
  field_gMSKMultislotPowerProfile(par_gMSKMultislotPowerProfile),
  field_eightPSKMultislotPowerProfile(par_eightPSKMultislotPowerProfile)
{
}

AccessCapAdditionsRel5::AccessCapAdditionsRel5(const AccessCapAdditionsRel5& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel5.");
if (other_value.presenceBitHighMultislotCapability().is_bound()) field_presenceBitHighMultislotCapability = other_value.presenceBitHighMultislotCapability();
else field_presenceBitHighMultislotCapability.clean_up();
if (other_value.highMultislotCapability().is_bound()) field_highMultislotCapability = other_value.highMultislotCapability();
else field_highMultislotCapability.clean_up();
if (other_value.presenceBitGeranIuModeCapability().is_bound()) field_presenceBitGeranIuModeCapability = other_value.presenceBitGeranIuModeCapability();
else field_presenceBitGeranIuModeCapability.clean_up();
if (other_value.gMSKMultislotPowerProfile().is_bound()) field_gMSKMultislotPowerProfile = other_value.gMSKMultislotPowerProfile();
else field_gMSKMultislotPowerProfile.clean_up();
if (other_value.eightPSKMultislotPowerProfile().is_bound()) field_eightPSKMultislotPowerProfile = other_value.eightPSKMultislotPowerProfile();
else field_eightPSKMultislotPowerProfile.clean_up();
}

void AccessCapAdditionsRel5::clean_up()
{
field_presenceBitHighMultislotCapability.clean_up();
field_highMultislotCapability.clean_up();
field_presenceBitGeranIuModeCapability.clean_up();
field_gMSKMultislotPowerProfile.clean_up();
field_eightPSKMultislotPowerProfile.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel5::get_descriptor() const { return &AccessCapAdditionsRel5_descr_; }
AccessCapAdditionsRel5& AccessCapAdditionsRel5::operator=(const AccessCapAdditionsRel5& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel5.");
  if (other_value.presenceBitHighMultislotCapability().is_bound()) field_presenceBitHighMultislotCapability = other_value.presenceBitHighMultislotCapability();
  else field_presenceBitHighMultislotCapability.clean_up();
  if (other_value.highMultislotCapability().is_bound()) field_highMultislotCapability = other_value.highMultislotCapability();
  else field_highMultislotCapability.clean_up();
  if (other_value.presenceBitGeranIuModeCapability().is_bound()) field_presenceBitGeranIuModeCapability = other_value.presenceBitGeranIuModeCapability();
  else field_presenceBitGeranIuModeCapability.clean_up();
  if (other_value.gMSKMultislotPowerProfile().is_bound()) field_gMSKMultislotPowerProfile = other_value.gMSKMultislotPowerProfile();
  else field_gMSKMultislotPowerProfile.clean_up();
  if (other_value.eightPSKMultislotPowerProfile().is_bound()) field_eightPSKMultislotPowerProfile = other_value.eightPSKMultislotPowerProfile();
  else field_eightPSKMultislotPowerProfile.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel5::operator==(const AccessCapAdditionsRel5& other_value) const
{
return field_presenceBitHighMultislotCapability==other_value.field_presenceBitHighMultislotCapability
  && field_highMultislotCapability==other_value.field_highMultislotCapability
  && field_presenceBitGeranIuModeCapability==other_value.field_presenceBitGeranIuModeCapability
  && field_gMSKMultislotPowerProfile==other_value.field_gMSKMultislotPowerProfile
  && field_eightPSKMultislotPowerProfile==other_value.field_eightPSKMultislotPowerProfile;
}

boolean AccessCapAdditionsRel5::is_bound() const
{
return (field_presenceBitHighMultislotCapability.is_bound())
  || (OPTIONAL_OMIT == field_highMultislotCapability.get_selection() || field_highMultislotCapability.is_bound())
  || (field_presenceBitGeranIuModeCapability.is_bound())
  || (field_gMSKMultislotPowerProfile.is_bound())
  || (field_eightPSKMultislotPowerProfile.is_bound());
}
boolean AccessCapAdditionsRel5::is_value() const
{
return field_presenceBitHighMultislotCapability.is_value()
  && (OPTIONAL_OMIT == field_highMultislotCapability.get_selection() || field_highMultislotCapability.is_value())
  && field_presenceBitGeranIuModeCapability.is_value()
  && field_gMSKMultislotPowerProfile.is_value()
  && field_eightPSKMultislotPowerProfile.is_value();
}
int AccessCapAdditionsRel5::size_of() const
{
  int ret_val = 4;
  if (field_highMultislotCapability.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsRel5::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ presenceBitHighMultislotCapability := ");
field_presenceBitHighMultislotCapability.log();
TTCN_Logger::log_event_str(", highMultislotCapability := ");
field_highMultislotCapability.log();
TTCN_Logger::log_event_str(", presenceBitGeranIuModeCapability := ");
field_presenceBitGeranIuModeCapability.log();
TTCN_Logger::log_event_str(", gMSKMultislotPowerProfile := ");
field_gMSKMultislotPowerProfile.log();
TTCN_Logger::log_event_str(", eightPSKMultislotPowerProfile := ");
field_eightPSKMultislotPowerProfile.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel5::set_implicit_omit()
{
if (presenceBitHighMultislotCapability().is_bound()) presenceBitHighMultislotCapability().set_implicit_omit();
if (!highMultislotCapability().is_bound()) highMultislotCapability() = OMIT_VALUE;
else highMultislotCapability().set_implicit_omit();
if (presenceBitGeranIuModeCapability().is_bound()) presenceBitGeranIuModeCapability().set_implicit_omit();
if (gMSKMultislotPowerProfile().is_bound()) gMSKMultislotPowerProfile().set_implicit_omit();
if (eightPSKMultislotPowerProfile().is_bound()) eightPSKMultislotPowerProfile().set_implicit_omit();
}

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

void AccessCapAdditionsRel5::encode_text(Text_Buf& text_buf) const
{
field_presenceBitHighMultislotCapability.encode_text(text_buf);
field_highMultislotCapability.encode_text(text_buf);
field_presenceBitGeranIuModeCapability.encode_text(text_buf);
field_gMSKMultislotPowerProfile.encode_text(text_buf);
field_eightPSKMultislotPowerProfile.encode_text(text_buf);
}

void AccessCapAdditionsRel5::decode_text(Text_Buf& text_buf)
{
field_presenceBitHighMultislotCapability.decode_text(text_buf);
field_highMultislotCapability.decode_text(text_buf);
field_presenceBitGeranIuModeCapability.decode_text(text_buf);
field_gMSKMultislotPowerProfile.decode_text(text_buf);
field_eightPSKMultislotPowerProfile.decode_text(text_buf);
}

void AccessCapAdditionsRel5::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 AccessCapAdditionsRel5::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 AccessCapAdditionsRel5::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, AccessCapAdditionsRel5_presenceBitHighMultislotCapability_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitHighMultislotCapability.RAW_decode(AccessCapAdditionsRel5_presenceBitHighMultislotCapability_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 && field_presenceBitHighMultislotCapability ==  bs_2){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_highMultislotCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel5_highMultislotCapability_descr_.raw->forceomit);
  decoded_field_length = field_highMultislotCapability().RAW_decode(AccessCapAdditionsRel5_highMultislotCapability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_highMultislotCapability = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_highMultislotCapability=OMIT_VALUE;
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel5_presenceBitGeranIuModeCapability_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitGeranIuModeCapability.RAW_decode(AccessCapAdditionsRel5_presenceBitGeranIuModeCapability_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, AccessCapAdditionsRel5_gMSKMultislotPowerProfile_descr_.raw->forceomit);
  decoded_field_length = field_gMSKMultislotPowerProfile.RAW_decode(AccessCapAdditionsRel5_gMSKMultislotPowerProfile_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, AccessCapAdditionsRel5_eightPSKMultislotPowerProfile_descr_.raw->forceomit);
  decoded_field_length = field_eightPSKMultislotPowerProfile.RAW_decode(AccessCapAdditionsRel5_eightPSKMultislotPowerProfile_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel5::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, AccessCapAdditionsRel5_presenceBitHighMultislotCapability_descr_.raw);
  if (field_highMultislotCapability.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel5_highMultislotCapability_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel5_presenceBitGeranIuModeCapability_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel5_gMSKMultislotPowerProfile_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel5_eightPSKMultislotPowerProfile_descr_.raw);
  encoded_length += field_presenceBitHighMultislotCapability.RAW_encode(AccessCapAdditionsRel5_presenceBitHighMultislotCapability_descr_, *myleaf.body.node.nodes[0]);
  if (field_highMultislotCapability.ispresent()) {
  encoded_length += field_highMultislotCapability().RAW_encode(AccessCapAdditionsRel5_highMultislotCapability_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_presenceBitGeranIuModeCapability.RAW_encode(AccessCapAdditionsRel5_presenceBitGeranIuModeCapability_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_gMSKMultislotPowerProfile.RAW_encode(AccessCapAdditionsRel5_gMSKMultislotPowerProfile_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_eightPSKMultislotPowerProfile.RAW_encode(AccessCapAdditionsRel5_eightPSKMultislotPowerProfile_descr_, *myleaf.body.node.nodes[4]);
  if (field_highMultislotCapability.ispresent() && (field_presenceBitHighMultislotCapability !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  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_2.RAW_encode(AccessCapAdditionsRel5_presenceBitHighMultislotCapability_descr_,*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 AccessCapAdditionsRel5_template::single_value_struct {
BITSTRING_template field_presenceBitHighMultislotCapability;
BITSTRING_template field_highMultislotCapability;
BITSTRING_template field_presenceBitGeranIuModeCapability;
BITSTRING_template field_gMSKMultislotPowerProfile;
BITSTRING_template field_eightPSKMultislotPowerProfile;
};

void AccessCapAdditionsRel5_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_presenceBitHighMultislotCapability = ANY_VALUE;
single_value->field_highMultislotCapability = ANY_OR_OMIT;
single_value->field_presenceBitGeranIuModeCapability = ANY_VALUE;
single_value->field_gMSKMultislotPowerProfile = ANY_VALUE;
single_value->field_eightPSKMultislotPowerProfile = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel5_template::copy_value(const AccessCapAdditionsRel5& other_value)
{
single_value = new single_value_struct;
if (other_value.presenceBitHighMultislotCapability().is_bound()) {
  single_value->field_presenceBitHighMultislotCapability = other_value.presenceBitHighMultislotCapability();
} else {
  single_value->field_presenceBitHighMultislotCapability.clean_up();
}
if (other_value.highMultislotCapability().is_bound()) {
  if (other_value.highMultislotCapability().ispresent()) single_value->field_highMultislotCapability = other_value.highMultislotCapability()();
  else single_value->field_highMultislotCapability = OMIT_VALUE;
} else {
  single_value->field_highMultislotCapability.clean_up();
}
if (other_value.presenceBitGeranIuModeCapability().is_bound()) {
  single_value->field_presenceBitGeranIuModeCapability = other_value.presenceBitGeranIuModeCapability();
} else {
  single_value->field_presenceBitGeranIuModeCapability.clean_up();
}
if (other_value.gMSKMultislotPowerProfile().is_bound()) {
  single_value->field_gMSKMultislotPowerProfile = other_value.gMSKMultislotPowerProfile();
} else {
  single_value->field_gMSKMultislotPowerProfile.clean_up();
}
if (other_value.eightPSKMultislotPowerProfile().is_bound()) {
  single_value->field_eightPSKMultislotPowerProfile = other_value.eightPSKMultislotPowerProfile();
} else {
  single_value->field_eightPSKMultislotPowerProfile.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel5_template::copy_template(const AccessCapAdditionsRel5_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitHighMultislotCapability().get_selection()) {
single_value->field_presenceBitHighMultislotCapability = other_value.presenceBitHighMultislotCapability();
} else {
single_value->field_presenceBitHighMultislotCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.highMultislotCapability().get_selection()) {
single_value->field_highMultislotCapability = other_value.highMultislotCapability();
} else {
single_value->field_highMultislotCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitGeranIuModeCapability().get_selection()) {
single_value->field_presenceBitGeranIuModeCapability = other_value.presenceBitGeranIuModeCapability();
} else {
single_value->field_presenceBitGeranIuModeCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gMSKMultislotPowerProfile().get_selection()) {
single_value->field_gMSKMultislotPowerProfile = other_value.gMSKMultislotPowerProfile();
} else {
single_value->field_gMSKMultislotPowerProfile.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eightPSKMultislotPowerProfile().get_selection()) {
single_value->field_eightPSKMultislotPowerProfile = other_value.eightPSKMultislotPowerProfile();
} else {
single_value->field_eightPSKMultislotPowerProfile.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 AccessCapAdditionsRel5_template[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 AccessCapAdditionsRel5_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel5_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_GMM_SM_Types.AccessCapAdditionsRel5.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel5_template::AccessCapAdditionsRel5_template()
{
}

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

AccessCapAdditionsRel5_template::AccessCapAdditionsRel5_template(const AccessCapAdditionsRel5& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel5_template::match(const AccessCapAdditionsRel5& 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.presenceBitHighMultislotCapability().is_bound()) return FALSE;
if(!single_value->field_presenceBitHighMultislotCapability.match(other_value.presenceBitHighMultislotCapability(), legacy))return FALSE;
if(!other_value.highMultislotCapability().is_bound()) return FALSE;
if((other_value.highMultislotCapability().ispresent() ? !single_value->field_highMultislotCapability.match((const BITSTRING&)other_value.highMultislotCapability(), legacy) : !single_value->field_highMultislotCapability.match_omit(legacy)))return FALSE;
if(!other_value.presenceBitGeranIuModeCapability().is_bound()) return FALSE;
if(!single_value->field_presenceBitGeranIuModeCapability.match(other_value.presenceBitGeranIuModeCapability(), legacy))return FALSE;
if(!other_value.gMSKMultislotPowerProfile().is_bound()) return FALSE;
if(!single_value->field_gMSKMultislotPowerProfile.match(other_value.gMSKMultislotPowerProfile(), legacy))return FALSE;
if(!other_value.eightPSKMultislotPowerProfile().is_bound()) return FALSE;
if(!single_value->field_eightPSKMultislotPowerProfile.match(other_value.eightPSKMultislotPowerProfile(), 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_GMM_SM_Types.AccessCapAdditionsRel5.");
}
return FALSE;
}

boolean AccessCapAdditionsRel5_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_presenceBitHighMultislotCapability.is_bound()
 || (single_value->field_highMultislotCapability.is_omit() || single_value->field_highMultislotCapability.is_bound())
 || single_value->field_presenceBitGeranIuModeCapability.is_bound()
 || single_value->field_gMSKMultislotPowerProfile.is_bound()
 || single_value->field_eightPSKMultislotPowerProfile.is_bound();
}

boolean AccessCapAdditionsRel5_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_presenceBitHighMultislotCapability.is_value()
 && (single_value->field_highMultislotCapability.is_omit() || single_value->field_highMultislotCapability.is_value())
 && single_value->field_presenceBitGeranIuModeCapability.is_value()
 && single_value->field_gMSKMultislotPowerProfile.is_value()
 && single_value->field_eightPSKMultislotPowerProfile.is_value();
}

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

AccessCapAdditionsRel5 AccessCapAdditionsRel5_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_GMM_SM_Types.AccessCapAdditionsRel5.");
AccessCapAdditionsRel5 ret_val;
if (single_value->field_presenceBitHighMultislotCapability.is_bound()) {
ret_val.presenceBitHighMultislotCapability() = single_value->field_presenceBitHighMultislotCapability.valueof();
}
if (single_value->field_highMultislotCapability.is_omit()) ret_val.highMultislotCapability() = OMIT_VALUE;
else if (single_value->field_highMultislotCapability.is_bound()) {
ret_val.highMultislotCapability() = single_value->field_highMultislotCapability.valueof();
}
if (single_value->field_presenceBitGeranIuModeCapability.is_bound()) {
ret_val.presenceBitGeranIuModeCapability() = single_value->field_presenceBitGeranIuModeCapability.valueof();
}
if (single_value->field_gMSKMultislotPowerProfile.is_bound()) {
ret_val.gMSKMultislotPowerProfile() = single_value->field_gMSKMultislotPowerProfile.valueof();
}
if (single_value->field_eightPSKMultislotPowerProfile.is_bound()) {
ret_val.eightPSKMultislotPowerProfile() = single_value->field_eightPSKMultislotPowerProfile.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel5_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_GMM_SM_Types.AccessCapAdditionsRel5.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel5_template[list_length];
}

AccessCapAdditionsRel5_template& AccessCapAdditionsRel5_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_GMM_SM_Types.AccessCapAdditionsRel5.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel5.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel5_template::presenceBitHighMultislotCapability()
{
set_specific();
return single_value->field_presenceBitHighMultislotCapability;
}

const BITSTRING_template& AccessCapAdditionsRel5_template::presenceBitHighMultislotCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitHighMultislotCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel5.");
return single_value->field_presenceBitHighMultislotCapability;
}

BITSTRING_template& AccessCapAdditionsRel5_template::highMultislotCapability()
{
set_specific();
return single_value->field_highMultislotCapability;
}

const BITSTRING_template& AccessCapAdditionsRel5_template::highMultislotCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field highMultislotCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel5.");
return single_value->field_highMultislotCapability;
}

BITSTRING_template& AccessCapAdditionsRel5_template::presenceBitGeranIuModeCapability()
{
set_specific();
return single_value->field_presenceBitGeranIuModeCapability;
}

const BITSTRING_template& AccessCapAdditionsRel5_template::presenceBitGeranIuModeCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitGeranIuModeCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel5.");
return single_value->field_presenceBitGeranIuModeCapability;
}

BITSTRING_template& AccessCapAdditionsRel5_template::gMSKMultislotPowerProfile()
{
set_specific();
return single_value->field_gMSKMultislotPowerProfile;
}

const BITSTRING_template& AccessCapAdditionsRel5_template::gMSKMultislotPowerProfile() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gMSKMultislotPowerProfile of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel5.");
return single_value->field_gMSKMultislotPowerProfile;
}

BITSTRING_template& AccessCapAdditionsRel5_template::eightPSKMultislotPowerProfile()
{
set_specific();
return single_value->field_eightPSKMultislotPowerProfile;
}

const BITSTRING_template& AccessCapAdditionsRel5_template::eightPSKMultislotPowerProfile() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eightPSKMultislotPowerProfile of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel5.");
return single_value->field_eightPSKMultislotPowerProfile;
}

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

void AccessCapAdditionsRel5_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ presenceBitHighMultislotCapability := ");
single_value->field_presenceBitHighMultislotCapability.log();
TTCN_Logger::log_event_str(", highMultislotCapability := ");
single_value->field_highMultislotCapability.log();
TTCN_Logger::log_event_str(", presenceBitGeranIuModeCapability := ");
single_value->field_presenceBitGeranIuModeCapability.log();
TTCN_Logger::log_event_str(", gMSKMultislotPowerProfile := ");
single_value->field_gMSKMultislotPowerProfile.log();
TTCN_Logger::log_event_str(", eightPSKMultislotPowerProfile := ");
single_value->field_eightPSKMultislotPowerProfile.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 AccessCapAdditionsRel5_template::log_match(const AccessCapAdditionsRel5& 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_presenceBitHighMultislotCapability.match(match_value.presenceBitHighMultislotCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitHighMultislotCapability");
single_value->field_presenceBitHighMultislotCapability.log_match(match_value.presenceBitHighMultislotCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.highMultislotCapability().ispresent()){
if(!single_value->field_highMultislotCapability.match(match_value.highMultislotCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".highMultislotCapability");
single_value->field_highMultislotCapability.log_match(match_value.highMultislotCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_highMultislotCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".highMultislotCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_highMultislotCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_presenceBitGeranIuModeCapability.match(match_value.presenceBitGeranIuModeCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitGeranIuModeCapability");
single_value->field_presenceBitGeranIuModeCapability.log_match(match_value.presenceBitGeranIuModeCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gMSKMultislotPowerProfile.match(match_value.gMSKMultislotPowerProfile(), legacy)){
TTCN_Logger::log_logmatch_info(".gMSKMultislotPowerProfile");
single_value->field_gMSKMultislotPowerProfile.log_match(match_value.gMSKMultislotPowerProfile(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eightPSKMultislotPowerProfile.match(match_value.eightPSKMultislotPowerProfile(), legacy)){
TTCN_Logger::log_logmatch_info(".eightPSKMultislotPowerProfile");
single_value->field_eightPSKMultislotPowerProfile.log_match(match_value.eightPSKMultislotPowerProfile(), 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("{ presenceBitHighMultislotCapability := ");
single_value->field_presenceBitHighMultislotCapability.log_match(match_value.presenceBitHighMultislotCapability(), legacy);
TTCN_Logger::log_event_str(", highMultislotCapability := ");
if (match_value.highMultislotCapability().ispresent()) {
single_value->field_highMultislotCapability.log_match(match_value.highMultislotCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_highMultislotCapability.log();
if (single_value->field_highMultislotCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", presenceBitGeranIuModeCapability := ");
single_value->field_presenceBitGeranIuModeCapability.log_match(match_value.presenceBitGeranIuModeCapability(), legacy);
TTCN_Logger::log_event_str(", gMSKMultislotPowerProfile := ");
single_value->field_gMSKMultislotPowerProfile.log_match(match_value.gMSKMultislotPowerProfile(), legacy);
TTCN_Logger::log_event_str(", eightPSKMultislotPowerProfile := ");
single_value->field_eightPSKMultislotPowerProfile.log_match(match_value.eightPSKMultislotPowerProfile(), 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 AccessCapAdditionsRel5_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (presenceBitHighMultislotCapability().is_bound()) presenceBitHighMultislotCapability().set_implicit_omit();
if (!highMultislotCapability().is_bound()) highMultislotCapability() = OMIT_VALUE;
else highMultislotCapability().set_implicit_omit();
if (presenceBitGeranIuModeCapability().is_bound()) presenceBitGeranIuModeCapability().set_implicit_omit();
if (gMSKMultislotPowerProfile().is_bound()) gMSKMultislotPowerProfile().set_implicit_omit();
if (eightPSKMultislotPowerProfile().is_bound()) eightPSKMultislotPowerProfile().set_implicit_omit();
}

void AccessCapAdditionsRel5_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_presenceBitHighMultislotCapability.encode_text(text_buf);
single_value->field_highMultislotCapability.encode_text(text_buf);
single_value->field_presenceBitGeranIuModeCapability.encode_text(text_buf);
single_value->field_gMSKMultislotPowerProfile.encode_text(text_buf);
single_value->field_eightPSKMultislotPowerProfile.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_GMM_SM_Types.AccessCapAdditionsRel5.");
}
}

void AccessCapAdditionsRel5_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_presenceBitHighMultislotCapability.decode_text(text_buf);
single_value->field_highMultislotCapability.decode_text(text_buf);
single_value->field_presenceBitGeranIuModeCapability.decode_text(text_buf);
single_value->field_gMSKMultislotPowerProfile.decode_text(text_buf);
single_value->field_eightPSKMultislotPowerProfile.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 AccessCapAdditionsRel5_template[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_GMM_SM_Types.AccessCapAdditionsRel5.");
}
}

void AccessCapAdditionsRel5_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: {
    AccessCapAdditionsRel5_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_GMM_SM_Types.AccessCapAdditionsRel5 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) presenceBitHighMultislotCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) highMultislotCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitGeranIuModeCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gMSKMultislotPowerProfile().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) eightPSKMultislotPowerProfile().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(), "presenceBitHighMultislotCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitHighMultislotCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "highMultislotCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          highMultislotCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitGeranIuModeCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitGeranIuModeCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gMSKMultislotPowerProfile")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gMSKMultislotPowerProfile().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eightPSKMultislotPowerProfile")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eightPSKMultislotPowerProfile().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel5: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel5_template* precondition = new AccessCapAdditionsRel5_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel5_template* implied_template = new AccessCapAdditionsRel5_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel5_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel5");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel5_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_presenceBitHighMultislotCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel5");
single_value->field_highMultislotCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel5");
single_value->field_presenceBitGeranIuModeCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel5");
single_value->field_gMSKMultislotPowerProfile.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel5");
single_value->field_eightPSKMultislotPowerProfile.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel5");
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_GMM_SM_Types.AccessCapAdditionsRel5");
}

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

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

AccessCapAdditionsAfterRel4::AccessCapAdditionsAfterRel4()
{
}

AccessCapAdditionsAfterRel4::AccessCapAdditionsAfterRel4(const AccessCapAdditionsRel5& par_accessCapAdditionsRel5,
    const OPTIONAL< AccessCapAdditionsAfterRel5 >& par_accessCapAdditionsAfterRel5)
  :   field_accessCapAdditionsRel5(par_accessCapAdditionsRel5),
  field_accessCapAdditionsAfterRel5(par_accessCapAdditionsAfterRel5)
{
}

AccessCapAdditionsAfterRel4::AccessCapAdditionsAfterRel4(const AccessCapAdditionsAfterRel4& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
if (other_value.accessCapAdditionsRel5().is_bound()) field_accessCapAdditionsRel5 = other_value.accessCapAdditionsRel5();
else field_accessCapAdditionsRel5.clean_up();
if (other_value.accessCapAdditionsAfterRel5().is_bound()) field_accessCapAdditionsAfterRel5 = other_value.accessCapAdditionsAfterRel5();
else field_accessCapAdditionsAfterRel5.clean_up();
}

void AccessCapAdditionsAfterRel4::clean_up()
{
field_accessCapAdditionsRel5.clean_up();
field_accessCapAdditionsAfterRel5.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel4::get_descriptor() const { return &AccessCapAdditionsAfterRel4_descr_; }
AccessCapAdditionsAfterRel4& AccessCapAdditionsAfterRel4::operator=(const AccessCapAdditionsAfterRel4& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
  if (other_value.accessCapAdditionsRel5().is_bound()) field_accessCapAdditionsRel5 = other_value.accessCapAdditionsRel5();
  else field_accessCapAdditionsRel5.clean_up();
  if (other_value.accessCapAdditionsAfterRel5().is_bound()) field_accessCapAdditionsAfterRel5 = other_value.accessCapAdditionsAfterRel5();
  else field_accessCapAdditionsAfterRel5.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel4::operator==(const AccessCapAdditionsAfterRel4& other_value) const
{
return field_accessCapAdditionsRel5==other_value.field_accessCapAdditionsRel5
  && field_accessCapAdditionsAfterRel5==other_value.field_accessCapAdditionsAfterRel5;
}

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

void AccessCapAdditionsAfterRel4::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel5 := ");
field_accessCapAdditionsRel5.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel5 := ");
field_accessCapAdditionsAfterRel5.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel4::set_implicit_omit()
{
if (accessCapAdditionsRel5().is_bound()) accessCapAdditionsRel5().set_implicit_omit();
if (!accessCapAdditionsAfterRel5().is_bound()) accessCapAdditionsAfterRel5() = OMIT_VALUE;
else accessCapAdditionsAfterRel5().set_implicit_omit();
}

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

void AccessCapAdditionsAfterRel4::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel5.encode_text(text_buf);
field_accessCapAdditionsAfterRel5.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel4::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel5.decode_text(text_buf);
field_accessCapAdditionsAfterRel5.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel4::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 AccessCapAdditionsAfterRel4::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 AccessCapAdditionsAfterRel4::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, AccessCapAdditionsAfterRel4_accessCapAdditionsRel5_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel5.RAW_decode(AccessCapAdditionsAfterRel4_accessCapAdditionsRel5_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_accessCapAdditionsAfterRel5 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel4_accessCapAdditionsAfterRel5_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel5().RAW_decode(AccessCapAdditionsAfterRel4_accessCapAdditionsAfterRel5_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_accessCapAdditionsAfterRel5 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_accessCapAdditionsAfterRel5=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel4::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, AccessCapAdditionsAfterRel4_accessCapAdditionsRel5_descr_.raw);
  if (field_accessCapAdditionsAfterRel5.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel4_accessCapAdditionsAfterRel5_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_accessCapAdditionsRel5.RAW_encode(AccessCapAdditionsAfterRel4_accessCapAdditionsRel5_descr_, *myleaf.body.node.nodes[0]);
  if (field_accessCapAdditionsAfterRel5.ispresent()) {
  encoded_length += field_accessCapAdditionsAfterRel5().RAW_encode(AccessCapAdditionsAfterRel4_accessCapAdditionsAfterRel5_descr_, *myleaf.body.node.nodes[1]);
  }
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel4_template::single_value_struct {
AccessCapAdditionsRel5_template field_accessCapAdditionsRel5;
AccessCapAdditionsAfterRel5_template field_accessCapAdditionsAfterRel5;
};

void AccessCapAdditionsAfterRel4_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_accessCapAdditionsRel5 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel5 = ANY_OR_OMIT;
}
}
}

void AccessCapAdditionsAfterRel4_template::copy_value(const AccessCapAdditionsAfterRel4& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel5().is_bound()) {
  single_value->field_accessCapAdditionsRel5 = other_value.accessCapAdditionsRel5();
} else {
  single_value->field_accessCapAdditionsRel5.clean_up();
}
if (other_value.accessCapAdditionsAfterRel5().is_bound()) {
  if (other_value.accessCapAdditionsAfterRel5().ispresent()) single_value->field_accessCapAdditionsAfterRel5 = other_value.accessCapAdditionsAfterRel5()();
  else single_value->field_accessCapAdditionsAfterRel5 = OMIT_VALUE;
} else {
  single_value->field_accessCapAdditionsAfterRel5.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel4_template::copy_template(const AccessCapAdditionsAfterRel4_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel5().get_selection()) {
single_value->field_accessCapAdditionsRel5 = other_value.accessCapAdditionsRel5();
} else {
single_value->field_accessCapAdditionsRel5.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel5().get_selection()) {
single_value->field_accessCapAdditionsAfterRel5 = other_value.accessCapAdditionsAfterRel5();
} else {
single_value->field_accessCapAdditionsAfterRel5.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 AccessCapAdditionsAfterRel4_template[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 AccessCapAdditionsAfterRel4_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel4_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_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel4_template::AccessCapAdditionsAfterRel4_template()
{
}

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

AccessCapAdditionsAfterRel4_template::AccessCapAdditionsAfterRel4_template(const AccessCapAdditionsAfterRel4& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsAfterRel4_template::match(const AccessCapAdditionsAfterRel4& 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.accessCapAdditionsRel5().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel5.match(other_value.accessCapAdditionsRel5(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel5().is_bound()) return FALSE;
if((other_value.accessCapAdditionsAfterRel5().ispresent() ? !single_value->field_accessCapAdditionsAfterRel5.match((const AccessCapAdditionsAfterRel5&)other_value.accessCapAdditionsAfterRel5(), legacy) : !single_value->field_accessCapAdditionsAfterRel5.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_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel4_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel5.is_bound()
 || (single_value->field_accessCapAdditionsAfterRel5.is_omit() || single_value->field_accessCapAdditionsAfterRel5.is_bound());
}

boolean AccessCapAdditionsAfterRel4_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel5.is_value()
 && (single_value->field_accessCapAdditionsAfterRel5.is_omit() || single_value->field_accessCapAdditionsAfterRel5.is_value());
}

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

AccessCapAdditionsAfterRel4 AccessCapAdditionsAfterRel4_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_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
AccessCapAdditionsAfterRel4 ret_val;
if (single_value->field_accessCapAdditionsRel5.is_bound()) {
ret_val.accessCapAdditionsRel5() = single_value->field_accessCapAdditionsRel5.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel5.is_omit()) ret_val.accessCapAdditionsAfterRel5() = OMIT_VALUE;
else if (single_value->field_accessCapAdditionsAfterRel5.is_bound()) {
ret_val.accessCapAdditionsAfterRel5() = single_value->field_accessCapAdditionsAfterRel5.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel4_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_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel4_template[list_length];
}

AccessCapAdditionsAfterRel4_template& AccessCapAdditionsAfterRel4_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_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel5_template& AccessCapAdditionsAfterRel4_template::accessCapAdditionsRel5()
{
set_specific();
return single_value->field_accessCapAdditionsRel5;
}

const AccessCapAdditionsRel5_template& AccessCapAdditionsAfterRel4_template::accessCapAdditionsRel5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel5 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
return single_value->field_accessCapAdditionsRel5;
}

AccessCapAdditionsAfterRel5_template& AccessCapAdditionsAfterRel4_template::accessCapAdditionsAfterRel5()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel5;
}

const AccessCapAdditionsAfterRel5_template& AccessCapAdditionsAfterRel4_template::accessCapAdditionsAfterRel5() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel5 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
return single_value->field_accessCapAdditionsAfterRel5;
}

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

void AccessCapAdditionsAfterRel4_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel5 := ");
single_value->field_accessCapAdditionsRel5.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel5 := ");
single_value->field_accessCapAdditionsAfterRel5.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 AccessCapAdditionsAfterRel4_template::log_match(const AccessCapAdditionsAfterRel4& 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_accessCapAdditionsRel5.match(match_value.accessCapAdditionsRel5(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel5");
single_value->field_accessCapAdditionsRel5.log_match(match_value.accessCapAdditionsRel5(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.accessCapAdditionsAfterRel5().ispresent()){
if(!single_value->field_accessCapAdditionsAfterRel5.match(match_value.accessCapAdditionsAfterRel5(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel5");
single_value->field_accessCapAdditionsAfterRel5.log_match(match_value.accessCapAdditionsAfterRel5(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_accessCapAdditionsAfterRel5.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel5 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_accessCapAdditionsAfterRel5.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("{ accessCapAdditionsRel5 := ");
single_value->field_accessCapAdditionsRel5.log_match(match_value.accessCapAdditionsRel5(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel5 := ");
if (match_value.accessCapAdditionsAfterRel5().ispresent()) {
single_value->field_accessCapAdditionsAfterRel5.log_match(match_value.accessCapAdditionsAfterRel5(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_accessCapAdditionsAfterRel5.log();
if (single_value->field_accessCapAdditionsAfterRel5.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 AccessCapAdditionsAfterRel4_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (accessCapAdditionsRel5().is_bound()) accessCapAdditionsRel5().set_implicit_omit();
if (!accessCapAdditionsAfterRel5().is_bound()) accessCapAdditionsAfterRel5() = OMIT_VALUE;
else accessCapAdditionsAfterRel5().set_implicit_omit();
}

void AccessCapAdditionsAfterRel4_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel5.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel5.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_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
}
}

void AccessCapAdditionsAfterRel4_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_accessCapAdditionsRel5.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel5.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 AccessCapAdditionsAfterRel4_template[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_GMM_SM_Types.AccessCapAdditionsAfterRel4.");
}
}

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

void AccessCapAdditionsAfterRel4_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_accessCapAdditionsRel5.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel4");
single_value->field_accessCapAdditionsAfterRel5.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel4");
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_GMM_SM_Types.AccessCapAdditionsAfterRel4");
}

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

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

AccessCapAdditionsRel6::AccessCapAdditionsRel6()
{
}

AccessCapAdditionsRel6::AccessCapAdditionsRel6(const BITSTRING& par_multipleTBFCapability,
    const BITSTRING& par_downlinkAdvancedReceiverPerformance,
    const BITSTRING& par_extendedRLCMACCtrlMsgSegmentationCap,
    const BITSTRING& par_dTMEnhancementsCapability,
    const BITSTRING& par_presenceBitDTMGPRSHighMultiSlotClass,
    const OPTIONAL< DTMGPRSHighMultiSlotClass >& par_dTMGPRSHighMultiSlotClass,
    const BITSTRING& par_pSHandoverCapability)
  :   field_multipleTBFCapability(par_multipleTBFCapability),
  field_downlinkAdvancedReceiverPerformance(par_downlinkAdvancedReceiverPerformance),
  field_extendedRLCMACCtrlMsgSegmentationCap(par_extendedRLCMACCtrlMsgSegmentationCap),
  field_dTMEnhancementsCapability(par_dTMEnhancementsCapability),
  field_presenceBitDTMGPRSHighMultiSlotClass(par_presenceBitDTMGPRSHighMultiSlotClass),
  field_dTMGPRSHighMultiSlotClass(par_dTMGPRSHighMultiSlotClass),
  field_pSHandoverCapability(par_pSHandoverCapability)
{
}

AccessCapAdditionsRel6::AccessCapAdditionsRel6(const AccessCapAdditionsRel6& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
if (other_value.multipleTBFCapability().is_bound()) field_multipleTBFCapability = other_value.multipleTBFCapability();
else field_multipleTBFCapability.clean_up();
if (other_value.downlinkAdvancedReceiverPerformance().is_bound()) field_downlinkAdvancedReceiverPerformance = other_value.downlinkAdvancedReceiverPerformance();
else field_downlinkAdvancedReceiverPerformance.clean_up();
if (other_value.extendedRLCMACCtrlMsgSegmentationCap().is_bound()) field_extendedRLCMACCtrlMsgSegmentationCap = other_value.extendedRLCMACCtrlMsgSegmentationCap();
else field_extendedRLCMACCtrlMsgSegmentationCap.clean_up();
if (other_value.dTMEnhancementsCapability().is_bound()) field_dTMEnhancementsCapability = other_value.dTMEnhancementsCapability();
else field_dTMEnhancementsCapability.clean_up();
if (other_value.presenceBitDTMGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMGPRSHighMultiSlotClass = other_value.presenceBitDTMGPRSHighMultiSlotClass();
else field_presenceBitDTMGPRSHighMultiSlotClass.clean_up();
if (other_value.dTMGPRSHighMultiSlotClass().is_bound()) field_dTMGPRSHighMultiSlotClass = other_value.dTMGPRSHighMultiSlotClass();
else field_dTMGPRSHighMultiSlotClass.clean_up();
if (other_value.pSHandoverCapability().is_bound()) field_pSHandoverCapability = other_value.pSHandoverCapability();
else field_pSHandoverCapability.clean_up();
}

void AccessCapAdditionsRel6::clean_up()
{
field_multipleTBFCapability.clean_up();
field_downlinkAdvancedReceiverPerformance.clean_up();
field_extendedRLCMACCtrlMsgSegmentationCap.clean_up();
field_dTMEnhancementsCapability.clean_up();
field_presenceBitDTMGPRSHighMultiSlotClass.clean_up();
field_dTMGPRSHighMultiSlotClass.clean_up();
field_pSHandoverCapability.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel6::get_descriptor() const { return &AccessCapAdditionsRel6_descr_; }
AccessCapAdditionsRel6& AccessCapAdditionsRel6::operator=(const AccessCapAdditionsRel6& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
  if (other_value.multipleTBFCapability().is_bound()) field_multipleTBFCapability = other_value.multipleTBFCapability();
  else field_multipleTBFCapability.clean_up();
  if (other_value.downlinkAdvancedReceiverPerformance().is_bound()) field_downlinkAdvancedReceiverPerformance = other_value.downlinkAdvancedReceiverPerformance();
  else field_downlinkAdvancedReceiverPerformance.clean_up();
  if (other_value.extendedRLCMACCtrlMsgSegmentationCap().is_bound()) field_extendedRLCMACCtrlMsgSegmentationCap = other_value.extendedRLCMACCtrlMsgSegmentationCap();
  else field_extendedRLCMACCtrlMsgSegmentationCap.clean_up();
  if (other_value.dTMEnhancementsCapability().is_bound()) field_dTMEnhancementsCapability = other_value.dTMEnhancementsCapability();
  else field_dTMEnhancementsCapability.clean_up();
  if (other_value.presenceBitDTMGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMGPRSHighMultiSlotClass = other_value.presenceBitDTMGPRSHighMultiSlotClass();
  else field_presenceBitDTMGPRSHighMultiSlotClass.clean_up();
  if (other_value.dTMGPRSHighMultiSlotClass().is_bound()) field_dTMGPRSHighMultiSlotClass = other_value.dTMGPRSHighMultiSlotClass();
  else field_dTMGPRSHighMultiSlotClass.clean_up();
  if (other_value.pSHandoverCapability().is_bound()) field_pSHandoverCapability = other_value.pSHandoverCapability();
  else field_pSHandoverCapability.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel6::operator==(const AccessCapAdditionsRel6& other_value) const
{
return field_multipleTBFCapability==other_value.field_multipleTBFCapability
  && field_downlinkAdvancedReceiverPerformance==other_value.field_downlinkAdvancedReceiverPerformance
  && field_extendedRLCMACCtrlMsgSegmentationCap==other_value.field_extendedRLCMACCtrlMsgSegmentationCap
  && field_dTMEnhancementsCapability==other_value.field_dTMEnhancementsCapability
  && field_presenceBitDTMGPRSHighMultiSlotClass==other_value.field_presenceBitDTMGPRSHighMultiSlotClass
  && field_dTMGPRSHighMultiSlotClass==other_value.field_dTMGPRSHighMultiSlotClass
  && field_pSHandoverCapability==other_value.field_pSHandoverCapability;
}

boolean AccessCapAdditionsRel6::is_bound() const
{
return (field_multipleTBFCapability.is_bound())
  || (field_downlinkAdvancedReceiverPerformance.is_bound())
  || (field_extendedRLCMACCtrlMsgSegmentationCap.is_bound())
  || (field_dTMEnhancementsCapability.is_bound())
  || (field_presenceBitDTMGPRSHighMultiSlotClass.is_bound())
  || (OPTIONAL_OMIT == field_dTMGPRSHighMultiSlotClass.get_selection() || field_dTMGPRSHighMultiSlotClass.is_bound())
  || (field_pSHandoverCapability.is_bound());
}
boolean AccessCapAdditionsRel6::is_value() const
{
return field_multipleTBFCapability.is_value()
  && field_downlinkAdvancedReceiverPerformance.is_value()
  && field_extendedRLCMACCtrlMsgSegmentationCap.is_value()
  && field_dTMEnhancementsCapability.is_value()
  && field_presenceBitDTMGPRSHighMultiSlotClass.is_value()
  && (OPTIONAL_OMIT == field_dTMGPRSHighMultiSlotClass.get_selection() || field_dTMGPRSHighMultiSlotClass.is_value())
  && field_pSHandoverCapability.is_value();
}
int AccessCapAdditionsRel6::size_of() const
{
  int ret_val = 6;
  if (field_dTMGPRSHighMultiSlotClass.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsRel6::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ multipleTBFCapability := ");
field_multipleTBFCapability.log();
TTCN_Logger::log_event_str(", downlinkAdvancedReceiverPerformance := ");
field_downlinkAdvancedReceiverPerformance.log();
TTCN_Logger::log_event_str(", extendedRLCMACCtrlMsgSegmentationCap := ");
field_extendedRLCMACCtrlMsgSegmentationCap.log();
TTCN_Logger::log_event_str(", dTMEnhancementsCapability := ");
field_dTMEnhancementsCapability.log();
TTCN_Logger::log_event_str(", presenceBitDTMGPRSHighMultiSlotClass := ");
field_presenceBitDTMGPRSHighMultiSlotClass.log();
TTCN_Logger::log_event_str(", dTMGPRSHighMultiSlotClass := ");
field_dTMGPRSHighMultiSlotClass.log();
TTCN_Logger::log_event_str(", pSHandoverCapability := ");
field_pSHandoverCapability.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel6::set_implicit_omit()
{
if (multipleTBFCapability().is_bound()) multipleTBFCapability().set_implicit_omit();
if (downlinkAdvancedReceiverPerformance().is_bound()) downlinkAdvancedReceiverPerformance().set_implicit_omit();
if (extendedRLCMACCtrlMsgSegmentationCap().is_bound()) extendedRLCMACCtrlMsgSegmentationCap().set_implicit_omit();
if (dTMEnhancementsCapability().is_bound()) dTMEnhancementsCapability().set_implicit_omit();
if (presenceBitDTMGPRSHighMultiSlotClass().is_bound()) presenceBitDTMGPRSHighMultiSlotClass().set_implicit_omit();
if (!dTMGPRSHighMultiSlotClass().is_bound()) dTMGPRSHighMultiSlotClass() = OMIT_VALUE;
else dTMGPRSHighMultiSlotClass().set_implicit_omit();
if (pSHandoverCapability().is_bound()) pSHandoverCapability().set_implicit_omit();
}

void AccessCapAdditionsRel6::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_GMM_SM_Types.AccessCapAdditionsRel6 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) multipleTBFCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) downlinkAdvancedReceiverPerformance().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) extendedRLCMACCtrlMsgSegmentationCap().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dTMEnhancementsCapability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTMGPRSHighMultiSlotClass().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) dTMGPRSHighMultiSlotClass().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pSHandoverCapability().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(), "multipleTBFCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multipleTBFCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "downlinkAdvancedReceiverPerformance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkAdvancedReceiverPerformance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedRLCMACCtrlMsgSegmentationCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedRLCMACCtrlMsgSegmentationCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTMEnhancementsCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMEnhancementsCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitDTMGPRSHighMultiSlotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDTMGPRSHighMultiSlotClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTMGPRSHighMultiSlotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMGPRSHighMultiSlotClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pSHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pSHandoverCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel6");
  }
}

void AccessCapAdditionsRel6::encode_text(Text_Buf& text_buf) const
{
field_multipleTBFCapability.encode_text(text_buf);
field_downlinkAdvancedReceiverPerformance.encode_text(text_buf);
field_extendedRLCMACCtrlMsgSegmentationCap.encode_text(text_buf);
field_dTMEnhancementsCapability.encode_text(text_buf);
field_presenceBitDTMGPRSHighMultiSlotClass.encode_text(text_buf);
field_dTMGPRSHighMultiSlotClass.encode_text(text_buf);
field_pSHandoverCapability.encode_text(text_buf);
}

void AccessCapAdditionsRel6::decode_text(Text_Buf& text_buf)
{
field_multipleTBFCapability.decode_text(text_buf);
field_downlinkAdvancedReceiverPerformance.decode_text(text_buf);
field_extendedRLCMACCtrlMsgSegmentationCap.decode_text(text_buf);
field_dTMEnhancementsCapability.decode_text(text_buf);
field_presenceBitDTMGPRSHighMultiSlotClass.decode_text(text_buf);
field_dTMGPRSHighMultiSlotClass.decode_text(text_buf);
field_pSHandoverCapability.decode_text(text_buf);
}

void AccessCapAdditionsRel6::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 AccessCapAdditionsRel6::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 AccessCapAdditionsRel6::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, AccessCapAdditionsRel6_multipleTBFCapability_descr_.raw->forceomit);
  decoded_field_length = field_multipleTBFCapability.RAW_decode(AccessCapAdditionsRel6_multipleTBFCapability_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, AccessCapAdditionsRel6_downlinkAdvancedReceiverPerformance_descr_.raw->forceomit);
  decoded_field_length = field_downlinkAdvancedReceiverPerformance.RAW_decode(AccessCapAdditionsRel6_downlinkAdvancedReceiverPerformance_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, AccessCapAdditionsRel6_extendedRLCMACCtrlMsgSegmentationCap_descr_.raw->forceomit);
  decoded_field_length = field_extendedRLCMACCtrlMsgSegmentationCap.RAW_decode(AccessCapAdditionsRel6_extendedRLCMACCtrlMsgSegmentationCap_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, AccessCapAdditionsRel6_dTMEnhancementsCapability_descr_.raw->forceomit);
  decoded_field_length = field_dTMEnhancementsCapability.RAW_decode(AccessCapAdditionsRel6_dTMEnhancementsCapability_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, AccessCapAdditionsRel6_presenceBitDTMGPRSHighMultiSlotClass_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitDTMGPRSHighMultiSlotClass.RAW_decode(AccessCapAdditionsRel6_presenceBitDTMGPRSHighMultiSlotClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_presenceBitDTMGPRSHighMultiSlotClass ==  bs_2){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_dTMGPRSHighMultiSlotClass = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, AccessCapAdditionsRel6_dTMGPRSHighMultiSlotClass_descr_.raw->forceomit);
  decoded_field_length = field_dTMGPRSHighMultiSlotClass().RAW_decode(AccessCapAdditionsRel6_dTMGPRSHighMultiSlotClass_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_dTMGPRSHighMultiSlotClass = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dTMGPRSHighMultiSlotClass=OMIT_VALUE;
  RAW_Force_Omit field_6_force_omit(6, force_omit, AccessCapAdditionsRel6_pSHandoverCapability_descr_.raw->forceomit);
  decoded_field_length = field_pSHandoverCapability.RAW_decode(AccessCapAdditionsRel6_pSHandoverCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel6::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, AccessCapAdditionsRel6_multipleTBFCapability_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel6_downlinkAdvancedReceiverPerformance_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel6_extendedRLCMACCtrlMsgSegmentationCap_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel6_dTMEnhancementsCapability_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel6_presenceBitDTMGPRSHighMultiSlotClass_descr_.raw);
  if (field_dTMGPRSHighMultiSlotClass.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel6_dTMGPRSHighMultiSlotClass_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AccessCapAdditionsRel6_pSHandoverCapability_descr_.raw);
  encoded_length += field_multipleTBFCapability.RAW_encode(AccessCapAdditionsRel6_multipleTBFCapability_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_downlinkAdvancedReceiverPerformance.RAW_encode(AccessCapAdditionsRel6_downlinkAdvancedReceiverPerformance_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_extendedRLCMACCtrlMsgSegmentationCap.RAW_encode(AccessCapAdditionsRel6_extendedRLCMACCtrlMsgSegmentationCap_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_dTMEnhancementsCapability.RAW_encode(AccessCapAdditionsRel6_dTMEnhancementsCapability_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_presenceBitDTMGPRSHighMultiSlotClass.RAW_encode(AccessCapAdditionsRel6_presenceBitDTMGPRSHighMultiSlotClass_descr_, *myleaf.body.node.nodes[4]);
  if (field_dTMGPRSHighMultiSlotClass.ispresent()) {
  encoded_length += field_dTMGPRSHighMultiSlotClass().RAW_encode(AccessCapAdditionsRel6_dTMGPRSHighMultiSlotClass_descr_, *myleaf.body.node.nodes[5]);
  }
  encoded_length += field_pSHandoverCapability.RAW_encode(AccessCapAdditionsRel6_pSHandoverCapability_descr_, *myleaf.body.node.nodes[6]);
  if (field_dTMGPRSHighMultiSlotClass.ispresent() && (field_presenceBitDTMGPRSHighMultiSlotClass !=  bs_2)) {
  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_2.RAW_encode(AccessCapAdditionsRel6_presenceBitDTMGPRSHighMultiSlotClass_descr_,*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 AccessCapAdditionsRel6_template::single_value_struct {
BITSTRING_template field_multipleTBFCapability;
BITSTRING_template field_downlinkAdvancedReceiverPerformance;
BITSTRING_template field_extendedRLCMACCtrlMsgSegmentationCap;
BITSTRING_template field_dTMEnhancementsCapability;
BITSTRING_template field_presenceBitDTMGPRSHighMultiSlotClass;
DTMGPRSHighMultiSlotClass_template field_dTMGPRSHighMultiSlotClass;
BITSTRING_template field_pSHandoverCapability;
};

void AccessCapAdditionsRel6_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_multipleTBFCapability = ANY_VALUE;
single_value->field_downlinkAdvancedReceiverPerformance = ANY_VALUE;
single_value->field_extendedRLCMACCtrlMsgSegmentationCap = ANY_VALUE;
single_value->field_dTMEnhancementsCapability = ANY_VALUE;
single_value->field_presenceBitDTMGPRSHighMultiSlotClass = ANY_VALUE;
single_value->field_dTMGPRSHighMultiSlotClass = ANY_OR_OMIT;
single_value->field_pSHandoverCapability = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel6_template::copy_value(const AccessCapAdditionsRel6& other_value)
{
single_value = new single_value_struct;
if (other_value.multipleTBFCapability().is_bound()) {
  single_value->field_multipleTBFCapability = other_value.multipleTBFCapability();
} else {
  single_value->field_multipleTBFCapability.clean_up();
}
if (other_value.downlinkAdvancedReceiverPerformance().is_bound()) {
  single_value->field_downlinkAdvancedReceiverPerformance = other_value.downlinkAdvancedReceiverPerformance();
} else {
  single_value->field_downlinkAdvancedReceiverPerformance.clean_up();
}
if (other_value.extendedRLCMACCtrlMsgSegmentationCap().is_bound()) {
  single_value->field_extendedRLCMACCtrlMsgSegmentationCap = other_value.extendedRLCMACCtrlMsgSegmentationCap();
} else {
  single_value->field_extendedRLCMACCtrlMsgSegmentationCap.clean_up();
}
if (other_value.dTMEnhancementsCapability().is_bound()) {
  single_value->field_dTMEnhancementsCapability = other_value.dTMEnhancementsCapability();
} else {
  single_value->field_dTMEnhancementsCapability.clean_up();
}
if (other_value.presenceBitDTMGPRSHighMultiSlotClass().is_bound()) {
  single_value->field_presenceBitDTMGPRSHighMultiSlotClass = other_value.presenceBitDTMGPRSHighMultiSlotClass();
} else {
  single_value->field_presenceBitDTMGPRSHighMultiSlotClass.clean_up();
}
if (other_value.dTMGPRSHighMultiSlotClass().is_bound()) {
  if (other_value.dTMGPRSHighMultiSlotClass().ispresent()) single_value->field_dTMGPRSHighMultiSlotClass = other_value.dTMGPRSHighMultiSlotClass()();
  else single_value->field_dTMGPRSHighMultiSlotClass = OMIT_VALUE;
} else {
  single_value->field_dTMGPRSHighMultiSlotClass.clean_up();
}
if (other_value.pSHandoverCapability().is_bound()) {
  single_value->field_pSHandoverCapability = other_value.pSHandoverCapability();
} else {
  single_value->field_pSHandoverCapability.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel6_template::copy_template(const AccessCapAdditionsRel6_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.multipleTBFCapability().get_selection()) {
single_value->field_multipleTBFCapability = other_value.multipleTBFCapability();
} else {
single_value->field_multipleTBFCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.downlinkAdvancedReceiverPerformance().get_selection()) {
single_value->field_downlinkAdvancedReceiverPerformance = other_value.downlinkAdvancedReceiverPerformance();
} else {
single_value->field_downlinkAdvancedReceiverPerformance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedRLCMACCtrlMsgSegmentationCap().get_selection()) {
single_value->field_extendedRLCMACCtrlMsgSegmentationCap = other_value.extendedRLCMACCtrlMsgSegmentationCap();
} else {
single_value->field_extendedRLCMACCtrlMsgSegmentationCap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dTMEnhancementsCapability().get_selection()) {
single_value->field_dTMEnhancementsCapability = other_value.dTMEnhancementsCapability();
} else {
single_value->field_dTMEnhancementsCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDTMGPRSHighMultiSlotClass().get_selection()) {
single_value->field_presenceBitDTMGPRSHighMultiSlotClass = other_value.presenceBitDTMGPRSHighMultiSlotClass();
} else {
single_value->field_presenceBitDTMGPRSHighMultiSlotClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dTMGPRSHighMultiSlotClass().get_selection()) {
single_value->field_dTMGPRSHighMultiSlotClass = other_value.dTMGPRSHighMultiSlotClass();
} else {
single_value->field_dTMGPRSHighMultiSlotClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pSHandoverCapability().get_selection()) {
single_value->field_pSHandoverCapability = other_value.pSHandoverCapability();
} else {
single_value->field_pSHandoverCapability.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 AccessCapAdditionsRel6_template[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 AccessCapAdditionsRel6_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel6_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_GMM_SM_Types.AccessCapAdditionsRel6.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel6_template::AccessCapAdditionsRel6_template()
{
}

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

AccessCapAdditionsRel6_template::AccessCapAdditionsRel6_template(const AccessCapAdditionsRel6& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel6_template::match(const AccessCapAdditionsRel6& 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.multipleTBFCapability().is_bound()) return FALSE;
if(!single_value->field_multipleTBFCapability.match(other_value.multipleTBFCapability(), legacy))return FALSE;
if(!other_value.downlinkAdvancedReceiverPerformance().is_bound()) return FALSE;
if(!single_value->field_downlinkAdvancedReceiverPerformance.match(other_value.downlinkAdvancedReceiverPerformance(), legacy))return FALSE;
if(!other_value.extendedRLCMACCtrlMsgSegmentationCap().is_bound()) return FALSE;
if(!single_value->field_extendedRLCMACCtrlMsgSegmentationCap.match(other_value.extendedRLCMACCtrlMsgSegmentationCap(), legacy))return FALSE;
if(!other_value.dTMEnhancementsCapability().is_bound()) return FALSE;
if(!single_value->field_dTMEnhancementsCapability.match(other_value.dTMEnhancementsCapability(), legacy))return FALSE;
if(!other_value.presenceBitDTMGPRSHighMultiSlotClass().is_bound()) return FALSE;
if(!single_value->field_presenceBitDTMGPRSHighMultiSlotClass.match(other_value.presenceBitDTMGPRSHighMultiSlotClass(), legacy))return FALSE;
if(!other_value.dTMGPRSHighMultiSlotClass().is_bound()) return FALSE;
if((other_value.dTMGPRSHighMultiSlotClass().ispresent() ? !single_value->field_dTMGPRSHighMultiSlotClass.match((const DTMGPRSHighMultiSlotClass&)other_value.dTMGPRSHighMultiSlotClass(), legacy) : !single_value->field_dTMGPRSHighMultiSlotClass.match_omit(legacy)))return FALSE;
if(!other_value.pSHandoverCapability().is_bound()) return FALSE;
if(!single_value->field_pSHandoverCapability.match(other_value.pSHandoverCapability(), 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_GMM_SM_Types.AccessCapAdditionsRel6.");
}
return FALSE;
}

boolean AccessCapAdditionsRel6_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_multipleTBFCapability.is_bound()
 || single_value->field_downlinkAdvancedReceiverPerformance.is_bound()
 || single_value->field_extendedRLCMACCtrlMsgSegmentationCap.is_bound()
 || single_value->field_dTMEnhancementsCapability.is_bound()
 || single_value->field_presenceBitDTMGPRSHighMultiSlotClass.is_bound()
 || (single_value->field_dTMGPRSHighMultiSlotClass.is_omit() || single_value->field_dTMGPRSHighMultiSlotClass.is_bound())
 || single_value->field_pSHandoverCapability.is_bound();
}

boolean AccessCapAdditionsRel6_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_multipleTBFCapability.is_value()
 && single_value->field_downlinkAdvancedReceiverPerformance.is_value()
 && single_value->field_extendedRLCMACCtrlMsgSegmentationCap.is_value()
 && single_value->field_dTMEnhancementsCapability.is_value()
 && single_value->field_presenceBitDTMGPRSHighMultiSlotClass.is_value()
 && (single_value->field_dTMGPRSHighMultiSlotClass.is_omit() || single_value->field_dTMGPRSHighMultiSlotClass.is_value())
 && single_value->field_pSHandoverCapability.is_value();
}

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

AccessCapAdditionsRel6 AccessCapAdditionsRel6_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_GMM_SM_Types.AccessCapAdditionsRel6.");
AccessCapAdditionsRel6 ret_val;
if (single_value->field_multipleTBFCapability.is_bound()) {
ret_val.multipleTBFCapability() = single_value->field_multipleTBFCapability.valueof();
}
if (single_value->field_downlinkAdvancedReceiverPerformance.is_bound()) {
ret_val.downlinkAdvancedReceiverPerformance() = single_value->field_downlinkAdvancedReceiverPerformance.valueof();
}
if (single_value->field_extendedRLCMACCtrlMsgSegmentationCap.is_bound()) {
ret_val.extendedRLCMACCtrlMsgSegmentationCap() = single_value->field_extendedRLCMACCtrlMsgSegmentationCap.valueof();
}
if (single_value->field_dTMEnhancementsCapability.is_bound()) {
ret_val.dTMEnhancementsCapability() = single_value->field_dTMEnhancementsCapability.valueof();
}
if (single_value->field_presenceBitDTMGPRSHighMultiSlotClass.is_bound()) {
ret_val.presenceBitDTMGPRSHighMultiSlotClass() = single_value->field_presenceBitDTMGPRSHighMultiSlotClass.valueof();
}
if (single_value->field_dTMGPRSHighMultiSlotClass.is_omit()) ret_val.dTMGPRSHighMultiSlotClass() = OMIT_VALUE;
else if (single_value->field_dTMGPRSHighMultiSlotClass.is_bound()) {
ret_val.dTMGPRSHighMultiSlotClass() = single_value->field_dTMGPRSHighMultiSlotClass.valueof();
}
if (single_value->field_pSHandoverCapability.is_bound()) {
ret_val.pSHandoverCapability() = single_value->field_pSHandoverCapability.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel6_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_GMM_SM_Types.AccessCapAdditionsRel6.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel6_template[list_length];
}

AccessCapAdditionsRel6_template& AccessCapAdditionsRel6_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_GMM_SM_Types.AccessCapAdditionsRel6.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel6_template::multipleTBFCapability()
{
set_specific();
return single_value->field_multipleTBFCapability;
}

const BITSTRING_template& AccessCapAdditionsRel6_template::multipleTBFCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multipleTBFCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
return single_value->field_multipleTBFCapability;
}

BITSTRING_template& AccessCapAdditionsRel6_template::downlinkAdvancedReceiverPerformance()
{
set_specific();
return single_value->field_downlinkAdvancedReceiverPerformance;
}

const BITSTRING_template& AccessCapAdditionsRel6_template::downlinkAdvancedReceiverPerformance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field downlinkAdvancedReceiverPerformance of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
return single_value->field_downlinkAdvancedReceiverPerformance;
}

BITSTRING_template& AccessCapAdditionsRel6_template::extendedRLCMACCtrlMsgSegmentationCap()
{
set_specific();
return single_value->field_extendedRLCMACCtrlMsgSegmentationCap;
}

const BITSTRING_template& AccessCapAdditionsRel6_template::extendedRLCMACCtrlMsgSegmentationCap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedRLCMACCtrlMsgSegmentationCap of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
return single_value->field_extendedRLCMACCtrlMsgSegmentationCap;
}

BITSTRING_template& AccessCapAdditionsRel6_template::dTMEnhancementsCapability()
{
set_specific();
return single_value->field_dTMEnhancementsCapability;
}

const BITSTRING_template& AccessCapAdditionsRel6_template::dTMEnhancementsCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTMEnhancementsCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
return single_value->field_dTMEnhancementsCapability;
}

BITSTRING_template& AccessCapAdditionsRel6_template::presenceBitDTMGPRSHighMultiSlotClass()
{
set_specific();
return single_value->field_presenceBitDTMGPRSHighMultiSlotClass;
}

const BITSTRING_template& AccessCapAdditionsRel6_template::presenceBitDTMGPRSHighMultiSlotClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitDTMGPRSHighMultiSlotClass of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
return single_value->field_presenceBitDTMGPRSHighMultiSlotClass;
}

DTMGPRSHighMultiSlotClass_template& AccessCapAdditionsRel6_template::dTMGPRSHighMultiSlotClass()
{
set_specific();
return single_value->field_dTMGPRSHighMultiSlotClass;
}

const DTMGPRSHighMultiSlotClass_template& AccessCapAdditionsRel6_template::dTMGPRSHighMultiSlotClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTMGPRSHighMultiSlotClass of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
return single_value->field_dTMGPRSHighMultiSlotClass;
}

BITSTRING_template& AccessCapAdditionsRel6_template::pSHandoverCapability()
{
set_specific();
return single_value->field_pSHandoverCapability;
}

const BITSTRING_template& AccessCapAdditionsRel6_template::pSHandoverCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pSHandoverCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6.");
return single_value->field_pSHandoverCapability;
}

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

void AccessCapAdditionsRel6_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ multipleTBFCapability := ");
single_value->field_multipleTBFCapability.log();
TTCN_Logger::log_event_str(", downlinkAdvancedReceiverPerformance := ");
single_value->field_downlinkAdvancedReceiverPerformance.log();
TTCN_Logger::log_event_str(", extendedRLCMACCtrlMsgSegmentationCap := ");
single_value->field_extendedRLCMACCtrlMsgSegmentationCap.log();
TTCN_Logger::log_event_str(", dTMEnhancementsCapability := ");
single_value->field_dTMEnhancementsCapability.log();
TTCN_Logger::log_event_str(", presenceBitDTMGPRSHighMultiSlotClass := ");
single_value->field_presenceBitDTMGPRSHighMultiSlotClass.log();
TTCN_Logger::log_event_str(", dTMGPRSHighMultiSlotClass := ");
single_value->field_dTMGPRSHighMultiSlotClass.log();
TTCN_Logger::log_event_str(", pSHandoverCapability := ");
single_value->field_pSHandoverCapability.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 AccessCapAdditionsRel6_template::log_match(const AccessCapAdditionsRel6& 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_multipleTBFCapability.match(match_value.multipleTBFCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".multipleTBFCapability");
single_value->field_multipleTBFCapability.log_match(match_value.multipleTBFCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_downlinkAdvancedReceiverPerformance.match(match_value.downlinkAdvancedReceiverPerformance(), legacy)){
TTCN_Logger::log_logmatch_info(".downlinkAdvancedReceiverPerformance");
single_value->field_downlinkAdvancedReceiverPerformance.log_match(match_value.downlinkAdvancedReceiverPerformance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_extendedRLCMACCtrlMsgSegmentationCap.match(match_value.extendedRLCMACCtrlMsgSegmentationCap(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedRLCMACCtrlMsgSegmentationCap");
single_value->field_extendedRLCMACCtrlMsgSegmentationCap.log_match(match_value.extendedRLCMACCtrlMsgSegmentationCap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dTMEnhancementsCapability.match(match_value.dTMEnhancementsCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".dTMEnhancementsCapability");
single_value->field_dTMEnhancementsCapability.log_match(match_value.dTMEnhancementsCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitDTMGPRSHighMultiSlotClass.match(match_value.presenceBitDTMGPRSHighMultiSlotClass(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitDTMGPRSHighMultiSlotClass");
single_value->field_presenceBitDTMGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMGPRSHighMultiSlotClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dTMGPRSHighMultiSlotClass().ispresent()){
if(!single_value->field_dTMGPRSHighMultiSlotClass.match(match_value.dTMGPRSHighMultiSlotClass(), legacy)){
TTCN_Logger::log_logmatch_info(".dTMGPRSHighMultiSlotClass");
single_value->field_dTMGPRSHighMultiSlotClass.log_match(match_value.dTMGPRSHighMultiSlotClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dTMGPRSHighMultiSlotClass.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dTMGPRSHighMultiSlotClass := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dTMGPRSHighMultiSlotClass.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_pSHandoverCapability.match(match_value.pSHandoverCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".pSHandoverCapability");
single_value->field_pSHandoverCapability.log_match(match_value.pSHandoverCapability(), 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("{ multipleTBFCapability := ");
single_value->field_multipleTBFCapability.log_match(match_value.multipleTBFCapability(), legacy);
TTCN_Logger::log_event_str(", downlinkAdvancedReceiverPerformance := ");
single_value->field_downlinkAdvancedReceiverPerformance.log_match(match_value.downlinkAdvancedReceiverPerformance(), legacy);
TTCN_Logger::log_event_str(", extendedRLCMACCtrlMsgSegmentationCap := ");
single_value->field_extendedRLCMACCtrlMsgSegmentationCap.log_match(match_value.extendedRLCMACCtrlMsgSegmentationCap(), legacy);
TTCN_Logger::log_event_str(", dTMEnhancementsCapability := ");
single_value->field_dTMEnhancementsCapability.log_match(match_value.dTMEnhancementsCapability(), legacy);
TTCN_Logger::log_event_str(", presenceBitDTMGPRSHighMultiSlotClass := ");
single_value->field_presenceBitDTMGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMGPRSHighMultiSlotClass(), legacy);
TTCN_Logger::log_event_str(", dTMGPRSHighMultiSlotClass := ");
if (match_value.dTMGPRSHighMultiSlotClass().ispresent()) {
single_value->field_dTMGPRSHighMultiSlotClass.log_match(match_value.dTMGPRSHighMultiSlotClass(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dTMGPRSHighMultiSlotClass.log();
if (single_value->field_dTMGPRSHighMultiSlotClass.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pSHandoverCapability := ");
single_value->field_pSHandoverCapability.log_match(match_value.pSHandoverCapability(), 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 AccessCapAdditionsRel6_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (multipleTBFCapability().is_bound()) multipleTBFCapability().set_implicit_omit();
if (downlinkAdvancedReceiverPerformance().is_bound()) downlinkAdvancedReceiverPerformance().set_implicit_omit();
if (extendedRLCMACCtrlMsgSegmentationCap().is_bound()) extendedRLCMACCtrlMsgSegmentationCap().set_implicit_omit();
if (dTMEnhancementsCapability().is_bound()) dTMEnhancementsCapability().set_implicit_omit();
if (presenceBitDTMGPRSHighMultiSlotClass().is_bound()) presenceBitDTMGPRSHighMultiSlotClass().set_implicit_omit();
if (!dTMGPRSHighMultiSlotClass().is_bound()) dTMGPRSHighMultiSlotClass() = OMIT_VALUE;
else dTMGPRSHighMultiSlotClass().set_implicit_omit();
if (pSHandoverCapability().is_bound()) pSHandoverCapability().set_implicit_omit();
}

void AccessCapAdditionsRel6_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_multipleTBFCapability.encode_text(text_buf);
single_value->field_downlinkAdvancedReceiverPerformance.encode_text(text_buf);
single_value->field_extendedRLCMACCtrlMsgSegmentationCap.encode_text(text_buf);
single_value->field_dTMEnhancementsCapability.encode_text(text_buf);
single_value->field_presenceBitDTMGPRSHighMultiSlotClass.encode_text(text_buf);
single_value->field_dTMGPRSHighMultiSlotClass.encode_text(text_buf);
single_value->field_pSHandoverCapability.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_GMM_SM_Types.AccessCapAdditionsRel6.");
}
}

void AccessCapAdditionsRel6_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_multipleTBFCapability.decode_text(text_buf);
single_value->field_downlinkAdvancedReceiverPerformance.decode_text(text_buf);
single_value->field_extendedRLCMACCtrlMsgSegmentationCap.decode_text(text_buf);
single_value->field_dTMEnhancementsCapability.decode_text(text_buf);
single_value->field_presenceBitDTMGPRSHighMultiSlotClass.decode_text(text_buf);
single_value->field_dTMGPRSHighMultiSlotClass.decode_text(text_buf);
single_value->field_pSHandoverCapability.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 AccessCapAdditionsRel6_template[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_GMM_SM_Types.AccessCapAdditionsRel6.");
}
}

void AccessCapAdditionsRel6_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: {
    AccessCapAdditionsRel6_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_GMM_SM_Types.AccessCapAdditionsRel6 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) multipleTBFCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) downlinkAdvancedReceiverPerformance().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) extendedRLCMACCtrlMsgSegmentationCap().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dTMEnhancementsCapability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTMGPRSHighMultiSlotClass().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) dTMGPRSHighMultiSlotClass().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pSHandoverCapability().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(), "multipleTBFCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          multipleTBFCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "downlinkAdvancedReceiverPerformance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkAdvancedReceiverPerformance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedRLCMACCtrlMsgSegmentationCap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedRLCMACCtrlMsgSegmentationCap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTMEnhancementsCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMEnhancementsCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitDTMGPRSHighMultiSlotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDTMGPRSHighMultiSlotClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTMGPRSHighMultiSlotClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMGPRSHighMultiSlotClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pSHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pSHandoverCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel6: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel6_template* precondition = new AccessCapAdditionsRel6_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel6_template* implied_template = new AccessCapAdditionsRel6_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel6_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel6");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel6_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_multipleTBFCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel6");
single_value->field_downlinkAdvancedReceiverPerformance.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel6");
single_value->field_extendedRLCMACCtrlMsgSegmentationCap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel6");
single_value->field_dTMEnhancementsCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel6");
single_value->field_presenceBitDTMGPRSHighMultiSlotClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel6");
single_value->field_dTMGPRSHighMultiSlotClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel6");
single_value->field_pSHandoverCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel6");
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_GMM_SM_Types.AccessCapAdditionsRel6");
}

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

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

DTMGPRSHighMultiSlotClass::DTMGPRSHighMultiSlotClass()
{
}

DTMGPRSHighMultiSlotClass::DTMGPRSHighMultiSlotClass(const BITSTRING& par_dTMGPRSHighMultiSlotClassValue,
    const BITSTRING& par_presenceBitDTMEGPRSHighMultiSlotClass,
    const OPTIONAL< BITSTRING >& par_dTMEGPRSHighMultiSlotClassValue)
  :   field_dTMGPRSHighMultiSlotClassValue(par_dTMGPRSHighMultiSlotClassValue),
  field_presenceBitDTMEGPRSHighMultiSlotClass(par_presenceBitDTMEGPRSHighMultiSlotClass),
  field_dTMEGPRSHighMultiSlotClassValue(par_dTMEGPRSHighMultiSlotClassValue)
{
}

DTMGPRSHighMultiSlotClass::DTMGPRSHighMultiSlotClass(const DTMGPRSHighMultiSlotClass& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
if (other_value.dTMGPRSHighMultiSlotClassValue().is_bound()) field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue();
else field_dTMGPRSHighMultiSlotClassValue.clean_up();
if (other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass();
else field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
if (other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue();
else field_dTMEGPRSHighMultiSlotClassValue.clean_up();
}

void DTMGPRSHighMultiSlotClass::clean_up()
{
field_dTMGPRSHighMultiSlotClassValue.clean_up();
field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
field_dTMEGPRSHighMultiSlotClassValue.clean_up();
}

const TTCN_Typedescriptor_t* DTMGPRSHighMultiSlotClass::get_descriptor() const { return &DTMGPRSHighMultiSlotClass_descr_; }
DTMGPRSHighMultiSlotClass& DTMGPRSHighMultiSlotClass::operator=(const DTMGPRSHighMultiSlotClass& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
  if (other_value.dTMGPRSHighMultiSlotClassValue().is_bound()) field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue();
  else field_dTMGPRSHighMultiSlotClassValue.clean_up();
  if (other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass();
  else field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
  if (other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue();
  else field_dTMEGPRSHighMultiSlotClassValue.clean_up();
}
return *this;
}

boolean DTMGPRSHighMultiSlotClass::operator==(const DTMGPRSHighMultiSlotClass& other_value) const
{
return field_dTMGPRSHighMultiSlotClassValue==other_value.field_dTMGPRSHighMultiSlotClassValue
  && field_presenceBitDTMEGPRSHighMultiSlotClass==other_value.field_presenceBitDTMEGPRSHighMultiSlotClass
  && field_dTMEGPRSHighMultiSlotClassValue==other_value.field_dTMEGPRSHighMultiSlotClassValue;
}

boolean DTMGPRSHighMultiSlotClass::is_bound() const
{
return (field_dTMGPRSHighMultiSlotClassValue.is_bound())
  || (field_presenceBitDTMEGPRSHighMultiSlotClass.is_bound())
  || (OPTIONAL_OMIT == field_dTMEGPRSHighMultiSlotClassValue.get_selection() || field_dTMEGPRSHighMultiSlotClassValue.is_bound());
}
boolean DTMGPRSHighMultiSlotClass::is_value() const
{
return field_dTMGPRSHighMultiSlotClassValue.is_value()
  && field_presenceBitDTMEGPRSHighMultiSlotClass.is_value()
  && (OPTIONAL_OMIT == field_dTMEGPRSHighMultiSlotClassValue.get_selection() || field_dTMEGPRSHighMultiSlotClassValue.is_value());
}
int DTMGPRSHighMultiSlotClass::size_of() const
{
  int ret_val = 2;
  if (field_dTMEGPRSHighMultiSlotClassValue.ispresent()) ret_val++;
  return ret_val;
}

void DTMGPRSHighMultiSlotClass::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dTMGPRSHighMultiSlotClassValue := ");
field_dTMGPRSHighMultiSlotClassValue.log();
TTCN_Logger::log_event_str(", presenceBitDTMEGPRSHighMultiSlotClass := ");
field_presenceBitDTMEGPRSHighMultiSlotClass.log();
TTCN_Logger::log_event_str(", dTMEGPRSHighMultiSlotClassValue := ");
field_dTMEGPRSHighMultiSlotClassValue.log();
TTCN_Logger::log_event_str(" }");
}

void DTMGPRSHighMultiSlotClass::set_implicit_omit()
{
if (dTMGPRSHighMultiSlotClassValue().is_bound()) dTMGPRSHighMultiSlotClassValue().set_implicit_omit();
if (presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) presenceBitDTMEGPRSHighMultiSlotClass().set_implicit_omit();
if (!dTMEGPRSHighMultiSlotClassValue().is_bound()) dTMEGPRSHighMultiSlotClassValue() = OMIT_VALUE;
else dTMEGPRSHighMultiSlotClassValue().set_implicit_omit();
}

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

void DTMGPRSHighMultiSlotClass::encode_text(Text_Buf& text_buf) const
{
field_dTMGPRSHighMultiSlotClassValue.encode_text(text_buf);
field_presenceBitDTMEGPRSHighMultiSlotClass.encode_text(text_buf);
field_dTMEGPRSHighMultiSlotClassValue.encode_text(text_buf);
}

void DTMGPRSHighMultiSlotClass::decode_text(Text_Buf& text_buf)
{
field_dTMGPRSHighMultiSlotClassValue.decode_text(text_buf);
field_presenceBitDTMEGPRSHighMultiSlotClass.decode_text(text_buf);
field_dTMEGPRSHighMultiSlotClassValue.decode_text(text_buf);
}

void DTMGPRSHighMultiSlotClass::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 DTMGPRSHighMultiSlotClass::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 DTMGPRSHighMultiSlotClass::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, DTMGPRSHighMultiSlotClass_dTMGPRSHighMultiSlotClassValue_descr_.raw->forceomit);
  decoded_field_length = field_dTMGPRSHighMultiSlotClassValue.RAW_decode(DTMGPRSHighMultiSlotClass_dTMGPRSHighMultiSlotClassValue_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, DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitDTMEGPRSHighMultiSlotClass.RAW_decode(DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_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 && field_presenceBitDTMEGPRSHighMultiSlotClass ==  bs_2){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_dTMEGPRSHighMultiSlotClassValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, DTMGPRSHighMultiSlotClass_dTMEGPRSHighMultiSlotClassValue_descr_.raw->forceomit);
  decoded_field_length = field_dTMEGPRSHighMultiSlotClassValue().RAW_decode(DTMGPRSHighMultiSlotClass_dTMEGPRSHighMultiSlotClassValue_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_dTMEGPRSHighMultiSlotClassValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dTMEGPRSHighMultiSlotClassValue=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int DTMGPRSHighMultiSlotClass::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, DTMGPRSHighMultiSlotClass_dTMGPRSHighMultiSlotClassValue_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_descr_.raw);
  if (field_dTMEGPRSHighMultiSlotClassValue.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DTMGPRSHighMultiSlotClass_dTMEGPRSHighMultiSlotClassValue_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_dTMGPRSHighMultiSlotClassValue.RAW_encode(DTMGPRSHighMultiSlotClass_dTMGPRSHighMultiSlotClassValue_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_presenceBitDTMEGPRSHighMultiSlotClass.RAW_encode(DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_descr_, *myleaf.body.node.nodes[1]);
  if (field_dTMEGPRSHighMultiSlotClassValue.ispresent()) {
  encoded_length += field_dTMEGPRSHighMultiSlotClassValue().RAW_encode(DTMGPRSHighMultiSlotClass_dTMEGPRSHighMultiSlotClassValue_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_dTMEGPRSHighMultiSlotClassValue.ispresent() && (field_presenceBitDTMEGPRSHighMultiSlotClass !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  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_2.RAW_encode(DTMGPRSHighMultiSlotClass_presenceBitDTMEGPRSHighMultiSlotClass_descr_,*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 DTMGPRSHighMultiSlotClass_template::single_value_struct {
BITSTRING_template field_dTMGPRSHighMultiSlotClassValue;
BITSTRING_template field_presenceBitDTMEGPRSHighMultiSlotClass;
BITSTRING_template field_dTMEGPRSHighMultiSlotClassValue;
};

void DTMGPRSHighMultiSlotClass_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_dTMGPRSHighMultiSlotClassValue = ANY_VALUE;
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass = ANY_VALUE;
single_value->field_dTMEGPRSHighMultiSlotClassValue = ANY_OR_OMIT;
}
}
}

void DTMGPRSHighMultiSlotClass_template::copy_value(const DTMGPRSHighMultiSlotClass& other_value)
{
single_value = new single_value_struct;
if (other_value.dTMGPRSHighMultiSlotClassValue().is_bound()) {
  single_value->field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue();
} else {
  single_value->field_dTMGPRSHighMultiSlotClassValue.clean_up();
}
if (other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) {
  single_value->field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass();
} else {
  single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
}
if (other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) {
  if (other_value.dTMEGPRSHighMultiSlotClassValue().ispresent()) single_value->field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue()();
  else single_value->field_dTMEGPRSHighMultiSlotClassValue = OMIT_VALUE;
} else {
  single_value->field_dTMEGPRSHighMultiSlotClassValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DTMGPRSHighMultiSlotClass_template::copy_template(const DTMGPRSHighMultiSlotClass_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dTMGPRSHighMultiSlotClassValue().get_selection()) {
single_value->field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue();
} else {
single_value->field_dTMGPRSHighMultiSlotClassValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDTMEGPRSHighMultiSlotClass().get_selection()) {
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass();
} else {
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dTMEGPRSHighMultiSlotClassValue().get_selection()) {
single_value->field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue();
} else {
single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass_template[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 DTMGPRSHighMultiSlotClass_template(*other_value.implication_.precondition);
implication_.implied_template = new DTMGPRSHighMultiSlotClass_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_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
break;
}
set_selection(other_value);
}

DTMGPRSHighMultiSlotClass_template::DTMGPRSHighMultiSlotClass_template()
{
}

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

DTMGPRSHighMultiSlotClass_template::DTMGPRSHighMultiSlotClass_template(const DTMGPRSHighMultiSlotClass& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean DTMGPRSHighMultiSlotClass_template::match(const DTMGPRSHighMultiSlotClass& 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.dTMGPRSHighMultiSlotClassValue().is_bound()) return FALSE;
if(!single_value->field_dTMGPRSHighMultiSlotClassValue.match(other_value.dTMGPRSHighMultiSlotClassValue(), legacy))return FALSE;
if(!other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) return FALSE;
if(!single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.match(other_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy))return FALSE;
if(!other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) return FALSE;
if((other_value.dTMEGPRSHighMultiSlotClassValue().ispresent() ? !single_value->field_dTMEGPRSHighMultiSlotClassValue.match((const BITSTRING&)other_value.dTMEGPRSHighMultiSlotClassValue(), legacy) : !single_value->field_dTMEGPRSHighMultiSlotClassValue.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_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
}
return FALSE;
}

boolean DTMGPRSHighMultiSlotClass_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dTMGPRSHighMultiSlotClassValue.is_bound()
 || single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.is_bound()
 || (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_omit() || single_value->field_dTMEGPRSHighMultiSlotClassValue.is_bound());
}

boolean DTMGPRSHighMultiSlotClass_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dTMGPRSHighMultiSlotClassValue.is_value()
 && single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.is_value()
 && (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_omit() || single_value->field_dTMEGPRSHighMultiSlotClassValue.is_value());
}

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

DTMGPRSHighMultiSlotClass DTMGPRSHighMultiSlotClass_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_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
DTMGPRSHighMultiSlotClass ret_val;
if (single_value->field_dTMGPRSHighMultiSlotClassValue.is_bound()) {
ret_val.dTMGPRSHighMultiSlotClassValue() = single_value->field_dTMGPRSHighMultiSlotClassValue.valueof();
}
if (single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.is_bound()) {
ret_val.presenceBitDTMEGPRSHighMultiSlotClass() = single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.valueof();
}
if (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_omit()) ret_val.dTMEGPRSHighMultiSlotClassValue() = OMIT_VALUE;
else if (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_bound()) {
ret_val.dTMEGPRSHighMultiSlotClassValue() = single_value->field_dTMEGPRSHighMultiSlotClassValue.valueof();
}
return ret_val;
}

void DTMGPRSHighMultiSlotClass_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_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DTMGPRSHighMultiSlotClass_template[list_length];
}

DTMGPRSHighMultiSlotClass_template& DTMGPRSHighMultiSlotClass_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_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
return value_list.list_value[list_index];
}

BITSTRING_template& DTMGPRSHighMultiSlotClass_template::dTMGPRSHighMultiSlotClassValue()
{
set_specific();
return single_value->field_dTMGPRSHighMultiSlotClassValue;
}

const BITSTRING_template& DTMGPRSHighMultiSlotClass_template::dTMGPRSHighMultiSlotClassValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTMGPRSHighMultiSlotClassValue of a non-specific template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
return single_value->field_dTMGPRSHighMultiSlotClassValue;
}

BITSTRING_template& DTMGPRSHighMultiSlotClass_template::presenceBitDTMEGPRSHighMultiSlotClass()
{
set_specific();
return single_value->field_presenceBitDTMEGPRSHighMultiSlotClass;
}

const BITSTRING_template& DTMGPRSHighMultiSlotClass_template::presenceBitDTMEGPRSHighMultiSlotClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitDTMEGPRSHighMultiSlotClass of a non-specific template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
return single_value->field_presenceBitDTMEGPRSHighMultiSlotClass;
}

BITSTRING_template& DTMGPRSHighMultiSlotClass_template::dTMEGPRSHighMultiSlotClassValue()
{
set_specific();
return single_value->field_dTMEGPRSHighMultiSlotClassValue;
}

const BITSTRING_template& DTMGPRSHighMultiSlotClass_template::dTMEGPRSHighMultiSlotClassValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTMEGPRSHighMultiSlotClassValue of a non-specific template of type @MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
return single_value->field_dTMEGPRSHighMultiSlotClassValue;
}

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

void DTMGPRSHighMultiSlotClass_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dTMGPRSHighMultiSlotClassValue := ");
single_value->field_dTMGPRSHighMultiSlotClassValue.log();
TTCN_Logger::log_event_str(", presenceBitDTMEGPRSHighMultiSlotClass := ");
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.log();
TTCN_Logger::log_event_str(", dTMEGPRSHighMultiSlotClassValue := ");
single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass_template::log_match(const DTMGPRSHighMultiSlotClass& 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_dTMGPRSHighMultiSlotClassValue.match(match_value.dTMGPRSHighMultiSlotClassValue(), legacy)){
TTCN_Logger::log_logmatch_info(".dTMGPRSHighMultiSlotClassValue");
single_value->field_dTMGPRSHighMultiSlotClassValue.log_match(match_value.dTMGPRSHighMultiSlotClassValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.match(match_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitDTMEGPRSHighMultiSlotClass");
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dTMEGPRSHighMultiSlotClassValue().ispresent()){
if(!single_value->field_dTMEGPRSHighMultiSlotClassValue.match(match_value.dTMEGPRSHighMultiSlotClassValue(), legacy)){
TTCN_Logger::log_logmatch_info(".dTMEGPRSHighMultiSlotClassValue");
single_value->field_dTMEGPRSHighMultiSlotClassValue.log_match(match_value.dTMEGPRSHighMultiSlotClassValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dTMEGPRSHighMultiSlotClassValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dTMEGPRSHighMultiSlotClassValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dTMEGPRSHighMultiSlotClassValue.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("{ dTMGPRSHighMultiSlotClassValue := ");
single_value->field_dTMGPRSHighMultiSlotClassValue.log_match(match_value.dTMGPRSHighMultiSlotClassValue(), legacy);
TTCN_Logger::log_event_str(", presenceBitDTMEGPRSHighMultiSlotClass := ");
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy);
TTCN_Logger::log_event_str(", dTMEGPRSHighMultiSlotClassValue := ");
if (match_value.dTMEGPRSHighMultiSlotClassValue().ispresent()) {
single_value->field_dTMEGPRSHighMultiSlotClassValue.log_match(match_value.dTMEGPRSHighMultiSlotClassValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dTMEGPRSHighMultiSlotClassValue.log();
if (single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dTMGPRSHighMultiSlotClassValue().is_bound()) dTMGPRSHighMultiSlotClassValue().set_implicit_omit();
if (presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) presenceBitDTMEGPRSHighMultiSlotClass().set_implicit_omit();
if (!dTMEGPRSHighMultiSlotClassValue().is_bound()) dTMEGPRSHighMultiSlotClassValue() = OMIT_VALUE;
else dTMEGPRSHighMultiSlotClassValue().set_implicit_omit();
}

void DTMGPRSHighMultiSlotClass_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dTMGPRSHighMultiSlotClassValue.encode_text(text_buf);
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.encode_text(text_buf);
single_value->field_dTMEGPRSHighMultiSlotClassValue.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_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
}
}

void DTMGPRSHighMultiSlotClass_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_dTMGPRSHighMultiSlotClassValue.decode_text(text_buf);
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.decode_text(text_buf);
single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass_template[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_GMM_SM_Types.DTMGPRSHighMultiSlotClass.");
}
}

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

void DTMGPRSHighMultiSlotClass_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_dTMGPRSHighMultiSlotClassValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
single_value->field_dTMEGPRSHighMultiSlotClassValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
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_GMM_SM_Types.DTMGPRSHighMultiSlotClass");
}

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

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

AccessCapAdditionsAfterRel5::AccessCapAdditionsAfterRel5()
{
}

AccessCapAdditionsAfterRel5::AccessCapAdditionsAfterRel5(const AccessCapAdditionsRel6& par_accessCapAdditionsRel6,
    const OPTIONAL< AccessCapAdditionsAfterRel6 >& par_accessCapAdditionsAfterRel6)
  :   field_accessCapAdditionsRel6(par_accessCapAdditionsRel6),
  field_accessCapAdditionsAfterRel6(par_accessCapAdditionsAfterRel6)
{
}

AccessCapAdditionsAfterRel5::AccessCapAdditionsAfterRel5(const AccessCapAdditionsAfterRel5& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
if (other_value.accessCapAdditionsRel6().is_bound()) field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6();
else field_accessCapAdditionsRel6.clean_up();
if (other_value.accessCapAdditionsAfterRel6().is_bound()) field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6();
else field_accessCapAdditionsAfterRel6.clean_up();
}

void AccessCapAdditionsAfterRel5::clean_up()
{
field_accessCapAdditionsRel6.clean_up();
field_accessCapAdditionsAfterRel6.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel5::get_descriptor() const { return &AccessCapAdditionsAfterRel5_descr_; }
AccessCapAdditionsAfterRel5& AccessCapAdditionsAfterRel5::operator=(const AccessCapAdditionsAfterRel5& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
  if (other_value.accessCapAdditionsRel6().is_bound()) field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6();
  else field_accessCapAdditionsRel6.clean_up();
  if (other_value.accessCapAdditionsAfterRel6().is_bound()) field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6();
  else field_accessCapAdditionsAfterRel6.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel5::operator==(const AccessCapAdditionsAfterRel5& other_value) const
{
return field_accessCapAdditionsRel6==other_value.field_accessCapAdditionsRel6
  && field_accessCapAdditionsAfterRel6==other_value.field_accessCapAdditionsAfterRel6;
}

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

void AccessCapAdditionsAfterRel5::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel6 := ");
field_accessCapAdditionsRel6.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel6 := ");
field_accessCapAdditionsAfterRel6.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel5::set_implicit_omit()
{
if (accessCapAdditionsRel6().is_bound()) accessCapAdditionsRel6().set_implicit_omit();
if (!accessCapAdditionsAfterRel6().is_bound()) accessCapAdditionsAfterRel6() = OMIT_VALUE;
else accessCapAdditionsAfterRel6().set_implicit_omit();
}

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

void AccessCapAdditionsAfterRel5::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel6.encode_text(text_buf);
field_accessCapAdditionsAfterRel6.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel5::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel6.decode_text(text_buf);
field_accessCapAdditionsAfterRel6.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel5::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 AccessCapAdditionsAfterRel5::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 AccessCapAdditionsAfterRel5::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, AccessCapAdditionsAfterRel5_accessCapAdditionsRel6_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel6.RAW_decode(AccessCapAdditionsAfterRel5_accessCapAdditionsRel6_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_accessCapAdditionsAfterRel6 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel5_accessCapAdditionsAfterRel6_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel6().RAW_decode(AccessCapAdditionsAfterRel5_accessCapAdditionsAfterRel6_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_accessCapAdditionsAfterRel6 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_accessCapAdditionsAfterRel6=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel5::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, AccessCapAdditionsAfterRel5_accessCapAdditionsRel6_descr_.raw);
  if (field_accessCapAdditionsAfterRel6.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel5_accessCapAdditionsAfterRel6_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_accessCapAdditionsRel6.RAW_encode(AccessCapAdditionsAfterRel5_accessCapAdditionsRel6_descr_, *myleaf.body.node.nodes[0]);
  if (field_accessCapAdditionsAfterRel6.ispresent()) {
  encoded_length += field_accessCapAdditionsAfterRel6().RAW_encode(AccessCapAdditionsAfterRel5_accessCapAdditionsAfterRel6_descr_, *myleaf.body.node.nodes[1]);
  }
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel5_template::single_value_struct {
AccessCapAdditionsRel6_template field_accessCapAdditionsRel6;
AccessCapAdditionsAfterRel6_template field_accessCapAdditionsAfterRel6;
};

void AccessCapAdditionsAfterRel5_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_accessCapAdditionsRel6 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel6 = ANY_OR_OMIT;
}
}
}

void AccessCapAdditionsAfterRel5_template::copy_value(const AccessCapAdditionsAfterRel5& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel6().is_bound()) {
  single_value->field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6();
} else {
  single_value->field_accessCapAdditionsRel6.clean_up();
}
if (other_value.accessCapAdditionsAfterRel6().is_bound()) {
  if (other_value.accessCapAdditionsAfterRel6().ispresent()) single_value->field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6()();
  else single_value->field_accessCapAdditionsAfterRel6 = OMIT_VALUE;
} else {
  single_value->field_accessCapAdditionsAfterRel6.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel5_template::copy_template(const AccessCapAdditionsAfterRel5_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel6().get_selection()) {
single_value->field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6();
} else {
single_value->field_accessCapAdditionsRel6.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel6().get_selection()) {
single_value->field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6();
} else {
single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5_template[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 AccessCapAdditionsAfterRel5_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel5_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_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel5_template::AccessCapAdditionsAfterRel5_template()
{
}

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

AccessCapAdditionsAfterRel5_template::AccessCapAdditionsAfterRel5_template(const AccessCapAdditionsAfterRel5& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsAfterRel5_template::match(const AccessCapAdditionsAfterRel5& 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.accessCapAdditionsRel6().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel6.match(other_value.accessCapAdditionsRel6(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel6().is_bound()) return FALSE;
if((other_value.accessCapAdditionsAfterRel6().ispresent() ? !single_value->field_accessCapAdditionsAfterRel6.match((const AccessCapAdditionsAfterRel6&)other_value.accessCapAdditionsAfterRel6(), legacy) : !single_value->field_accessCapAdditionsAfterRel6.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_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel5_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel6.is_bound()
 || (single_value->field_accessCapAdditionsAfterRel6.is_omit() || single_value->field_accessCapAdditionsAfterRel6.is_bound());
}

boolean AccessCapAdditionsAfterRel5_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel6.is_value()
 && (single_value->field_accessCapAdditionsAfterRel6.is_omit() || single_value->field_accessCapAdditionsAfterRel6.is_value());
}

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

AccessCapAdditionsAfterRel5 AccessCapAdditionsAfterRel5_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_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
AccessCapAdditionsAfterRel5 ret_val;
if (single_value->field_accessCapAdditionsRel6.is_bound()) {
ret_val.accessCapAdditionsRel6() = single_value->field_accessCapAdditionsRel6.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel6.is_omit()) ret_val.accessCapAdditionsAfterRel6() = OMIT_VALUE;
else if (single_value->field_accessCapAdditionsAfterRel6.is_bound()) {
ret_val.accessCapAdditionsAfterRel6() = single_value->field_accessCapAdditionsAfterRel6.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel5_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_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel5_template[list_length];
}

AccessCapAdditionsAfterRel5_template& AccessCapAdditionsAfterRel5_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_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel6_template& AccessCapAdditionsAfterRel5_template::accessCapAdditionsRel6()
{
set_specific();
return single_value->field_accessCapAdditionsRel6;
}

const AccessCapAdditionsRel6_template& AccessCapAdditionsAfterRel5_template::accessCapAdditionsRel6() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel6 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
return single_value->field_accessCapAdditionsRel6;
}

AccessCapAdditionsAfterRel6_template& AccessCapAdditionsAfterRel5_template::accessCapAdditionsAfterRel6()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel6;
}

const AccessCapAdditionsAfterRel6_template& AccessCapAdditionsAfterRel5_template::accessCapAdditionsAfterRel6() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel6 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
return single_value->field_accessCapAdditionsAfterRel6;
}

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

void AccessCapAdditionsAfterRel5_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel6 := ");
single_value->field_accessCapAdditionsRel6.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel6 := ");
single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5_template::log_match(const AccessCapAdditionsAfterRel5& 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_accessCapAdditionsRel6.match(match_value.accessCapAdditionsRel6(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel6");
single_value->field_accessCapAdditionsRel6.log_match(match_value.accessCapAdditionsRel6(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.accessCapAdditionsAfterRel6().ispresent()){
if(!single_value->field_accessCapAdditionsAfterRel6.match(match_value.accessCapAdditionsAfterRel6(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel6");
single_value->field_accessCapAdditionsAfterRel6.log_match(match_value.accessCapAdditionsAfterRel6(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_accessCapAdditionsAfterRel6.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel6 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_accessCapAdditionsAfterRel6.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("{ accessCapAdditionsRel6 := ");
single_value->field_accessCapAdditionsRel6.log_match(match_value.accessCapAdditionsRel6(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel6 := ");
if (match_value.accessCapAdditionsAfterRel6().ispresent()) {
single_value->field_accessCapAdditionsAfterRel6.log_match(match_value.accessCapAdditionsAfterRel6(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_accessCapAdditionsAfterRel6.log();
if (single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (accessCapAdditionsRel6().is_bound()) accessCapAdditionsRel6().set_implicit_omit();
if (!accessCapAdditionsAfterRel6().is_bound()) accessCapAdditionsAfterRel6() = OMIT_VALUE;
else accessCapAdditionsAfterRel6().set_implicit_omit();
}

void AccessCapAdditionsAfterRel5_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel6.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel6.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_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
}
}

void AccessCapAdditionsAfterRel5_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_accessCapAdditionsRel6.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5_template[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_GMM_SM_Types.AccessCapAdditionsAfterRel5.");
}
}

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

void AccessCapAdditionsAfterRel5_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_accessCapAdditionsRel6.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5");
single_value->field_accessCapAdditionsAfterRel6.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel5");
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_GMM_SM_Types.AccessCapAdditionsAfterRel5");
}

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

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

AccessCapAdditionsRel7::AccessCapAdditionsRel7()
{
}

AccessCapAdditionsRel7::AccessCapAdditionsRel7(const BITSTRING& par_dTMHandoverCapability,
    const BITSTRING& par_presenceBitDownlinkDualCarrier,
    const OPTIONAL< DownlinkDualCarrier >& par_downlinkDualCarrier,
    const BITSTRING& par_flexibleTimeslotAssignment,
    const BITSTRING& par_gANPSHandoverCapability,
    const BITSTRING& par_rLCNonPersistentMode,
    const BITSTRING& par_reducedLatencyCapability,
    const BITSTRING& par_uplinkEGPRS2,
    const BITSTRING& par_downlinkEGPRS2)
  :   field_dTMHandoverCapability(par_dTMHandoverCapability),
  field_presenceBitDownlinkDualCarrier(par_presenceBitDownlinkDualCarrier),
  field_downlinkDualCarrier(par_downlinkDualCarrier),
  field_flexibleTimeslotAssignment(par_flexibleTimeslotAssignment),
  field_gANPSHandoverCapability(par_gANPSHandoverCapability),
  field_rLCNonPersistentMode(par_rLCNonPersistentMode),
  field_reducedLatencyCapability(par_reducedLatencyCapability),
  field_uplinkEGPRS2(par_uplinkEGPRS2),
  field_downlinkEGPRS2(par_downlinkEGPRS2)
{
}

AccessCapAdditionsRel7::AccessCapAdditionsRel7(const AccessCapAdditionsRel7& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
if (other_value.dTMHandoverCapability().is_bound()) field_dTMHandoverCapability = other_value.dTMHandoverCapability();
else field_dTMHandoverCapability.clean_up();
if (other_value.presenceBitDownlinkDualCarrier().is_bound()) field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier();
else field_presenceBitDownlinkDualCarrier.clean_up();
if (other_value.downlinkDualCarrier().is_bound()) field_downlinkDualCarrier = other_value.downlinkDualCarrier();
else field_downlinkDualCarrier.clean_up();
if (other_value.flexibleTimeslotAssignment().is_bound()) field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment();
else field_flexibleTimeslotAssignment.clean_up();
if (other_value.gANPSHandoverCapability().is_bound()) field_gANPSHandoverCapability = other_value.gANPSHandoverCapability();
else field_gANPSHandoverCapability.clean_up();
if (other_value.rLCNonPersistentMode().is_bound()) field_rLCNonPersistentMode = other_value.rLCNonPersistentMode();
else field_rLCNonPersistentMode.clean_up();
if (other_value.reducedLatencyCapability().is_bound()) field_reducedLatencyCapability = other_value.reducedLatencyCapability();
else field_reducedLatencyCapability.clean_up();
if (other_value.uplinkEGPRS2().is_bound()) field_uplinkEGPRS2 = other_value.uplinkEGPRS2();
else field_uplinkEGPRS2.clean_up();
if (other_value.downlinkEGPRS2().is_bound()) field_downlinkEGPRS2 = other_value.downlinkEGPRS2();
else field_downlinkEGPRS2.clean_up();
}

void AccessCapAdditionsRel7::clean_up()
{
field_dTMHandoverCapability.clean_up();
field_presenceBitDownlinkDualCarrier.clean_up();
field_downlinkDualCarrier.clean_up();
field_flexibleTimeslotAssignment.clean_up();
field_gANPSHandoverCapability.clean_up();
field_rLCNonPersistentMode.clean_up();
field_reducedLatencyCapability.clean_up();
field_uplinkEGPRS2.clean_up();
field_downlinkEGPRS2.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel7::get_descriptor() const { return &AccessCapAdditionsRel7_descr_; }
AccessCapAdditionsRel7& AccessCapAdditionsRel7::operator=(const AccessCapAdditionsRel7& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
  if (other_value.dTMHandoverCapability().is_bound()) field_dTMHandoverCapability = other_value.dTMHandoverCapability();
  else field_dTMHandoverCapability.clean_up();
  if (other_value.presenceBitDownlinkDualCarrier().is_bound()) field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier();
  else field_presenceBitDownlinkDualCarrier.clean_up();
  if (other_value.downlinkDualCarrier().is_bound()) field_downlinkDualCarrier = other_value.downlinkDualCarrier();
  else field_downlinkDualCarrier.clean_up();
  if (other_value.flexibleTimeslotAssignment().is_bound()) field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment();
  else field_flexibleTimeslotAssignment.clean_up();
  if (other_value.gANPSHandoverCapability().is_bound()) field_gANPSHandoverCapability = other_value.gANPSHandoverCapability();
  else field_gANPSHandoverCapability.clean_up();
  if (other_value.rLCNonPersistentMode().is_bound()) field_rLCNonPersistentMode = other_value.rLCNonPersistentMode();
  else field_rLCNonPersistentMode.clean_up();
  if (other_value.reducedLatencyCapability().is_bound()) field_reducedLatencyCapability = other_value.reducedLatencyCapability();
  else field_reducedLatencyCapability.clean_up();
  if (other_value.uplinkEGPRS2().is_bound()) field_uplinkEGPRS2 = other_value.uplinkEGPRS2();
  else field_uplinkEGPRS2.clean_up();
  if (other_value.downlinkEGPRS2().is_bound()) field_downlinkEGPRS2 = other_value.downlinkEGPRS2();
  else field_downlinkEGPRS2.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel7::operator==(const AccessCapAdditionsRel7& other_value) const
{
return field_dTMHandoverCapability==other_value.field_dTMHandoverCapability
  && field_presenceBitDownlinkDualCarrier==other_value.field_presenceBitDownlinkDualCarrier
  && field_downlinkDualCarrier==other_value.field_downlinkDualCarrier
  && field_flexibleTimeslotAssignment==other_value.field_flexibleTimeslotAssignment
  && field_gANPSHandoverCapability==other_value.field_gANPSHandoverCapability
  && field_rLCNonPersistentMode==other_value.field_rLCNonPersistentMode
  && field_reducedLatencyCapability==other_value.field_reducedLatencyCapability
  && field_uplinkEGPRS2==other_value.field_uplinkEGPRS2
  && field_downlinkEGPRS2==other_value.field_downlinkEGPRS2;
}

boolean AccessCapAdditionsRel7::is_bound() const
{
return (field_dTMHandoverCapability.is_bound())
  || (field_presenceBitDownlinkDualCarrier.is_bound())
  || (OPTIONAL_OMIT == field_downlinkDualCarrier.get_selection() || field_downlinkDualCarrier.is_bound())
  || (field_flexibleTimeslotAssignment.is_bound())
  || (field_gANPSHandoverCapability.is_bound())
  || (field_rLCNonPersistentMode.is_bound())
  || (field_reducedLatencyCapability.is_bound())
  || (field_uplinkEGPRS2.is_bound())
  || (field_downlinkEGPRS2.is_bound());
}
boolean AccessCapAdditionsRel7::is_value() const
{
return field_dTMHandoverCapability.is_value()
  && field_presenceBitDownlinkDualCarrier.is_value()
  && (OPTIONAL_OMIT == field_downlinkDualCarrier.get_selection() || field_downlinkDualCarrier.is_value())
  && field_flexibleTimeslotAssignment.is_value()
  && field_gANPSHandoverCapability.is_value()
  && field_rLCNonPersistentMode.is_value()
  && field_reducedLatencyCapability.is_value()
  && field_uplinkEGPRS2.is_value()
  && field_downlinkEGPRS2.is_value();
}
int AccessCapAdditionsRel7::size_of() const
{
  int ret_val = 8;
  if (field_downlinkDualCarrier.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsRel7::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dTMHandoverCapability := ");
field_dTMHandoverCapability.log();
TTCN_Logger::log_event_str(", presenceBitDownlinkDualCarrier := ");
field_presenceBitDownlinkDualCarrier.log();
TTCN_Logger::log_event_str(", downlinkDualCarrier := ");
field_downlinkDualCarrier.log();
TTCN_Logger::log_event_str(", flexibleTimeslotAssignment := ");
field_flexibleTimeslotAssignment.log();
TTCN_Logger::log_event_str(", gANPSHandoverCapability := ");
field_gANPSHandoverCapability.log();
TTCN_Logger::log_event_str(", rLCNonPersistentMode := ");
field_rLCNonPersistentMode.log();
TTCN_Logger::log_event_str(", reducedLatencyCapability := ");
field_reducedLatencyCapability.log();
TTCN_Logger::log_event_str(", uplinkEGPRS2 := ");
field_uplinkEGPRS2.log();
TTCN_Logger::log_event_str(", downlinkEGPRS2 := ");
field_downlinkEGPRS2.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel7::set_implicit_omit()
{
if (dTMHandoverCapability().is_bound()) dTMHandoverCapability().set_implicit_omit();
if (presenceBitDownlinkDualCarrier().is_bound()) presenceBitDownlinkDualCarrier().set_implicit_omit();
if (!downlinkDualCarrier().is_bound()) downlinkDualCarrier() = OMIT_VALUE;
else downlinkDualCarrier().set_implicit_omit();
if (flexibleTimeslotAssignment().is_bound()) flexibleTimeslotAssignment().set_implicit_omit();
if (gANPSHandoverCapability().is_bound()) gANPSHandoverCapability().set_implicit_omit();
if (rLCNonPersistentMode().is_bound()) rLCNonPersistentMode().set_implicit_omit();
if (reducedLatencyCapability().is_bound()) reducedLatencyCapability().set_implicit_omit();
if (uplinkEGPRS2().is_bound()) uplinkEGPRS2().set_implicit_omit();
if (downlinkEGPRS2().is_bound()) downlinkEGPRS2().set_implicit_omit();
}

void AccessCapAdditionsRel7::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) dTMHandoverCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDownlinkDualCarrier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) flexibleTimeslotAssignment().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gANPSHandoverCapability().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rLCNonPersistentMode().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) reducedLatencyCapability().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) uplinkEGPRS2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) downlinkEGPRS2().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTMHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMHandoverCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitDownlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDownlinkDualCarrier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "downlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkDualCarrier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flexibleTimeslotAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flexibleTimeslotAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gANPSHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gANPSHandoverCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rLCNonPersistentMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rLCNonPersistentMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reducedLatencyCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reducedLatencyCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uplinkEGPRS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uplinkEGPRS2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "downlinkEGPRS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkEGPRS2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
  }
}

void AccessCapAdditionsRel7::encode_text(Text_Buf& text_buf) const
{
field_dTMHandoverCapability.encode_text(text_buf);
field_presenceBitDownlinkDualCarrier.encode_text(text_buf);
field_downlinkDualCarrier.encode_text(text_buf);
field_flexibleTimeslotAssignment.encode_text(text_buf);
field_gANPSHandoverCapability.encode_text(text_buf);
field_rLCNonPersistentMode.encode_text(text_buf);
field_reducedLatencyCapability.encode_text(text_buf);
field_uplinkEGPRS2.encode_text(text_buf);
field_downlinkEGPRS2.encode_text(text_buf);
}

void AccessCapAdditionsRel7::decode_text(Text_Buf& text_buf)
{
field_dTMHandoverCapability.decode_text(text_buf);
field_presenceBitDownlinkDualCarrier.decode_text(text_buf);
field_downlinkDualCarrier.decode_text(text_buf);
field_flexibleTimeslotAssignment.decode_text(text_buf);
field_gANPSHandoverCapability.decode_text(text_buf);
field_rLCNonPersistentMode.decode_text(text_buf);
field_reducedLatencyCapability.decode_text(text_buf);
field_uplinkEGPRS2.decode_text(text_buf);
field_downlinkEGPRS2.decode_text(text_buf);
}

void AccessCapAdditionsRel7::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 AccessCapAdditionsRel7::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 AccessCapAdditionsRel7::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, AccessCapAdditionsRel7_dTMHandoverCapability_descr_.raw->forceomit);
  decoded_field_length = field_dTMHandoverCapability.RAW_decode(AccessCapAdditionsRel7_dTMHandoverCapability_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, AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitDownlinkDualCarrier.RAW_decode(AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_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 && field_presenceBitDownlinkDualCarrier ==  bs_2){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_downlinkDualCarrier = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel7_downlinkDualCarrier_descr_.raw->forceomit);
  decoded_field_length = field_downlinkDualCarrier().RAW_decode(AccessCapAdditionsRel7_downlinkDualCarrier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_downlinkDualCarrier = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_downlinkDualCarrier=OMIT_VALUE;
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel7_flexibleTimeslotAssignment_descr_.raw->forceomit);
  decoded_field_length = field_flexibleTimeslotAssignment.RAW_decode(AccessCapAdditionsRel7_flexibleTimeslotAssignment_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, AccessCapAdditionsRel7_gANPSHandoverCapability_descr_.raw->forceomit);
  decoded_field_length = field_gANPSHandoverCapability.RAW_decode(AccessCapAdditionsRel7_gANPSHandoverCapability_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, AccessCapAdditionsRel7_rLCNonPersistentMode_descr_.raw->forceomit);
  decoded_field_length = field_rLCNonPersistentMode.RAW_decode(AccessCapAdditionsRel7_rLCNonPersistentMode_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, AccessCapAdditionsRel7_reducedLatencyCapability_descr_.raw->forceomit);
  decoded_field_length = field_reducedLatencyCapability.RAW_decode(AccessCapAdditionsRel7_reducedLatencyCapability_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, AccessCapAdditionsRel7_uplinkEGPRS2_descr_.raw->forceomit);
  decoded_field_length = field_uplinkEGPRS2.RAW_decode(AccessCapAdditionsRel7_uplinkEGPRS2_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, AccessCapAdditionsRel7_downlinkEGPRS2_descr_.raw->forceomit);
  decoded_field_length = field_downlinkEGPRS2.RAW_decode(AccessCapAdditionsRel7_downlinkEGPRS2_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel7::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel7_dTMHandoverCapability_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_descr_.raw);
  if (field_downlinkDualCarrier.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel7_downlinkDualCarrier_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel7_flexibleTimeslotAssignment_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel7_gANPSHandoverCapability_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel7_rLCNonPersistentMode_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AccessCapAdditionsRel7_reducedLatencyCapability_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, AccessCapAdditionsRel7_uplinkEGPRS2_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, AccessCapAdditionsRel7_downlinkEGPRS2_descr_.raw);
  encoded_length += field_dTMHandoverCapability.RAW_encode(AccessCapAdditionsRel7_dTMHandoverCapability_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_presenceBitDownlinkDualCarrier.RAW_encode(AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_descr_, *myleaf.body.node.nodes[1]);
  if (field_downlinkDualCarrier.ispresent()) {
  encoded_length += field_downlinkDualCarrier().RAW_encode(AccessCapAdditionsRel7_downlinkDualCarrier_descr_, *myleaf.body.node.nodes[2]);
  }
  encoded_length += field_flexibleTimeslotAssignment.RAW_encode(AccessCapAdditionsRel7_flexibleTimeslotAssignment_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_gANPSHandoverCapability.RAW_encode(AccessCapAdditionsRel7_gANPSHandoverCapability_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_rLCNonPersistentMode.RAW_encode(AccessCapAdditionsRel7_rLCNonPersistentMode_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_reducedLatencyCapability.RAW_encode(AccessCapAdditionsRel7_reducedLatencyCapability_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_uplinkEGPRS2.RAW_encode(AccessCapAdditionsRel7_uplinkEGPRS2_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_downlinkEGPRS2.RAW_encode(AccessCapAdditionsRel7_downlinkEGPRS2_descr_, *myleaf.body.node.nodes[8]);
  if (field_downlinkDualCarrier.ispresent() && (field_presenceBitDownlinkDualCarrier !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={1};
  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_2.RAW_encode(AccessCapAdditionsRel7_presenceBitDownlinkDualCarrier_descr_,*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 AccessCapAdditionsRel7_template::single_value_struct {
BITSTRING_template field_dTMHandoverCapability;
BITSTRING_template field_presenceBitDownlinkDualCarrier;
DownlinkDualCarrier_template field_downlinkDualCarrier;
BITSTRING_template field_flexibleTimeslotAssignment;
BITSTRING_template field_gANPSHandoverCapability;
BITSTRING_template field_rLCNonPersistentMode;
BITSTRING_template field_reducedLatencyCapability;
BITSTRING_template field_uplinkEGPRS2;
BITSTRING_template field_downlinkEGPRS2;
};

void AccessCapAdditionsRel7_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_dTMHandoverCapability = ANY_VALUE;
single_value->field_presenceBitDownlinkDualCarrier = ANY_VALUE;
single_value->field_downlinkDualCarrier = ANY_OR_OMIT;
single_value->field_flexibleTimeslotAssignment = ANY_VALUE;
single_value->field_gANPSHandoverCapability = ANY_VALUE;
single_value->field_rLCNonPersistentMode = ANY_VALUE;
single_value->field_reducedLatencyCapability = ANY_VALUE;
single_value->field_uplinkEGPRS2 = ANY_VALUE;
single_value->field_downlinkEGPRS2 = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel7_template::copy_value(const AccessCapAdditionsRel7& other_value)
{
single_value = new single_value_struct;
if (other_value.dTMHandoverCapability().is_bound()) {
  single_value->field_dTMHandoverCapability = other_value.dTMHandoverCapability();
} else {
  single_value->field_dTMHandoverCapability.clean_up();
}
if (other_value.presenceBitDownlinkDualCarrier().is_bound()) {
  single_value->field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier();
} else {
  single_value->field_presenceBitDownlinkDualCarrier.clean_up();
}
if (other_value.downlinkDualCarrier().is_bound()) {
  if (other_value.downlinkDualCarrier().ispresent()) single_value->field_downlinkDualCarrier = other_value.downlinkDualCarrier()();
  else single_value->field_downlinkDualCarrier = OMIT_VALUE;
} else {
  single_value->field_downlinkDualCarrier.clean_up();
}
if (other_value.flexibleTimeslotAssignment().is_bound()) {
  single_value->field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment();
} else {
  single_value->field_flexibleTimeslotAssignment.clean_up();
}
if (other_value.gANPSHandoverCapability().is_bound()) {
  single_value->field_gANPSHandoverCapability = other_value.gANPSHandoverCapability();
} else {
  single_value->field_gANPSHandoverCapability.clean_up();
}
if (other_value.rLCNonPersistentMode().is_bound()) {
  single_value->field_rLCNonPersistentMode = other_value.rLCNonPersistentMode();
} else {
  single_value->field_rLCNonPersistentMode.clean_up();
}
if (other_value.reducedLatencyCapability().is_bound()) {
  single_value->field_reducedLatencyCapability = other_value.reducedLatencyCapability();
} else {
  single_value->field_reducedLatencyCapability.clean_up();
}
if (other_value.uplinkEGPRS2().is_bound()) {
  single_value->field_uplinkEGPRS2 = other_value.uplinkEGPRS2();
} else {
  single_value->field_uplinkEGPRS2.clean_up();
}
if (other_value.downlinkEGPRS2().is_bound()) {
  single_value->field_downlinkEGPRS2 = other_value.downlinkEGPRS2();
} else {
  single_value->field_downlinkEGPRS2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel7_template::copy_template(const AccessCapAdditionsRel7_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dTMHandoverCapability().get_selection()) {
single_value->field_dTMHandoverCapability = other_value.dTMHandoverCapability();
} else {
single_value->field_dTMHandoverCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDownlinkDualCarrier().get_selection()) {
single_value->field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier();
} else {
single_value->field_presenceBitDownlinkDualCarrier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.downlinkDualCarrier().get_selection()) {
single_value->field_downlinkDualCarrier = other_value.downlinkDualCarrier();
} else {
single_value->field_downlinkDualCarrier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.flexibleTimeslotAssignment().get_selection()) {
single_value->field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment();
} else {
single_value->field_flexibleTimeslotAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gANPSHandoverCapability().get_selection()) {
single_value->field_gANPSHandoverCapability = other_value.gANPSHandoverCapability();
} else {
single_value->field_gANPSHandoverCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rLCNonPersistentMode().get_selection()) {
single_value->field_rLCNonPersistentMode = other_value.rLCNonPersistentMode();
} else {
single_value->field_rLCNonPersistentMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reducedLatencyCapability().get_selection()) {
single_value->field_reducedLatencyCapability = other_value.reducedLatencyCapability();
} else {
single_value->field_reducedLatencyCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uplinkEGPRS2().get_selection()) {
single_value->field_uplinkEGPRS2 = other_value.uplinkEGPRS2();
} else {
single_value->field_uplinkEGPRS2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.downlinkEGPRS2().get_selection()) {
single_value->field_downlinkEGPRS2 = other_value.downlinkEGPRS2();
} else {
single_value->field_downlinkEGPRS2.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 AccessCapAdditionsRel7_template[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 AccessCapAdditionsRel7_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel7_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_GMM_SM_Types.AccessCapAdditionsRel7.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel7_template::AccessCapAdditionsRel7_template()
{
}

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

AccessCapAdditionsRel7_template::AccessCapAdditionsRel7_template(const AccessCapAdditionsRel7& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel7_template::match(const AccessCapAdditionsRel7& 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.dTMHandoverCapability().is_bound()) return FALSE;
if(!single_value->field_dTMHandoverCapability.match(other_value.dTMHandoverCapability(), legacy))return FALSE;
if(!other_value.presenceBitDownlinkDualCarrier().is_bound()) return FALSE;
if(!single_value->field_presenceBitDownlinkDualCarrier.match(other_value.presenceBitDownlinkDualCarrier(), legacy))return FALSE;
if(!other_value.downlinkDualCarrier().is_bound()) return FALSE;
if((other_value.downlinkDualCarrier().ispresent() ? !single_value->field_downlinkDualCarrier.match((const DownlinkDualCarrier&)other_value.downlinkDualCarrier(), legacy) : !single_value->field_downlinkDualCarrier.match_omit(legacy)))return FALSE;
if(!other_value.flexibleTimeslotAssignment().is_bound()) return FALSE;
if(!single_value->field_flexibleTimeslotAssignment.match(other_value.flexibleTimeslotAssignment(), legacy))return FALSE;
if(!other_value.gANPSHandoverCapability().is_bound()) return FALSE;
if(!single_value->field_gANPSHandoverCapability.match(other_value.gANPSHandoverCapability(), legacy))return FALSE;
if(!other_value.rLCNonPersistentMode().is_bound()) return FALSE;
if(!single_value->field_rLCNonPersistentMode.match(other_value.rLCNonPersistentMode(), legacy))return FALSE;
if(!other_value.reducedLatencyCapability().is_bound()) return FALSE;
if(!single_value->field_reducedLatencyCapability.match(other_value.reducedLatencyCapability(), legacy))return FALSE;
if(!other_value.uplinkEGPRS2().is_bound()) return FALSE;
if(!single_value->field_uplinkEGPRS2.match(other_value.uplinkEGPRS2(), legacy))return FALSE;
if(!other_value.downlinkEGPRS2().is_bound()) return FALSE;
if(!single_value->field_downlinkEGPRS2.match(other_value.downlinkEGPRS2(), 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_GMM_SM_Types.AccessCapAdditionsRel7.");
}
return FALSE;
}

boolean AccessCapAdditionsRel7_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dTMHandoverCapability.is_bound()
 || single_value->field_presenceBitDownlinkDualCarrier.is_bound()
 || (single_value->field_downlinkDualCarrier.is_omit() || single_value->field_downlinkDualCarrier.is_bound())
 || single_value->field_flexibleTimeslotAssignment.is_bound()
 || single_value->field_gANPSHandoverCapability.is_bound()
 || single_value->field_rLCNonPersistentMode.is_bound()
 || single_value->field_reducedLatencyCapability.is_bound()
 || single_value->field_uplinkEGPRS2.is_bound()
 || single_value->field_downlinkEGPRS2.is_bound();
}

boolean AccessCapAdditionsRel7_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dTMHandoverCapability.is_value()
 && single_value->field_presenceBitDownlinkDualCarrier.is_value()
 && (single_value->field_downlinkDualCarrier.is_omit() || single_value->field_downlinkDualCarrier.is_value())
 && single_value->field_flexibleTimeslotAssignment.is_value()
 && single_value->field_gANPSHandoverCapability.is_value()
 && single_value->field_rLCNonPersistentMode.is_value()
 && single_value->field_reducedLatencyCapability.is_value()
 && single_value->field_uplinkEGPRS2.is_value()
 && single_value->field_downlinkEGPRS2.is_value();
}

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

AccessCapAdditionsRel7 AccessCapAdditionsRel7_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_GMM_SM_Types.AccessCapAdditionsRel7.");
AccessCapAdditionsRel7 ret_val;
if (single_value->field_dTMHandoverCapability.is_bound()) {
ret_val.dTMHandoverCapability() = single_value->field_dTMHandoverCapability.valueof();
}
if (single_value->field_presenceBitDownlinkDualCarrier.is_bound()) {
ret_val.presenceBitDownlinkDualCarrier() = single_value->field_presenceBitDownlinkDualCarrier.valueof();
}
if (single_value->field_downlinkDualCarrier.is_omit()) ret_val.downlinkDualCarrier() = OMIT_VALUE;
else if (single_value->field_downlinkDualCarrier.is_bound()) {
ret_val.downlinkDualCarrier() = single_value->field_downlinkDualCarrier.valueof();
}
if (single_value->field_flexibleTimeslotAssignment.is_bound()) {
ret_val.flexibleTimeslotAssignment() = single_value->field_flexibleTimeslotAssignment.valueof();
}
if (single_value->field_gANPSHandoverCapability.is_bound()) {
ret_val.gANPSHandoverCapability() = single_value->field_gANPSHandoverCapability.valueof();
}
if (single_value->field_rLCNonPersistentMode.is_bound()) {
ret_val.rLCNonPersistentMode() = single_value->field_rLCNonPersistentMode.valueof();
}
if (single_value->field_reducedLatencyCapability.is_bound()) {
ret_val.reducedLatencyCapability() = single_value->field_reducedLatencyCapability.valueof();
}
if (single_value->field_uplinkEGPRS2.is_bound()) {
ret_val.uplinkEGPRS2() = single_value->field_uplinkEGPRS2.valueof();
}
if (single_value->field_downlinkEGPRS2.is_bound()) {
ret_val.downlinkEGPRS2() = single_value->field_downlinkEGPRS2.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel7_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_GMM_SM_Types.AccessCapAdditionsRel7.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel7_template[list_length];
}

AccessCapAdditionsRel7_template& AccessCapAdditionsRel7_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_GMM_SM_Types.AccessCapAdditionsRel7.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel7_template::dTMHandoverCapability()
{
set_specific();
return single_value->field_dTMHandoverCapability;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::dTMHandoverCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTMHandoverCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_dTMHandoverCapability;
}

BITSTRING_template& AccessCapAdditionsRel7_template::presenceBitDownlinkDualCarrier()
{
set_specific();
return single_value->field_presenceBitDownlinkDualCarrier;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::presenceBitDownlinkDualCarrier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitDownlinkDualCarrier of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_presenceBitDownlinkDualCarrier;
}

DownlinkDualCarrier_template& AccessCapAdditionsRel7_template::downlinkDualCarrier()
{
set_specific();
return single_value->field_downlinkDualCarrier;
}

const DownlinkDualCarrier_template& AccessCapAdditionsRel7_template::downlinkDualCarrier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field downlinkDualCarrier of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_downlinkDualCarrier;
}

BITSTRING_template& AccessCapAdditionsRel7_template::flexibleTimeslotAssignment()
{
set_specific();
return single_value->field_flexibleTimeslotAssignment;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::flexibleTimeslotAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field flexibleTimeslotAssignment of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_flexibleTimeslotAssignment;
}

BITSTRING_template& AccessCapAdditionsRel7_template::gANPSHandoverCapability()
{
set_specific();
return single_value->field_gANPSHandoverCapability;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::gANPSHandoverCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gANPSHandoverCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_gANPSHandoverCapability;
}

BITSTRING_template& AccessCapAdditionsRel7_template::rLCNonPersistentMode()
{
set_specific();
return single_value->field_rLCNonPersistentMode;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::rLCNonPersistentMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rLCNonPersistentMode of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_rLCNonPersistentMode;
}

BITSTRING_template& AccessCapAdditionsRel7_template::reducedLatencyCapability()
{
set_specific();
return single_value->field_reducedLatencyCapability;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::reducedLatencyCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reducedLatencyCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_reducedLatencyCapability;
}

BITSTRING_template& AccessCapAdditionsRel7_template::uplinkEGPRS2()
{
set_specific();
return single_value->field_uplinkEGPRS2;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::uplinkEGPRS2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uplinkEGPRS2 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_uplinkEGPRS2;
}

BITSTRING_template& AccessCapAdditionsRel7_template::downlinkEGPRS2()
{
set_specific();
return single_value->field_downlinkEGPRS2;
}

const BITSTRING_template& AccessCapAdditionsRel7_template::downlinkEGPRS2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field downlinkEGPRS2 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7.");
return single_value->field_downlinkEGPRS2;
}

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

void AccessCapAdditionsRel7_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dTMHandoverCapability := ");
single_value->field_dTMHandoverCapability.log();
TTCN_Logger::log_event_str(", presenceBitDownlinkDualCarrier := ");
single_value->field_presenceBitDownlinkDualCarrier.log();
TTCN_Logger::log_event_str(", downlinkDualCarrier := ");
single_value->field_downlinkDualCarrier.log();
TTCN_Logger::log_event_str(", flexibleTimeslotAssignment := ");
single_value->field_flexibleTimeslotAssignment.log();
TTCN_Logger::log_event_str(", gANPSHandoverCapability := ");
single_value->field_gANPSHandoverCapability.log();
TTCN_Logger::log_event_str(", rLCNonPersistentMode := ");
single_value->field_rLCNonPersistentMode.log();
TTCN_Logger::log_event_str(", reducedLatencyCapability := ");
single_value->field_reducedLatencyCapability.log();
TTCN_Logger::log_event_str(", uplinkEGPRS2 := ");
single_value->field_uplinkEGPRS2.log();
TTCN_Logger::log_event_str(", downlinkEGPRS2 := ");
single_value->field_downlinkEGPRS2.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 AccessCapAdditionsRel7_template::log_match(const AccessCapAdditionsRel7& 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_dTMHandoverCapability.match(match_value.dTMHandoverCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".dTMHandoverCapability");
single_value->field_dTMHandoverCapability.log_match(match_value.dTMHandoverCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitDownlinkDualCarrier.match(match_value.presenceBitDownlinkDualCarrier(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitDownlinkDualCarrier");
single_value->field_presenceBitDownlinkDualCarrier.log_match(match_value.presenceBitDownlinkDualCarrier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.downlinkDualCarrier().ispresent()){
if(!single_value->field_downlinkDualCarrier.match(match_value.downlinkDualCarrier(), legacy)){
TTCN_Logger::log_logmatch_info(".downlinkDualCarrier");
single_value->field_downlinkDualCarrier.log_match(match_value.downlinkDualCarrier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_downlinkDualCarrier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".downlinkDualCarrier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_downlinkDualCarrier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_flexibleTimeslotAssignment.match(match_value.flexibleTimeslotAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".flexibleTimeslotAssignment");
single_value->field_flexibleTimeslotAssignment.log_match(match_value.flexibleTimeslotAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gANPSHandoverCapability.match(match_value.gANPSHandoverCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".gANPSHandoverCapability");
single_value->field_gANPSHandoverCapability.log_match(match_value.gANPSHandoverCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rLCNonPersistentMode.match(match_value.rLCNonPersistentMode(), legacy)){
TTCN_Logger::log_logmatch_info(".rLCNonPersistentMode");
single_value->field_rLCNonPersistentMode.log_match(match_value.rLCNonPersistentMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reducedLatencyCapability.match(match_value.reducedLatencyCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".reducedLatencyCapability");
single_value->field_reducedLatencyCapability.log_match(match_value.reducedLatencyCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uplinkEGPRS2.match(match_value.uplinkEGPRS2(), legacy)){
TTCN_Logger::log_logmatch_info(".uplinkEGPRS2");
single_value->field_uplinkEGPRS2.log_match(match_value.uplinkEGPRS2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_downlinkEGPRS2.match(match_value.downlinkEGPRS2(), legacy)){
TTCN_Logger::log_logmatch_info(".downlinkEGPRS2");
single_value->field_downlinkEGPRS2.log_match(match_value.downlinkEGPRS2(), 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("{ dTMHandoverCapability := ");
single_value->field_dTMHandoverCapability.log_match(match_value.dTMHandoverCapability(), legacy);
TTCN_Logger::log_event_str(", presenceBitDownlinkDualCarrier := ");
single_value->field_presenceBitDownlinkDualCarrier.log_match(match_value.presenceBitDownlinkDualCarrier(), legacy);
TTCN_Logger::log_event_str(", downlinkDualCarrier := ");
if (match_value.downlinkDualCarrier().ispresent()) {
single_value->field_downlinkDualCarrier.log_match(match_value.downlinkDualCarrier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_downlinkDualCarrier.log();
if (single_value->field_downlinkDualCarrier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", flexibleTimeslotAssignment := ");
single_value->field_flexibleTimeslotAssignment.log_match(match_value.flexibleTimeslotAssignment(), legacy);
TTCN_Logger::log_event_str(", gANPSHandoverCapability := ");
single_value->field_gANPSHandoverCapability.log_match(match_value.gANPSHandoverCapability(), legacy);
TTCN_Logger::log_event_str(", rLCNonPersistentMode := ");
single_value->field_rLCNonPersistentMode.log_match(match_value.rLCNonPersistentMode(), legacy);
TTCN_Logger::log_event_str(", reducedLatencyCapability := ");
single_value->field_reducedLatencyCapability.log_match(match_value.reducedLatencyCapability(), legacy);
TTCN_Logger::log_event_str(", uplinkEGPRS2 := ");
single_value->field_uplinkEGPRS2.log_match(match_value.uplinkEGPRS2(), legacy);
TTCN_Logger::log_event_str(", downlinkEGPRS2 := ");
single_value->field_downlinkEGPRS2.log_match(match_value.downlinkEGPRS2(), 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 AccessCapAdditionsRel7_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dTMHandoverCapability().is_bound()) dTMHandoverCapability().set_implicit_omit();
if (presenceBitDownlinkDualCarrier().is_bound()) presenceBitDownlinkDualCarrier().set_implicit_omit();
if (!downlinkDualCarrier().is_bound()) downlinkDualCarrier() = OMIT_VALUE;
else downlinkDualCarrier().set_implicit_omit();
if (flexibleTimeslotAssignment().is_bound()) flexibleTimeslotAssignment().set_implicit_omit();
if (gANPSHandoverCapability().is_bound()) gANPSHandoverCapability().set_implicit_omit();
if (rLCNonPersistentMode().is_bound()) rLCNonPersistentMode().set_implicit_omit();
if (reducedLatencyCapability().is_bound()) reducedLatencyCapability().set_implicit_omit();
if (uplinkEGPRS2().is_bound()) uplinkEGPRS2().set_implicit_omit();
if (downlinkEGPRS2().is_bound()) downlinkEGPRS2().set_implicit_omit();
}

void AccessCapAdditionsRel7_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dTMHandoverCapability.encode_text(text_buf);
single_value->field_presenceBitDownlinkDualCarrier.encode_text(text_buf);
single_value->field_downlinkDualCarrier.encode_text(text_buf);
single_value->field_flexibleTimeslotAssignment.encode_text(text_buf);
single_value->field_gANPSHandoverCapability.encode_text(text_buf);
single_value->field_rLCNonPersistentMode.encode_text(text_buf);
single_value->field_reducedLatencyCapability.encode_text(text_buf);
single_value->field_uplinkEGPRS2.encode_text(text_buf);
single_value->field_downlinkEGPRS2.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_GMM_SM_Types.AccessCapAdditionsRel7.");
}
}

void AccessCapAdditionsRel7_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_dTMHandoverCapability.decode_text(text_buf);
single_value->field_presenceBitDownlinkDualCarrier.decode_text(text_buf);
single_value->field_downlinkDualCarrier.decode_text(text_buf);
single_value->field_flexibleTimeslotAssignment.decode_text(text_buf);
single_value->field_gANPSHandoverCapability.decode_text(text_buf);
single_value->field_rLCNonPersistentMode.decode_text(text_buf);
single_value->field_reducedLatencyCapability.decode_text(text_buf);
single_value->field_uplinkEGPRS2.decode_text(text_buf);
single_value->field_downlinkEGPRS2.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 AccessCapAdditionsRel7_template[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_GMM_SM_Types.AccessCapAdditionsRel7.");
}
}

void AccessCapAdditionsRel7_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: {
    AccessCapAdditionsRel7_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7 has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) dTMHandoverCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDownlinkDualCarrier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrier().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) flexibleTimeslotAssignment().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gANPSHandoverCapability().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rLCNonPersistentMode().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) reducedLatencyCapability().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) uplinkEGPRS2().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) downlinkEGPRS2().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTMHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTMHandoverCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitDownlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDownlinkDualCarrier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "downlinkDualCarrier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkDualCarrier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "flexibleTimeslotAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          flexibleTimeslotAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gANPSHandoverCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gANPSHandoverCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rLCNonPersistentMode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rLCNonPersistentMode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reducedLatencyCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reducedLatencyCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uplinkEGPRS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uplinkEGPRS2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "downlinkEGPRS2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          downlinkEGPRS2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel7: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel7_template* precondition = new AccessCapAdditionsRel7_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel7_template* implied_template = new AccessCapAdditionsRel7_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel7_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel7_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_dTMHandoverCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_presenceBitDownlinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_downlinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_flexibleTimeslotAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_gANPSHandoverCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_rLCNonPersistentMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_reducedLatencyCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_uplinkEGPRS2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
single_value->field_downlinkEGPRS2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel7");
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_GMM_SM_Types.AccessCapAdditionsRel7");
}

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

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

DownlinkDualCarrier::DownlinkDualCarrier()
{
}

DownlinkDualCarrier::DownlinkDualCarrier(const BITSTRING& par_multislotCapReductionforDownLinkDualCarrier,
    const BITSTRING& par_downlinkDualCarrierforDTMCapability)
  :   field_multislotCapReductionforDownLinkDualCarrier(par_multislotCapReductionforDownLinkDualCarrier),
  field_downlinkDualCarrierforDTMCapability(par_downlinkDualCarrierforDTMCapability)
{
}

DownlinkDualCarrier::DownlinkDualCarrier(const DownlinkDualCarrier& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
if (other_value.multislotCapReductionforDownLinkDualCarrier().is_bound()) field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier();
else field_multislotCapReductionforDownLinkDualCarrier.clean_up();
if (other_value.downlinkDualCarrierforDTMCapability().is_bound()) field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability();
else field_downlinkDualCarrierforDTMCapability.clean_up();
}

void DownlinkDualCarrier::clean_up()
{
field_multislotCapReductionforDownLinkDualCarrier.clean_up();
field_downlinkDualCarrierforDTMCapability.clean_up();
}

const TTCN_Typedescriptor_t* DownlinkDualCarrier::get_descriptor() const { return &DownlinkDualCarrier_descr_; }
DownlinkDualCarrier& DownlinkDualCarrier::operator=(const DownlinkDualCarrier& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
  if (other_value.multislotCapReductionforDownLinkDualCarrier().is_bound()) field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier();
  else field_multislotCapReductionforDownLinkDualCarrier.clean_up();
  if (other_value.downlinkDualCarrierforDTMCapability().is_bound()) field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability();
  else field_downlinkDualCarrierforDTMCapability.clean_up();
}
return *this;
}

boolean DownlinkDualCarrier::operator==(const DownlinkDualCarrier& other_value) const
{
return field_multislotCapReductionforDownLinkDualCarrier==other_value.field_multislotCapReductionforDownLinkDualCarrier
  && field_downlinkDualCarrierforDTMCapability==other_value.field_downlinkDualCarrierforDTMCapability;
}

boolean DownlinkDualCarrier::is_bound() const
{
return (field_multislotCapReductionforDownLinkDualCarrier.is_bound())
  || (field_downlinkDualCarrierforDTMCapability.is_bound());
}
boolean DownlinkDualCarrier::is_value() const
{
return field_multislotCapReductionforDownLinkDualCarrier.is_value()
  && field_downlinkDualCarrierforDTMCapability.is_value();
}
void DownlinkDualCarrier::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ multislotCapReductionforDownLinkDualCarrier := ");
field_multislotCapReductionforDownLinkDualCarrier.log();
TTCN_Logger::log_event_str(", downlinkDualCarrierforDTMCapability := ");
field_downlinkDualCarrierforDTMCapability.log();
TTCN_Logger::log_event_str(" }");
}

void DownlinkDualCarrier::set_implicit_omit()
{
if (multislotCapReductionforDownLinkDualCarrier().is_bound()) multislotCapReductionforDownLinkDualCarrier().set_implicit_omit();
if (downlinkDualCarrierforDTMCapability().is_bound()) downlinkDualCarrierforDTMCapability().set_implicit_omit();
}

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

void DownlinkDualCarrier::encode_text(Text_Buf& text_buf) const
{
field_multislotCapReductionforDownLinkDualCarrier.encode_text(text_buf);
field_downlinkDualCarrierforDTMCapability.encode_text(text_buf);
}

void DownlinkDualCarrier::decode_text(Text_Buf& text_buf)
{
field_multislotCapReductionforDownLinkDualCarrier.decode_text(text_buf);
field_downlinkDualCarrierforDTMCapability.decode_text(text_buf);
}

void DownlinkDualCarrier::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 DownlinkDualCarrier::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 DownlinkDualCarrier::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, DownlinkDualCarrier_multislotCapReductionforDownLinkDualCarrier_descr_.raw->forceomit);
  decoded_field_length = field_multislotCapReductionforDownLinkDualCarrier.RAW_decode(DownlinkDualCarrier_multislotCapReductionforDownLinkDualCarrier_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, DownlinkDualCarrier_downlinkDualCarrierforDTMCapability_descr_.raw->forceomit);
  decoded_field_length = field_downlinkDualCarrierforDTMCapability.RAW_decode(DownlinkDualCarrier_downlinkDualCarrierforDTMCapability_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 DownlinkDualCarrier::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, DownlinkDualCarrier_multislotCapReductionforDownLinkDualCarrier_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DownlinkDualCarrier_downlinkDualCarrierforDTMCapability_descr_.raw);
  encoded_length += field_multislotCapReductionforDownLinkDualCarrier.RAW_encode(DownlinkDualCarrier_multislotCapReductionforDownLinkDualCarrier_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_downlinkDualCarrierforDTMCapability.RAW_encode(DownlinkDualCarrier_downlinkDualCarrierforDTMCapability_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct DownlinkDualCarrier_template::single_value_struct {
BITSTRING_template field_multislotCapReductionforDownLinkDualCarrier;
BITSTRING_template field_downlinkDualCarrierforDTMCapability;
};

void DownlinkDualCarrier_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_multislotCapReductionforDownLinkDualCarrier = ANY_VALUE;
single_value->field_downlinkDualCarrierforDTMCapability = ANY_VALUE;
}
}
}

void DownlinkDualCarrier_template::copy_value(const DownlinkDualCarrier& other_value)
{
single_value = new single_value_struct;
if (other_value.multislotCapReductionforDownLinkDualCarrier().is_bound()) {
  single_value->field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier();
} else {
  single_value->field_multislotCapReductionforDownLinkDualCarrier.clean_up();
}
if (other_value.downlinkDualCarrierforDTMCapability().is_bound()) {
  single_value->field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability();
} else {
  single_value->field_downlinkDualCarrierforDTMCapability.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DownlinkDualCarrier_template::copy_template(const DownlinkDualCarrier_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.multislotCapReductionforDownLinkDualCarrier().get_selection()) {
single_value->field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier();
} else {
single_value->field_multislotCapReductionforDownLinkDualCarrier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.downlinkDualCarrierforDTMCapability().get_selection()) {
single_value->field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability();
} else {
single_value->field_downlinkDualCarrierforDTMCapability.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 DownlinkDualCarrier_template[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 DownlinkDualCarrier_template(*other_value.implication_.precondition);
implication_.implied_template = new DownlinkDualCarrier_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_GMM_SM_Types.DownlinkDualCarrier.");
break;
}
set_selection(other_value);
}

DownlinkDualCarrier_template::DownlinkDualCarrier_template()
{
}

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

DownlinkDualCarrier_template::DownlinkDualCarrier_template(const DownlinkDualCarrier& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean DownlinkDualCarrier_template::match(const DownlinkDualCarrier& 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.multislotCapReductionforDownLinkDualCarrier().is_bound()) return FALSE;
if(!single_value->field_multislotCapReductionforDownLinkDualCarrier.match(other_value.multislotCapReductionforDownLinkDualCarrier(), legacy))return FALSE;
if(!other_value.downlinkDualCarrierforDTMCapability().is_bound()) return FALSE;
if(!single_value->field_downlinkDualCarrierforDTMCapability.match(other_value.downlinkDualCarrierforDTMCapability(), 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_GMM_SM_Types.DownlinkDualCarrier.");
}
return FALSE;
}

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

boolean DownlinkDualCarrier_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_multislotCapReductionforDownLinkDualCarrier.is_value()
 && single_value->field_downlinkDualCarrierforDTMCapability.is_value();
}

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

DownlinkDualCarrier DownlinkDualCarrier_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_GMM_SM_Types.DownlinkDualCarrier.");
DownlinkDualCarrier ret_val;
if (single_value->field_multislotCapReductionforDownLinkDualCarrier.is_bound()) {
ret_val.multislotCapReductionforDownLinkDualCarrier() = single_value->field_multislotCapReductionforDownLinkDualCarrier.valueof();
}
if (single_value->field_downlinkDualCarrierforDTMCapability.is_bound()) {
ret_val.downlinkDualCarrierforDTMCapability() = single_value->field_downlinkDualCarrierforDTMCapability.valueof();
}
return ret_val;
}

void DownlinkDualCarrier_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_GMM_SM_Types.DownlinkDualCarrier.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DownlinkDualCarrier_template[list_length];
}

DownlinkDualCarrier_template& DownlinkDualCarrier_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_GMM_SM_Types.DownlinkDualCarrier.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
return value_list.list_value[list_index];
}

BITSTRING_template& DownlinkDualCarrier_template::multislotCapReductionforDownLinkDualCarrier()
{
set_specific();
return single_value->field_multislotCapReductionforDownLinkDualCarrier;
}

const BITSTRING_template& DownlinkDualCarrier_template::multislotCapReductionforDownLinkDualCarrier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field multislotCapReductionforDownLinkDualCarrier of a non-specific template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
return single_value->field_multislotCapReductionforDownLinkDualCarrier;
}

BITSTRING_template& DownlinkDualCarrier_template::downlinkDualCarrierforDTMCapability()
{
set_specific();
return single_value->field_downlinkDualCarrierforDTMCapability;
}

const BITSTRING_template& DownlinkDualCarrier_template::downlinkDualCarrierforDTMCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field downlinkDualCarrierforDTMCapability of a non-specific template of type @MobileL3_GMM_SM_Types.DownlinkDualCarrier.");
return single_value->field_downlinkDualCarrierforDTMCapability;
}

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

void DownlinkDualCarrier_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ multislotCapReductionforDownLinkDualCarrier := ");
single_value->field_multislotCapReductionforDownLinkDualCarrier.log();
TTCN_Logger::log_event_str(", downlinkDualCarrierforDTMCapability := ");
single_value->field_downlinkDualCarrierforDTMCapability.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 DownlinkDualCarrier_template::log_match(const DownlinkDualCarrier& 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_multislotCapReductionforDownLinkDualCarrier.match(match_value.multislotCapReductionforDownLinkDualCarrier(), legacy)){
TTCN_Logger::log_logmatch_info(".multislotCapReductionforDownLinkDualCarrier");
single_value->field_multislotCapReductionforDownLinkDualCarrier.log_match(match_value.multislotCapReductionforDownLinkDualCarrier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_downlinkDualCarrierforDTMCapability.match(match_value.downlinkDualCarrierforDTMCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".downlinkDualCarrierforDTMCapability");
single_value->field_downlinkDualCarrierforDTMCapability.log_match(match_value.downlinkDualCarrierforDTMCapability(), 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("{ multislotCapReductionforDownLinkDualCarrier := ");
single_value->field_multislotCapReductionforDownLinkDualCarrier.log_match(match_value.multislotCapReductionforDownLinkDualCarrier(), legacy);
TTCN_Logger::log_event_str(", downlinkDualCarrierforDTMCapability := ");
single_value->field_downlinkDualCarrierforDTMCapability.log_match(match_value.downlinkDualCarrierforDTMCapability(), 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 DownlinkDualCarrier_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (multislotCapReductionforDownLinkDualCarrier().is_bound()) multislotCapReductionforDownLinkDualCarrier().set_implicit_omit();
if (downlinkDualCarrierforDTMCapability().is_bound()) downlinkDualCarrierforDTMCapability().set_implicit_omit();
}

void DownlinkDualCarrier_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_multislotCapReductionforDownLinkDualCarrier.encode_text(text_buf);
single_value->field_downlinkDualCarrierforDTMCapability.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_GMM_SM_Types.DownlinkDualCarrier.");
}
}

void DownlinkDualCarrier_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_multislotCapReductionforDownLinkDualCarrier.decode_text(text_buf);
single_value->field_downlinkDualCarrierforDTMCapability.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 DownlinkDualCarrier_template[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_GMM_SM_Types.DownlinkDualCarrier.");
}
}

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

void DownlinkDualCarrier_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_multislotCapReductionforDownLinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DownlinkDualCarrier");
single_value->field_downlinkDualCarrierforDTMCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DownlinkDualCarrier");
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_GMM_SM_Types.DownlinkDualCarrier");
}

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

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

AccessCapAdditionsAfterRel6::AccessCapAdditionsAfterRel6()
{
}

AccessCapAdditionsAfterRel6::AccessCapAdditionsAfterRel6(const AccessCapAdditionsRel7& par_accessCapAdditionsRel7,
    const OPTIONAL< AccessCapAdditionsAfterRel7 >& par_accessCapAdditionsAfterRel7)
  :   field_accessCapAdditionsRel7(par_accessCapAdditionsRel7),
  field_accessCapAdditionsAfterRel7(par_accessCapAdditionsAfterRel7)
{
}

AccessCapAdditionsAfterRel6::AccessCapAdditionsAfterRel6(const AccessCapAdditionsAfterRel6& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
if (other_value.accessCapAdditionsRel7().is_bound()) field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7();
else field_accessCapAdditionsRel7.clean_up();
if (other_value.accessCapAdditionsAfterRel7().is_bound()) field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7();
else field_accessCapAdditionsAfterRel7.clean_up();
}

void AccessCapAdditionsAfterRel6::clean_up()
{
field_accessCapAdditionsRel7.clean_up();
field_accessCapAdditionsAfterRel7.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel6::get_descriptor() const { return &AccessCapAdditionsAfterRel6_descr_; }
AccessCapAdditionsAfterRel6& AccessCapAdditionsAfterRel6::operator=(const AccessCapAdditionsAfterRel6& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
  if (other_value.accessCapAdditionsRel7().is_bound()) field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7();
  else field_accessCapAdditionsRel7.clean_up();
  if (other_value.accessCapAdditionsAfterRel7().is_bound()) field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7();
  else field_accessCapAdditionsAfterRel7.clean_up();
}
return *this;
}

boolean AccessCapAdditionsAfterRel6::operator==(const AccessCapAdditionsAfterRel6& other_value) const
{
return field_accessCapAdditionsRel7==other_value.field_accessCapAdditionsRel7
  && field_accessCapAdditionsAfterRel7==other_value.field_accessCapAdditionsAfterRel7;
}

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

void AccessCapAdditionsAfterRel6::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ accessCapAdditionsRel7 := ");
field_accessCapAdditionsRel7.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel7 := ");
field_accessCapAdditionsAfterRel7.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsAfterRel6::set_implicit_omit()
{
if (accessCapAdditionsRel7().is_bound()) accessCapAdditionsRel7().set_implicit_omit();
if (!accessCapAdditionsAfterRel7().is_bound()) accessCapAdditionsAfterRel7() = OMIT_VALUE;
else accessCapAdditionsAfterRel7().set_implicit_omit();
}

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

void AccessCapAdditionsAfterRel6::encode_text(Text_Buf& text_buf) const
{
field_accessCapAdditionsRel7.encode_text(text_buf);
field_accessCapAdditionsAfterRel7.encode_text(text_buf);
}

void AccessCapAdditionsAfterRel6::decode_text(Text_Buf& text_buf)
{
field_accessCapAdditionsRel7.decode_text(text_buf);
field_accessCapAdditionsAfterRel7.decode_text(text_buf);
}

void AccessCapAdditionsAfterRel6::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 AccessCapAdditionsAfterRel6::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 AccessCapAdditionsAfterRel6::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, AccessCapAdditionsAfterRel6_accessCapAdditionsRel7_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsRel7.RAW_decode(AccessCapAdditionsAfterRel6_accessCapAdditionsRel7_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_accessCapAdditionsAfterRel7 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel6_accessCapAdditionsAfterRel7_descr_.raw->forceomit);
  decoded_field_length = field_accessCapAdditionsAfterRel7().RAW_decode(AccessCapAdditionsAfterRel6_accessCapAdditionsAfterRel7_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_accessCapAdditionsAfterRel7 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_accessCapAdditionsAfterRel7=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsAfterRel6::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, AccessCapAdditionsAfterRel6_accessCapAdditionsRel7_descr_.raw);
  if (field_accessCapAdditionsAfterRel7.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel6_accessCapAdditionsAfterRel7_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  encoded_length += field_accessCapAdditionsRel7.RAW_encode(AccessCapAdditionsAfterRel6_accessCapAdditionsRel7_descr_, *myleaf.body.node.nodes[0]);
  if (field_accessCapAdditionsAfterRel7.ispresent()) {
  encoded_length += field_accessCapAdditionsAfterRel7().RAW_encode(AccessCapAdditionsAfterRel6_accessCapAdditionsAfterRel7_descr_, *myleaf.body.node.nodes[1]);
  }
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsAfterRel6_template::single_value_struct {
AccessCapAdditionsRel7_template field_accessCapAdditionsRel7;
AccessCapAdditionsAfterRel7_template field_accessCapAdditionsAfterRel7;
};

void AccessCapAdditionsAfterRel6_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_accessCapAdditionsRel7 = ANY_VALUE;
single_value->field_accessCapAdditionsAfterRel7 = ANY_OR_OMIT;
}
}
}

void AccessCapAdditionsAfterRel6_template::copy_value(const AccessCapAdditionsAfterRel6& other_value)
{
single_value = new single_value_struct;
if (other_value.accessCapAdditionsRel7().is_bound()) {
  single_value->field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7();
} else {
  single_value->field_accessCapAdditionsRel7.clean_up();
}
if (other_value.accessCapAdditionsAfterRel7().is_bound()) {
  if (other_value.accessCapAdditionsAfterRel7().ispresent()) single_value->field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7()();
  else single_value->field_accessCapAdditionsAfterRel7 = OMIT_VALUE;
} else {
  single_value->field_accessCapAdditionsAfterRel7.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsAfterRel6_template::copy_template(const AccessCapAdditionsAfterRel6_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel7().get_selection()) {
single_value->field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7();
} else {
single_value->field_accessCapAdditionsRel7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel7().get_selection()) {
single_value->field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7();
} else {
single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6_template[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 AccessCapAdditionsAfterRel6_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsAfterRel6_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_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsAfterRel6_template::AccessCapAdditionsAfterRel6_template()
{
}

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

AccessCapAdditionsAfterRel6_template::AccessCapAdditionsAfterRel6_template(const AccessCapAdditionsAfterRel6& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsAfterRel6_template::match(const AccessCapAdditionsAfterRel6& 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.accessCapAdditionsRel7().is_bound()) return FALSE;
if(!single_value->field_accessCapAdditionsRel7.match(other_value.accessCapAdditionsRel7(), legacy))return FALSE;
if(!other_value.accessCapAdditionsAfterRel7().is_bound()) return FALSE;
if((other_value.accessCapAdditionsAfterRel7().ispresent() ? !single_value->field_accessCapAdditionsAfterRel7.match((const AccessCapAdditionsAfterRel7&)other_value.accessCapAdditionsAfterRel7(), legacy) : !single_value->field_accessCapAdditionsAfterRel7.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_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
}
return FALSE;
}

boolean AccessCapAdditionsAfterRel6_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_accessCapAdditionsRel7.is_bound()
 || (single_value->field_accessCapAdditionsAfterRel7.is_omit() || single_value->field_accessCapAdditionsAfterRel7.is_bound());
}

boolean AccessCapAdditionsAfterRel6_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_accessCapAdditionsRel7.is_value()
 && (single_value->field_accessCapAdditionsAfterRel7.is_omit() || single_value->field_accessCapAdditionsAfterRel7.is_value());
}

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

AccessCapAdditionsAfterRel6 AccessCapAdditionsAfterRel6_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_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
AccessCapAdditionsAfterRel6 ret_val;
if (single_value->field_accessCapAdditionsRel7.is_bound()) {
ret_val.accessCapAdditionsRel7() = single_value->field_accessCapAdditionsRel7.valueof();
}
if (single_value->field_accessCapAdditionsAfterRel7.is_omit()) ret_val.accessCapAdditionsAfterRel7() = OMIT_VALUE;
else if (single_value->field_accessCapAdditionsAfterRel7.is_bound()) {
ret_val.accessCapAdditionsAfterRel7() = single_value->field_accessCapAdditionsAfterRel7.valueof();
}
return ret_val;
}

void AccessCapAdditionsAfterRel6_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_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsAfterRel6_template[list_length];
}

AccessCapAdditionsAfterRel6_template& AccessCapAdditionsAfterRel6_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_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
return value_list.list_value[list_index];
}

AccessCapAdditionsRel7_template& AccessCapAdditionsAfterRel6_template::accessCapAdditionsRel7()
{
set_specific();
return single_value->field_accessCapAdditionsRel7;
}

const AccessCapAdditionsRel7_template& AccessCapAdditionsAfterRel6_template::accessCapAdditionsRel7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsRel7 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
return single_value->field_accessCapAdditionsRel7;
}

AccessCapAdditionsAfterRel7_template& AccessCapAdditionsAfterRel6_template::accessCapAdditionsAfterRel7()
{
set_specific();
return single_value->field_accessCapAdditionsAfterRel7;
}

const AccessCapAdditionsAfterRel7_template& AccessCapAdditionsAfterRel6_template::accessCapAdditionsAfterRel7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field accessCapAdditionsAfterRel7 of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
return single_value->field_accessCapAdditionsAfterRel7;
}

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

void AccessCapAdditionsAfterRel6_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ accessCapAdditionsRel7 := ");
single_value->field_accessCapAdditionsRel7.log();
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel7 := ");
single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6_template::log_match(const AccessCapAdditionsAfterRel6& 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_accessCapAdditionsRel7.match(match_value.accessCapAdditionsRel7(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel7");
single_value->field_accessCapAdditionsRel7.log_match(match_value.accessCapAdditionsRel7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.accessCapAdditionsAfterRel7().ispresent()){
if(!single_value->field_accessCapAdditionsAfterRel7.match(match_value.accessCapAdditionsAfterRel7(), legacy)){
TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel7");
single_value->field_accessCapAdditionsAfterRel7.log_match(match_value.accessCapAdditionsAfterRel7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_accessCapAdditionsAfterRel7.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel7 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_accessCapAdditionsAfterRel7.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("{ accessCapAdditionsRel7 := ");
single_value->field_accessCapAdditionsRel7.log_match(match_value.accessCapAdditionsRel7(), legacy);
TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel7 := ");
if (match_value.accessCapAdditionsAfterRel7().ispresent()) {
single_value->field_accessCapAdditionsAfterRel7.log_match(match_value.accessCapAdditionsAfterRel7(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_accessCapAdditionsAfterRel7.log();
if (single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (accessCapAdditionsRel7().is_bound()) accessCapAdditionsRel7().set_implicit_omit();
if (!accessCapAdditionsAfterRel7().is_bound()) accessCapAdditionsAfterRel7() = OMIT_VALUE;
else accessCapAdditionsAfterRel7().set_implicit_omit();
}

void AccessCapAdditionsAfterRel6_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_accessCapAdditionsRel7.encode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel7.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_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
}
}

void AccessCapAdditionsAfterRel6_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_accessCapAdditionsRel7.decode_text(text_buf);
single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6_template[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_GMM_SM_Types.AccessCapAdditionsAfterRel6.");
}
}

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

void AccessCapAdditionsAfterRel6_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_accessCapAdditionsRel7.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6");
single_value->field_accessCapAdditionsAfterRel7.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsAfterRel6");
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_GMM_SM_Types.AccessCapAdditionsAfterRel6");
}

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

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

AccessCapAdditionsRel8::AccessCapAdditionsRel8()
{
}

AccessCapAdditionsRel8::AccessCapAdditionsRel8(const BITSTRING& par_eUTRAFDDsupport,
    const BITSTRING& par_eUTRATDDsupport,
    const BITSTRING& par_gERANToEUTRASupportInGERANPacketTransferMode,
    const BITSTRING& par_priorityBasedReselectionSupport)
  :   field_eUTRAFDDsupport(par_eUTRAFDDsupport),
  field_eUTRATDDsupport(par_eUTRATDDsupport),
  field_gERANToEUTRASupportInGERANPacketTransferMode(par_gERANToEUTRASupportInGERANPacketTransferMode),
  field_priorityBasedReselectionSupport(par_priorityBasedReselectionSupport)
{
}

AccessCapAdditionsRel8::AccessCapAdditionsRel8(const AccessCapAdditionsRel8& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
if (other_value.eUTRAFDDsupport().is_bound()) field_eUTRAFDDsupport = other_value.eUTRAFDDsupport();
else field_eUTRAFDDsupport.clean_up();
if (other_value.eUTRATDDsupport().is_bound()) field_eUTRATDDsupport = other_value.eUTRATDDsupport();
else field_eUTRATDDsupport.clean_up();
if (other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode();
else field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
if (other_value.priorityBasedReselectionSupport().is_bound()) field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport();
else field_priorityBasedReselectionSupport.clean_up();
}

void AccessCapAdditionsRel8::clean_up()
{
field_eUTRAFDDsupport.clean_up();
field_eUTRATDDsupport.clean_up();
field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
field_priorityBasedReselectionSupport.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel8::get_descriptor() const { return &AccessCapAdditionsRel8_descr_; }
AccessCapAdditionsRel8& AccessCapAdditionsRel8::operator=(const AccessCapAdditionsRel8& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
  if (other_value.eUTRAFDDsupport().is_bound()) field_eUTRAFDDsupport = other_value.eUTRAFDDsupport();
  else field_eUTRAFDDsupport.clean_up();
  if (other_value.eUTRATDDsupport().is_bound()) field_eUTRATDDsupport = other_value.eUTRATDDsupport();
  else field_eUTRATDDsupport.clean_up();
  if (other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode();
  else field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
  if (other_value.priorityBasedReselectionSupport().is_bound()) field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport();
  else field_priorityBasedReselectionSupport.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel8::operator==(const AccessCapAdditionsRel8& other_value) const
{
return field_eUTRAFDDsupport==other_value.field_eUTRAFDDsupport
  && field_eUTRATDDsupport==other_value.field_eUTRATDDsupport
  && field_gERANToEUTRASupportInGERANPacketTransferMode==other_value.field_gERANToEUTRASupportInGERANPacketTransferMode
  && field_priorityBasedReselectionSupport==other_value.field_priorityBasedReselectionSupport;
}

boolean AccessCapAdditionsRel8::is_bound() const
{
return (field_eUTRAFDDsupport.is_bound())
  || (field_eUTRATDDsupport.is_bound())
  || (field_gERANToEUTRASupportInGERANPacketTransferMode.is_bound())
  || (field_priorityBasedReselectionSupport.is_bound());
}
boolean AccessCapAdditionsRel8::is_value() const
{
return field_eUTRAFDDsupport.is_value()
  && field_eUTRATDDsupport.is_value()
  && field_gERANToEUTRASupportInGERANPacketTransferMode.is_value()
  && field_priorityBasedReselectionSupport.is_value();
}
void AccessCapAdditionsRel8::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ eUTRAFDDsupport := ");
field_eUTRAFDDsupport.log();
TTCN_Logger::log_event_str(", eUTRATDDsupport := ");
field_eUTRATDDsupport.log();
TTCN_Logger::log_event_str(", gERANToEUTRASupportInGERANPacketTransferMode := ");
field_gERANToEUTRASupportInGERANPacketTransferMode.log();
TTCN_Logger::log_event_str(", priorityBasedReselectionSupport := ");
field_priorityBasedReselectionSupport.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel8::set_implicit_omit()
{
if (eUTRAFDDsupport().is_bound()) eUTRAFDDsupport().set_implicit_omit();
if (eUTRATDDsupport().is_bound()) eUTRATDDsupport().set_implicit_omit();
if (gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) gERANToEUTRASupportInGERANPacketTransferMode().set_implicit_omit();
if (priorityBasedReselectionSupport().is_bound()) priorityBasedReselectionSupport().set_implicit_omit();
}

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

void AccessCapAdditionsRel8::encode_text(Text_Buf& text_buf) const
{
field_eUTRAFDDsupport.encode_text(text_buf);
field_eUTRATDDsupport.encode_text(text_buf);
field_gERANToEUTRASupportInGERANPacketTransferMode.encode_text(text_buf);
field_priorityBasedReselectionSupport.encode_text(text_buf);
}

void AccessCapAdditionsRel8::decode_text(Text_Buf& text_buf)
{
field_eUTRAFDDsupport.decode_text(text_buf);
field_eUTRATDDsupport.decode_text(text_buf);
field_gERANToEUTRASupportInGERANPacketTransferMode.decode_text(text_buf);
field_priorityBasedReselectionSupport.decode_text(text_buf);
}

void AccessCapAdditionsRel8::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 AccessCapAdditionsRel8::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 AccessCapAdditionsRel8::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, AccessCapAdditionsRel8_eUTRAFDDsupport_descr_.raw->forceomit);
  decoded_field_length = field_eUTRAFDDsupport.RAW_decode(AccessCapAdditionsRel8_eUTRAFDDsupport_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, AccessCapAdditionsRel8_eUTRATDDsupport_descr_.raw->forceomit);
  decoded_field_length = field_eUTRATDDsupport.RAW_decode(AccessCapAdditionsRel8_eUTRATDDsupport_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, AccessCapAdditionsRel8_gERANToEUTRASupportInGERANPacketTransferMode_descr_.raw->forceomit);
  decoded_field_length = field_gERANToEUTRASupportInGERANPacketTransferMode.RAW_decode(AccessCapAdditionsRel8_gERANToEUTRASupportInGERANPacketTransferMode_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, AccessCapAdditionsRel8_priorityBasedReselectionSupport_descr_.raw->forceomit);
  decoded_field_length = field_priorityBasedReselectionSupport.RAW_decode(AccessCapAdditionsRel8_priorityBasedReselectionSupport_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 AccessCapAdditionsRel8::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, AccessCapAdditionsRel8_eUTRAFDDsupport_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel8_eUTRATDDsupport_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel8_gERANToEUTRASupportInGERANPacketTransferMode_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel8_priorityBasedReselectionSupport_descr_.raw);
  encoded_length += field_eUTRAFDDsupport.RAW_encode(AccessCapAdditionsRel8_eUTRAFDDsupport_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_eUTRATDDsupport.RAW_encode(AccessCapAdditionsRel8_eUTRATDDsupport_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_gERANToEUTRASupportInGERANPacketTransferMode.RAW_encode(AccessCapAdditionsRel8_gERANToEUTRASupportInGERANPacketTransferMode_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_priorityBasedReselectionSupport.RAW_encode(AccessCapAdditionsRel8_priorityBasedReselectionSupport_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel8_template::single_value_struct {
BITSTRING_template field_eUTRAFDDsupport;
BITSTRING_template field_eUTRATDDsupport;
BITSTRING_template field_gERANToEUTRASupportInGERANPacketTransferMode;
BITSTRING_template field_priorityBasedReselectionSupport;
};

void AccessCapAdditionsRel8_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_eUTRAFDDsupport = ANY_VALUE;
single_value->field_eUTRATDDsupport = ANY_VALUE;
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode = ANY_VALUE;
single_value->field_priorityBasedReselectionSupport = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel8_template::copy_value(const AccessCapAdditionsRel8& other_value)
{
single_value = new single_value_struct;
if (other_value.eUTRAFDDsupport().is_bound()) {
  single_value->field_eUTRAFDDsupport = other_value.eUTRAFDDsupport();
} else {
  single_value->field_eUTRAFDDsupport.clean_up();
}
if (other_value.eUTRATDDsupport().is_bound()) {
  single_value->field_eUTRATDDsupport = other_value.eUTRATDDsupport();
} else {
  single_value->field_eUTRATDDsupport.clean_up();
}
if (other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) {
  single_value->field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode();
} else {
  single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
}
if (other_value.priorityBasedReselectionSupport().is_bound()) {
  single_value->field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport();
} else {
  single_value->field_priorityBasedReselectionSupport.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel8_template::copy_template(const AccessCapAdditionsRel8_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.eUTRAFDDsupport().get_selection()) {
single_value->field_eUTRAFDDsupport = other_value.eUTRAFDDsupport();
} else {
single_value->field_eUTRAFDDsupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRATDDsupport().get_selection()) {
single_value->field_eUTRATDDsupport = other_value.eUTRATDDsupport();
} else {
single_value->field_eUTRATDDsupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gERANToEUTRASupportInGERANPacketTransferMode().get_selection()) {
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode();
} else {
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.priorityBasedReselectionSupport().get_selection()) {
single_value->field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport();
} else {
single_value->field_priorityBasedReselectionSupport.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 AccessCapAdditionsRel8_template[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 AccessCapAdditionsRel8_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel8_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_GMM_SM_Types.AccessCapAdditionsRel8.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel8_template::AccessCapAdditionsRel8_template()
{
}

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

AccessCapAdditionsRel8_template::AccessCapAdditionsRel8_template(const AccessCapAdditionsRel8& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel8_template::match(const AccessCapAdditionsRel8& 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.eUTRAFDDsupport().is_bound()) return FALSE;
if(!single_value->field_eUTRAFDDsupport.match(other_value.eUTRAFDDsupport(), legacy))return FALSE;
if(!other_value.eUTRATDDsupport().is_bound()) return FALSE;
if(!single_value->field_eUTRATDDsupport.match(other_value.eUTRATDDsupport(), legacy))return FALSE;
if(!other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) return FALSE;
if(!single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.match(other_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy))return FALSE;
if(!other_value.priorityBasedReselectionSupport().is_bound()) return FALSE;
if(!single_value->field_priorityBasedReselectionSupport.match(other_value.priorityBasedReselectionSupport(), 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_GMM_SM_Types.AccessCapAdditionsRel8.");
}
return FALSE;
}

boolean AccessCapAdditionsRel8_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_eUTRAFDDsupport.is_bound()
 || single_value->field_eUTRATDDsupport.is_bound()
 || single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.is_bound()
 || single_value->field_priorityBasedReselectionSupport.is_bound();
}

boolean AccessCapAdditionsRel8_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_eUTRAFDDsupport.is_value()
 && single_value->field_eUTRATDDsupport.is_value()
 && single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.is_value()
 && single_value->field_priorityBasedReselectionSupport.is_value();
}

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

AccessCapAdditionsRel8 AccessCapAdditionsRel8_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_GMM_SM_Types.AccessCapAdditionsRel8.");
AccessCapAdditionsRel8 ret_val;
if (single_value->field_eUTRAFDDsupport.is_bound()) {
ret_val.eUTRAFDDsupport() = single_value->field_eUTRAFDDsupport.valueof();
}
if (single_value->field_eUTRATDDsupport.is_bound()) {
ret_val.eUTRATDDsupport() = single_value->field_eUTRATDDsupport.valueof();
}
if (single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.is_bound()) {
ret_val.gERANToEUTRASupportInGERANPacketTransferMode() = single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.valueof();
}
if (single_value->field_priorityBasedReselectionSupport.is_bound()) {
ret_val.priorityBasedReselectionSupport() = single_value->field_priorityBasedReselectionSupport.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel8_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_GMM_SM_Types.AccessCapAdditionsRel8.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel8_template[list_length];
}

AccessCapAdditionsRel8_template& AccessCapAdditionsRel8_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_GMM_SM_Types.AccessCapAdditionsRel8.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel8_template::eUTRAFDDsupport()
{
set_specific();
return single_value->field_eUTRAFDDsupport;
}

const BITSTRING_template& AccessCapAdditionsRel8_template::eUTRAFDDsupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRAFDDsupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return single_value->field_eUTRAFDDsupport;
}

BITSTRING_template& AccessCapAdditionsRel8_template::eUTRATDDsupport()
{
set_specific();
return single_value->field_eUTRATDDsupport;
}

const BITSTRING_template& AccessCapAdditionsRel8_template::eUTRATDDsupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRATDDsupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return single_value->field_eUTRATDDsupport;
}

BITSTRING_template& AccessCapAdditionsRel8_template::gERANToEUTRASupportInGERANPacketTransferMode()
{
set_specific();
return single_value->field_gERANToEUTRASupportInGERANPacketTransferMode;
}

const BITSTRING_template& AccessCapAdditionsRel8_template::gERANToEUTRASupportInGERANPacketTransferMode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gERANToEUTRASupportInGERANPacketTransferMode of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return single_value->field_gERANToEUTRASupportInGERANPacketTransferMode;
}

BITSTRING_template& AccessCapAdditionsRel8_template::priorityBasedReselectionSupport()
{
set_specific();
return single_value->field_priorityBasedReselectionSupport;
}

const BITSTRING_template& AccessCapAdditionsRel8_template::priorityBasedReselectionSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priorityBasedReselectionSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel8.");
return single_value->field_priorityBasedReselectionSupport;
}

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

void AccessCapAdditionsRel8_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ eUTRAFDDsupport := ");
single_value->field_eUTRAFDDsupport.log();
TTCN_Logger::log_event_str(", eUTRATDDsupport := ");
single_value->field_eUTRATDDsupport.log();
TTCN_Logger::log_event_str(", gERANToEUTRASupportInGERANPacketTransferMode := ");
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.log();
TTCN_Logger::log_event_str(", priorityBasedReselectionSupport := ");
single_value->field_priorityBasedReselectionSupport.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 AccessCapAdditionsRel8_template::log_match(const AccessCapAdditionsRel8& 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_eUTRAFDDsupport.match(match_value.eUTRAFDDsupport(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRAFDDsupport");
single_value->field_eUTRAFDDsupport.log_match(match_value.eUTRAFDDsupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRATDDsupport.match(match_value.eUTRATDDsupport(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRATDDsupport");
single_value->field_eUTRATDDsupport.log_match(match_value.eUTRATDDsupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.match(match_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy)){
TTCN_Logger::log_logmatch_info(".gERANToEUTRASupportInGERANPacketTransferMode");
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.log_match(match_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_priorityBasedReselectionSupport.match(match_value.priorityBasedReselectionSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".priorityBasedReselectionSupport");
single_value->field_priorityBasedReselectionSupport.log_match(match_value.priorityBasedReselectionSupport(), 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("{ eUTRAFDDsupport := ");
single_value->field_eUTRAFDDsupport.log_match(match_value.eUTRAFDDsupport(), legacy);
TTCN_Logger::log_event_str(", eUTRATDDsupport := ");
single_value->field_eUTRATDDsupport.log_match(match_value.eUTRATDDsupport(), legacy);
TTCN_Logger::log_event_str(", gERANToEUTRASupportInGERANPacketTransferMode := ");
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.log_match(match_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy);
TTCN_Logger::log_event_str(", priorityBasedReselectionSupport := ");
single_value->field_priorityBasedReselectionSupport.log_match(match_value.priorityBasedReselectionSupport(), 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 AccessCapAdditionsRel8_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (eUTRAFDDsupport().is_bound()) eUTRAFDDsupport().set_implicit_omit();
if (eUTRATDDsupport().is_bound()) eUTRATDDsupport().set_implicit_omit();
if (gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) gERANToEUTRASupportInGERANPacketTransferMode().set_implicit_omit();
if (priorityBasedReselectionSupport().is_bound()) priorityBasedReselectionSupport().set_implicit_omit();
}

void AccessCapAdditionsRel8_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_eUTRAFDDsupport.encode_text(text_buf);
single_value->field_eUTRATDDsupport.encode_text(text_buf);
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.encode_text(text_buf);
single_value->field_priorityBasedReselectionSupport.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_GMM_SM_Types.AccessCapAdditionsRel8.");
}
}

void AccessCapAdditionsRel8_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_eUTRAFDDsupport.decode_text(text_buf);
single_value->field_eUTRATDDsupport.decode_text(text_buf);
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.decode_text(text_buf);
single_value->field_priorityBasedReselectionSupport.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 AccessCapAdditionsRel8_template[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_GMM_SM_Types.AccessCapAdditionsRel8.");
}
}

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

void AccessCapAdditionsRel8_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_eUTRAFDDsupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
single_value->field_eUTRATDDsupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
single_value->field_priorityBasedReselectionSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel8");
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_GMM_SM_Types.AccessCapAdditionsRel8");
}

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

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

EnhancedFlexTimeslotAssignment::EnhancedFlexTimeslotAssignment()
{
}

EnhancedFlexTimeslotAssignment::EnhancedFlexTimeslotAssignment(const BITSTRING& par_presenceBitalternativeEFTAMultislotClass,
    const BITSTRING& par_alternativeEFTAMultislotClass,
    const BITSTRING& par_eFTAMultislotCapabilityReductionforDownlinkDualCarrier)
  :   field_presenceBitalternativeEFTAMultislotClass(par_presenceBitalternativeEFTAMultislotClass),
  field_alternativeEFTAMultislotClass(par_alternativeEFTAMultislotClass),
  field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier(par_eFTAMultislotCapabilityReductionforDownlinkDualCarrier)
{
}

EnhancedFlexTimeslotAssignment::EnhancedFlexTimeslotAssignment(const EnhancedFlexTimeslotAssignment& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
if (other_value.presenceBitalternativeEFTAMultislotClass().is_bound()) field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass();
else field_presenceBitalternativeEFTAMultislotClass.clean_up();
if (other_value.alternativeEFTAMultislotClass().is_bound()) field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass();
else field_alternativeEFTAMultislotClass.clean_up();
if (other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier();
else field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.clean_up();
}

void EnhancedFlexTimeslotAssignment::clean_up()
{
field_presenceBitalternativeEFTAMultislotClass.clean_up();
field_alternativeEFTAMultislotClass.clean_up();
field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.clean_up();
}

const TTCN_Typedescriptor_t* EnhancedFlexTimeslotAssignment::get_descriptor() const { return &EnhancedFlexTimeslotAssignment_descr_; }
EnhancedFlexTimeslotAssignment& EnhancedFlexTimeslotAssignment::operator=(const EnhancedFlexTimeslotAssignment& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
  if (other_value.presenceBitalternativeEFTAMultislotClass().is_bound()) field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass();
  else field_presenceBitalternativeEFTAMultislotClass.clean_up();
  if (other_value.alternativeEFTAMultislotClass().is_bound()) field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass();
  else field_alternativeEFTAMultislotClass.clean_up();
  if (other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier();
  else field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.clean_up();
}
return *this;
}

boolean EnhancedFlexTimeslotAssignment::operator==(const EnhancedFlexTimeslotAssignment& other_value) const
{
return field_presenceBitalternativeEFTAMultislotClass==other_value.field_presenceBitalternativeEFTAMultislotClass
  && field_alternativeEFTAMultislotClass==other_value.field_alternativeEFTAMultislotClass
  && field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier==other_value.field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier;
}

boolean EnhancedFlexTimeslotAssignment::is_bound() const
{
return (field_presenceBitalternativeEFTAMultislotClass.is_bound())
  || (field_alternativeEFTAMultislotClass.is_bound())
  || (field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_bound());
}
boolean EnhancedFlexTimeslotAssignment::is_value() const
{
return field_presenceBitalternativeEFTAMultislotClass.is_value()
  && field_alternativeEFTAMultislotClass.is_value()
  && field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_value();
}
void EnhancedFlexTimeslotAssignment::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ presenceBitalternativeEFTAMultislotClass := ");
field_presenceBitalternativeEFTAMultislotClass.log();
TTCN_Logger::log_event_str(", alternativeEFTAMultislotClass := ");
field_alternativeEFTAMultislotClass.log();
TTCN_Logger::log_event_str(", eFTAMultislotCapabilityReductionforDownlinkDualCarrier := ");
field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.log();
TTCN_Logger::log_event_str(" }");
}

void EnhancedFlexTimeslotAssignment::set_implicit_omit()
{
if (presenceBitalternativeEFTAMultislotClass().is_bound()) presenceBitalternativeEFTAMultislotClass().set_implicit_omit();
if (alternativeEFTAMultislotClass().is_bound()) alternativeEFTAMultislotClass().set_implicit_omit();
if (eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) eFTAMultislotCapabilityReductionforDownlinkDualCarrier().set_implicit_omit();
}

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

void EnhancedFlexTimeslotAssignment::encode_text(Text_Buf& text_buf) const
{
field_presenceBitalternativeEFTAMultislotClass.encode_text(text_buf);
field_alternativeEFTAMultislotClass.encode_text(text_buf);
field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.encode_text(text_buf);
}

void EnhancedFlexTimeslotAssignment::decode_text(Text_Buf& text_buf)
{
field_presenceBitalternativeEFTAMultislotClass.decode_text(text_buf);
field_alternativeEFTAMultislotClass.decode_text(text_buf);
field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.decode_text(text_buf);
}

void EnhancedFlexTimeslotAssignment::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 EnhancedFlexTimeslotAssignment::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 EnhancedFlexTimeslotAssignment::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, EnhancedFlexTimeslotAssignment_presenceBitalternativeEFTAMultislotClass_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitalternativeEFTAMultislotClass.RAW_decode(EnhancedFlexTimeslotAssignment_presenceBitalternativeEFTAMultislotClass_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, EnhancedFlexTimeslotAssignment_alternativeEFTAMultislotClass_descr_.raw->forceomit);
  decoded_field_length = field_alternativeEFTAMultislotClass.RAW_decode(EnhancedFlexTimeslotAssignment_alternativeEFTAMultislotClass_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, EnhancedFlexTimeslotAssignment_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_.raw->forceomit);
  decoded_field_length = field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.RAW_decode(EnhancedFlexTimeslotAssignment_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_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 EnhancedFlexTimeslotAssignment::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, EnhancedFlexTimeslotAssignment_presenceBitalternativeEFTAMultislotClass_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, EnhancedFlexTimeslotAssignment_alternativeEFTAMultislotClass_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, EnhancedFlexTimeslotAssignment_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_.raw);
  encoded_length += field_presenceBitalternativeEFTAMultislotClass.RAW_encode(EnhancedFlexTimeslotAssignment_presenceBitalternativeEFTAMultislotClass_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_alternativeEFTAMultislotClass.RAW_encode(EnhancedFlexTimeslotAssignment_alternativeEFTAMultislotClass_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.RAW_encode(EnhancedFlexTimeslotAssignment_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct EnhancedFlexTimeslotAssignment_template::single_value_struct {
BITSTRING_template field_presenceBitalternativeEFTAMultislotClass;
BITSTRING_template field_alternativeEFTAMultislotClass;
BITSTRING_template field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier;
};

void EnhancedFlexTimeslotAssignment_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_presenceBitalternativeEFTAMultislotClass = ANY_VALUE;
single_value->field_alternativeEFTAMultislotClass = ANY_VALUE;
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = ANY_VALUE;
}
}
}

void EnhancedFlexTimeslotAssignment_template::copy_value(const EnhancedFlexTimeslotAssignment& other_value)
{
single_value = new single_value_struct;
if (other_value.presenceBitalternativeEFTAMultislotClass().is_bound()) {
  single_value->field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass();
} else {
  single_value->field_presenceBitalternativeEFTAMultislotClass.clean_up();
}
if (other_value.alternativeEFTAMultislotClass().is_bound()) {
  single_value->field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass();
} else {
  single_value->field_alternativeEFTAMultislotClass.clean_up();
}
if (other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) {
  single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier();
} else {
  single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void EnhancedFlexTimeslotAssignment_template::copy_template(const EnhancedFlexTimeslotAssignment_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitalternativeEFTAMultislotClass().get_selection()) {
single_value->field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass();
} else {
single_value->field_presenceBitalternativeEFTAMultislotClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.alternativeEFTAMultislotClass().get_selection()) {
single_value->field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass();
} else {
single_value->field_alternativeEFTAMultislotClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().get_selection()) {
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier();
} else {
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 EnhancedFlexTimeslotAssignment_template[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 EnhancedFlexTimeslotAssignment_template(*other_value.implication_.precondition);
implication_.implied_template = new EnhancedFlexTimeslotAssignment_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_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
break;
}
set_selection(other_value);
}

EnhancedFlexTimeslotAssignment_template::EnhancedFlexTimeslotAssignment_template()
{
}

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

EnhancedFlexTimeslotAssignment_template::EnhancedFlexTimeslotAssignment_template(const EnhancedFlexTimeslotAssignment& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean EnhancedFlexTimeslotAssignment_template::match(const EnhancedFlexTimeslotAssignment& 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.presenceBitalternativeEFTAMultislotClass().is_bound()) return FALSE;
if(!single_value->field_presenceBitalternativeEFTAMultislotClass.match(other_value.presenceBitalternativeEFTAMultislotClass(), legacy))return FALSE;
if(!other_value.alternativeEFTAMultislotClass().is_bound()) return FALSE;
if(!single_value->field_alternativeEFTAMultislotClass.match(other_value.alternativeEFTAMultislotClass(), legacy))return FALSE;
if(!other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) return FALSE;
if(!single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.match(other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), 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_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
}
return FALSE;
}

boolean EnhancedFlexTimeslotAssignment_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_presenceBitalternativeEFTAMultislotClass.is_bound()
 || single_value->field_alternativeEFTAMultislotClass.is_bound()
 || single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_bound();
}

boolean EnhancedFlexTimeslotAssignment_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_presenceBitalternativeEFTAMultislotClass.is_value()
 && single_value->field_alternativeEFTAMultislotClass.is_value()
 && single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_value();
}

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

EnhancedFlexTimeslotAssignment EnhancedFlexTimeslotAssignment_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_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
EnhancedFlexTimeslotAssignment ret_val;
if (single_value->field_presenceBitalternativeEFTAMultislotClass.is_bound()) {
ret_val.presenceBitalternativeEFTAMultislotClass() = single_value->field_presenceBitalternativeEFTAMultislotClass.valueof();
}
if (single_value->field_alternativeEFTAMultislotClass.is_bound()) {
ret_val.alternativeEFTAMultislotClass() = single_value->field_alternativeEFTAMultislotClass.valueof();
}
if (single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_bound()) {
ret_val.eFTAMultislotCapabilityReductionforDownlinkDualCarrier() = single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.valueof();
}
return ret_val;
}

void EnhancedFlexTimeslotAssignment_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_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new EnhancedFlexTimeslotAssignment_template[list_length];
}

EnhancedFlexTimeslotAssignment_template& EnhancedFlexTimeslotAssignment_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_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
return value_list.list_value[list_index];
}

BITSTRING_template& EnhancedFlexTimeslotAssignment_template::presenceBitalternativeEFTAMultislotClass()
{
set_specific();
return single_value->field_presenceBitalternativeEFTAMultislotClass;
}

const BITSTRING_template& EnhancedFlexTimeslotAssignment_template::presenceBitalternativeEFTAMultislotClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitalternativeEFTAMultislotClass of a non-specific template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
return single_value->field_presenceBitalternativeEFTAMultislotClass;
}

BITSTRING_template& EnhancedFlexTimeslotAssignment_template::alternativeEFTAMultislotClass()
{
set_specific();
return single_value->field_alternativeEFTAMultislotClass;
}

const BITSTRING_template& EnhancedFlexTimeslotAssignment_template::alternativeEFTAMultislotClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field alternativeEFTAMultislotClass of a non-specific template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
return single_value->field_alternativeEFTAMultislotClass;
}

BITSTRING_template& EnhancedFlexTimeslotAssignment_template::eFTAMultislotCapabilityReductionforDownlinkDualCarrier()
{
set_specific();
return single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier;
}

const BITSTRING_template& EnhancedFlexTimeslotAssignment_template::eFTAMultislotCapabilityReductionforDownlinkDualCarrier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eFTAMultislotCapabilityReductionforDownlinkDualCarrier of a non-specific template of type @MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
return single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier;
}

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

void EnhancedFlexTimeslotAssignment_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ presenceBitalternativeEFTAMultislotClass := ");
single_value->field_presenceBitalternativeEFTAMultislotClass.log();
TTCN_Logger::log_event_str(", alternativeEFTAMultislotClass := ");
single_value->field_alternativeEFTAMultislotClass.log();
TTCN_Logger::log_event_str(", eFTAMultislotCapabilityReductionforDownlinkDualCarrier := ");
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 EnhancedFlexTimeslotAssignment_template::log_match(const EnhancedFlexTimeslotAssignment& 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_presenceBitalternativeEFTAMultislotClass.match(match_value.presenceBitalternativeEFTAMultislotClass(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitalternativeEFTAMultislotClass");
single_value->field_presenceBitalternativeEFTAMultislotClass.log_match(match_value.presenceBitalternativeEFTAMultislotClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_alternativeEFTAMultislotClass.match(match_value.alternativeEFTAMultislotClass(), legacy)){
TTCN_Logger::log_logmatch_info(".alternativeEFTAMultislotClass");
single_value->field_alternativeEFTAMultislotClass.log_match(match_value.alternativeEFTAMultislotClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.match(match_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), legacy)){
TTCN_Logger::log_logmatch_info(".eFTAMultislotCapabilityReductionforDownlinkDualCarrier");
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.log_match(match_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), 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("{ presenceBitalternativeEFTAMultislotClass := ");
single_value->field_presenceBitalternativeEFTAMultislotClass.log_match(match_value.presenceBitalternativeEFTAMultislotClass(), legacy);
TTCN_Logger::log_event_str(", alternativeEFTAMultislotClass := ");
single_value->field_alternativeEFTAMultislotClass.log_match(match_value.alternativeEFTAMultislotClass(), legacy);
TTCN_Logger::log_event_str(", eFTAMultislotCapabilityReductionforDownlinkDualCarrier := ");
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.log_match(match_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), 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 EnhancedFlexTimeslotAssignment_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (presenceBitalternativeEFTAMultislotClass().is_bound()) presenceBitalternativeEFTAMultislotClass().set_implicit_omit();
if (alternativeEFTAMultislotClass().is_bound()) alternativeEFTAMultislotClass().set_implicit_omit();
if (eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) eFTAMultislotCapabilityReductionforDownlinkDualCarrier().set_implicit_omit();
}

void EnhancedFlexTimeslotAssignment_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_presenceBitalternativeEFTAMultislotClass.encode_text(text_buf);
single_value->field_alternativeEFTAMultislotClass.encode_text(text_buf);
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
}
}

void EnhancedFlexTimeslotAssignment_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_presenceBitalternativeEFTAMultislotClass.decode_text(text_buf);
single_value->field_alternativeEFTAMultislotClass.decode_text(text_buf);
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 EnhancedFlexTimeslotAssignment_template[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_GMM_SM_Types.EnhancedFlexTimeslotAssignment.");
}
}

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

void EnhancedFlexTimeslotAssignment_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_presenceBitalternativeEFTAMultislotClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
single_value->field_alternativeEFTAMultislotClass.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
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_GMM_SM_Types.EnhancedFlexTimeslotAssignment");
}

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

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

AccessCapAdditionsRel9::AccessCapAdditionsRel9()
{
}

AccessCapAdditionsRel9::AccessCapAdditionsRel9(const EnhancedFlexTimeslotAssignment& par_enhancedFlexTimeslotAssignment,
    const BITSTRING& par_indicationofUpperLayerPDUStartCapabilityforRLCUM,
    const BITSTRING& par_eMSTCapability,
    const BITSTRING& par_mTTICapability,
    const BITSTRING& par_uTRACSGCellsReporting,
    const BITSTRING& par_eUTRACSGCellsReporting)
  :   field_enhancedFlexTimeslotAssignment(par_enhancedFlexTimeslotAssignment),
  field_indicationofUpperLayerPDUStartCapabilityforRLCUM(par_indicationofUpperLayerPDUStartCapabilityforRLCUM),
  field_eMSTCapability(par_eMSTCapability),
  field_mTTICapability(par_mTTICapability),
  field_uTRACSGCellsReporting(par_uTRACSGCellsReporting),
  field_eUTRACSGCellsReporting(par_eUTRACSGCellsReporting)
{
}

AccessCapAdditionsRel9::AccessCapAdditionsRel9(const AccessCapAdditionsRel9& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
if (other_value.enhancedFlexTimeslotAssignment().is_bound()) field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment();
else field_enhancedFlexTimeslotAssignment.clean_up();
if (other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM();
else field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
if (other_value.eMSTCapability().is_bound()) field_eMSTCapability = other_value.eMSTCapability();
else field_eMSTCapability.clean_up();
if (other_value.mTTICapability().is_bound()) field_mTTICapability = other_value.mTTICapability();
else field_mTTICapability.clean_up();
if (other_value.uTRACSGCellsReporting().is_bound()) field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting();
else field_uTRACSGCellsReporting.clean_up();
if (other_value.eUTRACSGCellsReporting().is_bound()) field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting();
else field_eUTRACSGCellsReporting.clean_up();
}

void AccessCapAdditionsRel9::clean_up()
{
field_enhancedFlexTimeslotAssignment.clean_up();
field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
field_eMSTCapability.clean_up();
field_mTTICapability.clean_up();
field_uTRACSGCellsReporting.clean_up();
field_eUTRACSGCellsReporting.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel9::get_descriptor() const { return &AccessCapAdditionsRel9_descr_; }
AccessCapAdditionsRel9& AccessCapAdditionsRel9::operator=(const AccessCapAdditionsRel9& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
  if (other_value.enhancedFlexTimeslotAssignment().is_bound()) field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment();
  else field_enhancedFlexTimeslotAssignment.clean_up();
  if (other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM();
  else field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
  if (other_value.eMSTCapability().is_bound()) field_eMSTCapability = other_value.eMSTCapability();
  else field_eMSTCapability.clean_up();
  if (other_value.mTTICapability().is_bound()) field_mTTICapability = other_value.mTTICapability();
  else field_mTTICapability.clean_up();
  if (other_value.uTRACSGCellsReporting().is_bound()) field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting();
  else field_uTRACSGCellsReporting.clean_up();
  if (other_value.eUTRACSGCellsReporting().is_bound()) field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting();
  else field_eUTRACSGCellsReporting.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel9::operator==(const AccessCapAdditionsRel9& other_value) const
{
return field_enhancedFlexTimeslotAssignment==other_value.field_enhancedFlexTimeslotAssignment
  && field_indicationofUpperLayerPDUStartCapabilityforRLCUM==other_value.field_indicationofUpperLayerPDUStartCapabilityforRLCUM
  && field_eMSTCapability==other_value.field_eMSTCapability
  && field_mTTICapability==other_value.field_mTTICapability
  && field_uTRACSGCellsReporting==other_value.field_uTRACSGCellsReporting
  && field_eUTRACSGCellsReporting==other_value.field_eUTRACSGCellsReporting;
}

boolean AccessCapAdditionsRel9::is_bound() const
{
return (field_enhancedFlexTimeslotAssignment.is_bound())
  || (field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_bound())
  || (field_eMSTCapability.is_bound())
  || (field_mTTICapability.is_bound())
  || (field_uTRACSGCellsReporting.is_bound())
  || (field_eUTRACSGCellsReporting.is_bound());
}
boolean AccessCapAdditionsRel9::is_value() const
{
return field_enhancedFlexTimeslotAssignment.is_value()
  && field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_value()
  && field_eMSTCapability.is_value()
  && field_mTTICapability.is_value()
  && field_uTRACSGCellsReporting.is_value()
  && field_eUTRACSGCellsReporting.is_value();
}
void AccessCapAdditionsRel9::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ enhancedFlexTimeslotAssignment := ");
field_enhancedFlexTimeslotAssignment.log();
TTCN_Logger::log_event_str(", indicationofUpperLayerPDUStartCapabilityforRLCUM := ");
field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log();
TTCN_Logger::log_event_str(", eMSTCapability := ");
field_eMSTCapability.log();
TTCN_Logger::log_event_str(", mTTICapability := ");
field_mTTICapability.log();
TTCN_Logger::log_event_str(", uTRACSGCellsReporting := ");
field_uTRACSGCellsReporting.log();
TTCN_Logger::log_event_str(", eUTRACSGCellsReporting := ");
field_eUTRACSGCellsReporting.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel9::set_implicit_omit()
{
if (enhancedFlexTimeslotAssignment().is_bound()) enhancedFlexTimeslotAssignment().set_implicit_omit();
if (indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) indicationofUpperLayerPDUStartCapabilityforRLCUM().set_implicit_omit();
if (eMSTCapability().is_bound()) eMSTCapability().set_implicit_omit();
if (mTTICapability().is_bound()) mTTICapability().set_implicit_omit();
if (uTRACSGCellsReporting().is_bound()) uTRACSGCellsReporting().set_implicit_omit();
if (eUTRACSGCellsReporting().is_bound()) eUTRACSGCellsReporting().set_implicit_omit();
}

void AccessCapAdditionsRel9::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_GMM_SM_Types.AccessCapAdditionsRel9 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) enhancedFlexTimeslotAssignment().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eMSTCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mTTICapability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uTRACSGCellsReporting().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eUTRACSGCellsReporting().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(), "enhancedFlexTimeslotAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          enhancedFlexTimeslotAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "indicationofUpperLayerPDUStartCapabilityforRLCUM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eMSTCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMSTCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mTTICapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mTTICapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uTRACSGCellsReporting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRACSGCellsReporting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRACSGCellsReporting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRACSGCellsReporting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
  }
}

void AccessCapAdditionsRel9::encode_text(Text_Buf& text_buf) const
{
field_enhancedFlexTimeslotAssignment.encode_text(text_buf);
field_indicationofUpperLayerPDUStartCapabilityforRLCUM.encode_text(text_buf);
field_eMSTCapability.encode_text(text_buf);
field_mTTICapability.encode_text(text_buf);
field_uTRACSGCellsReporting.encode_text(text_buf);
field_eUTRACSGCellsReporting.encode_text(text_buf);
}

void AccessCapAdditionsRel9::decode_text(Text_Buf& text_buf)
{
field_enhancedFlexTimeslotAssignment.decode_text(text_buf);
field_indicationofUpperLayerPDUStartCapabilityforRLCUM.decode_text(text_buf);
field_eMSTCapability.decode_text(text_buf);
field_mTTICapability.decode_text(text_buf);
field_uTRACSGCellsReporting.decode_text(text_buf);
field_eUTRACSGCellsReporting.decode_text(text_buf);
}

void AccessCapAdditionsRel9::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 AccessCapAdditionsRel9::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 AccessCapAdditionsRel9::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, AccessCapAdditionsRel9_enhancedFlexTimeslotAssignment_descr_.raw->forceomit);
  decoded_field_length = field_enhancedFlexTimeslotAssignment.RAW_decode(AccessCapAdditionsRel9_enhancedFlexTimeslotAssignment_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, AccessCapAdditionsRel9_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_.raw->forceomit);
  decoded_field_length = field_indicationofUpperLayerPDUStartCapabilityforRLCUM.RAW_decode(AccessCapAdditionsRel9_indicationofUpperLayerPDUStartCapabilityforRLCUM_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, AccessCapAdditionsRel9_eMSTCapability_descr_.raw->forceomit);
  decoded_field_length = field_eMSTCapability.RAW_decode(AccessCapAdditionsRel9_eMSTCapability_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, AccessCapAdditionsRel9_mTTICapability_descr_.raw->forceomit);
  decoded_field_length = field_mTTICapability.RAW_decode(AccessCapAdditionsRel9_mTTICapability_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, AccessCapAdditionsRel9_uTRACSGCellsReporting_descr_.raw->forceomit);
  decoded_field_length = field_uTRACSGCellsReporting.RAW_decode(AccessCapAdditionsRel9_uTRACSGCellsReporting_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, AccessCapAdditionsRel9_eUTRACSGCellsReporting_descr_.raw->forceomit);
  decoded_field_length = field_eUTRACSGCellsReporting.RAW_decode(AccessCapAdditionsRel9_eUTRACSGCellsReporting_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 AccessCapAdditionsRel9::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, AccessCapAdditionsRel9_enhancedFlexTimeslotAssignment_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel9_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel9_eMSTCapability_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel9_mTTICapability_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel9_uTRACSGCellsReporting_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel9_eUTRACSGCellsReporting_descr_.raw);
  encoded_length += field_enhancedFlexTimeslotAssignment.RAW_encode(AccessCapAdditionsRel9_enhancedFlexTimeslotAssignment_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_indicationofUpperLayerPDUStartCapabilityforRLCUM.RAW_encode(AccessCapAdditionsRel9_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_eMSTCapability.RAW_encode(AccessCapAdditionsRel9_eMSTCapability_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mTTICapability.RAW_encode(AccessCapAdditionsRel9_mTTICapability_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_uTRACSGCellsReporting.RAW_encode(AccessCapAdditionsRel9_uTRACSGCellsReporting_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_eUTRACSGCellsReporting.RAW_encode(AccessCapAdditionsRel9_eUTRACSGCellsReporting_descr_, *myleaf.body.node.nodes[5]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel9_template::single_value_struct {
EnhancedFlexTimeslotAssignment_template field_enhancedFlexTimeslotAssignment;
BITSTRING_template field_indicationofUpperLayerPDUStartCapabilityforRLCUM;
BITSTRING_template field_eMSTCapability;
BITSTRING_template field_mTTICapability;
BITSTRING_template field_uTRACSGCellsReporting;
BITSTRING_template field_eUTRACSGCellsReporting;
};

void AccessCapAdditionsRel9_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_enhancedFlexTimeslotAssignment = ANY_VALUE;
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM = ANY_VALUE;
single_value->field_eMSTCapability = ANY_VALUE;
single_value->field_mTTICapability = ANY_VALUE;
single_value->field_uTRACSGCellsReporting = ANY_VALUE;
single_value->field_eUTRACSGCellsReporting = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel9_template::copy_value(const AccessCapAdditionsRel9& other_value)
{
single_value = new single_value_struct;
if (other_value.enhancedFlexTimeslotAssignment().is_bound()) {
  single_value->field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment();
} else {
  single_value->field_enhancedFlexTimeslotAssignment.clean_up();
}
if (other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) {
  single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM();
} else {
  single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
}
if (other_value.eMSTCapability().is_bound()) {
  single_value->field_eMSTCapability = other_value.eMSTCapability();
} else {
  single_value->field_eMSTCapability.clean_up();
}
if (other_value.mTTICapability().is_bound()) {
  single_value->field_mTTICapability = other_value.mTTICapability();
} else {
  single_value->field_mTTICapability.clean_up();
}
if (other_value.uTRACSGCellsReporting().is_bound()) {
  single_value->field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting();
} else {
  single_value->field_uTRACSGCellsReporting.clean_up();
}
if (other_value.eUTRACSGCellsReporting().is_bound()) {
  single_value->field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting();
} else {
  single_value->field_eUTRACSGCellsReporting.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel9_template::copy_template(const AccessCapAdditionsRel9_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.enhancedFlexTimeslotAssignment().get_selection()) {
single_value->field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment();
} else {
single_value->field_enhancedFlexTimeslotAssignment.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().get_selection()) {
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM();
} else {
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eMSTCapability().get_selection()) {
single_value->field_eMSTCapability = other_value.eMSTCapability();
} else {
single_value->field_eMSTCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mTTICapability().get_selection()) {
single_value->field_mTTICapability = other_value.mTTICapability();
} else {
single_value->field_mTTICapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uTRACSGCellsReporting().get_selection()) {
single_value->field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting();
} else {
single_value->field_uTRACSGCellsReporting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRACSGCellsReporting().get_selection()) {
single_value->field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting();
} else {
single_value->field_eUTRACSGCellsReporting.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 AccessCapAdditionsRel9_template[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 AccessCapAdditionsRel9_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel9_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_GMM_SM_Types.AccessCapAdditionsRel9.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel9_template::AccessCapAdditionsRel9_template()
{
}

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

AccessCapAdditionsRel9_template::AccessCapAdditionsRel9_template(const AccessCapAdditionsRel9& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel9_template::match(const AccessCapAdditionsRel9& 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.enhancedFlexTimeslotAssignment().is_bound()) return FALSE;
if(!single_value->field_enhancedFlexTimeslotAssignment.match(other_value.enhancedFlexTimeslotAssignment(), legacy))return FALSE;
if(!other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) return FALSE;
if(!single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.match(other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy))return FALSE;
if(!other_value.eMSTCapability().is_bound()) return FALSE;
if(!single_value->field_eMSTCapability.match(other_value.eMSTCapability(), legacy))return FALSE;
if(!other_value.mTTICapability().is_bound()) return FALSE;
if(!single_value->field_mTTICapability.match(other_value.mTTICapability(), legacy))return FALSE;
if(!other_value.uTRACSGCellsReporting().is_bound()) return FALSE;
if(!single_value->field_uTRACSGCellsReporting.match(other_value.uTRACSGCellsReporting(), legacy))return FALSE;
if(!other_value.eUTRACSGCellsReporting().is_bound()) return FALSE;
if(!single_value->field_eUTRACSGCellsReporting.match(other_value.eUTRACSGCellsReporting(), 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_GMM_SM_Types.AccessCapAdditionsRel9.");
}
return FALSE;
}

boolean AccessCapAdditionsRel9_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_enhancedFlexTimeslotAssignment.is_bound()
 || single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_bound()
 || single_value->field_eMSTCapability.is_bound()
 || single_value->field_mTTICapability.is_bound()
 || single_value->field_uTRACSGCellsReporting.is_bound()
 || single_value->field_eUTRACSGCellsReporting.is_bound();
}

boolean AccessCapAdditionsRel9_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_enhancedFlexTimeslotAssignment.is_value()
 && single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_value()
 && single_value->field_eMSTCapability.is_value()
 && single_value->field_mTTICapability.is_value()
 && single_value->field_uTRACSGCellsReporting.is_value()
 && single_value->field_eUTRACSGCellsReporting.is_value();
}

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

AccessCapAdditionsRel9 AccessCapAdditionsRel9_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_GMM_SM_Types.AccessCapAdditionsRel9.");
AccessCapAdditionsRel9 ret_val;
if (single_value->field_enhancedFlexTimeslotAssignment.is_bound()) {
ret_val.enhancedFlexTimeslotAssignment() = single_value->field_enhancedFlexTimeslotAssignment.valueof();
}
if (single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_bound()) {
ret_val.indicationofUpperLayerPDUStartCapabilityforRLCUM() = single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.valueof();
}
if (single_value->field_eMSTCapability.is_bound()) {
ret_val.eMSTCapability() = single_value->field_eMSTCapability.valueof();
}
if (single_value->field_mTTICapability.is_bound()) {
ret_val.mTTICapability() = single_value->field_mTTICapability.valueof();
}
if (single_value->field_uTRACSGCellsReporting.is_bound()) {
ret_val.uTRACSGCellsReporting() = single_value->field_uTRACSGCellsReporting.valueof();
}
if (single_value->field_eUTRACSGCellsReporting.is_bound()) {
ret_val.eUTRACSGCellsReporting() = single_value->field_eUTRACSGCellsReporting.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel9_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_GMM_SM_Types.AccessCapAdditionsRel9.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel9_template[list_length];
}

AccessCapAdditionsRel9_template& AccessCapAdditionsRel9_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_GMM_SM_Types.AccessCapAdditionsRel9.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return value_list.list_value[list_index];
}

EnhancedFlexTimeslotAssignment_template& AccessCapAdditionsRel9_template::enhancedFlexTimeslotAssignment()
{
set_specific();
return single_value->field_enhancedFlexTimeslotAssignment;
}

const EnhancedFlexTimeslotAssignment_template& AccessCapAdditionsRel9_template::enhancedFlexTimeslotAssignment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field enhancedFlexTimeslotAssignment of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_enhancedFlexTimeslotAssignment;
}

BITSTRING_template& AccessCapAdditionsRel9_template::indicationofUpperLayerPDUStartCapabilityforRLCUM()
{
set_specific();
return single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::indicationofUpperLayerPDUStartCapabilityforRLCUM() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field indicationofUpperLayerPDUStartCapabilityforRLCUM of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM;
}

BITSTRING_template& AccessCapAdditionsRel9_template::eMSTCapability()
{
set_specific();
return single_value->field_eMSTCapability;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::eMSTCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eMSTCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_eMSTCapability;
}

BITSTRING_template& AccessCapAdditionsRel9_template::mTTICapability()
{
set_specific();
return single_value->field_mTTICapability;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::mTTICapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mTTICapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_mTTICapability;
}

BITSTRING_template& AccessCapAdditionsRel9_template::uTRACSGCellsReporting()
{
set_specific();
return single_value->field_uTRACSGCellsReporting;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::uTRACSGCellsReporting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uTRACSGCellsReporting of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_uTRACSGCellsReporting;
}

BITSTRING_template& AccessCapAdditionsRel9_template::eUTRACSGCellsReporting()
{
set_specific();
return single_value->field_eUTRACSGCellsReporting;
}

const BITSTRING_template& AccessCapAdditionsRel9_template::eUTRACSGCellsReporting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRACSGCellsReporting of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9.");
return single_value->field_eUTRACSGCellsReporting;
}

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

void AccessCapAdditionsRel9_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ enhancedFlexTimeslotAssignment := ");
single_value->field_enhancedFlexTimeslotAssignment.log();
TTCN_Logger::log_event_str(", indicationofUpperLayerPDUStartCapabilityforRLCUM := ");
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log();
TTCN_Logger::log_event_str(", eMSTCapability := ");
single_value->field_eMSTCapability.log();
TTCN_Logger::log_event_str(", mTTICapability := ");
single_value->field_mTTICapability.log();
TTCN_Logger::log_event_str(", uTRACSGCellsReporting := ");
single_value->field_uTRACSGCellsReporting.log();
TTCN_Logger::log_event_str(", eUTRACSGCellsReporting := ");
single_value->field_eUTRACSGCellsReporting.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 AccessCapAdditionsRel9_template::log_match(const AccessCapAdditionsRel9& 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_enhancedFlexTimeslotAssignment.match(match_value.enhancedFlexTimeslotAssignment(), legacy)){
TTCN_Logger::log_logmatch_info(".enhancedFlexTimeslotAssignment");
single_value->field_enhancedFlexTimeslotAssignment.log_match(match_value.enhancedFlexTimeslotAssignment(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.match(match_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy)){
TTCN_Logger::log_logmatch_info(".indicationofUpperLayerPDUStartCapabilityforRLCUM");
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log_match(match_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eMSTCapability.match(match_value.eMSTCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".eMSTCapability");
single_value->field_eMSTCapability.log_match(match_value.eMSTCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mTTICapability.match(match_value.mTTICapability(), legacy)){
TTCN_Logger::log_logmatch_info(".mTTICapability");
single_value->field_mTTICapability.log_match(match_value.mTTICapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_uTRACSGCellsReporting.match(match_value.uTRACSGCellsReporting(), legacy)){
TTCN_Logger::log_logmatch_info(".uTRACSGCellsReporting");
single_value->field_uTRACSGCellsReporting.log_match(match_value.uTRACSGCellsReporting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRACSGCellsReporting.match(match_value.eUTRACSGCellsReporting(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRACSGCellsReporting");
single_value->field_eUTRACSGCellsReporting.log_match(match_value.eUTRACSGCellsReporting(), 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("{ enhancedFlexTimeslotAssignment := ");
single_value->field_enhancedFlexTimeslotAssignment.log_match(match_value.enhancedFlexTimeslotAssignment(), legacy);
TTCN_Logger::log_event_str(", indicationofUpperLayerPDUStartCapabilityforRLCUM := ");
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log_match(match_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy);
TTCN_Logger::log_event_str(", eMSTCapability := ");
single_value->field_eMSTCapability.log_match(match_value.eMSTCapability(), legacy);
TTCN_Logger::log_event_str(", mTTICapability := ");
single_value->field_mTTICapability.log_match(match_value.mTTICapability(), legacy);
TTCN_Logger::log_event_str(", uTRACSGCellsReporting := ");
single_value->field_uTRACSGCellsReporting.log_match(match_value.uTRACSGCellsReporting(), legacy);
TTCN_Logger::log_event_str(", eUTRACSGCellsReporting := ");
single_value->field_eUTRACSGCellsReporting.log_match(match_value.eUTRACSGCellsReporting(), 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 AccessCapAdditionsRel9_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (enhancedFlexTimeslotAssignment().is_bound()) enhancedFlexTimeslotAssignment().set_implicit_omit();
if (indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) indicationofUpperLayerPDUStartCapabilityforRLCUM().set_implicit_omit();
if (eMSTCapability().is_bound()) eMSTCapability().set_implicit_omit();
if (mTTICapability().is_bound()) mTTICapability().set_implicit_omit();
if (uTRACSGCellsReporting().is_bound()) uTRACSGCellsReporting().set_implicit_omit();
if (eUTRACSGCellsReporting().is_bound()) eUTRACSGCellsReporting().set_implicit_omit();
}

void AccessCapAdditionsRel9_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_enhancedFlexTimeslotAssignment.encode_text(text_buf);
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.encode_text(text_buf);
single_value->field_eMSTCapability.encode_text(text_buf);
single_value->field_mTTICapability.encode_text(text_buf);
single_value->field_uTRACSGCellsReporting.encode_text(text_buf);
single_value->field_eUTRACSGCellsReporting.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_GMM_SM_Types.AccessCapAdditionsRel9.");
}
}

void AccessCapAdditionsRel9_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_enhancedFlexTimeslotAssignment.decode_text(text_buf);
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.decode_text(text_buf);
single_value->field_eMSTCapability.decode_text(text_buf);
single_value->field_mTTICapability.decode_text(text_buf);
single_value->field_uTRACSGCellsReporting.decode_text(text_buf);
single_value->field_eUTRACSGCellsReporting.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 AccessCapAdditionsRel9_template[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_GMM_SM_Types.AccessCapAdditionsRel9.");
}
}

void AccessCapAdditionsRel9_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: {
    AccessCapAdditionsRel9_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_GMM_SM_Types.AccessCapAdditionsRel9 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) enhancedFlexTimeslotAssignment().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eMSTCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mTTICapability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uTRACSGCellsReporting().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eUTRACSGCellsReporting().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(), "enhancedFlexTimeslotAssignment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          enhancedFlexTimeslotAssignment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "indicationofUpperLayerPDUStartCapabilityforRLCUM")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eMSTCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMSTCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mTTICapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mTTICapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uTRACSGCellsReporting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRACSGCellsReporting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRACSGCellsReporting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRACSGCellsReporting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel9: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel9_template* precondition = new AccessCapAdditionsRel9_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel9_template* implied_template = new AccessCapAdditionsRel9_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel9_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel9_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_enhancedFlexTimeslotAssignment.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_eMSTCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_mTTICapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_uTRACSGCellsReporting.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
single_value->field_eUTRACSGCellsReporting.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel9");
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_GMM_SM_Types.AccessCapAdditionsRel9");
}

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

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

AccessCapAdditionsRel10::AccessCapAdditionsRel10()
{
}

AccessCapAdditionsRel10::AccessCapAdditionsRel10(const BITSTRING& par_dTRCapability,
    const BITSTRING& par_eMSRCapability,
    const BITSTRING& par_fastDownlinkFrequencySwitchingCapability,
    const BITSTRING& par_tIGHTER__Capability)
  :   field_dTRCapability(par_dTRCapability),
  field_eMSRCapability(par_eMSRCapability),
  field_fastDownlinkFrequencySwitchingCapability(par_fastDownlinkFrequencySwitchingCapability),
  field_tIGHTER__Capability(par_tIGHTER__Capability)
{
}

AccessCapAdditionsRel10::AccessCapAdditionsRel10(const AccessCapAdditionsRel10& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
if (other_value.dTRCapability().is_bound()) field_dTRCapability = other_value.dTRCapability();
else field_dTRCapability.clean_up();
if (other_value.eMSRCapability().is_bound()) field_eMSRCapability = other_value.eMSRCapability();
else field_eMSRCapability.clean_up();
if (other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability();
else field_fastDownlinkFrequencySwitchingCapability.clean_up();
if (other_value.tIGHTER__Capability().is_bound()) field_tIGHTER__Capability = other_value.tIGHTER__Capability();
else field_tIGHTER__Capability.clean_up();
}

void AccessCapAdditionsRel10::clean_up()
{
field_dTRCapability.clean_up();
field_eMSRCapability.clean_up();
field_fastDownlinkFrequencySwitchingCapability.clean_up();
field_tIGHTER__Capability.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel10::get_descriptor() const { return &AccessCapAdditionsRel10_descr_; }
AccessCapAdditionsRel10& AccessCapAdditionsRel10::operator=(const AccessCapAdditionsRel10& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
  if (other_value.dTRCapability().is_bound()) field_dTRCapability = other_value.dTRCapability();
  else field_dTRCapability.clean_up();
  if (other_value.eMSRCapability().is_bound()) field_eMSRCapability = other_value.eMSRCapability();
  else field_eMSRCapability.clean_up();
  if (other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability();
  else field_fastDownlinkFrequencySwitchingCapability.clean_up();
  if (other_value.tIGHTER__Capability().is_bound()) field_tIGHTER__Capability = other_value.tIGHTER__Capability();
  else field_tIGHTER__Capability.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel10::operator==(const AccessCapAdditionsRel10& other_value) const
{
return field_dTRCapability==other_value.field_dTRCapability
  && field_eMSRCapability==other_value.field_eMSRCapability
  && field_fastDownlinkFrequencySwitchingCapability==other_value.field_fastDownlinkFrequencySwitchingCapability
  && field_tIGHTER__Capability==other_value.field_tIGHTER__Capability;
}

boolean AccessCapAdditionsRel10::is_bound() const
{
return (field_dTRCapability.is_bound())
  || (field_eMSRCapability.is_bound())
  || (field_fastDownlinkFrequencySwitchingCapability.is_bound())
  || (field_tIGHTER__Capability.is_bound());
}
boolean AccessCapAdditionsRel10::is_value() const
{
return field_dTRCapability.is_value()
  && field_eMSRCapability.is_value()
  && field_fastDownlinkFrequencySwitchingCapability.is_value()
  && field_tIGHTER__Capability.is_value();
}
void AccessCapAdditionsRel10::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dTRCapability := ");
field_dTRCapability.log();
TTCN_Logger::log_event_str(", eMSRCapability := ");
field_eMSRCapability.log();
TTCN_Logger::log_event_str(", fastDownlinkFrequencySwitchingCapability := ");
field_fastDownlinkFrequencySwitchingCapability.log();
TTCN_Logger::log_event_str(", tIGHTER_Capability := ");
field_tIGHTER__Capability.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel10::set_implicit_omit()
{
if (dTRCapability().is_bound()) dTRCapability().set_implicit_omit();
if (eMSRCapability().is_bound()) eMSRCapability().set_implicit_omit();
if (fastDownlinkFrequencySwitchingCapability().is_bound()) fastDownlinkFrequencySwitchingCapability().set_implicit_omit();
if (tIGHTER__Capability().is_bound()) tIGHTER__Capability().set_implicit_omit();
}

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

void AccessCapAdditionsRel10::encode_text(Text_Buf& text_buf) const
{
field_dTRCapability.encode_text(text_buf);
field_eMSRCapability.encode_text(text_buf);
field_fastDownlinkFrequencySwitchingCapability.encode_text(text_buf);
field_tIGHTER__Capability.encode_text(text_buf);
}

void AccessCapAdditionsRel10::decode_text(Text_Buf& text_buf)
{
field_dTRCapability.decode_text(text_buf);
field_eMSRCapability.decode_text(text_buf);
field_fastDownlinkFrequencySwitchingCapability.decode_text(text_buf);
field_tIGHTER__Capability.decode_text(text_buf);
}

void AccessCapAdditionsRel10::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 AccessCapAdditionsRel10::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 AccessCapAdditionsRel10::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, AccessCapAdditionsRel10_dTRCapability_descr_.raw->forceomit);
  decoded_field_length = field_dTRCapability.RAW_decode(AccessCapAdditionsRel10_dTRCapability_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, AccessCapAdditionsRel10_eMSRCapability_descr_.raw->forceomit);
  decoded_field_length = field_eMSRCapability.RAW_decode(AccessCapAdditionsRel10_eMSRCapability_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, AccessCapAdditionsRel10_fastDownlinkFrequencySwitchingCapability_descr_.raw->forceomit);
  decoded_field_length = field_fastDownlinkFrequencySwitchingCapability.RAW_decode(AccessCapAdditionsRel10_fastDownlinkFrequencySwitchingCapability_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, AccessCapAdditionsRel10_tIGHTER__Capability_descr_.raw->forceomit);
  decoded_field_length = field_tIGHTER__Capability.RAW_decode(AccessCapAdditionsRel10_tIGHTER__Capability_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 AccessCapAdditionsRel10::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, AccessCapAdditionsRel10_dTRCapability_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel10_eMSRCapability_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel10_fastDownlinkFrequencySwitchingCapability_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel10_tIGHTER__Capability_descr_.raw);
  encoded_length += field_dTRCapability.RAW_encode(AccessCapAdditionsRel10_dTRCapability_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_eMSRCapability.RAW_encode(AccessCapAdditionsRel10_eMSRCapability_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_fastDownlinkFrequencySwitchingCapability.RAW_encode(AccessCapAdditionsRel10_fastDownlinkFrequencySwitchingCapability_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tIGHTER__Capability.RAW_encode(AccessCapAdditionsRel10_tIGHTER__Capability_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel10_template::single_value_struct {
BITSTRING_template field_dTRCapability;
BITSTRING_template field_eMSRCapability;
BITSTRING_template field_fastDownlinkFrequencySwitchingCapability;
BITSTRING_template field_tIGHTER__Capability;
};

void AccessCapAdditionsRel10_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_dTRCapability = ANY_VALUE;
single_value->field_eMSRCapability = ANY_VALUE;
single_value->field_fastDownlinkFrequencySwitchingCapability = ANY_VALUE;
single_value->field_tIGHTER__Capability = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel10_template::copy_value(const AccessCapAdditionsRel10& other_value)
{
single_value = new single_value_struct;
if (other_value.dTRCapability().is_bound()) {
  single_value->field_dTRCapability = other_value.dTRCapability();
} else {
  single_value->field_dTRCapability.clean_up();
}
if (other_value.eMSRCapability().is_bound()) {
  single_value->field_eMSRCapability = other_value.eMSRCapability();
} else {
  single_value->field_eMSRCapability.clean_up();
}
if (other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) {
  single_value->field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability();
} else {
  single_value->field_fastDownlinkFrequencySwitchingCapability.clean_up();
}
if (other_value.tIGHTER__Capability().is_bound()) {
  single_value->field_tIGHTER__Capability = other_value.tIGHTER__Capability();
} else {
  single_value->field_tIGHTER__Capability.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel10_template::copy_template(const AccessCapAdditionsRel10_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dTRCapability().get_selection()) {
single_value->field_dTRCapability = other_value.dTRCapability();
} else {
single_value->field_dTRCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eMSRCapability().get_selection()) {
single_value->field_eMSRCapability = other_value.eMSRCapability();
} else {
single_value->field_eMSRCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fastDownlinkFrequencySwitchingCapability().get_selection()) {
single_value->field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability();
} else {
single_value->field_fastDownlinkFrequencySwitchingCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tIGHTER__Capability().get_selection()) {
single_value->field_tIGHTER__Capability = other_value.tIGHTER__Capability();
} else {
single_value->field_tIGHTER__Capability.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 AccessCapAdditionsRel10_template[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 AccessCapAdditionsRel10_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel10_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_GMM_SM_Types.AccessCapAdditionsRel10.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel10_template::AccessCapAdditionsRel10_template()
{
}

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

AccessCapAdditionsRel10_template::AccessCapAdditionsRel10_template(const AccessCapAdditionsRel10& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel10_template::match(const AccessCapAdditionsRel10& 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.dTRCapability().is_bound()) return FALSE;
if(!single_value->field_dTRCapability.match(other_value.dTRCapability(), legacy))return FALSE;
if(!other_value.eMSRCapability().is_bound()) return FALSE;
if(!single_value->field_eMSRCapability.match(other_value.eMSRCapability(), legacy))return FALSE;
if(!other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) return FALSE;
if(!single_value->field_fastDownlinkFrequencySwitchingCapability.match(other_value.fastDownlinkFrequencySwitchingCapability(), legacy))return FALSE;
if(!other_value.tIGHTER__Capability().is_bound()) return FALSE;
if(!single_value->field_tIGHTER__Capability.match(other_value.tIGHTER__Capability(), 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_GMM_SM_Types.AccessCapAdditionsRel10.");
}
return FALSE;
}

boolean AccessCapAdditionsRel10_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dTRCapability.is_bound()
 || single_value->field_eMSRCapability.is_bound()
 || single_value->field_fastDownlinkFrequencySwitchingCapability.is_bound()
 || single_value->field_tIGHTER__Capability.is_bound();
}

boolean AccessCapAdditionsRel10_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dTRCapability.is_value()
 && single_value->field_eMSRCapability.is_value()
 && single_value->field_fastDownlinkFrequencySwitchingCapability.is_value()
 && single_value->field_tIGHTER__Capability.is_value();
}

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

AccessCapAdditionsRel10 AccessCapAdditionsRel10_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_GMM_SM_Types.AccessCapAdditionsRel10.");
AccessCapAdditionsRel10 ret_val;
if (single_value->field_dTRCapability.is_bound()) {
ret_val.dTRCapability() = single_value->field_dTRCapability.valueof();
}
if (single_value->field_eMSRCapability.is_bound()) {
ret_val.eMSRCapability() = single_value->field_eMSRCapability.valueof();
}
if (single_value->field_fastDownlinkFrequencySwitchingCapability.is_bound()) {
ret_val.fastDownlinkFrequencySwitchingCapability() = single_value->field_fastDownlinkFrequencySwitchingCapability.valueof();
}
if (single_value->field_tIGHTER__Capability.is_bound()) {
ret_val.tIGHTER__Capability() = single_value->field_tIGHTER__Capability.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel10_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_GMM_SM_Types.AccessCapAdditionsRel10.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel10_template[list_length];
}

AccessCapAdditionsRel10_template& AccessCapAdditionsRel10_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_GMM_SM_Types.AccessCapAdditionsRel10.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel10_template::dTRCapability()
{
set_specific();
return single_value->field_dTRCapability;
}

const BITSTRING_template& AccessCapAdditionsRel10_template::dTRCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTRCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return single_value->field_dTRCapability;
}

BITSTRING_template& AccessCapAdditionsRel10_template::eMSRCapability()
{
set_specific();
return single_value->field_eMSRCapability;
}

const BITSTRING_template& AccessCapAdditionsRel10_template::eMSRCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eMSRCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return single_value->field_eMSRCapability;
}

BITSTRING_template& AccessCapAdditionsRel10_template::fastDownlinkFrequencySwitchingCapability()
{
set_specific();
return single_value->field_fastDownlinkFrequencySwitchingCapability;
}

const BITSTRING_template& AccessCapAdditionsRel10_template::fastDownlinkFrequencySwitchingCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fastDownlinkFrequencySwitchingCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return single_value->field_fastDownlinkFrequencySwitchingCapability;
}

BITSTRING_template& AccessCapAdditionsRel10_template::tIGHTER__Capability()
{
set_specific();
return single_value->field_tIGHTER__Capability;
}

const BITSTRING_template& AccessCapAdditionsRel10_template::tIGHTER__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tIGHTER_Capability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10.");
return single_value->field_tIGHTER__Capability;
}

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

void AccessCapAdditionsRel10_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dTRCapability := ");
single_value->field_dTRCapability.log();
TTCN_Logger::log_event_str(", eMSRCapability := ");
single_value->field_eMSRCapability.log();
TTCN_Logger::log_event_str(", fastDownlinkFrequencySwitchingCapability := ");
single_value->field_fastDownlinkFrequencySwitchingCapability.log();
TTCN_Logger::log_event_str(", tIGHTER_Capability := ");
single_value->field_tIGHTER__Capability.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 AccessCapAdditionsRel10_template::log_match(const AccessCapAdditionsRel10& 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_dTRCapability.match(match_value.dTRCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".dTRCapability");
single_value->field_dTRCapability.log_match(match_value.dTRCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eMSRCapability.match(match_value.eMSRCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".eMSRCapability");
single_value->field_eMSRCapability.log_match(match_value.eMSRCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fastDownlinkFrequencySwitchingCapability.match(match_value.fastDownlinkFrequencySwitchingCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".fastDownlinkFrequencySwitchingCapability");
single_value->field_fastDownlinkFrequencySwitchingCapability.log_match(match_value.fastDownlinkFrequencySwitchingCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tIGHTER__Capability.match(match_value.tIGHTER__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".tIGHTER_Capability");
single_value->field_tIGHTER__Capability.log_match(match_value.tIGHTER__Capability(), 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("{ dTRCapability := ");
single_value->field_dTRCapability.log_match(match_value.dTRCapability(), legacy);
TTCN_Logger::log_event_str(", eMSRCapability := ");
single_value->field_eMSRCapability.log_match(match_value.eMSRCapability(), legacy);
TTCN_Logger::log_event_str(", fastDownlinkFrequencySwitchingCapability := ");
single_value->field_fastDownlinkFrequencySwitchingCapability.log_match(match_value.fastDownlinkFrequencySwitchingCapability(), legacy);
TTCN_Logger::log_event_str(", tIGHTER_Capability := ");
single_value->field_tIGHTER__Capability.log_match(match_value.tIGHTER__Capability(), 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 AccessCapAdditionsRel10_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dTRCapability().is_bound()) dTRCapability().set_implicit_omit();
if (eMSRCapability().is_bound()) eMSRCapability().set_implicit_omit();
if (fastDownlinkFrequencySwitchingCapability().is_bound()) fastDownlinkFrequencySwitchingCapability().set_implicit_omit();
if (tIGHTER__Capability().is_bound()) tIGHTER__Capability().set_implicit_omit();
}

void AccessCapAdditionsRel10_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dTRCapability.encode_text(text_buf);
single_value->field_eMSRCapability.encode_text(text_buf);
single_value->field_fastDownlinkFrequencySwitchingCapability.encode_text(text_buf);
single_value->field_tIGHTER__Capability.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_GMM_SM_Types.AccessCapAdditionsRel10.");
}
}

void AccessCapAdditionsRel10_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_dTRCapability.decode_text(text_buf);
single_value->field_eMSRCapability.decode_text(text_buf);
single_value->field_fastDownlinkFrequencySwitchingCapability.decode_text(text_buf);
single_value->field_tIGHTER__Capability.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 AccessCapAdditionsRel10_template[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_GMM_SM_Types.AccessCapAdditionsRel10.");
}
}

void AccessCapAdditionsRel10_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: {
    AccessCapAdditionsRel10_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_GMM_SM_Types.AccessCapAdditionsRel10 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) dTRCapability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eMSRCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fastDownlinkFrequencySwitchingCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tIGHTER__Capability().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(), "dTRCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTRCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eMSRCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMSRCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fastDownlinkFrequencySwitchingCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fastDownlinkFrequencySwitchingCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tIGHTER_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tIGHTER__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel10: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel10_template* precondition = new AccessCapAdditionsRel10_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel10_template* implied_template = new AccessCapAdditionsRel10_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel10_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel10_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_dTRCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
single_value->field_eMSRCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
single_value->field_fastDownlinkFrequencySwitchingCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
single_value->field_tIGHTER__Capability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel10");
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_GMM_SM_Types.AccessCapAdditionsRel10");
}

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

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

AccessCapAdditionsRel11::AccessCapAdditionsRel11()
{
}

AccessCapAdditionsRel11::AccessCapAdditionsRel11(const BITSTRING& par_fANRCapability,
    const BITSTRING& par_iPACapability,
    const BITSTRING& par_gERANNetworkSharingSupport,
    const BITSTRING& par_eUTRAWidebandRSRQMeasurementsSupport)
  :   field_fANRCapability(par_fANRCapability),
  field_iPACapability(par_iPACapability),
  field_gERANNetworkSharingSupport(par_gERANNetworkSharingSupport),
  field_eUTRAWidebandRSRQMeasurementsSupport(par_eUTRAWidebandRSRQMeasurementsSupport)
{
}

AccessCapAdditionsRel11::AccessCapAdditionsRel11(const AccessCapAdditionsRel11& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
if (other_value.fANRCapability().is_bound()) field_fANRCapability = other_value.fANRCapability();
else field_fANRCapability.clean_up();
if (other_value.iPACapability().is_bound()) field_iPACapability = other_value.iPACapability();
else field_iPACapability.clean_up();
if (other_value.gERANNetworkSharingSupport().is_bound()) field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport();
else field_gERANNetworkSharingSupport.clean_up();
if (other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport();
else field_eUTRAWidebandRSRQMeasurementsSupport.clean_up();
}

void AccessCapAdditionsRel11::clean_up()
{
field_fANRCapability.clean_up();
field_iPACapability.clean_up();
field_gERANNetworkSharingSupport.clean_up();
field_eUTRAWidebandRSRQMeasurementsSupport.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel11::get_descriptor() const { return &AccessCapAdditionsRel11_descr_; }
AccessCapAdditionsRel11& AccessCapAdditionsRel11::operator=(const AccessCapAdditionsRel11& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
  if (other_value.fANRCapability().is_bound()) field_fANRCapability = other_value.fANRCapability();
  else field_fANRCapability.clean_up();
  if (other_value.iPACapability().is_bound()) field_iPACapability = other_value.iPACapability();
  else field_iPACapability.clean_up();
  if (other_value.gERANNetworkSharingSupport().is_bound()) field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport();
  else field_gERANNetworkSharingSupport.clean_up();
  if (other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport();
  else field_eUTRAWidebandRSRQMeasurementsSupport.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel11::operator==(const AccessCapAdditionsRel11& other_value) const
{
return field_fANRCapability==other_value.field_fANRCapability
  && field_iPACapability==other_value.field_iPACapability
  && field_gERANNetworkSharingSupport==other_value.field_gERANNetworkSharingSupport
  && field_eUTRAWidebandRSRQMeasurementsSupport==other_value.field_eUTRAWidebandRSRQMeasurementsSupport;
}

boolean AccessCapAdditionsRel11::is_bound() const
{
return (field_fANRCapability.is_bound())
  || (field_iPACapability.is_bound())
  || (field_gERANNetworkSharingSupport.is_bound())
  || (field_eUTRAWidebandRSRQMeasurementsSupport.is_bound());
}
boolean AccessCapAdditionsRel11::is_value() const
{
return field_fANRCapability.is_value()
  && field_iPACapability.is_value()
  && field_gERANNetworkSharingSupport.is_value()
  && field_eUTRAWidebandRSRQMeasurementsSupport.is_value();
}
void AccessCapAdditionsRel11::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ fANRCapability := ");
field_fANRCapability.log();
TTCN_Logger::log_event_str(", iPACapability := ");
field_iPACapability.log();
TTCN_Logger::log_event_str(", gERANNetworkSharingSupport := ");
field_gERANNetworkSharingSupport.log();
TTCN_Logger::log_event_str(", eUTRAWidebandRSRQMeasurementsSupport := ");
field_eUTRAWidebandRSRQMeasurementsSupport.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel11::set_implicit_omit()
{
if (fANRCapability().is_bound()) fANRCapability().set_implicit_omit();
if (iPACapability().is_bound()) iPACapability().set_implicit_omit();
if (gERANNetworkSharingSupport().is_bound()) gERANNetworkSharingSupport().set_implicit_omit();
if (eUTRAWidebandRSRQMeasurementsSupport().is_bound()) eUTRAWidebandRSRQMeasurementsSupport().set_implicit_omit();
}

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

void AccessCapAdditionsRel11::encode_text(Text_Buf& text_buf) const
{
field_fANRCapability.encode_text(text_buf);
field_iPACapability.encode_text(text_buf);
field_gERANNetworkSharingSupport.encode_text(text_buf);
field_eUTRAWidebandRSRQMeasurementsSupport.encode_text(text_buf);
}

void AccessCapAdditionsRel11::decode_text(Text_Buf& text_buf)
{
field_fANRCapability.decode_text(text_buf);
field_iPACapability.decode_text(text_buf);
field_gERANNetworkSharingSupport.decode_text(text_buf);
field_eUTRAWidebandRSRQMeasurementsSupport.decode_text(text_buf);
}

void AccessCapAdditionsRel11::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 AccessCapAdditionsRel11::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 AccessCapAdditionsRel11::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, AccessCapAdditionsRel11_fANRCapability_descr_.raw->forceomit);
  decoded_field_length = field_fANRCapability.RAW_decode(AccessCapAdditionsRel11_fANRCapability_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, AccessCapAdditionsRel11_iPACapability_descr_.raw->forceomit);
  decoded_field_length = field_iPACapability.RAW_decode(AccessCapAdditionsRel11_iPACapability_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, AccessCapAdditionsRel11_gERANNetworkSharingSupport_descr_.raw->forceomit);
  decoded_field_length = field_gERANNetworkSharingSupport.RAW_decode(AccessCapAdditionsRel11_gERANNetworkSharingSupport_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, AccessCapAdditionsRel11_eUTRAWidebandRSRQMeasurementsSupport_descr_.raw->forceomit);
  decoded_field_length = field_eUTRAWidebandRSRQMeasurementsSupport.RAW_decode(AccessCapAdditionsRel11_eUTRAWidebandRSRQMeasurementsSupport_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 AccessCapAdditionsRel11::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, AccessCapAdditionsRel11_fANRCapability_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel11_iPACapability_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel11_gERANNetworkSharingSupport_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel11_eUTRAWidebandRSRQMeasurementsSupport_descr_.raw);
  encoded_length += field_fANRCapability.RAW_encode(AccessCapAdditionsRel11_fANRCapability_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iPACapability.RAW_encode(AccessCapAdditionsRel11_iPACapability_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_gERANNetworkSharingSupport.RAW_encode(AccessCapAdditionsRel11_gERANNetworkSharingSupport_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_eUTRAWidebandRSRQMeasurementsSupport.RAW_encode(AccessCapAdditionsRel11_eUTRAWidebandRSRQMeasurementsSupport_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct AccessCapAdditionsRel11_template::single_value_struct {
BITSTRING_template field_fANRCapability;
BITSTRING_template field_iPACapability;
BITSTRING_template field_gERANNetworkSharingSupport;
BITSTRING_template field_eUTRAWidebandRSRQMeasurementsSupport;
};

void AccessCapAdditionsRel11_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_fANRCapability = ANY_VALUE;
single_value->field_iPACapability = ANY_VALUE;
single_value->field_gERANNetworkSharingSupport = ANY_VALUE;
single_value->field_eUTRAWidebandRSRQMeasurementsSupport = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel11_template::copy_value(const AccessCapAdditionsRel11& other_value)
{
single_value = new single_value_struct;
if (other_value.fANRCapability().is_bound()) {
  single_value->field_fANRCapability = other_value.fANRCapability();
} else {
  single_value->field_fANRCapability.clean_up();
}
if (other_value.iPACapability().is_bound()) {
  single_value->field_iPACapability = other_value.iPACapability();
} else {
  single_value->field_iPACapability.clean_up();
}
if (other_value.gERANNetworkSharingSupport().is_bound()) {
  single_value->field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport();
} else {
  single_value->field_gERANNetworkSharingSupport.clean_up();
}
if (other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) {
  single_value->field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport();
} else {
  single_value->field_eUTRAWidebandRSRQMeasurementsSupport.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel11_template::copy_template(const AccessCapAdditionsRel11_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.fANRCapability().get_selection()) {
single_value->field_fANRCapability = other_value.fANRCapability();
} else {
single_value->field_fANRCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iPACapability().get_selection()) {
single_value->field_iPACapability = other_value.iPACapability();
} else {
single_value->field_iPACapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gERANNetworkSharingSupport().get_selection()) {
single_value->field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport();
} else {
single_value->field_gERANNetworkSharingSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRAWidebandRSRQMeasurementsSupport().get_selection()) {
single_value->field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport();
} else {
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 AccessCapAdditionsRel11_template[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 AccessCapAdditionsRel11_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel11_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_GMM_SM_Types.AccessCapAdditionsRel11.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel11_template::AccessCapAdditionsRel11_template()
{
}

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

AccessCapAdditionsRel11_template::AccessCapAdditionsRel11_template(const AccessCapAdditionsRel11& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel11_template::match(const AccessCapAdditionsRel11& 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.fANRCapability().is_bound()) return FALSE;
if(!single_value->field_fANRCapability.match(other_value.fANRCapability(), legacy))return FALSE;
if(!other_value.iPACapability().is_bound()) return FALSE;
if(!single_value->field_iPACapability.match(other_value.iPACapability(), legacy))return FALSE;
if(!other_value.gERANNetworkSharingSupport().is_bound()) return FALSE;
if(!single_value->field_gERANNetworkSharingSupport.match(other_value.gERANNetworkSharingSupport(), legacy))return FALSE;
if(!other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) return FALSE;
if(!single_value->field_eUTRAWidebandRSRQMeasurementsSupport.match(other_value.eUTRAWidebandRSRQMeasurementsSupport(), 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_GMM_SM_Types.AccessCapAdditionsRel11.");
}
return FALSE;
}

boolean AccessCapAdditionsRel11_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_fANRCapability.is_bound()
 || single_value->field_iPACapability.is_bound()
 || single_value->field_gERANNetworkSharingSupport.is_bound()
 || single_value->field_eUTRAWidebandRSRQMeasurementsSupport.is_bound();
}

boolean AccessCapAdditionsRel11_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_fANRCapability.is_value()
 && single_value->field_iPACapability.is_value()
 && single_value->field_gERANNetworkSharingSupport.is_value()
 && single_value->field_eUTRAWidebandRSRQMeasurementsSupport.is_value();
}

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

AccessCapAdditionsRel11 AccessCapAdditionsRel11_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_GMM_SM_Types.AccessCapAdditionsRel11.");
AccessCapAdditionsRel11 ret_val;
if (single_value->field_fANRCapability.is_bound()) {
ret_val.fANRCapability() = single_value->field_fANRCapability.valueof();
}
if (single_value->field_iPACapability.is_bound()) {
ret_val.iPACapability() = single_value->field_iPACapability.valueof();
}
if (single_value->field_gERANNetworkSharingSupport.is_bound()) {
ret_val.gERANNetworkSharingSupport() = single_value->field_gERANNetworkSharingSupport.valueof();
}
if (single_value->field_eUTRAWidebandRSRQMeasurementsSupport.is_bound()) {
ret_val.eUTRAWidebandRSRQMeasurementsSupport() = single_value->field_eUTRAWidebandRSRQMeasurementsSupport.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel11_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_GMM_SM_Types.AccessCapAdditionsRel11.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel11_template[list_length];
}

AccessCapAdditionsRel11_template& AccessCapAdditionsRel11_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_GMM_SM_Types.AccessCapAdditionsRel11.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel11_template::fANRCapability()
{
set_specific();
return single_value->field_fANRCapability;
}

const BITSTRING_template& AccessCapAdditionsRel11_template::fANRCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fANRCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return single_value->field_fANRCapability;
}

BITSTRING_template& AccessCapAdditionsRel11_template::iPACapability()
{
set_specific();
return single_value->field_iPACapability;
}

const BITSTRING_template& AccessCapAdditionsRel11_template::iPACapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iPACapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return single_value->field_iPACapability;
}

BITSTRING_template& AccessCapAdditionsRel11_template::gERANNetworkSharingSupport()
{
set_specific();
return single_value->field_gERANNetworkSharingSupport;
}

const BITSTRING_template& AccessCapAdditionsRel11_template::gERANNetworkSharingSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gERANNetworkSharingSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return single_value->field_gERANNetworkSharingSupport;
}

BITSTRING_template& AccessCapAdditionsRel11_template::eUTRAWidebandRSRQMeasurementsSupport()
{
set_specific();
return single_value->field_eUTRAWidebandRSRQMeasurementsSupport;
}

const BITSTRING_template& AccessCapAdditionsRel11_template::eUTRAWidebandRSRQMeasurementsSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRAWidebandRSRQMeasurementsSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel11.");
return single_value->field_eUTRAWidebandRSRQMeasurementsSupport;
}

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

void AccessCapAdditionsRel11_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ fANRCapability := ");
single_value->field_fANRCapability.log();
TTCN_Logger::log_event_str(", iPACapability := ");
single_value->field_iPACapability.log();
TTCN_Logger::log_event_str(", gERANNetworkSharingSupport := ");
single_value->field_gERANNetworkSharingSupport.log();
TTCN_Logger::log_event_str(", eUTRAWidebandRSRQMeasurementsSupport := ");
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 AccessCapAdditionsRel11_template::log_match(const AccessCapAdditionsRel11& 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_fANRCapability.match(match_value.fANRCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".fANRCapability");
single_value->field_fANRCapability.log_match(match_value.fANRCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iPACapability.match(match_value.iPACapability(), legacy)){
TTCN_Logger::log_logmatch_info(".iPACapability");
single_value->field_iPACapability.log_match(match_value.iPACapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gERANNetworkSharingSupport.match(match_value.gERANNetworkSharingSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".gERANNetworkSharingSupport");
single_value->field_gERANNetworkSharingSupport.log_match(match_value.gERANNetworkSharingSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRAWidebandRSRQMeasurementsSupport.match(match_value.eUTRAWidebandRSRQMeasurementsSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRAWidebandRSRQMeasurementsSupport");
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.log_match(match_value.eUTRAWidebandRSRQMeasurementsSupport(), 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("{ fANRCapability := ");
single_value->field_fANRCapability.log_match(match_value.fANRCapability(), legacy);
TTCN_Logger::log_event_str(", iPACapability := ");
single_value->field_iPACapability.log_match(match_value.iPACapability(), legacy);
TTCN_Logger::log_event_str(", gERANNetworkSharingSupport := ");
single_value->field_gERANNetworkSharingSupport.log_match(match_value.gERANNetworkSharingSupport(), legacy);
TTCN_Logger::log_event_str(", eUTRAWidebandRSRQMeasurementsSupport := ");
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.log_match(match_value.eUTRAWidebandRSRQMeasurementsSupport(), 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 AccessCapAdditionsRel11_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (fANRCapability().is_bound()) fANRCapability().set_implicit_omit();
if (iPACapability().is_bound()) iPACapability().set_implicit_omit();
if (gERANNetworkSharingSupport().is_bound()) gERANNetworkSharingSupport().set_implicit_omit();
if (eUTRAWidebandRSRQMeasurementsSupport().is_bound()) eUTRAWidebandRSRQMeasurementsSupport().set_implicit_omit();
}

void AccessCapAdditionsRel11_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_fANRCapability.encode_text(text_buf);
single_value->field_iPACapability.encode_text(text_buf);
single_value->field_gERANNetworkSharingSupport.encode_text(text_buf);
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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_GMM_SM_Types.AccessCapAdditionsRel11.");
}
}

void AccessCapAdditionsRel11_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_fANRCapability.decode_text(text_buf);
single_value->field_iPACapability.decode_text(text_buf);
single_value->field_gERANNetworkSharingSupport.decode_text(text_buf);
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 AccessCapAdditionsRel11_template[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_GMM_SM_Types.AccessCapAdditionsRel11.");
}
}

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

void AccessCapAdditionsRel11_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_fANRCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
single_value->field_iPACapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
single_value->field_gERANNetworkSharingSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
single_value->field_eUTRAWidebandRSRQMeasurementsSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel11");
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_GMM_SM_Types.AccessCapAdditionsRel11");
}

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

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

AccessCapAdditionsRel12::AccessCapAdditionsRel12()
{
}

AccessCapAdditionsRel12::AccessCapAdditionsRel12(const BITSTRING& par_uTRAMultipleFrequencyBandIndicatorsSupport,
    const BITSTRING& par_eUTRAMultipleFrequencyBandIndicatorsSupport,
    const BITSTRING& par_presenceBitDLMCCapability,
    const OPTIONAL< DLMCCapability >& par_dLMCCapability,
    const BITSTRING& par_extendedTSCSetCapabilitySupport)
  :   field_uTRAMultipleFrequencyBandIndicatorsSupport(par_uTRAMultipleFrequencyBandIndicatorsSupport),
  field_eUTRAMultipleFrequencyBandIndicatorsSupport(par_eUTRAMultipleFrequencyBandIndicatorsSupport),
  field_presenceBitDLMCCapability(par_presenceBitDLMCCapability),
  field_dLMCCapability(par_dLMCCapability),
  field_extendedTSCSetCapabilitySupport(par_extendedTSCSetCapabilitySupport)
{
}

AccessCapAdditionsRel12::AccessCapAdditionsRel12(const AccessCapAdditionsRel12& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
if (other_value.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport();
else field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
if (other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport();
else field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
if (other_value.presenceBitDLMCCapability().is_bound()) field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability();
else field_presenceBitDLMCCapability.clean_up();
if (other_value.dLMCCapability().is_bound()) field_dLMCCapability = other_value.dLMCCapability();
else field_dLMCCapability.clean_up();
if (other_value.extendedTSCSetCapabilitySupport().is_bound()) field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport();
else field_extendedTSCSetCapabilitySupport.clean_up();
}

void AccessCapAdditionsRel12::clean_up()
{
field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
field_presenceBitDLMCCapability.clean_up();
field_dLMCCapability.clean_up();
field_extendedTSCSetCapabilitySupport.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapAdditionsRel12::get_descriptor() const { return &AccessCapAdditionsRel12_descr_; }
AccessCapAdditionsRel12& AccessCapAdditionsRel12::operator=(const AccessCapAdditionsRel12& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
  if (other_value.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport();
  else field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
  if (other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport();
  else field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
  if (other_value.presenceBitDLMCCapability().is_bound()) field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability();
  else field_presenceBitDLMCCapability.clean_up();
  if (other_value.dLMCCapability().is_bound()) field_dLMCCapability = other_value.dLMCCapability();
  else field_dLMCCapability.clean_up();
  if (other_value.extendedTSCSetCapabilitySupport().is_bound()) field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport();
  else field_extendedTSCSetCapabilitySupport.clean_up();
}
return *this;
}

boolean AccessCapAdditionsRel12::operator==(const AccessCapAdditionsRel12& other_value) const
{
return field_uTRAMultipleFrequencyBandIndicatorsSupport==other_value.field_uTRAMultipleFrequencyBandIndicatorsSupport
  && field_eUTRAMultipleFrequencyBandIndicatorsSupport==other_value.field_eUTRAMultipleFrequencyBandIndicatorsSupport
  && field_presenceBitDLMCCapability==other_value.field_presenceBitDLMCCapability
  && field_dLMCCapability==other_value.field_dLMCCapability
  && field_extendedTSCSetCapabilitySupport==other_value.field_extendedTSCSetCapabilitySupport;
}

boolean AccessCapAdditionsRel12::is_bound() const
{
return (field_uTRAMultipleFrequencyBandIndicatorsSupport.is_bound())
  || (field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_bound())
  || (field_presenceBitDLMCCapability.is_bound())
  || (OPTIONAL_OMIT == field_dLMCCapability.get_selection() || field_dLMCCapability.is_bound())
  || (field_extendedTSCSetCapabilitySupport.is_bound());
}
boolean AccessCapAdditionsRel12::is_value() const
{
return field_uTRAMultipleFrequencyBandIndicatorsSupport.is_value()
  && field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_value()
  && field_presenceBitDLMCCapability.is_value()
  && (OPTIONAL_OMIT == field_dLMCCapability.get_selection() || field_dLMCCapability.is_value())
  && field_extendedTSCSetCapabilitySupport.is_value();
}
int AccessCapAdditionsRel12::size_of() const
{
  int ret_val = 4;
  if (field_dLMCCapability.ispresent()) ret_val++;
  return ret_val;
}

void AccessCapAdditionsRel12::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ uTRAMultipleFrequencyBandIndicatorsSupport := ");
field_uTRAMultipleFrequencyBandIndicatorsSupport.log();
TTCN_Logger::log_event_str(", eUTRAMultipleFrequencyBandIndicatorsSupport := ");
field_eUTRAMultipleFrequencyBandIndicatorsSupport.log();
TTCN_Logger::log_event_str(", presenceBitDLMCCapability := ");
field_presenceBitDLMCCapability.log();
TTCN_Logger::log_event_str(", dLMCCapability := ");
field_dLMCCapability.log();
TTCN_Logger::log_event_str(", extendedTSCSetCapabilitySupport := ");
field_extendedTSCSetCapabilitySupport.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapAdditionsRel12::set_implicit_omit()
{
if (uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) uTRAMultipleFrequencyBandIndicatorsSupport().set_implicit_omit();
if (eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) eUTRAMultipleFrequencyBandIndicatorsSupport().set_implicit_omit();
if (presenceBitDLMCCapability().is_bound()) presenceBitDLMCCapability().set_implicit_omit();
if (!dLMCCapability().is_bound()) dLMCCapability() = OMIT_VALUE;
else dLMCCapability().set_implicit_omit();
if (extendedTSCSetCapabilitySupport().is_bound()) extendedTSCSetCapabilitySupport().set_implicit_omit();
}

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

void AccessCapAdditionsRel12::encode_text(Text_Buf& text_buf) const
{
field_uTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf);
field_eUTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf);
field_presenceBitDLMCCapability.encode_text(text_buf);
field_dLMCCapability.encode_text(text_buf);
field_extendedTSCSetCapabilitySupport.encode_text(text_buf);
}

void AccessCapAdditionsRel12::decode_text(Text_Buf& text_buf)
{
field_uTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf);
field_eUTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf);
field_presenceBitDLMCCapability.decode_text(text_buf);
field_dLMCCapability.decode_text(text_buf);
field_extendedTSCSetCapabilitySupport.decode_text(text_buf);
}

void AccessCapAdditionsRel12::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 AccessCapAdditionsRel12::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 AccessCapAdditionsRel12::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, AccessCapAdditionsRel12_uTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw->forceomit);
  decoded_field_length = field_uTRAMultipleFrequencyBandIndicatorsSupport.RAW_decode(AccessCapAdditionsRel12_uTRAMultipleFrequencyBandIndicatorsSupport_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, AccessCapAdditionsRel12_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw->forceomit);
  decoded_field_length = field_eUTRAMultipleFrequencyBandIndicatorsSupport.RAW_decode(AccessCapAdditionsRel12_eUTRAMultipleFrequencyBandIndicatorsSupport_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, AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_.raw->forceomit);
  decoded_field_length = field_presenceBitDLMCCapability.RAW_decode(AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_presenceBitDLMCCapability ==  bs_2){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_dLMCCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel12_dLMCCapability_descr_.raw->forceomit);
  decoded_field_length = field_dLMCCapability().RAW_decode(AccessCapAdditionsRel12_dLMCCapability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_dLMCCapability = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dLMCCapability=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel12_extendedTSCSetCapabilitySupport_descr_.raw->forceomit);
  decoded_field_length = field_extendedTSCSetCapabilitySupport.RAW_decode(AccessCapAdditionsRel12_extendedTSCSetCapabilitySupport_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int AccessCapAdditionsRel12::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, AccessCapAdditionsRel12_uTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel12_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_.raw);
  if (field_dLMCCapability.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel12_dLMCCapability_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel12_extendedTSCSetCapabilitySupport_descr_.raw);
  encoded_length += field_uTRAMultipleFrequencyBandIndicatorsSupport.RAW_encode(AccessCapAdditionsRel12_uTRAMultipleFrequencyBandIndicatorsSupport_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_eUTRAMultipleFrequencyBandIndicatorsSupport.RAW_encode(AccessCapAdditionsRel12_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_presenceBitDLMCCapability.RAW_encode(AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_, *myleaf.body.node.nodes[2]);
  if (field_dLMCCapability.ispresent()) {
  encoded_length += field_dLMCCapability().RAW_encode(AccessCapAdditionsRel12_dLMCCapability_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_extendedTSCSetCapabilitySupport.RAW_encode(AccessCapAdditionsRel12_extendedTSCSetCapabilitySupport_descr_, *myleaf.body.node.nodes[4]);
  if (field_dLMCCapability.ispresent() && (field_presenceBitDLMCCapability !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={2};
  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_2.RAW_encode(AccessCapAdditionsRel12_presenceBitDLMCCapability_descr_,*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 AccessCapAdditionsRel12_template::single_value_struct {
BITSTRING_template field_uTRAMultipleFrequencyBandIndicatorsSupport;
BITSTRING_template field_eUTRAMultipleFrequencyBandIndicatorsSupport;
BITSTRING_template field_presenceBitDLMCCapability;
DLMCCapability_template field_dLMCCapability;
BITSTRING_template field_extendedTSCSetCapabilitySupport;
};

void AccessCapAdditionsRel12_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_uTRAMultipleFrequencyBandIndicatorsSupport = ANY_VALUE;
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport = ANY_VALUE;
single_value->field_presenceBitDLMCCapability = ANY_VALUE;
single_value->field_dLMCCapability = ANY_OR_OMIT;
single_value->field_extendedTSCSetCapabilitySupport = ANY_VALUE;
}
}
}

void AccessCapAdditionsRel12_template::copy_value(const AccessCapAdditionsRel12& other_value)
{
single_value = new single_value_struct;
if (other_value.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) {
  single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport();
} else {
  single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
}
if (other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) {
  single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport();
} else {
  single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
}
if (other_value.presenceBitDLMCCapability().is_bound()) {
  single_value->field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability();
} else {
  single_value->field_presenceBitDLMCCapability.clean_up();
}
if (other_value.dLMCCapability().is_bound()) {
  if (other_value.dLMCCapability().ispresent()) single_value->field_dLMCCapability = other_value.dLMCCapability()();
  else single_value->field_dLMCCapability = OMIT_VALUE;
} else {
  single_value->field_dLMCCapability.clean_up();
}
if (other_value.extendedTSCSetCapabilitySupport().is_bound()) {
  single_value->field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport();
} else {
  single_value->field_extendedTSCSetCapabilitySupport.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapAdditionsRel12_template::copy_template(const AccessCapAdditionsRel12_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.uTRAMultipleFrequencyBandIndicatorsSupport().get_selection()) {
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport();
} else {
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().get_selection()) {
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport();
} else {
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDLMCCapability().get_selection()) {
single_value->field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability();
} else {
single_value->field_presenceBitDLMCCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCCapability().get_selection()) {
single_value->field_dLMCCapability = other_value.dLMCCapability();
} else {
single_value->field_dLMCCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedTSCSetCapabilitySupport().get_selection()) {
single_value->field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport();
} else {
single_value->field_extendedTSCSetCapabilitySupport.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 AccessCapAdditionsRel12_template[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 AccessCapAdditionsRel12_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapAdditionsRel12_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_GMM_SM_Types.AccessCapAdditionsRel12.");
break;
}
set_selection(other_value);
}

AccessCapAdditionsRel12_template::AccessCapAdditionsRel12_template()
{
}

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

AccessCapAdditionsRel12_template::AccessCapAdditionsRel12_template(const AccessCapAdditionsRel12& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapAdditionsRel12_template::match(const AccessCapAdditionsRel12& 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.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) return FALSE;
if(!single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.match(other_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy))return FALSE;
if(!other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) return FALSE;
if(!single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.match(other_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy))return FALSE;
if(!other_value.presenceBitDLMCCapability().is_bound()) return FALSE;
if(!single_value->field_presenceBitDLMCCapability.match(other_value.presenceBitDLMCCapability(), legacy))return FALSE;
if(!other_value.dLMCCapability().is_bound()) return FALSE;
if((other_value.dLMCCapability().ispresent() ? !single_value->field_dLMCCapability.match((const DLMCCapability&)other_value.dLMCCapability(), legacy) : !single_value->field_dLMCCapability.match_omit(legacy)))return FALSE;
if(!other_value.extendedTSCSetCapabilitySupport().is_bound()) return FALSE;
if(!single_value->field_extendedTSCSetCapabilitySupport.match(other_value.extendedTSCSetCapabilitySupport(), 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_GMM_SM_Types.AccessCapAdditionsRel12.");
}
return FALSE;
}

boolean AccessCapAdditionsRel12_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.is_bound()
 || single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_bound()
 || single_value->field_presenceBitDLMCCapability.is_bound()
 || (single_value->field_dLMCCapability.is_omit() || single_value->field_dLMCCapability.is_bound())
 || single_value->field_extendedTSCSetCapabilitySupport.is_bound();
}

boolean AccessCapAdditionsRel12_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.is_value()
 && single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_value()
 && single_value->field_presenceBitDLMCCapability.is_value()
 && (single_value->field_dLMCCapability.is_omit() || single_value->field_dLMCCapability.is_value())
 && single_value->field_extendedTSCSetCapabilitySupport.is_value();
}

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

AccessCapAdditionsRel12 AccessCapAdditionsRel12_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_GMM_SM_Types.AccessCapAdditionsRel12.");
AccessCapAdditionsRel12 ret_val;
if (single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.is_bound()) {
ret_val.uTRAMultipleFrequencyBandIndicatorsSupport() = single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.valueof();
}
if (single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_bound()) {
ret_val.eUTRAMultipleFrequencyBandIndicatorsSupport() = single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.valueof();
}
if (single_value->field_presenceBitDLMCCapability.is_bound()) {
ret_val.presenceBitDLMCCapability() = single_value->field_presenceBitDLMCCapability.valueof();
}
if (single_value->field_dLMCCapability.is_omit()) ret_val.dLMCCapability() = OMIT_VALUE;
else if (single_value->field_dLMCCapability.is_bound()) {
ret_val.dLMCCapability() = single_value->field_dLMCCapability.valueof();
}
if (single_value->field_extendedTSCSetCapabilitySupport.is_bound()) {
ret_val.extendedTSCSetCapabilitySupport() = single_value->field_extendedTSCSetCapabilitySupport.valueof();
}
return ret_val;
}

void AccessCapAdditionsRel12_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_GMM_SM_Types.AccessCapAdditionsRel12.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapAdditionsRel12_template[list_length];
}

AccessCapAdditionsRel12_template& AccessCapAdditionsRel12_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_GMM_SM_Types.AccessCapAdditionsRel12.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapAdditionsRel12_template::uTRAMultipleFrequencyBandIndicatorsSupport()
{
set_specific();
return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport;
}

const BITSTRING_template& AccessCapAdditionsRel12_template::uTRAMultipleFrequencyBandIndicatorsSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uTRAMultipleFrequencyBandIndicatorsSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport;
}

BITSTRING_template& AccessCapAdditionsRel12_template::eUTRAMultipleFrequencyBandIndicatorsSupport()
{
set_specific();
return single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport;
}

const BITSTRING_template& AccessCapAdditionsRel12_template::eUTRAMultipleFrequencyBandIndicatorsSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRAMultipleFrequencyBandIndicatorsSupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport;
}

BITSTRING_template& AccessCapAdditionsRel12_template::presenceBitDLMCCapability()
{
set_specific();
return single_value->field_presenceBitDLMCCapability;
}

const BITSTRING_template& AccessCapAdditionsRel12_template::presenceBitDLMCCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceBitDLMCCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_presenceBitDLMCCapability;
}

DLMCCapability_template& AccessCapAdditionsRel12_template::dLMCCapability()
{
set_specific();
return single_value->field_dLMCCapability;
}

const DLMCCapability_template& AccessCapAdditionsRel12_template::dLMCCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCCapability of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_dLMCCapability;
}

BITSTRING_template& AccessCapAdditionsRel12_template::extendedTSCSetCapabilitySupport()
{
set_specific();
return single_value->field_extendedTSCSetCapabilitySupport;
}

const BITSTRING_template& AccessCapAdditionsRel12_template::extendedTSCSetCapabilitySupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedTSCSetCapabilitySupport of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12.");
return single_value->field_extendedTSCSetCapabilitySupport;
}

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

void AccessCapAdditionsRel12_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ uTRAMultipleFrequencyBandIndicatorsSupport := ");
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.log();
TTCN_Logger::log_event_str(", eUTRAMultipleFrequencyBandIndicatorsSupport := ");
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.log();
TTCN_Logger::log_event_str(", presenceBitDLMCCapability := ");
single_value->field_presenceBitDLMCCapability.log();
TTCN_Logger::log_event_str(", dLMCCapability := ");
single_value->field_dLMCCapability.log();
TTCN_Logger::log_event_str(", extendedTSCSetCapabilitySupport := ");
single_value->field_extendedTSCSetCapabilitySupport.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 AccessCapAdditionsRel12_template::log_match(const AccessCapAdditionsRel12& 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_uTRAMultipleFrequencyBandIndicatorsSupport.match(match_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".uTRAMultipleFrequencyBandIndicatorsSupport");
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.match(match_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRAMultipleFrequencyBandIndicatorsSupport");
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_presenceBitDLMCCapability.match(match_value.presenceBitDLMCCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceBitDLMCCapability");
single_value->field_presenceBitDLMCCapability.log_match(match_value.presenceBitDLMCCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dLMCCapability().ispresent()){
if(!single_value->field_dLMCCapability.match(match_value.dLMCCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCCapability");
single_value->field_dLMCCapability.log_match(match_value.dLMCCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dLMCCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dLMCCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dLMCCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_extendedTSCSetCapabilitySupport.match(match_value.extendedTSCSetCapabilitySupport(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedTSCSetCapabilitySupport");
single_value->field_extendedTSCSetCapabilitySupport.log_match(match_value.extendedTSCSetCapabilitySupport(), 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("{ uTRAMultipleFrequencyBandIndicatorsSupport := ");
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy);
TTCN_Logger::log_event_str(", eUTRAMultipleFrequencyBandIndicatorsSupport := ");
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy);
TTCN_Logger::log_event_str(", presenceBitDLMCCapability := ");
single_value->field_presenceBitDLMCCapability.log_match(match_value.presenceBitDLMCCapability(), legacy);
TTCN_Logger::log_event_str(", dLMCCapability := ");
if (match_value.dLMCCapability().ispresent()) {
single_value->field_dLMCCapability.log_match(match_value.dLMCCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dLMCCapability.log();
if (single_value->field_dLMCCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedTSCSetCapabilitySupport := ");
single_value->field_extendedTSCSetCapabilitySupport.log_match(match_value.extendedTSCSetCapabilitySupport(), 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 AccessCapAdditionsRel12_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) uTRAMultipleFrequencyBandIndicatorsSupport().set_implicit_omit();
if (eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) eUTRAMultipleFrequencyBandIndicatorsSupport().set_implicit_omit();
if (presenceBitDLMCCapability().is_bound()) presenceBitDLMCCapability().set_implicit_omit();
if (!dLMCCapability().is_bound()) dLMCCapability() = OMIT_VALUE;
else dLMCCapability().set_implicit_omit();
if (extendedTSCSetCapabilitySupport().is_bound()) extendedTSCSetCapabilitySupport().set_implicit_omit();
}

void AccessCapAdditionsRel12_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf);
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf);
single_value->field_presenceBitDLMCCapability.encode_text(text_buf);
single_value->field_dLMCCapability.encode_text(text_buf);
single_value->field_extendedTSCSetCapabilitySupport.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_GMM_SM_Types.AccessCapAdditionsRel12.");
}
}

void AccessCapAdditionsRel12_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_uTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf);
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf);
single_value->field_presenceBitDLMCCapability.decode_text(text_buf);
single_value->field_dLMCCapability.decode_text(text_buf);
single_value->field_extendedTSCSetCapabilitySupport.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 AccessCapAdditionsRel12_template[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_GMM_SM_Types.AccessCapAdditionsRel12.");
}
}

void AccessCapAdditionsRel12_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: {
    AccessCapAdditionsRel12_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_GMM_SM_Types.AccessCapAdditionsRel12 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) uTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eUTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitDLMCCapability().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCCapability().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSetCapabilitySupport().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(), "uTRAMultipleFrequencyBandIndicatorsSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uTRAMultipleFrequencyBandIndicatorsSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRAMultipleFrequencyBandIndicatorsSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRAMultipleFrequencyBandIndicatorsSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "presenceBitDLMCCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceBitDLMCCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dLMCCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedTSCSetCapabilitySupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedTSCSetCapabilitySupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.AccessCapAdditionsRel12: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    AccessCapAdditionsRel12_template* precondition = new AccessCapAdditionsRel12_template;
    precondition->set_param(*param.get_elem(0));
    AccessCapAdditionsRel12_template* implied_template = new AccessCapAdditionsRel12_template;
    implied_template->set_param(*param.get_elem(1));
    *this = AccessCapAdditionsRel12_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
  }
  is_ifpresent = param.get_ifpresent();
}

void AccessCapAdditionsRel12_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_uTRAMultipleFrequencyBandIndicatorsSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
single_value->field_presenceBitDLMCCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
single_value->field_dLMCCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
single_value->field_extendedTSCSetCapabilitySupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapAdditionsRel12");
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_GMM_SM_Types.AccessCapAdditionsRel12");
}

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

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

DLMCCapability::DLMCCapability()
{
}

DLMCCapability::DLMCCapability(const BITSTRING& par_presenceDLMC,
    const OPTIONAL< DLMCBandReception >& par_dLMCBandReception,
    const BITSTRING& par_dLMCMaxBandwidth,
    const BITSTRING& par_dLMCMaxNumOfDownlinkTimeslots,
    const BITSTRING& par_dLMCMaxNumOfDownlinkCarriers)
  :   field_presenceDLMC(par_presenceDLMC),
  field_dLMCBandReception(par_dLMCBandReception),
  field_dLMCMaxBandwidth(par_dLMCMaxBandwidth),
  field_dLMCMaxNumOfDownlinkTimeslots(par_dLMCMaxNumOfDownlinkTimeslots),
  field_dLMCMaxNumOfDownlinkCarriers(par_dLMCMaxNumOfDownlinkCarriers)
{
}

DLMCCapability::DLMCCapability(const DLMCCapability& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.DLMCCapability.");
if (other_value.presenceDLMC().is_bound()) field_presenceDLMC = other_value.presenceDLMC();
else field_presenceDLMC.clean_up();
if (other_value.dLMCBandReception().is_bound()) field_dLMCBandReception = other_value.dLMCBandReception();
else field_dLMCBandReception.clean_up();
if (other_value.dLMCMaxBandwidth().is_bound()) field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth();
else field_dLMCMaxBandwidth.clean_up();
if (other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots();
else field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
if (other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers();
else field_dLMCMaxNumOfDownlinkCarriers.clean_up();
}

void DLMCCapability::clean_up()
{
field_presenceDLMC.clean_up();
field_dLMCBandReception.clean_up();
field_dLMCMaxBandwidth.clean_up();
field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
field_dLMCMaxNumOfDownlinkCarriers.clean_up();
}

const TTCN_Typedescriptor_t* DLMCCapability::get_descriptor() const { return &DLMCCapability_descr_; }
DLMCCapability& DLMCCapability::operator=(const DLMCCapability& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.DLMCCapability.");
  if (other_value.presenceDLMC().is_bound()) field_presenceDLMC = other_value.presenceDLMC();
  else field_presenceDLMC.clean_up();
  if (other_value.dLMCBandReception().is_bound()) field_dLMCBandReception = other_value.dLMCBandReception();
  else field_dLMCBandReception.clean_up();
  if (other_value.dLMCMaxBandwidth().is_bound()) field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth();
  else field_dLMCMaxBandwidth.clean_up();
  if (other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots();
  else field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
  if (other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers();
  else field_dLMCMaxNumOfDownlinkCarriers.clean_up();
}
return *this;
}

boolean DLMCCapability::operator==(const DLMCCapability& other_value) const
{
return field_presenceDLMC==other_value.field_presenceDLMC
  && field_dLMCBandReception==other_value.field_dLMCBandReception
  && field_dLMCMaxBandwidth==other_value.field_dLMCMaxBandwidth
  && field_dLMCMaxNumOfDownlinkTimeslots==other_value.field_dLMCMaxNumOfDownlinkTimeslots
  && field_dLMCMaxNumOfDownlinkCarriers==other_value.field_dLMCMaxNumOfDownlinkCarriers;
}

boolean DLMCCapability::is_bound() const
{
return (field_presenceDLMC.is_bound())
  || (OPTIONAL_OMIT == field_dLMCBandReception.get_selection() || field_dLMCBandReception.is_bound())
  || (field_dLMCMaxBandwidth.is_bound())
  || (field_dLMCMaxNumOfDownlinkTimeslots.is_bound())
  || (field_dLMCMaxNumOfDownlinkCarriers.is_bound());
}
boolean DLMCCapability::is_value() const
{
return field_presenceDLMC.is_value()
  && (OPTIONAL_OMIT == field_dLMCBandReception.get_selection() || field_dLMCBandReception.is_value())
  && field_dLMCMaxBandwidth.is_value()
  && field_dLMCMaxNumOfDownlinkTimeslots.is_value()
  && field_dLMCMaxNumOfDownlinkCarriers.is_value();
}
int DLMCCapability::size_of() const
{
  int ret_val = 4;
  if (field_dLMCBandReception.ispresent()) ret_val++;
  return ret_val;
}

void DLMCCapability::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ presenceDLMC := ");
field_presenceDLMC.log();
TTCN_Logger::log_event_str(", dLMCBandReception := ");
field_dLMCBandReception.log();
TTCN_Logger::log_event_str(", dLMCMaxBandwidth := ");
field_dLMCMaxBandwidth.log();
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkTimeslots := ");
field_dLMCMaxNumOfDownlinkTimeslots.log();
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkCarriers := ");
field_dLMCMaxNumOfDownlinkCarriers.log();
TTCN_Logger::log_event_str(" }");
}

void DLMCCapability::set_implicit_omit()
{
if (presenceDLMC().is_bound()) presenceDLMC().set_implicit_omit();
if (!dLMCBandReception().is_bound()) dLMCBandReception() = OMIT_VALUE;
else dLMCBandReception().set_implicit_omit();
if (dLMCMaxBandwidth().is_bound()) dLMCMaxBandwidth().set_implicit_omit();
if (dLMCMaxNumOfDownlinkTimeslots().is_bound()) dLMCMaxNumOfDownlinkTimeslots().set_implicit_omit();
if (dLMCMaxNumOfDownlinkCarriers().is_bound()) dLMCMaxNumOfDownlinkCarriers().set_implicit_omit();
}

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

void DLMCCapability::encode_text(Text_Buf& text_buf) const
{
field_presenceDLMC.encode_text(text_buf);
field_dLMCBandReception.encode_text(text_buf);
field_dLMCMaxBandwidth.encode_text(text_buf);
field_dLMCMaxNumOfDownlinkTimeslots.encode_text(text_buf);
field_dLMCMaxNumOfDownlinkCarriers.encode_text(text_buf);
}

void DLMCCapability::decode_text(Text_Buf& text_buf)
{
field_presenceDLMC.decode_text(text_buf);
field_dLMCBandReception.decode_text(text_buf);
field_dLMCMaxBandwidth.decode_text(text_buf);
field_dLMCMaxNumOfDownlinkTimeslots.decode_text(text_buf);
field_dLMCMaxNumOfDownlinkCarriers.decode_text(text_buf);
}

void DLMCCapability::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 DLMCCapability::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 DLMCCapability::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, DLMCCapability_presenceDLMC_descr_.raw->forceomit);
  decoded_field_length = field_presenceDLMC.RAW_decode(DLMCCapability_presenceDLMC_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 && field_presenceDLMC ==  bs_2){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_dLMCBandReception = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, DLMCCapability_dLMCBandReception_descr_.raw->forceomit);
  decoded_field_length = field_dLMCBandReception().RAW_decode(DLMCCapability_dLMCBandReception_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_dLMCBandReception = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dLMCBandReception=OMIT_VALUE;
  RAW_Force_Omit field_2_force_omit(2, force_omit, DLMCCapability_dLMCMaxBandwidth_descr_.raw->forceomit);
  decoded_field_length = field_dLMCMaxBandwidth.RAW_decode(DLMCCapability_dLMCMaxBandwidth_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, DLMCCapability_dLMCMaxNumOfDownlinkTimeslots_descr_.raw->forceomit);
  decoded_field_length = field_dLMCMaxNumOfDownlinkTimeslots.RAW_decode(DLMCCapability_dLMCMaxNumOfDownlinkTimeslots_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, DLMCCapability_dLMCMaxNumOfDownlinkCarriers_descr_.raw->forceomit);
  decoded_field_length = field_dLMCMaxNumOfDownlinkCarriers.RAW_decode(DLMCCapability_dLMCMaxNumOfDownlinkCarriers_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());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int DLMCCapability::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, DLMCCapability_presenceDLMC_descr_.raw);
  if (field_dLMCBandReception.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DLMCCapability_dLMCBandReception_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DLMCCapability_dLMCMaxBandwidth_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, DLMCCapability_dLMCMaxNumOfDownlinkTimeslots_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, DLMCCapability_dLMCMaxNumOfDownlinkCarriers_descr_.raw);
  encoded_length += field_presenceDLMC.RAW_encode(DLMCCapability_presenceDLMC_descr_, *myleaf.body.node.nodes[0]);
  if (field_dLMCBandReception.ispresent()) {
  encoded_length += field_dLMCBandReception().RAW_encode(DLMCCapability_dLMCBandReception_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_dLMCMaxBandwidth.RAW_encode(DLMCCapability_dLMCMaxBandwidth_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_dLMCMaxNumOfDownlinkTimeslots.RAW_encode(DLMCCapability_dLMCMaxNumOfDownlinkTimeslots_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_dLMCMaxNumOfDownlinkCarriers.RAW_encode(DLMCCapability_dLMCMaxNumOfDownlinkCarriers_descr_, *myleaf.body.node.nodes[4]);
  if (field_dLMCBandReception.ispresent() && (field_presenceDLMC !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  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_2.RAW_encode(DLMCCapability_presenceDLMC_descr_,*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 DLMCCapability_template::single_value_struct {
BITSTRING_template field_presenceDLMC;
DLMCBandReception_template field_dLMCBandReception;
BITSTRING_template field_dLMCMaxBandwidth;
BITSTRING_template field_dLMCMaxNumOfDownlinkTimeslots;
BITSTRING_template field_dLMCMaxNumOfDownlinkCarriers;
};

void DLMCCapability_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_presenceDLMC = ANY_VALUE;
single_value->field_dLMCBandReception = ANY_OR_OMIT;
single_value->field_dLMCMaxBandwidth = ANY_VALUE;
single_value->field_dLMCMaxNumOfDownlinkTimeslots = ANY_VALUE;
single_value->field_dLMCMaxNumOfDownlinkCarriers = ANY_VALUE;
}
}
}

void DLMCCapability_template::copy_value(const DLMCCapability& other_value)
{
single_value = new single_value_struct;
if (other_value.presenceDLMC().is_bound()) {
  single_value->field_presenceDLMC = other_value.presenceDLMC();
} else {
  single_value->field_presenceDLMC.clean_up();
}
if (other_value.dLMCBandReception().is_bound()) {
  if (other_value.dLMCBandReception().ispresent()) single_value->field_dLMCBandReception = other_value.dLMCBandReception()();
  else single_value->field_dLMCBandReception = OMIT_VALUE;
} else {
  single_value->field_dLMCBandReception.clean_up();
}
if (other_value.dLMCMaxBandwidth().is_bound()) {
  single_value->field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth();
} else {
  single_value->field_dLMCMaxBandwidth.clean_up();
}
if (other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) {
  single_value->field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots();
} else {
  single_value->field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
}
if (other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) {
  single_value->field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers();
} else {
  single_value->field_dLMCMaxNumOfDownlinkCarriers.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DLMCCapability_template::copy_template(const DLMCCapability_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.presenceDLMC().get_selection()) {
single_value->field_presenceDLMC = other_value.presenceDLMC();
} else {
single_value->field_presenceDLMC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCBandReception().get_selection()) {
single_value->field_dLMCBandReception = other_value.dLMCBandReception();
} else {
single_value->field_dLMCBandReception.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCMaxBandwidth().get_selection()) {
single_value->field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth();
} else {
single_value->field_dLMCMaxBandwidth.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCMaxNumOfDownlinkTimeslots().get_selection()) {
single_value->field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots();
} else {
single_value->field_dLMCMaxNumOfDownlinkTimeslots.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCMaxNumOfDownlinkCarriers().get_selection()) {
single_value->field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers();
} else {
single_value->field_dLMCMaxNumOfDownlinkCarriers.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 DLMCCapability_template[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 DLMCCapability_template(*other_value.implication_.precondition);
implication_.implied_template = new DLMCCapability_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_GMM_SM_Types.DLMCCapability.");
break;
}
set_selection(other_value);
}

DLMCCapability_template::DLMCCapability_template()
{
}

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

DLMCCapability_template::DLMCCapability_template(const DLMCCapability& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean DLMCCapability_template::match(const DLMCCapability& 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.presenceDLMC().is_bound()) return FALSE;
if(!single_value->field_presenceDLMC.match(other_value.presenceDLMC(), legacy))return FALSE;
if(!other_value.dLMCBandReception().is_bound()) return FALSE;
if((other_value.dLMCBandReception().ispresent() ? !single_value->field_dLMCBandReception.match((const DLMCBandReception&)other_value.dLMCBandReception(), legacy) : !single_value->field_dLMCBandReception.match_omit(legacy)))return FALSE;
if(!other_value.dLMCMaxBandwidth().is_bound()) return FALSE;
if(!single_value->field_dLMCMaxBandwidth.match(other_value.dLMCMaxBandwidth(), legacy))return FALSE;
if(!other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) return FALSE;
if(!single_value->field_dLMCMaxNumOfDownlinkTimeslots.match(other_value.dLMCMaxNumOfDownlinkTimeslots(), legacy))return FALSE;
if(!other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) return FALSE;
if(!single_value->field_dLMCMaxNumOfDownlinkCarriers.match(other_value.dLMCMaxNumOfDownlinkCarriers(), 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_GMM_SM_Types.DLMCCapability.");
}
return FALSE;
}

boolean DLMCCapability_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_presenceDLMC.is_bound()
 || (single_value->field_dLMCBandReception.is_omit() || single_value->field_dLMCBandReception.is_bound())
 || single_value->field_dLMCMaxBandwidth.is_bound()
 || single_value->field_dLMCMaxNumOfDownlinkTimeslots.is_bound()
 || single_value->field_dLMCMaxNumOfDownlinkCarriers.is_bound();
}

boolean DLMCCapability_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_presenceDLMC.is_value()
 && (single_value->field_dLMCBandReception.is_omit() || single_value->field_dLMCBandReception.is_value())
 && single_value->field_dLMCMaxBandwidth.is_value()
 && single_value->field_dLMCMaxNumOfDownlinkTimeslots.is_value()
 && single_value->field_dLMCMaxNumOfDownlinkCarriers.is_value();
}

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

DLMCCapability DLMCCapability_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_GMM_SM_Types.DLMCCapability.");
DLMCCapability ret_val;
if (single_value->field_presenceDLMC.is_bound()) {
ret_val.presenceDLMC() = single_value->field_presenceDLMC.valueof();
}
if (single_value->field_dLMCBandReception.is_omit()) ret_val.dLMCBandReception() = OMIT_VALUE;
else if (single_value->field_dLMCBandReception.is_bound()) {
ret_val.dLMCBandReception() = single_value->field_dLMCBandReception.valueof();
}
if (single_value->field_dLMCMaxBandwidth.is_bound()) {
ret_val.dLMCMaxBandwidth() = single_value->field_dLMCMaxBandwidth.valueof();
}
if (single_value->field_dLMCMaxNumOfDownlinkTimeslots.is_bound()) {
ret_val.dLMCMaxNumOfDownlinkTimeslots() = single_value->field_dLMCMaxNumOfDownlinkTimeslots.valueof();
}
if (single_value->field_dLMCMaxNumOfDownlinkCarriers.is_bound()) {
ret_val.dLMCMaxNumOfDownlinkCarriers() = single_value->field_dLMCMaxNumOfDownlinkCarriers.valueof();
}
return ret_val;
}

void DLMCCapability_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_GMM_SM_Types.DLMCCapability.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DLMCCapability_template[list_length];
}

DLMCCapability_template& DLMCCapability_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_GMM_SM_Types.DLMCCapability.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return value_list.list_value[list_index];
}

BITSTRING_template& DLMCCapability_template::presenceDLMC()
{
set_specific();
return single_value->field_presenceDLMC;
}

const BITSTRING_template& DLMCCapability_template::presenceDLMC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field presenceDLMC of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_presenceDLMC;
}

DLMCBandReception_template& DLMCCapability_template::dLMCBandReception()
{
set_specific();
return single_value->field_dLMCBandReception;
}

const DLMCBandReception_template& DLMCCapability_template::dLMCBandReception() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCBandReception of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_dLMCBandReception;
}

BITSTRING_template& DLMCCapability_template::dLMCMaxBandwidth()
{
set_specific();
return single_value->field_dLMCMaxBandwidth;
}

const BITSTRING_template& DLMCCapability_template::dLMCMaxBandwidth() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCMaxBandwidth of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_dLMCMaxBandwidth;
}

BITSTRING_template& DLMCCapability_template::dLMCMaxNumOfDownlinkTimeslots()
{
set_specific();
return single_value->field_dLMCMaxNumOfDownlinkTimeslots;
}

const BITSTRING_template& DLMCCapability_template::dLMCMaxNumOfDownlinkTimeslots() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCMaxNumOfDownlinkTimeslots of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_dLMCMaxNumOfDownlinkTimeslots;
}

BITSTRING_template& DLMCCapability_template::dLMCMaxNumOfDownlinkCarriers()
{
set_specific();
return single_value->field_dLMCMaxNumOfDownlinkCarriers;
}

const BITSTRING_template& DLMCCapability_template::dLMCMaxNumOfDownlinkCarriers() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCMaxNumOfDownlinkCarriers of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCCapability.");
return single_value->field_dLMCMaxNumOfDownlinkCarriers;
}

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

void DLMCCapability_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ presenceDLMC := ");
single_value->field_presenceDLMC.log();
TTCN_Logger::log_event_str(", dLMCBandReception := ");
single_value->field_dLMCBandReception.log();
TTCN_Logger::log_event_str(", dLMCMaxBandwidth := ");
single_value->field_dLMCMaxBandwidth.log();
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkTimeslots := ");
single_value->field_dLMCMaxNumOfDownlinkTimeslots.log();
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkCarriers := ");
single_value->field_dLMCMaxNumOfDownlinkCarriers.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 DLMCCapability_template::log_match(const DLMCCapability& 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_presenceDLMC.match(match_value.presenceDLMC(), legacy)){
TTCN_Logger::log_logmatch_info(".presenceDLMC");
single_value->field_presenceDLMC.log_match(match_value.presenceDLMC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dLMCBandReception().ispresent()){
if(!single_value->field_dLMCBandReception.match(match_value.dLMCBandReception(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCBandReception");
single_value->field_dLMCBandReception.log_match(match_value.dLMCBandReception(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dLMCBandReception.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dLMCBandReception := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dLMCBandReception.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_dLMCMaxBandwidth.match(match_value.dLMCMaxBandwidth(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCMaxBandwidth");
single_value->field_dLMCMaxBandwidth.log_match(match_value.dLMCMaxBandwidth(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dLMCMaxNumOfDownlinkTimeslots.match(match_value.dLMCMaxNumOfDownlinkTimeslots(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCMaxNumOfDownlinkTimeslots");
single_value->field_dLMCMaxNumOfDownlinkTimeslots.log_match(match_value.dLMCMaxNumOfDownlinkTimeslots(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dLMCMaxNumOfDownlinkCarriers.match(match_value.dLMCMaxNumOfDownlinkCarriers(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCMaxNumOfDownlinkCarriers");
single_value->field_dLMCMaxNumOfDownlinkCarriers.log_match(match_value.dLMCMaxNumOfDownlinkCarriers(), 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("{ presenceDLMC := ");
single_value->field_presenceDLMC.log_match(match_value.presenceDLMC(), legacy);
TTCN_Logger::log_event_str(", dLMCBandReception := ");
if (match_value.dLMCBandReception().ispresent()) {
single_value->field_dLMCBandReception.log_match(match_value.dLMCBandReception(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dLMCBandReception.log();
if (single_value->field_dLMCBandReception.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", dLMCMaxBandwidth := ");
single_value->field_dLMCMaxBandwidth.log_match(match_value.dLMCMaxBandwidth(), legacy);
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkTimeslots := ");
single_value->field_dLMCMaxNumOfDownlinkTimeslots.log_match(match_value.dLMCMaxNumOfDownlinkTimeslots(), legacy);
TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkCarriers := ");
single_value->field_dLMCMaxNumOfDownlinkCarriers.log_match(match_value.dLMCMaxNumOfDownlinkCarriers(), 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 DLMCCapability_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (presenceDLMC().is_bound()) presenceDLMC().set_implicit_omit();
if (!dLMCBandReception().is_bound()) dLMCBandReception() = OMIT_VALUE;
else dLMCBandReception().set_implicit_omit();
if (dLMCMaxBandwidth().is_bound()) dLMCMaxBandwidth().set_implicit_omit();
if (dLMCMaxNumOfDownlinkTimeslots().is_bound()) dLMCMaxNumOfDownlinkTimeslots().set_implicit_omit();
if (dLMCMaxNumOfDownlinkCarriers().is_bound()) dLMCMaxNumOfDownlinkCarriers().set_implicit_omit();
}

void DLMCCapability_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_presenceDLMC.encode_text(text_buf);
single_value->field_dLMCBandReception.encode_text(text_buf);
single_value->field_dLMCMaxBandwidth.encode_text(text_buf);
single_value->field_dLMCMaxNumOfDownlinkTimeslots.encode_text(text_buf);
single_value->field_dLMCMaxNumOfDownlinkCarriers.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_GMM_SM_Types.DLMCCapability.");
}
}

void DLMCCapability_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_presenceDLMC.decode_text(text_buf);
single_value->field_dLMCBandReception.decode_text(text_buf);
single_value->field_dLMCMaxBandwidth.decode_text(text_buf);
single_value->field_dLMCMaxNumOfDownlinkTimeslots.decode_text(text_buf);
single_value->field_dLMCMaxNumOfDownlinkCarriers.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 DLMCCapability_template[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_GMM_SM_Types.DLMCCapability.");
}
}

void DLMCCapability_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: {
    DLMCCapability_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_GMM_SM_Types.DLMCCapability 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) presenceDLMC().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dLMCBandReception().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxBandwidth().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkTimeslots().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkCarriers().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(), "presenceDLMC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          presenceDLMC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dLMCBandReception")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCBandReception().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dLMCMaxBandwidth")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCMaxBandwidth().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dLMCMaxNumOfDownlinkTimeslots")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCMaxNumOfDownlinkTimeslots().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dLMCMaxNumOfDownlinkCarriers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dLMCMaxNumOfDownlinkCarriers().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.DLMCCapability: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DLMCCapability_template* precondition = new DLMCCapability_template;
    precondition->set_param(*param.get_elem(0));
    DLMCCapability_template* implied_template = new DLMCCapability_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DLMCCapability_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.DLMCCapability");
  }
  is_ifpresent = param.get_ifpresent();
}

void DLMCCapability_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_presenceDLMC.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
single_value->field_dLMCBandReception.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
single_value->field_dLMCMaxBandwidth.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
single_value->field_dLMCMaxNumOfDownlinkTimeslots.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
single_value->field_dLMCMaxNumOfDownlinkCarriers.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCCapability");
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_GMM_SM_Types.DLMCCapability");
}

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

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

DLMCBandReception::DLMCBandReception()
{
}

DLMCBandReception::DLMCBandReception(const BITSTRING& par_dLMCNonContiguousIntraBandReception,
    const BITSTRING& par_dLMCInterBandReception)
  :   field_dLMCNonContiguousIntraBandReception(par_dLMCNonContiguousIntraBandReception),
  field_dLMCInterBandReception(par_dLMCInterBandReception)
{
}

DLMCBandReception::DLMCBandReception(const DLMCBandReception& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
if (other_value.dLMCNonContiguousIntraBandReception().is_bound()) field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception();
else field_dLMCNonContiguousIntraBandReception.clean_up();
if (other_value.dLMCInterBandReception().is_bound()) field_dLMCInterBandReception = other_value.dLMCInterBandReception();
else field_dLMCInterBandReception.clean_up();
}

void DLMCBandReception::clean_up()
{
field_dLMCNonContiguousIntraBandReception.clean_up();
field_dLMCInterBandReception.clean_up();
}

const TTCN_Typedescriptor_t* DLMCBandReception::get_descriptor() const { return &DLMCBandReception_descr_; }
DLMCBandReception& DLMCBandReception::operator=(const DLMCBandReception& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
  if (other_value.dLMCNonContiguousIntraBandReception().is_bound()) field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception();
  else field_dLMCNonContiguousIntraBandReception.clean_up();
  if (other_value.dLMCInterBandReception().is_bound()) field_dLMCInterBandReception = other_value.dLMCInterBandReception();
  else field_dLMCInterBandReception.clean_up();
}
return *this;
}

boolean DLMCBandReception::operator==(const DLMCBandReception& other_value) const
{
return field_dLMCNonContiguousIntraBandReception==other_value.field_dLMCNonContiguousIntraBandReception
  && field_dLMCInterBandReception==other_value.field_dLMCInterBandReception;
}

boolean DLMCBandReception::is_bound() const
{
return (field_dLMCNonContiguousIntraBandReception.is_bound())
  || (field_dLMCInterBandReception.is_bound());
}
boolean DLMCBandReception::is_value() const
{
return field_dLMCNonContiguousIntraBandReception.is_value()
  && field_dLMCInterBandReception.is_value();
}
void DLMCBandReception::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dLMCNonContiguousIntraBandReception := ");
field_dLMCNonContiguousIntraBandReception.log();
TTCN_Logger::log_event_str(", dLMCInterBandReception := ");
field_dLMCInterBandReception.log();
TTCN_Logger::log_event_str(" }");
}

void DLMCBandReception::set_implicit_omit()
{
if (dLMCNonContiguousIntraBandReception().is_bound()) dLMCNonContiguousIntraBandReception().set_implicit_omit();
if (dLMCInterBandReception().is_bound()) dLMCInterBandReception().set_implicit_omit();
}

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

void DLMCBandReception::encode_text(Text_Buf& text_buf) const
{
field_dLMCNonContiguousIntraBandReception.encode_text(text_buf);
field_dLMCInterBandReception.encode_text(text_buf);
}

void DLMCBandReception::decode_text(Text_Buf& text_buf)
{
field_dLMCNonContiguousIntraBandReception.decode_text(text_buf);
field_dLMCInterBandReception.decode_text(text_buf);
}

void DLMCBandReception::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 DLMCBandReception::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 DLMCBandReception::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, DLMCBandReception_dLMCNonContiguousIntraBandReception_descr_.raw->forceomit);
  decoded_field_length = field_dLMCNonContiguousIntraBandReception.RAW_decode(DLMCBandReception_dLMCNonContiguousIntraBandReception_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, DLMCBandReception_dLMCInterBandReception_descr_.raw->forceomit);
  decoded_field_length = field_dLMCInterBandReception.RAW_decode(DLMCBandReception_dLMCInterBandReception_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 DLMCBandReception::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, DLMCBandReception_dLMCNonContiguousIntraBandReception_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DLMCBandReception_dLMCInterBandReception_descr_.raw);
  encoded_length += field_dLMCNonContiguousIntraBandReception.RAW_encode(DLMCBandReception_dLMCNonContiguousIntraBandReception_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_dLMCInterBandReception.RAW_encode(DLMCBandReception_dLMCInterBandReception_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct DLMCBandReception_template::single_value_struct {
BITSTRING_template field_dLMCNonContiguousIntraBandReception;
BITSTRING_template field_dLMCInterBandReception;
};

void DLMCBandReception_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_dLMCNonContiguousIntraBandReception = ANY_VALUE;
single_value->field_dLMCInterBandReception = ANY_VALUE;
}
}
}

void DLMCBandReception_template::copy_value(const DLMCBandReception& other_value)
{
single_value = new single_value_struct;
if (other_value.dLMCNonContiguousIntraBandReception().is_bound()) {
  single_value->field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception();
} else {
  single_value->field_dLMCNonContiguousIntraBandReception.clean_up();
}
if (other_value.dLMCInterBandReception().is_bound()) {
  single_value->field_dLMCInterBandReception = other_value.dLMCInterBandReception();
} else {
  single_value->field_dLMCInterBandReception.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DLMCBandReception_template::copy_template(const DLMCBandReception_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dLMCNonContiguousIntraBandReception().get_selection()) {
single_value->field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception();
} else {
single_value->field_dLMCNonContiguousIntraBandReception.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dLMCInterBandReception().get_selection()) {
single_value->field_dLMCInterBandReception = other_value.dLMCInterBandReception();
} else {
single_value->field_dLMCInterBandReception.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 DLMCBandReception_template[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 DLMCBandReception_template(*other_value.implication_.precondition);
implication_.implied_template = new DLMCBandReception_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_GMM_SM_Types.DLMCBandReception.");
break;
}
set_selection(other_value);
}

DLMCBandReception_template::DLMCBandReception_template()
{
}

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

DLMCBandReception_template::DLMCBandReception_template(const DLMCBandReception& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean DLMCBandReception_template::match(const DLMCBandReception& 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.dLMCNonContiguousIntraBandReception().is_bound()) return FALSE;
if(!single_value->field_dLMCNonContiguousIntraBandReception.match(other_value.dLMCNonContiguousIntraBandReception(), legacy))return FALSE;
if(!other_value.dLMCInterBandReception().is_bound()) return FALSE;
if(!single_value->field_dLMCInterBandReception.match(other_value.dLMCInterBandReception(), 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_GMM_SM_Types.DLMCBandReception.");
}
return FALSE;
}

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

boolean DLMCBandReception_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dLMCNonContiguousIntraBandReception.is_value()
 && single_value->field_dLMCInterBandReception.is_value();
}

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

DLMCBandReception DLMCBandReception_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_GMM_SM_Types.DLMCBandReception.");
DLMCBandReception ret_val;
if (single_value->field_dLMCNonContiguousIntraBandReception.is_bound()) {
ret_val.dLMCNonContiguousIntraBandReception() = single_value->field_dLMCNonContiguousIntraBandReception.valueof();
}
if (single_value->field_dLMCInterBandReception.is_bound()) {
ret_val.dLMCInterBandReception() = single_value->field_dLMCInterBandReception.valueof();
}
return ret_val;
}

void DLMCBandReception_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_GMM_SM_Types.DLMCBandReception.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new DLMCBandReception_template[list_length];
}

DLMCBandReception_template& DLMCBandReception_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_GMM_SM_Types.DLMCBandReception.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
return value_list.list_value[list_index];
}

BITSTRING_template& DLMCBandReception_template::dLMCNonContiguousIntraBandReception()
{
set_specific();
return single_value->field_dLMCNonContiguousIntraBandReception;
}

const BITSTRING_template& DLMCBandReception_template::dLMCNonContiguousIntraBandReception() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCNonContiguousIntraBandReception of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
return single_value->field_dLMCNonContiguousIntraBandReception;
}

BITSTRING_template& DLMCBandReception_template::dLMCInterBandReception()
{
set_specific();
return single_value->field_dLMCInterBandReception;
}

const BITSTRING_template& DLMCBandReception_template::dLMCInterBandReception() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dLMCInterBandReception of a non-specific template of type @MobileL3_GMM_SM_Types.DLMCBandReception.");
return single_value->field_dLMCInterBandReception;
}

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

void DLMCBandReception_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dLMCNonContiguousIntraBandReception := ");
single_value->field_dLMCNonContiguousIntraBandReception.log();
TTCN_Logger::log_event_str(", dLMCInterBandReception := ");
single_value->field_dLMCInterBandReception.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 DLMCBandReception_template::log_match(const DLMCBandReception& 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_dLMCNonContiguousIntraBandReception.match(match_value.dLMCNonContiguousIntraBandReception(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCNonContiguousIntraBandReception");
single_value->field_dLMCNonContiguousIntraBandReception.log_match(match_value.dLMCNonContiguousIntraBandReception(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dLMCInterBandReception.match(match_value.dLMCInterBandReception(), legacy)){
TTCN_Logger::log_logmatch_info(".dLMCInterBandReception");
single_value->field_dLMCInterBandReception.log_match(match_value.dLMCInterBandReception(), 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("{ dLMCNonContiguousIntraBandReception := ");
single_value->field_dLMCNonContiguousIntraBandReception.log_match(match_value.dLMCNonContiguousIntraBandReception(), legacy);
TTCN_Logger::log_event_str(", dLMCInterBandReception := ");
single_value->field_dLMCInterBandReception.log_match(match_value.dLMCInterBandReception(), 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 DLMCBandReception_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dLMCNonContiguousIntraBandReception().is_bound()) dLMCNonContiguousIntraBandReception().set_implicit_omit();
if (dLMCInterBandReception().is_bound()) dLMCInterBandReception().set_implicit_omit();
}

void DLMCBandReception_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dLMCNonContiguousIntraBandReception.encode_text(text_buf);
single_value->field_dLMCInterBandReception.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_GMM_SM_Types.DLMCBandReception.");
}
}

void DLMCBandReception_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_dLMCNonContiguousIntraBandReception.decode_text(text_buf);
single_value->field_dLMCInterBandReception.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 DLMCBandReception_template[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_GMM_SM_Types.DLMCBandReception.");
}
}

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

void DLMCBandReception_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_dLMCNonContiguousIntraBandReception.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCBandReception");
single_value->field_dLMCInterBandReception.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.DLMCBandReception");
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_GMM_SM_Types.DLMCBandReception");
}

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

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

AccessCapLateAdditionsRel11::AccessCapLateAdditionsRel11()
{
}

AccessCapLateAdditionsRel11::AccessCapLateAdditionsRel11(const BITSTRING& par_extendedEARFCNValueRange)
  :   field_extendedEARFCNValueRange(par_extendedEARFCNValueRange)
{
}

AccessCapLateAdditionsRel11::AccessCapLateAdditionsRel11(const AccessCapLateAdditionsRel11& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
if (other_value.extendedEARFCNValueRange().is_bound()) field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange();
else field_extendedEARFCNValueRange.clean_up();
}

void AccessCapLateAdditionsRel11::clean_up()
{
field_extendedEARFCNValueRange.clean_up();
}

const TTCN_Typedescriptor_t* AccessCapLateAdditionsRel11::get_descriptor() const { return &AccessCapLateAdditionsRel11_descr_; }
AccessCapLateAdditionsRel11& AccessCapLateAdditionsRel11::operator=(const AccessCapLateAdditionsRel11& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
  if (other_value.extendedEARFCNValueRange().is_bound()) field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange();
  else field_extendedEARFCNValueRange.clean_up();
}
return *this;
}

boolean AccessCapLateAdditionsRel11::operator==(const AccessCapLateAdditionsRel11& other_value) const
{
return field_extendedEARFCNValueRange==other_value.field_extendedEARFCNValueRange;
}

boolean AccessCapLateAdditionsRel11::is_bound() const
{
return (field_extendedEARFCNValueRange.is_bound());
}
boolean AccessCapLateAdditionsRel11::is_value() const
{
return field_extendedEARFCNValueRange.is_value();
}
void AccessCapLateAdditionsRel11::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ extendedEARFCNValueRange := ");
field_extendedEARFCNValueRange.log();
TTCN_Logger::log_event_str(" }");
}

void AccessCapLateAdditionsRel11::set_implicit_omit()
{
if (extendedEARFCNValueRange().is_bound()) extendedEARFCNValueRange().set_implicit_omit();
}

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

void AccessCapLateAdditionsRel11::encode_text(Text_Buf& text_buf) const
{
field_extendedEARFCNValueRange.encode_text(text_buf);
}

void AccessCapLateAdditionsRel11::decode_text(Text_Buf& text_buf)
{
field_extendedEARFCNValueRange.decode_text(text_buf);
}

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

int AccessCapLateAdditionsRel11::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::BIT1_descr_.raw);
  encoded_length += field_extendedEARFCNValueRange.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct AccessCapLateAdditionsRel11_template::single_value_struct {
BITSTRING_template field_extendedEARFCNValueRange;
};

void AccessCapLateAdditionsRel11_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_extendedEARFCNValueRange = ANY_VALUE;
}
}
}

void AccessCapLateAdditionsRel11_template::copy_value(const AccessCapLateAdditionsRel11& other_value)
{
single_value = new single_value_struct;
if (other_value.extendedEARFCNValueRange().is_bound()) {
  single_value->field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange();
} else {
  single_value->field_extendedEARFCNValueRange.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void AccessCapLateAdditionsRel11_template::copy_template(const AccessCapLateAdditionsRel11_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.extendedEARFCNValueRange().get_selection()) {
single_value->field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange();
} else {
single_value->field_extendedEARFCNValueRange.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 AccessCapLateAdditionsRel11_template[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 AccessCapLateAdditionsRel11_template(*other_value.implication_.precondition);
implication_.implied_template = new AccessCapLateAdditionsRel11_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_GMM_SM_Types.AccessCapLateAdditionsRel11.");
break;
}
set_selection(other_value);
}

AccessCapLateAdditionsRel11_template::AccessCapLateAdditionsRel11_template()
{
}

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

AccessCapLateAdditionsRel11_template::AccessCapLateAdditionsRel11_template(const AccessCapLateAdditionsRel11& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean AccessCapLateAdditionsRel11_template::match(const AccessCapLateAdditionsRel11& 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.extendedEARFCNValueRange().is_bound()) return FALSE;
if(!single_value->field_extendedEARFCNValueRange.match(other_value.extendedEARFCNValueRange(), 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_GMM_SM_Types.AccessCapLateAdditionsRel11.");
}
return FALSE;
}

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

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

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

AccessCapLateAdditionsRel11 AccessCapLateAdditionsRel11_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_GMM_SM_Types.AccessCapLateAdditionsRel11.");
AccessCapLateAdditionsRel11 ret_val;
if (single_value->field_extendedEARFCNValueRange.is_bound()) {
ret_val.extendedEARFCNValueRange() = single_value->field_extendedEARFCNValueRange.valueof();
}
return ret_val;
}

void AccessCapLateAdditionsRel11_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_GMM_SM_Types.AccessCapLateAdditionsRel11.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AccessCapLateAdditionsRel11_template[list_length];
}

AccessCapLateAdditionsRel11_template& AccessCapLateAdditionsRel11_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_GMM_SM_Types.AccessCapLateAdditionsRel11.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
return value_list.list_value[list_index];
}

BITSTRING_template& AccessCapLateAdditionsRel11_template::extendedEARFCNValueRange()
{
set_specific();
return single_value->field_extendedEARFCNValueRange;
}

const BITSTRING_template& AccessCapLateAdditionsRel11_template::extendedEARFCNValueRange() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedEARFCNValueRange of a non-specific template of type @MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11.");
return single_value->field_extendedEARFCNValueRange;
}

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

void AccessCapLateAdditionsRel11_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ extendedEARFCNValueRange := ");
single_value->field_extendedEARFCNValueRange.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 AccessCapLateAdditionsRel11_template::log_match(const AccessCapLateAdditionsRel11& 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_extendedEARFCNValueRange.match(match_value.extendedEARFCNValueRange(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedEARFCNValueRange");
single_value->field_extendedEARFCNValueRange.log_match(match_value.extendedEARFCNValueRange(), 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("{ extendedEARFCNValueRange := ");
single_value->field_extendedEARFCNValueRange.log_match(match_value.extendedEARFCNValueRange(), 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 AccessCapLateAdditionsRel11_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (extendedEARFCNValueRange().is_bound()) extendedEARFCNValueRange().set_implicit_omit();
}

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

void AccessCapLateAdditionsRel11_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_extendedEARFCNValueRange.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 AccessCapLateAdditionsRel11_template[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_GMM_SM_Types.AccessCapLateAdditionsRel11.");
}
}

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

void AccessCapLateAdditionsRel11_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_extendedEARFCNValueRange.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.AccessCapLateAdditionsRel11");
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_GMM_SM_Types.AccessCapLateAdditionsRel11");
}

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

boolean AccessCapLateAdditionsRel11_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 */
