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

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

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

/* Including header files */

#include "BSSGP_Types.hh"

namespace BSSGP__Types {

/* Member functions of C++ classes */

VelocityData::VelocityData()
{
}

VelocityData::VelocityData(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_velocityDataValue)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_velocityDataValue(par_velocityDataValue)
{
}

VelocityData::VelocityData(const VelocityData& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.VelocityData.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.velocityDataValue().is_bound()) field_velocityDataValue = other_value.velocityDataValue();
else field_velocityDataValue.clean_up();
}

void VelocityData::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_velocityDataValue.clean_up();
}

const TTCN_Typedescriptor_t* VelocityData::get_descriptor() const { return &VelocityData_descr_; }
VelocityData& VelocityData::operator=(const VelocityData& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.VelocityData.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.velocityDataValue().is_bound()) field_velocityDataValue = other_value.velocityDataValue();
  else field_velocityDataValue.clean_up();
}
return *this;
}

boolean VelocityData::operator==(const VelocityData& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_velocityDataValue==other_value.field_velocityDataValue;
}

boolean VelocityData::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_velocityDataValue.is_bound());
}
boolean VelocityData::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_velocityDataValue.is_value();
}
void VelocityData::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", velocityDataValue := ");
field_velocityDataValue.log();
TTCN_Logger::log_event_str(" }");
}

void VelocityData::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (velocityDataValue().is_bound()) velocityDataValue().set_implicit_omit();
}

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

void VelocityData::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_velocityDataValue.encode_text(text_buf);
}

void VelocityData::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_velocityDataValue.decode_text(text_buf);
}

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

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

int VelocityData::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, VelocityData_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(VelocityData_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, VelocityData_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(VelocityData_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_velocityDataValue.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_126) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int VelocityData::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, VelocityData_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, VelocityData_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, OCTETSTRING_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(VelocityData_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(VelocityData_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_velocityDataValue.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(VelocityData_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(VelocityData_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_126) {
  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_126.RAW_encode(General__Types::OCT1_descr_,*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 VelocityData_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_velocityDataValue;
};

void VelocityData_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_velocityDataValue = ANY_VALUE;
}
}
}

void VelocityData_template::copy_value(const VelocityData& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.velocityDataValue().is_bound()) {
  single_value->field_velocityDataValue = other_value.velocityDataValue();
} else {
  single_value->field_velocityDataValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void VelocityData_template::copy_template(const VelocityData_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.velocityDataValue().get_selection()) {
single_value->field_velocityDataValue = other_value.velocityDataValue();
} else {
single_value->field_velocityDataValue.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 VelocityData_template[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 VelocityData_template(*other_value.implication_.precondition);
implication_.implied_template = new VelocityData_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 @BSSGP_Types.VelocityData.");
break;
}
set_selection(other_value);
}

VelocityData_template::VelocityData_template()
{
}

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

VelocityData_template::VelocityData_template(const VelocityData& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean VelocityData_template::match(const VelocityData& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.velocityDataValue().is_bound()) return FALSE;
if(!single_value->field_velocityDataValue.match(other_value.velocityDataValue(), 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 @BSSGP_Types.VelocityData.");
}
return FALSE;
}

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

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

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

VelocityData VelocityData_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 @BSSGP_Types.VelocityData.");
VelocityData ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_velocityDataValue.is_bound()) {
ret_val.velocityDataValue() = single_value->field_velocityDataValue.valueof();
}
return ret_val;
}

void VelocityData_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 @BSSGP_Types.VelocityData.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new VelocityData_template[list_length];
}

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

OCTETSTRING_template& VelocityData_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& VelocityData_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.VelocityData.");
return single_value->field_iEI;
}

BITSTRING_template& VelocityData_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& VelocityData_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.VelocityData.");
return single_value->field_ext;
}

LIN2__2a_template& VelocityData_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& VelocityData_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.VelocityData.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& VelocityData_template::velocityDataValue()
{
set_specific();
return single_value->field_velocityDataValue;
}

const OCTETSTRING_template& VelocityData_template::velocityDataValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field velocityDataValue of a non-specific template of type @BSSGP_Types.VelocityData.");
return single_value->field_velocityDataValue;
}

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

void VelocityData_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", velocityDataValue := ");
single_value->field_velocityDataValue.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 VelocityData_template::log_match(const VelocityData& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_velocityDataValue.match(match_value.velocityDataValue(), legacy)){
TTCN_Logger::log_logmatch_info(".velocityDataValue");
single_value->field_velocityDataValue.log_match(match_value.velocityDataValue(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", velocityDataValue := ");
single_value->field_velocityDataValue.log_match(match_value.velocityDataValue(), 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 VelocityData_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_velocityDataValue.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 @BSSGP_Types.VelocityData.");
}
}

void VelocityData_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_velocityDataValue.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 VelocityData_template[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 @BSSGP_Types.VelocityData.");
}
}

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

void VelocityData_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.VelocityData");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.VelocityData");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.VelocityData");
single_value->field_velocityDataValue.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.VelocityData");
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 : "@BSSGP_Types.VelocityData");
}

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

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

Requested__GANSS__Assistance__Data::Requested__GANSS__Assistance__Data()
{
}

Requested__GANSS__Assistance__Data::Requested__GANSS__Assistance__Data(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_requested__GANSS__Assistance__Data__Value)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_requested__GANSS__Assistance__Data__Value(par_requested__GANSS__Assistance__Data__Value)
{
}

Requested__GANSS__Assistance__Data::Requested__GANSS__Assistance__Data(const Requested__GANSS__Assistance__Data& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Requested_GANSS_Assistance_Data.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.requested__GANSS__Assistance__Data__Value().is_bound()) field_requested__GANSS__Assistance__Data__Value = other_value.requested__GANSS__Assistance__Data__Value();
else field_requested__GANSS__Assistance__Data__Value.clean_up();
}

void Requested__GANSS__Assistance__Data::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_requested__GANSS__Assistance__Data__Value.clean_up();
}

const TTCN_Typedescriptor_t* Requested__GANSS__Assistance__Data::get_descriptor() const { return &Requested__GANSS__Assistance__Data_descr_; }
Requested__GANSS__Assistance__Data& Requested__GANSS__Assistance__Data::operator=(const Requested__GANSS__Assistance__Data& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Requested_GANSS_Assistance_Data.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.requested__GANSS__Assistance__Data__Value().is_bound()) field_requested__GANSS__Assistance__Data__Value = other_value.requested__GANSS__Assistance__Data__Value();
  else field_requested__GANSS__Assistance__Data__Value.clean_up();
}
return *this;
}

boolean Requested__GANSS__Assistance__Data::operator==(const Requested__GANSS__Assistance__Data& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_requested__GANSS__Assistance__Data__Value==other_value.field_requested__GANSS__Assistance__Data__Value;
}

boolean Requested__GANSS__Assistance__Data::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_requested__GANSS__Assistance__Data__Value.is_bound());
}
boolean Requested__GANSS__Assistance__Data::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_requested__GANSS__Assistance__Data__Value.is_value();
}
void Requested__GANSS__Assistance__Data::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", requested_GANSS_Assistance_Data_Value := ");
field_requested__GANSS__Assistance__Data__Value.log();
TTCN_Logger::log_event_str(" }");
}

void Requested__GANSS__Assistance__Data::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (requested__GANSS__Assistance__Data__Value().is_bound()) requested__GANSS__Assistance__Data__Value().set_implicit_omit();
}

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

void Requested__GANSS__Assistance__Data::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_requested__GANSS__Assistance__Data__Value.encode_text(text_buf);
}

void Requested__GANSS__Assistance__Data::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_requested__GANSS__Assistance__Data__Value.decode_text(text_buf);
}

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

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

int Requested__GANSS__Assistance__Data::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Requested__GANSS__Assistance__Data_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Requested__GANSS__Assistance__Data_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Requested__GANSS__Assistance__Data_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Requested__GANSS__Assistance__Data_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_requested__GANSS__Assistance__Data__Value.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_120) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Requested__GANSS__Assistance__Data::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Requested__GANSS__Assistance__Data_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Requested__GANSS__Assistance__Data_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, OCTETSTRING_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Requested__GANSS__Assistance__Data_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Requested__GANSS__Assistance__Data_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_requested__GANSS__Assistance__Data__Value.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Requested__GANSS__Assistance__Data_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Requested__GANSS__Assistance__Data_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_120) {
  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_120.RAW_encode(General__Types::OCT1_descr_,*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 Requested__GANSS__Assistance__Data_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_requested__GANSS__Assistance__Data__Value;
};

void Requested__GANSS__Assistance__Data_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_requested__GANSS__Assistance__Data__Value = ANY_VALUE;
}
}
}

void Requested__GANSS__Assistance__Data_template::copy_value(const Requested__GANSS__Assistance__Data& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.requested__GANSS__Assistance__Data__Value().is_bound()) {
  single_value->field_requested__GANSS__Assistance__Data__Value = other_value.requested__GANSS__Assistance__Data__Value();
} else {
  single_value->field_requested__GANSS__Assistance__Data__Value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Requested__GANSS__Assistance__Data_template::copy_template(const Requested__GANSS__Assistance__Data_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requested__GANSS__Assistance__Data__Value().get_selection()) {
single_value->field_requested__GANSS__Assistance__Data__Value = other_value.requested__GANSS__Assistance__Data__Value();
} else {
single_value->field_requested__GANSS__Assistance__Data__Value.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 Requested__GANSS__Assistance__Data_template[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 Requested__GANSS__Assistance__Data_template(*other_value.implication_.precondition);
implication_.implied_template = new Requested__GANSS__Assistance__Data_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 @BSSGP_Types.Requested_GANSS_Assistance_Data.");
break;
}
set_selection(other_value);
}

Requested__GANSS__Assistance__Data_template::Requested__GANSS__Assistance__Data_template()
{
}

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

Requested__GANSS__Assistance__Data_template::Requested__GANSS__Assistance__Data_template(const Requested__GANSS__Assistance__Data& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Requested__GANSS__Assistance__Data_template& Requested__GANSS__Assistance__Data_template::operator=(const OPTIONAL<Requested__GANSS__Assistance__Data>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Requested__GANSS__Assistance__Data&)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 @BSSGP_Types.Requested_GANSS_Assistance_Data.");
}
return *this;
}

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

boolean Requested__GANSS__Assistance__Data_template::match(const Requested__GANSS__Assistance__Data& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.requested__GANSS__Assistance__Data__Value().is_bound()) return FALSE;
if(!single_value->field_requested__GANSS__Assistance__Data__Value.match(other_value.requested__GANSS__Assistance__Data__Value(), 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 @BSSGP_Types.Requested_GANSS_Assistance_Data.");
}
return FALSE;
}

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

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

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

Requested__GANSS__Assistance__Data Requested__GANSS__Assistance__Data_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 @BSSGP_Types.Requested_GANSS_Assistance_Data.");
Requested__GANSS__Assistance__Data ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_requested__GANSS__Assistance__Data__Value.is_bound()) {
ret_val.requested__GANSS__Assistance__Data__Value() = single_value->field_requested__GANSS__Assistance__Data__Value.valueof();
}
return ret_val;
}

void Requested__GANSS__Assistance__Data_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 @BSSGP_Types.Requested_GANSS_Assistance_Data.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Requested__GANSS__Assistance__Data_template[list_length];
}

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

OCTETSTRING_template& Requested__GANSS__Assistance__Data_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Requested__GANSS__Assistance__Data_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Requested_GANSS_Assistance_Data.");
return single_value->field_iEI;
}

BITSTRING_template& Requested__GANSS__Assistance__Data_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Requested__GANSS__Assistance__Data_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Requested_GANSS_Assistance_Data.");
return single_value->field_ext;
}

LIN2__2a_template& Requested__GANSS__Assistance__Data_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Requested__GANSS__Assistance__Data_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Requested_GANSS_Assistance_Data.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Requested__GANSS__Assistance__Data_template::requested__GANSS__Assistance__Data__Value()
{
set_specific();
return single_value->field_requested__GANSS__Assistance__Data__Value;
}

const OCTETSTRING_template& Requested__GANSS__Assistance__Data_template::requested__GANSS__Assistance__Data__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requested_GANSS_Assistance_Data_Value of a non-specific template of type @BSSGP_Types.Requested_GANSS_Assistance_Data.");
return single_value->field_requested__GANSS__Assistance__Data__Value;
}

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

void Requested__GANSS__Assistance__Data_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", requested_GANSS_Assistance_Data_Value := ");
single_value->field_requested__GANSS__Assistance__Data__Value.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 Requested__GANSS__Assistance__Data_template::log_match(const Requested__GANSS__Assistance__Data& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_requested__GANSS__Assistance__Data__Value.match(match_value.requested__GANSS__Assistance__Data__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".requested_GANSS_Assistance_Data_Value");
single_value->field_requested__GANSS__Assistance__Data__Value.log_match(match_value.requested__GANSS__Assistance__Data__Value(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", requested_GANSS_Assistance_Data_Value := ");
single_value->field_requested__GANSS__Assistance__Data__Value.log_match(match_value.requested__GANSS__Assistance__Data__Value(), 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 Requested__GANSS__Assistance__Data_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_requested__GANSS__Assistance__Data__Value.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 @BSSGP_Types.Requested_GANSS_Assistance_Data.");
}
}

void Requested__GANSS__Assistance__Data_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_requested__GANSS__Assistance__Data__Value.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 Requested__GANSS__Assistance__Data_template[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 @BSSGP_Types.Requested_GANSS_Assistance_Data.");
}
}

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

void Requested__GANSS__Assistance__Data_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Requested_GANSS_Assistance_Data");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Requested_GANSS_Assistance_Data");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Requested_GANSS_Assistance_Data");
single_value->field_requested__GANSS__Assistance__Data__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Requested_GANSS_Assistance_Data");
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 : "@BSSGP_Types.Requested_GANSS_Assistance_Data");
}

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

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

GANSS__Location__Type::GANSS__Location__Type()
{
}

GANSS__Location__Type::GANSS__Location__Type(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_galileo,
    const BITSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_galileo(par_galileo),
  field_spare(par_spare)
{
}

GANSS__Location__Type::GANSS__Location__Type(const GANSS__Location__Type& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.GANSS_Location_Type.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.galileo().is_bound()) field_galileo = other_value.galileo();
else field_galileo.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void GANSS__Location__Type::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_galileo.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* GANSS__Location__Type::get_descriptor() const { return &GANSS__Location__Type_descr_; }
GANSS__Location__Type& GANSS__Location__Type::operator=(const GANSS__Location__Type& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.GANSS_Location_Type.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.galileo().is_bound()) field_galileo = other_value.galileo();
  else field_galileo.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean GANSS__Location__Type::operator==(const GANSS__Location__Type& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_galileo==other_value.field_galileo
  && field_spare==other_value.field_spare;
}

boolean GANSS__Location__Type::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_galileo.is_bound())
  || (field_spare.is_bound());
}
boolean GANSS__Location__Type::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_galileo.is_value()
  && field_spare.is_value();
}
void GANSS__Location__Type::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", galileo := ");
field_galileo.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void GANSS__Location__Type::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (galileo().is_bound()) galileo().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void GANSS__Location__Type::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_galileo.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void GANSS__Location__Type::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_galileo.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int GANSS__Location__Type::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, GANSS__Location__Type_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(GANSS__Location__Type_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, GANSS__Location__Type_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(GANSS__Location__Type_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_galileo.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT7_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_119) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GANSS__Location__Type::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GANSS__Location__Type_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, GANSS__Location__Type_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT7_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(GANSS__Location__Type_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(GANSS__Location__Type_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_galileo.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[4]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(GANSS__Location__Type_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(GANSS__Location__Type_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_119) {
  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_119.RAW_encode(General__Types::OCT1_descr_,*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 GANSS__Location__Type_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_galileo;
BITSTRING_template field_spare;
};

void GANSS__Location__Type_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_galileo = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void GANSS__Location__Type_template::copy_value(const GANSS__Location__Type& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.galileo().is_bound()) {
  single_value->field_galileo = other_value.galileo();
} else {
  single_value->field_galileo.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GANSS__Location__Type_template::copy_template(const GANSS__Location__Type_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.galileo().get_selection()) {
single_value->field_galileo = other_value.galileo();
} else {
single_value->field_galileo.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new GANSS__Location__Type_template[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 GANSS__Location__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new GANSS__Location__Type_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 @BSSGP_Types.GANSS_Location_Type.");
break;
}
set_selection(other_value);
}

GANSS__Location__Type_template::GANSS__Location__Type_template()
{
}

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

GANSS__Location__Type_template::GANSS__Location__Type_template(const GANSS__Location__Type& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

GANSS__Location__Type_template& GANSS__Location__Type_template::operator=(const OPTIONAL<GANSS__Location__Type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GANSS__Location__Type&)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 @BSSGP_Types.GANSS_Location_Type.");
}
return *this;
}

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

boolean GANSS__Location__Type_template::match(const GANSS__Location__Type& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.galileo().is_bound()) return FALSE;
if(!single_value->field_galileo.match(other_value.galileo(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.GANSS_Location_Type.");
}
return FALSE;
}

boolean GANSS__Location__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_galileo.is_bound()
 || single_value->field_spare.is_bound();
}

boolean GANSS__Location__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_galileo.is_value()
 && single_value->field_spare.is_value();
}

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

GANSS__Location__Type GANSS__Location__Type_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 @BSSGP_Types.GANSS_Location_Type.");
GANSS__Location__Type ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_galileo.is_bound()) {
ret_val.galileo() = single_value->field_galileo.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void GANSS__Location__Type_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 @BSSGP_Types.GANSS_Location_Type.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GANSS__Location__Type_template[list_length];
}

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

OCTETSTRING_template& GANSS__Location__Type_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& GANSS__Location__Type_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.GANSS_Location_Type.");
return single_value->field_iEI;
}

BITSTRING_template& GANSS__Location__Type_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& GANSS__Location__Type_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.GANSS_Location_Type.");
return single_value->field_ext;
}

LIN2__2a_template& GANSS__Location__Type_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& GANSS__Location__Type_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.GANSS_Location_Type.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& GANSS__Location__Type_template::galileo()
{
set_specific();
return single_value->field_galileo;
}

const BITSTRING_template& GANSS__Location__Type_template::galileo() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field galileo of a non-specific template of type @BSSGP_Types.GANSS_Location_Type.");
return single_value->field_galileo;
}

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

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

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

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

void GANSS__Location__Type_template::log_match(const GANSS__Location__Type& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_galileo.match(match_value.galileo(), legacy)){
TTCN_Logger::log_logmatch_info(".galileo");
single_value->field_galileo.log_match(match_value.galileo(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", galileo := ");
single_value->field_galileo.log_match(match_value.galileo(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void GANSS__Location__Type_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_galileo.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new GANSS__Location__Type_template[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 @BSSGP_Types.GANSS_Location_Type.");
}
}

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

void GANSS__Location__Type_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Location_Type");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Location_Type");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Location_Type");
single_value->field_galileo.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Location_Type");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Location_Type");
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 : "@BSSGP_Types.GANSS_Location_Type");
}

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

boolean GANSS__Location__Type_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 GANSS__Positioning__DataValue GANSS__Positioning__DataList::UNBOUND_ELEM;
GANSS__Positioning__DataList::GANSS__Positioning__DataList()
{
val_ptr = NULL;
}

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

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

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

void GANSS__Positioning__DataList::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.");
}
}

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

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

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

boolean GANSS__Positioning__DataList::operator==(const GANSS__Positioning__DataList& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
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;
}

GANSS__Positioning__DataValue& GANSS__Positioning__DataList::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.GANSS_Positioning_DataList 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 = (GANSS__Positioning__DataValue**)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 GANSS__Positioning__DataValue(*(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 GANSS__Positioning__DataValue;
}
return *val_ptr->value_elements[index_value];
}

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

const GANSS__Positioning__DataValue& GANSS__Positioning__DataList::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.GANSS_Positioning_DataList using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BSSGP_Types.GANSS_Positioning_DataList: 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 GANSS__Positioning__DataValue& GANSS__Positioning__DataList::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.GANSS_Positioning_DataList.");
return (*this)[(int)index_value];
}

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

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

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

GANSS__Positioning__DataList GANSS__Positioning__DataList::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
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;
GANSS__Positioning__DataList 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 GANSS__Positioning__DataValue(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

GANSS__Positioning__DataList GANSS__Positioning__DataList::operator+(const GANSS__Positioning__DataList& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BSSGP_Types.GANSS_Positioning_DataList concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
GANSS__Positioning__DataList 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 GANSS__Positioning__DataValue(*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 GANSS__Positioning__DataValue(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

GANSS__Positioning__DataList GANSS__Positioning__DataList::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Types.GANSS_Positioning_DataList","element");
GANSS__Positioning__DataList 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 GANSS__Positioning__DataValue(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

GANSS__Positioning__DataList GANSS__Positioning__DataList::replace(int index, int len, const GANSS__Positioning__DataList& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BSSGP_Types.GANSS_Positioning_DataList","element");
GANSS__Positioning__DataList 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 GANSS__Positioning__DataValue(*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 GANSS__Positioning__DataValue(*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 GANSS__Positioning__DataValue(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

GANSS__Positioning__DataList GANSS__Positioning__DataList::replace(int index, int len, const GANSS__Positioning__DataList_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 GANSS__Positioning__DataList::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BSSGP_Types.GANSS_Positioning_DataList.");
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 = (GANSS__Positioning__DataValue**)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 GANSS__Positioning__DataValue(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (GANSS__Positioning__DataValue**)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 @BSSGP_Types.GANSS_Positioning_DataList: %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 = (GANSS__Positioning__DataValue**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean GANSS__Positioning__DataList::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 GANSS__Positioning__DataList::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
return val_ptr->n_elements;
}

int GANSS__Positioning__DataList::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
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 GANSS__Positioning__DataList::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 GANSS__Positioning__DataList::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 GANSS__Positioning__DataList::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", "@BSSGP_Types.GANSS_Positioning_DataList");
    }
    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", "@BSSGP_Types.GANSS_Positioning_DataList");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void GANSS__Positioning__DataList::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BSSGP_Types.GANSS_Positioning_DataList.");
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 GANSS__Positioning__DataList::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 @BSSGP_Types.GANSS_Positioning_DataList.");
val_ptr->value_elements = (GANSS__Positioning__DataValue**)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 GANSS__Positioning__DataValue;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

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

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

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

int GANSS__Positioning__DataList::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 GANSS__Positioning__DataList_template::copy_value(const GANSS__Positioning__DataList& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Types.GANSS_Positioning_DataList with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (GANSS__Positioning__DataValue_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 GANSS__Positioning__DataValue_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new GANSS__Positioning__DataValue_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void GANSS__Positioning__DataList_template::copy_template(const GANSS__Positioning__DataList_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 = (GANSS__Positioning__DataValue_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 GANSS__Positioning__DataValue_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new GANSS__Positioning__DataValue_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 GANSS__Positioning__DataList_template[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 GANSS__Positioning__DataList_template(*other_value.implication_.precondition);
implication_.implied_template = new GANSS__Positioning__DataList_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 @BSSGP_Types.GANSS_Positioning_DataList.");
break;
}
set_selection(other_value);
}

boolean GANSS__Positioning__DataList_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 GANSS__Positioning__DataList_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const GANSS__Positioning__DataList*)value_ptr)[value_index], legacy);
else return ((const GANSS__Positioning__DataList_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

GANSS__Positioning__DataList_template::GANSS__Positioning__DataList_template()
{
}

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

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

GANSS__Positioning__DataList_template::GANSS__Positioning__DataList_template(const GANSS__Positioning__DataList& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

GANSS__Positioning__DataList_template& GANSS__Positioning__DataList_template::operator=(const OPTIONAL<GANSS__Positioning__DataList>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GANSS__Positioning__DataList&)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 @BSSGP_Types.GANSS_Positioning_DataList.");
}
return *this;
}

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

GANSS__Positioning__DataValue_template& GANSS__Positioning__DataList_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.GANSS_Positioning_DataList 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 @BSSGP_Types.GANSS_Positioning_DataList.");
    break;
}
return *single_value.value_elements[index_value];
}

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

const GANSS__Positioning__DataValue_template& GANSS__Positioning__DataList_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.GANSS_Positioning_DataList using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BSSGP_Types.GANSS_Positioning_DataList.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Types.GANSS_Positioning_DataList: 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 GANSS__Positioning__DataValue_template& GANSS__Positioning__DataList_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.GANSS_Positioning_DataList.");
return (*this)[(int)index_value];
}

void GANSS__Positioning__DataList_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BSSGP_Types.GANSS_Positioning_DataList.");
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 = (GANSS__Positioning__DataValue_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 GANSS__Positioning__DataValue_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 GANSS__Positioning__DataValue_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 = (GANSS__Positioning__DataValue_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int GANSS__Positioning__DataList_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 GANSS__Positioning__DataList_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 @BSSGP_Types.GANSS_Positioning_DataList 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 @BSSGP_Types.GANSS_Positioning_DataList 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 @BSSGP_Types.GANSS_Positioning_DataList 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 @BSSGP_Types.GANSS_Positioning_DataList 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 @BSSGP_Types.GANSS_Positioning_DataList 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 @BSSGP_Types.GANSS_Positioning_DataList containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BSSGP_Types.GANSS_Positioning_DataList.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BSSGP_Types.GANSS_Positioning_DataList");
}

boolean GANSS__Positioning__DataList_template::match(const GANSS__Positioning__DataList& 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 @BSSGP_Types.GANSS_Positioning_DataList.");
}
return FALSE;
}

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

GANSS__Positioning__DataList GANSS__Positioning__DataList_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 @BSSGP_Types.GANSS_Positioning_DataList.");
GANSS__Positioning__DataList 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;
}

GANSS__Positioning__DataList GANSS__Positioning__DataList_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);
}

GANSS__Positioning__DataList GANSS__Positioning__DataList_template::replace(int index, int len, const GANSS__Positioning__DataList_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());
}

GANSS__Positioning__DataList GANSS__Positioning__DataList_template::replace(int index, int len, const GANSS__Positioning__DataList& 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 GANSS__Positioning__DataList_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 GANSS__Positioning__DataList_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BSSGP_Types.GANSS_Positioning_DataList.");
}
set_selection(template_type);
}

GANSS__Positioning__DataList_template& GANSS__Positioning__DataList_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 @BSSGP_Types.GANSS_Positioning_DataList.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BSSGP_Types.GANSS_Positioning_DataList.");
return value_list.list_value[list_index];
}

void GANSS__Positioning__DataList_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 GANSS__Positioning__DataList_template::log_match(const GANSS__Positioning__DataList& 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 GANSS__Positioning__DataList_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 @BSSGP_Types.GANSS_Positioning_DataList.");
}
}

void GANSS__Positioning__DataList_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 @BSSGP_Types.GANSS_Positioning_DataList.");
single_value.value_elements = (GANSS__Positioning__DataValue_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 GANSS__Positioning__DataValue_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 GANSS__Positioning__DataList_template[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 @BSSGP_Types.GANSS_Positioning_DataList.");
}
}

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

boolean GANSS__Positioning__DataList_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 GANSS__Positioning__DataList_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: {
    GANSS__Positioning__DataList_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: {
    GANSS__Positioning__DataList_template* precondition = new GANSS__Positioning__DataList_template;
    precondition->set_param(*param.get_elem(0));
    GANSS__Positioning__DataList_template* implied_template = new GANSS__Positioning__DataList_template;
    implied_template->set_param(*param.get_elem(1));
    *this = GANSS__Positioning__DataList_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BSSGP_Types.GANSS_Positioning_DataList");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void GANSS__Positioning__DataList_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 : "@BSSGP_Types.GANSS_Positioning_DataList");
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 : "@BSSGP_Types.GANSS_Positioning_DataList");
}

boolean GANSS__Positioning__DataList_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);
}
}
GANSS__Positioning__DataValue::GANSS__Positioning__DataValue()
{
}

GANSS__Positioning__DataValue::GANSS__Positioning__DataValue(const BITSTRING& par_usage,
    const BITSTRING& par_gANSS__ID,
    const BITSTRING& par_method)
  :   field_usage(par_usage),
  field_gANSS__ID(par_gANSS__ID),
  field_method(par_method)
{
}

GANSS__Positioning__DataValue::GANSS__Positioning__DataValue(const GANSS__Positioning__DataValue& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.GANSS_Positioning_DataValue.");
if (other_value.usage().is_bound()) field_usage = other_value.usage();
else field_usage.clean_up();
if (other_value.gANSS__ID().is_bound()) field_gANSS__ID = other_value.gANSS__ID();
else field_gANSS__ID.clean_up();
if (other_value.method().is_bound()) field_method = other_value.method();
else field_method.clean_up();
}

void GANSS__Positioning__DataValue::clean_up()
{
field_usage.clean_up();
field_gANSS__ID.clean_up();
field_method.clean_up();
}

const TTCN_Typedescriptor_t* GANSS__Positioning__DataValue::get_descriptor() const { return &GANSS__Positioning__DataValue_descr_; }
GANSS__Positioning__DataValue& GANSS__Positioning__DataValue::operator=(const GANSS__Positioning__DataValue& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.GANSS_Positioning_DataValue.");
  if (other_value.usage().is_bound()) field_usage = other_value.usage();
  else field_usage.clean_up();
  if (other_value.gANSS__ID().is_bound()) field_gANSS__ID = other_value.gANSS__ID();
  else field_gANSS__ID.clean_up();
  if (other_value.method().is_bound()) field_method = other_value.method();
  else field_method.clean_up();
}
return *this;
}

boolean GANSS__Positioning__DataValue::operator==(const GANSS__Positioning__DataValue& other_value) const
{
return field_usage==other_value.field_usage
  && field_gANSS__ID==other_value.field_gANSS__ID
  && field_method==other_value.field_method;
}

boolean GANSS__Positioning__DataValue::is_bound() const
{
return (field_usage.is_bound())
  || (field_gANSS__ID.is_bound())
  || (field_method.is_bound());
}
boolean GANSS__Positioning__DataValue::is_value() const
{
return field_usage.is_value()
  && field_gANSS__ID.is_value()
  && field_method.is_value();
}
void GANSS__Positioning__DataValue::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ usage := ");
field_usage.log();
TTCN_Logger::log_event_str(", gANSS_ID := ");
field_gANSS__ID.log();
TTCN_Logger::log_event_str(", method := ");
field_method.log();
TTCN_Logger::log_event_str(" }");
}

void GANSS__Positioning__DataValue::set_implicit_omit()
{
if (usage().is_bound()) usage().set_implicit_omit();
if (gANSS__ID().is_bound()) gANSS__ID().set_implicit_omit();
if (method().is_bound()) method().set_implicit_omit();
}

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

void GANSS__Positioning__DataValue::encode_text(Text_Buf& text_buf) const
{
field_usage.encode_text(text_buf);
field_gANSS__ID.encode_text(text_buf);
field_method.encode_text(text_buf);
}

void GANSS__Positioning__DataValue::decode_text(Text_Buf& text_buf)
{
field_usage.decode_text(text_buf);
field_gANSS__ID.decode_text(text_buf);
field_method.decode_text(text_buf);
}

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

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

int GANSS__Positioning__DataValue::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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_usage.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_gANSS__ID.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_method.RAW_decode(General__Types::BIT2_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 GANSS__Positioning__DataValue::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT2_descr_.raw);
  encoded_length += field_usage.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gANSS__ID.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_method.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct GANSS__Positioning__DataValue_template::single_value_struct {
BITSTRING_template field_usage;
BITSTRING_template field_gANSS__ID;
BITSTRING_template field_method;
};

void GANSS__Positioning__DataValue_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_usage = ANY_VALUE;
single_value->field_gANSS__ID = ANY_VALUE;
single_value->field_method = ANY_VALUE;
}
}
}

void GANSS__Positioning__DataValue_template::copy_value(const GANSS__Positioning__DataValue& other_value)
{
single_value = new single_value_struct;
if (other_value.usage().is_bound()) {
  single_value->field_usage = other_value.usage();
} else {
  single_value->field_usage.clean_up();
}
if (other_value.gANSS__ID().is_bound()) {
  single_value->field_gANSS__ID = other_value.gANSS__ID();
} else {
  single_value->field_gANSS__ID.clean_up();
}
if (other_value.method().is_bound()) {
  single_value->field_method = other_value.method();
} else {
  single_value->field_method.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GANSS__Positioning__DataValue_template::copy_template(const GANSS__Positioning__DataValue_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.usage().get_selection()) {
single_value->field_usage = other_value.usage();
} else {
single_value->field_usage.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gANSS__ID().get_selection()) {
single_value->field_gANSS__ID = other_value.gANSS__ID();
} else {
single_value->field_gANSS__ID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.method().get_selection()) {
single_value->field_method = other_value.method();
} else {
single_value->field_method.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 GANSS__Positioning__DataValue_template[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 GANSS__Positioning__DataValue_template(*other_value.implication_.precondition);
implication_.implied_template = new GANSS__Positioning__DataValue_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 @BSSGP_Types.GANSS_Positioning_DataValue.");
break;
}
set_selection(other_value);
}

GANSS__Positioning__DataValue_template::GANSS__Positioning__DataValue_template()
{
}

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

GANSS__Positioning__DataValue_template::GANSS__Positioning__DataValue_template(const GANSS__Positioning__DataValue& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

GANSS__Positioning__DataValue_template& GANSS__Positioning__DataValue_template::operator=(const OPTIONAL<GANSS__Positioning__DataValue>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GANSS__Positioning__DataValue&)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 @BSSGP_Types.GANSS_Positioning_DataValue.");
}
return *this;
}

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

boolean GANSS__Positioning__DataValue_template::match(const GANSS__Positioning__DataValue& 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.usage().is_bound()) return FALSE;
if(!single_value->field_usage.match(other_value.usage(), legacy))return FALSE;
if(!other_value.gANSS__ID().is_bound()) return FALSE;
if(!single_value->field_gANSS__ID.match(other_value.gANSS__ID(), legacy))return FALSE;
if(!other_value.method().is_bound()) return FALSE;
if(!single_value->field_method.match(other_value.method(), 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 @BSSGP_Types.GANSS_Positioning_DataValue.");
}
return FALSE;
}

boolean GANSS__Positioning__DataValue_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_usage.is_bound()
 || single_value->field_gANSS__ID.is_bound()
 || single_value->field_method.is_bound();
}

boolean GANSS__Positioning__DataValue_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_usage.is_value()
 && single_value->field_gANSS__ID.is_value()
 && single_value->field_method.is_value();
}

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

GANSS__Positioning__DataValue GANSS__Positioning__DataValue_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 @BSSGP_Types.GANSS_Positioning_DataValue.");
GANSS__Positioning__DataValue ret_val;
if (single_value->field_usage.is_bound()) {
ret_val.usage() = single_value->field_usage.valueof();
}
if (single_value->field_gANSS__ID.is_bound()) {
ret_val.gANSS__ID() = single_value->field_gANSS__ID.valueof();
}
if (single_value->field_method.is_bound()) {
ret_val.method() = single_value->field_method.valueof();
}
return ret_val;
}

void GANSS__Positioning__DataValue_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 @BSSGP_Types.GANSS_Positioning_DataValue.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GANSS__Positioning__DataValue_template[list_length];
}

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

BITSTRING_template& GANSS__Positioning__DataValue_template::usage()
{
set_specific();
return single_value->field_usage;
}

const BITSTRING_template& GANSS__Positioning__DataValue_template::usage() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field usage of a non-specific template of type @BSSGP_Types.GANSS_Positioning_DataValue.");
return single_value->field_usage;
}

BITSTRING_template& GANSS__Positioning__DataValue_template::gANSS__ID()
{
set_specific();
return single_value->field_gANSS__ID;
}

const BITSTRING_template& GANSS__Positioning__DataValue_template::gANSS__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gANSS_ID of a non-specific template of type @BSSGP_Types.GANSS_Positioning_DataValue.");
return single_value->field_gANSS__ID;
}

BITSTRING_template& GANSS__Positioning__DataValue_template::method()
{
set_specific();
return single_value->field_method;
}

const BITSTRING_template& GANSS__Positioning__DataValue_template::method() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field method of a non-specific template of type @BSSGP_Types.GANSS_Positioning_DataValue.");
return single_value->field_method;
}

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

void GANSS__Positioning__DataValue_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ usage := ");
single_value->field_usage.log();
TTCN_Logger::log_event_str(", gANSS_ID := ");
single_value->field_gANSS__ID.log();
TTCN_Logger::log_event_str(", method := ");
single_value->field_method.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 GANSS__Positioning__DataValue_template::log_match(const GANSS__Positioning__DataValue& 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_usage.match(match_value.usage(), legacy)){
TTCN_Logger::log_logmatch_info(".usage");
single_value->field_usage.log_match(match_value.usage(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gANSS__ID.match(match_value.gANSS__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".gANSS_ID");
single_value->field_gANSS__ID.log_match(match_value.gANSS__ID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_method.match(match_value.method(), legacy)){
TTCN_Logger::log_logmatch_info(".method");
single_value->field_method.log_match(match_value.method(), 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("{ usage := ");
single_value->field_usage.log_match(match_value.usage(), legacy);
TTCN_Logger::log_event_str(", gANSS_ID := ");
single_value->field_gANSS__ID.log_match(match_value.gANSS__ID(), legacy);
TTCN_Logger::log_event_str(", method := ");
single_value->field_method.log_match(match_value.method(), 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 GANSS__Positioning__DataValue_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_usage.encode_text(text_buf);
single_value->field_gANSS__ID.encode_text(text_buf);
single_value->field_method.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 @BSSGP_Types.GANSS_Positioning_DataValue.");
}
}

void GANSS__Positioning__DataValue_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_usage.decode_text(text_buf);
single_value->field_gANSS__ID.decode_text(text_buf);
single_value->field_method.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 GANSS__Positioning__DataValue_template[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 @BSSGP_Types.GANSS_Positioning_DataValue.");
}
}

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

void GANSS__Positioning__DataValue_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_usage.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Positioning_DataValue");
single_value->field_gANSS__ID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Positioning_DataValue");
single_value->field_method.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Positioning_DataValue");
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 : "@BSSGP_Types.GANSS_Positioning_DataValue");
}

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

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

GANSS__Positioning__Data::GANSS__Positioning__Data()
{
}

GANSS__Positioning__Data::GANSS__Positioning__Data(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const GANSS__Positioning__DataList& par_gANSS__Positioning__DataList)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_gANSS__Positioning__DataList(par_gANSS__Positioning__DataList)
{
}

GANSS__Positioning__Data::GANSS__Positioning__Data(const GANSS__Positioning__Data& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.GANSS_Positioning_Data.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.gANSS__Positioning__DataList().is_bound()) field_gANSS__Positioning__DataList = other_value.gANSS__Positioning__DataList();
else field_gANSS__Positioning__DataList.clean_up();
}

void GANSS__Positioning__Data::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_gANSS__Positioning__DataList.clean_up();
}

const TTCN_Typedescriptor_t* GANSS__Positioning__Data::get_descriptor() const { return &GANSS__Positioning__Data_descr_; }
GANSS__Positioning__Data& GANSS__Positioning__Data::operator=(const GANSS__Positioning__Data& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.GANSS_Positioning_Data.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.gANSS__Positioning__DataList().is_bound()) field_gANSS__Positioning__DataList = other_value.gANSS__Positioning__DataList();
  else field_gANSS__Positioning__DataList.clean_up();
}
return *this;
}

boolean GANSS__Positioning__Data::operator==(const GANSS__Positioning__Data& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_gANSS__Positioning__DataList==other_value.field_gANSS__Positioning__DataList;
}

boolean GANSS__Positioning__Data::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_gANSS__Positioning__DataList.is_bound());
}
boolean GANSS__Positioning__Data::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_gANSS__Positioning__DataList.is_value();
}
void GANSS__Positioning__Data::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", gANSS_Positioning_DataList := ");
field_gANSS__Positioning__DataList.log();
TTCN_Logger::log_event_str(" }");
}

void GANSS__Positioning__Data::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (gANSS__Positioning__DataList().is_bound()) gANSS__Positioning__DataList().set_implicit_omit();
}

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

void GANSS__Positioning__Data::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_gANSS__Positioning__DataList.encode_text(text_buf);
}

void GANSS__Positioning__Data::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_gANSS__Positioning__DataList.decode_text(text_buf);
}

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

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

int GANSS__Positioning__Data::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, GANSS__Positioning__Data_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(GANSS__Positioning__Data_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, GANSS__Positioning__Data_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(GANSS__Positioning__Data_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, GANSS__Positioning__DataList_descr_.raw->forceomit);
  decoded_field_length = field_gANSS__Positioning__DataList.RAW_decode(GANSS__Positioning__DataList_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_127) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GANSS__Positioning__Data::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GANSS__Positioning__Data_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, GANSS__Positioning__Data_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GANSS__Positioning__DataList_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(GANSS__Positioning__Data_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(GANSS__Positioning__Data_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_gANSS__Positioning__DataList.RAW_encode(GANSS__Positioning__DataList_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(GANSS__Positioning__Data_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(GANSS__Positioning__Data_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_127) {
  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_127.RAW_encode(General__Types::OCT1_descr_,*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 GANSS__Positioning__Data_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
GANSS__Positioning__DataList_template field_gANSS__Positioning__DataList;
};

void GANSS__Positioning__Data_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_gANSS__Positioning__DataList = ANY_VALUE;
}
}
}

void GANSS__Positioning__Data_template::copy_value(const GANSS__Positioning__Data& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.gANSS__Positioning__DataList().is_bound()) {
  single_value->field_gANSS__Positioning__DataList = other_value.gANSS__Positioning__DataList();
} else {
  single_value->field_gANSS__Positioning__DataList.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GANSS__Positioning__Data_template::copy_template(const GANSS__Positioning__Data_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gANSS__Positioning__DataList().get_selection()) {
single_value->field_gANSS__Positioning__DataList = other_value.gANSS__Positioning__DataList();
} else {
single_value->field_gANSS__Positioning__DataList.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 GANSS__Positioning__Data_template[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 GANSS__Positioning__Data_template(*other_value.implication_.precondition);
implication_.implied_template = new GANSS__Positioning__Data_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 @BSSGP_Types.GANSS_Positioning_Data.");
break;
}
set_selection(other_value);
}

GANSS__Positioning__Data_template::GANSS__Positioning__Data_template()
{
}

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

GANSS__Positioning__Data_template::GANSS__Positioning__Data_template(const GANSS__Positioning__Data& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

GANSS__Positioning__Data_template& GANSS__Positioning__Data_template::operator=(const OPTIONAL<GANSS__Positioning__Data>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GANSS__Positioning__Data&)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 @BSSGP_Types.GANSS_Positioning_Data.");
}
return *this;
}

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

boolean GANSS__Positioning__Data_template::match(const GANSS__Positioning__Data& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.gANSS__Positioning__DataList().is_bound()) return FALSE;
if(!single_value->field_gANSS__Positioning__DataList.match(other_value.gANSS__Positioning__DataList(), 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 @BSSGP_Types.GANSS_Positioning_Data.");
}
return FALSE;
}

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

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

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

GANSS__Positioning__Data GANSS__Positioning__Data_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 @BSSGP_Types.GANSS_Positioning_Data.");
GANSS__Positioning__Data ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_gANSS__Positioning__DataList.is_bound()) {
ret_val.gANSS__Positioning__DataList() = single_value->field_gANSS__Positioning__DataList.valueof();
}
return ret_val;
}

void GANSS__Positioning__Data_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 @BSSGP_Types.GANSS_Positioning_Data.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GANSS__Positioning__Data_template[list_length];
}

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

OCTETSTRING_template& GANSS__Positioning__Data_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& GANSS__Positioning__Data_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.GANSS_Positioning_Data.");
return single_value->field_iEI;
}

BITSTRING_template& GANSS__Positioning__Data_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& GANSS__Positioning__Data_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.GANSS_Positioning_Data.");
return single_value->field_ext;
}

LIN2__2a_template& GANSS__Positioning__Data_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& GANSS__Positioning__Data_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.GANSS_Positioning_Data.");
return single_value->field_lengthIndicator;
}

GANSS__Positioning__DataList_template& GANSS__Positioning__Data_template::gANSS__Positioning__DataList()
{
set_specific();
return single_value->field_gANSS__Positioning__DataList;
}

const GANSS__Positioning__DataList_template& GANSS__Positioning__Data_template::gANSS__Positioning__DataList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gANSS_Positioning_DataList of a non-specific template of type @BSSGP_Types.GANSS_Positioning_Data.");
return single_value->field_gANSS__Positioning__DataList;
}

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

void GANSS__Positioning__Data_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", gANSS_Positioning_DataList := ");
single_value->field_gANSS__Positioning__DataList.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 GANSS__Positioning__Data_template::log_match(const GANSS__Positioning__Data& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gANSS__Positioning__DataList.match(match_value.gANSS__Positioning__DataList(), legacy)){
TTCN_Logger::log_logmatch_info(".gANSS_Positioning_DataList");
single_value->field_gANSS__Positioning__DataList.log_match(match_value.gANSS__Positioning__DataList(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", gANSS_Positioning_DataList := ");
single_value->field_gANSS__Positioning__DataList.log_match(match_value.gANSS__Positioning__DataList(), 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 GANSS__Positioning__Data_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_gANSS__Positioning__DataList.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 @BSSGP_Types.GANSS_Positioning_Data.");
}
}

void GANSS__Positioning__Data_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_gANSS__Positioning__DataList.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 GANSS__Positioning__Data_template[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 @BSSGP_Types.GANSS_Positioning_Data.");
}
}

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

void GANSS__Positioning__Data_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Positioning_Data");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Positioning_Data");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Positioning_Data");
single_value->field_gANSS__Positioning__DataList.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GANSS_Positioning_Data");
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 : "@BSSGP_Types.GANSS_Positioning_Data");
}

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

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

Flow__Control__Granularity::Flow__Control__Granularity()
{
}

Flow__Control__Granularity::Flow__Control__Granularity(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_granularity,
    const BITSTRING& par_reserved)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_granularity(par_granularity),
  field_reserved(par_reserved)
{
}

Flow__Control__Granularity::Flow__Control__Granularity(const Flow__Control__Granularity& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Flow_Control_Granularity.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.granularity().is_bound()) field_granularity = other_value.granularity();
else field_granularity.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void Flow__Control__Granularity::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_granularity.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* Flow__Control__Granularity::get_descriptor() const { return &Flow__Control__Granularity_descr_; }
Flow__Control__Granularity& Flow__Control__Granularity::operator=(const Flow__Control__Granularity& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Flow_Control_Granularity.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.granularity().is_bound()) field_granularity = other_value.granularity();
  else field_granularity.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

boolean Flow__Control__Granularity::operator==(const Flow__Control__Granularity& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_granularity==other_value.field_granularity
  && field_reserved==other_value.field_reserved;
}

boolean Flow__Control__Granularity::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_granularity.is_bound())
  || (field_reserved.is_bound());
}
boolean Flow__Control__Granularity::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_granularity.is_value()
  && field_reserved.is_value();
}
void Flow__Control__Granularity::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", granularity := ");
field_granularity.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void Flow__Control__Granularity::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (granularity().is_bound()) granularity().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

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

void Flow__Control__Granularity::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_granularity.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void Flow__Control__Granularity::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_granularity.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

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

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

int Flow__Control__Granularity::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Flow__Control__Granularity_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Flow__Control__Granularity_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Flow__Control__Granularity_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Flow__Control__Granularity_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_granularity.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(General__Types::BIT6_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_62) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Flow__Control__Granularity::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Flow__Control__Granularity_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Flow__Control__Granularity_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT6_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Flow__Control__Granularity_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Flow__Control__Granularity_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_granularity.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_reserved.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[4]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Flow__Control__Granularity_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Flow__Control__Granularity_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_62) {
  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_62.RAW_encode(General__Types::OCT1_descr_,*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 Flow__Control__Granularity_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_granularity;
BITSTRING_template field_reserved;
};

void Flow__Control__Granularity_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_granularity = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
}
}
}

void Flow__Control__Granularity_template::copy_value(const Flow__Control__Granularity& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.granularity().is_bound()) {
  single_value->field_granularity = other_value.granularity();
} else {
  single_value->field_granularity.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Flow__Control__Granularity_template::copy_template(const Flow__Control__Granularity_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.granularity().get_selection()) {
single_value->field_granularity = other_value.granularity();
} else {
single_value->field_granularity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.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 Flow__Control__Granularity_template[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 Flow__Control__Granularity_template(*other_value.implication_.precondition);
implication_.implied_template = new Flow__Control__Granularity_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 @BSSGP_Types.Flow_Control_Granularity.");
break;
}
set_selection(other_value);
}

Flow__Control__Granularity_template::Flow__Control__Granularity_template()
{
}

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

Flow__Control__Granularity_template::Flow__Control__Granularity_template(const Flow__Control__Granularity& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Flow__Control__Granularity_template& Flow__Control__Granularity_template::operator=(const OPTIONAL<Flow__Control__Granularity>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Flow__Control__Granularity&)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 @BSSGP_Types.Flow_Control_Granularity.");
}
return *this;
}

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

boolean Flow__Control__Granularity_template::match(const Flow__Control__Granularity& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.granularity().is_bound()) return FALSE;
if(!single_value->field_granularity.match(other_value.granularity(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), 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 @BSSGP_Types.Flow_Control_Granularity.");
}
return FALSE;
}

boolean Flow__Control__Granularity_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_granularity.is_bound()
 || single_value->field_reserved.is_bound();
}

boolean Flow__Control__Granularity_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_granularity.is_value()
 && single_value->field_reserved.is_value();
}

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

Flow__Control__Granularity Flow__Control__Granularity_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 @BSSGP_Types.Flow_Control_Granularity.");
Flow__Control__Granularity ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_granularity.is_bound()) {
ret_val.granularity() = single_value->field_granularity.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

void Flow__Control__Granularity_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 @BSSGP_Types.Flow_Control_Granularity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Flow__Control__Granularity_template[list_length];
}

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

OCTETSTRING_template& Flow__Control__Granularity_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Flow__Control__Granularity_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Flow_Control_Granularity.");
return single_value->field_iEI;
}

BITSTRING_template& Flow__Control__Granularity_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Flow__Control__Granularity_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Flow_Control_Granularity.");
return single_value->field_ext;
}

LIN2__2a_template& Flow__Control__Granularity_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Flow__Control__Granularity_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Flow_Control_Granularity.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& Flow__Control__Granularity_template::granularity()
{
set_specific();
return single_value->field_granularity;
}

const BITSTRING_template& Flow__Control__Granularity_template::granularity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field granularity of a non-specific template of type @BSSGP_Types.Flow_Control_Granularity.");
return single_value->field_granularity;
}

BITSTRING_template& Flow__Control__Granularity_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& Flow__Control__Granularity_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @BSSGP_Types.Flow_Control_Granularity.");
return single_value->field_reserved;
}

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

void Flow__Control__Granularity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", granularity := ");
single_value->field_granularity.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.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 Flow__Control__Granularity_template::log_match(const Flow__Control__Granularity& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_granularity.match(match_value.granularity(), legacy)){
TTCN_Logger::log_logmatch_info(".granularity");
single_value->field_granularity.log_match(match_value.granularity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", granularity := ");
single_value->field_granularity.log_match(match_value.granularity(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), 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 Flow__Control__Granularity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_granularity.encode_text(text_buf);
single_value->field_reserved.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 @BSSGP_Types.Flow_Control_Granularity.");
}
}

void Flow__Control__Granularity_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_granularity.decode_text(text_buf);
single_value->field_reserved.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 Flow__Control__Granularity_template[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 @BSSGP_Types.Flow_Control_Granularity.");
}
}

void Flow__Control__Granularity_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: {
    Flow__Control__Granularity_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 @BSSGP_Types.Flow_Control_Granularity 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) granularity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reserved().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "granularity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          granularity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Flow_Control_Granularity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Flow__Control__Granularity_template* precondition = new Flow__Control__Granularity_template;
    precondition->set_param(*param.get_elem(0));
    Flow__Control__Granularity_template* implied_template = new Flow__Control__Granularity_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Flow__Control__Granularity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Flow_Control_Granularity");
  }
  is_ifpresent = param.get_ifpresent();
}

void Flow__Control__Granularity_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Flow_Control_Granularity");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Flow_Control_Granularity");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Flow_Control_Granularity");
single_value->field_granularity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Flow_Control_Granularity");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Flow_Control_Granularity");
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 : "@BSSGP_Types.Flow_Control_Granularity");
}

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

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

ENB__Identifier::ENB__Identifier()
{
}

ENB__Identifier::ENB__Identifier(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const HEXSTRING& par_mccDigit1,
    const HEXSTRING& par_mccDigit2,
    const HEXSTRING& par_mccDigit3,
    const HEXSTRING& par_mncDigit3,
    const HEXSTRING& par_mncDigit1,
    const HEXSTRING& par_mncDigit2,
    const OCTETSTRING& par_tac,
    const OCTETSTRING& par_globalEnbID)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_mccDigit1(par_mccDigit1),
  field_mccDigit2(par_mccDigit2),
  field_mccDigit3(par_mccDigit3),
  field_mncDigit3(par_mncDigit3),
  field_mncDigit1(par_mncDigit1),
  field_mncDigit2(par_mncDigit2),
  field_tac(par_tac),
  field_globalEnbID(par_globalEnbID)
{
}

ENB__Identifier::ENB__Identifier(const ENB__Identifier& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.ENB_Identifier.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
else field_mccDigit1.clean_up();
if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
else field_mccDigit2.clean_up();
if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
else field_mccDigit3.clean_up();
if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
else field_mncDigit3.clean_up();
if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
else field_mncDigit1.clean_up();
if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
else field_mncDigit2.clean_up();
if (other_value.tac().is_bound()) field_tac = other_value.tac();
else field_tac.clean_up();
if (other_value.globalEnbID().is_bound()) field_globalEnbID = other_value.globalEnbID();
else field_globalEnbID.clean_up();
}

void ENB__Identifier::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_mccDigit1.clean_up();
field_mccDigit2.clean_up();
field_mccDigit3.clean_up();
field_mncDigit3.clean_up();
field_mncDigit1.clean_up();
field_mncDigit2.clean_up();
field_tac.clean_up();
field_globalEnbID.clean_up();
}

const TTCN_Typedescriptor_t* ENB__Identifier::get_descriptor() const { return &ENB__Identifier_descr_; }
ENB__Identifier& ENB__Identifier::operator=(const ENB__Identifier& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.ENB_Identifier.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
  else field_mccDigit1.clean_up();
  if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
  else field_mccDigit2.clean_up();
  if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
  else field_mccDigit3.clean_up();
  if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
  else field_mncDigit3.clean_up();
  if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
  else field_mncDigit1.clean_up();
  if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
  else field_mncDigit2.clean_up();
  if (other_value.tac().is_bound()) field_tac = other_value.tac();
  else field_tac.clean_up();
  if (other_value.globalEnbID().is_bound()) field_globalEnbID = other_value.globalEnbID();
  else field_globalEnbID.clean_up();
}
return *this;
}

boolean ENB__Identifier::operator==(const ENB__Identifier& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_mccDigit1==other_value.field_mccDigit1
  && field_mccDigit2==other_value.field_mccDigit2
  && field_mccDigit3==other_value.field_mccDigit3
  && field_mncDigit3==other_value.field_mncDigit3
  && field_mncDigit1==other_value.field_mncDigit1
  && field_mncDigit2==other_value.field_mncDigit2
  && field_tac==other_value.field_tac
  && field_globalEnbID==other_value.field_globalEnbID;
}

boolean ENB__Identifier::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mccDigit1.is_bound())
  || (field_mccDigit2.is_bound())
  || (field_mccDigit3.is_bound())
  || (field_mncDigit3.is_bound())
  || (field_mncDigit1.is_bound())
  || (field_mncDigit2.is_bound())
  || (field_tac.is_bound())
  || (field_globalEnbID.is_bound());
}
boolean ENB__Identifier::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_mccDigit1.is_value()
  && field_mccDigit2.is_value()
  && field_mccDigit3.is_value()
  && field_mncDigit3.is_value()
  && field_mncDigit1.is_value()
  && field_mncDigit2.is_value()
  && field_tac.is_value()
  && field_globalEnbID.is_value();
}
void ENB__Identifier::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
field_mncDigit2.log();
TTCN_Logger::log_event_str(", tac := ");
field_tac.log();
TTCN_Logger::log_event_str(", globalEnbID := ");
field_globalEnbID.log();
TTCN_Logger::log_event_str(" }");
}

void ENB__Identifier::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
if (tac().is_bound()) tac().set_implicit_omit();
if (globalEnbID().is_bound()) globalEnbID().set_implicit_omit();
}

void ENB__Identifier::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (11<param.get_size()) {
      param.error("record value of type @BSSGP_Types.ENB_Identifier has 11 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tac().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) globalEnbID().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "globalEnbID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globalEnbID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.ENB_Identifier: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.ENB_Identifier");
  }
}

void ENB__Identifier::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mccDigit1.encode_text(text_buf);
field_mccDigit2.encode_text(text_buf);
field_mccDigit3.encode_text(text_buf);
field_mncDigit3.encode_text(text_buf);
field_mncDigit1.encode_text(text_buf);
field_mncDigit2.encode_text(text_buf);
field_tac.encode_text(text_buf);
field_globalEnbID.encode_text(text_buf);
}

void ENB__Identifier::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mccDigit1.decode_text(text_buf);
field_mccDigit2.decode_text(text_buf);
field_mccDigit3.decode_text(text_buf);
field_mncDigit3.decode_text(text_buf);
field_mncDigit1.decode_text(text_buf);
field_mncDigit2.decode_text(text_buf);
field_tac.decode_text(text_buf);
field_globalEnbID.decode_text(text_buf);
}

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

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

int ENB__Identifier::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, ENB__Identifier_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(ENB__Identifier_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, ENB__Identifier_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(ENB__Identifier_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), 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());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_9_force_omit(9, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tac.RAW_decode(General__Types::OCT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_10_force_omit(10, force_omit, General__Types::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_globalEnbID.RAW_decode(General__Types::OCTN_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_96) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ENB__Identifier::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 11;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(11);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ENB__Identifier_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ENB__Identifier_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, General__Types::OCTN_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(ENB__Identifier_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(ENB__Identifier_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_tac.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_globalEnbID.RAW_encode(General__Types::OCTN_descr_, *myleaf.body.node.nodes[10]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(8);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[8]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[8]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[6].level = myleaf.body.node.nodes[9]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[6].pos = myleaf.body.node.nodes[9]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[7].level = myleaf.body.node.nodes[10]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[7].pos = myleaf.body.node.nodes[10]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(ENB__Identifier_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(ENB__Identifier_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_96) {
  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_96.RAW_encode(General__Types::OCT1_descr_,*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 ENB__Identifier_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
HEXSTRING_template field_mccDigit1;
HEXSTRING_template field_mccDigit2;
HEXSTRING_template field_mccDigit3;
HEXSTRING_template field_mncDigit3;
HEXSTRING_template field_mncDigit1;
HEXSTRING_template field_mncDigit2;
OCTETSTRING_template field_tac;
OCTETSTRING_template field_globalEnbID;
};

void ENB__Identifier_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_mccDigit1 = ANY_VALUE;
single_value->field_mccDigit2 = ANY_VALUE;
single_value->field_mccDigit3 = ANY_VALUE;
single_value->field_mncDigit3 = ANY_VALUE;
single_value->field_mncDigit1 = ANY_VALUE;
single_value->field_mncDigit2 = ANY_VALUE;
single_value->field_tac = ANY_VALUE;
single_value->field_globalEnbID = ANY_VALUE;
}
}
}

void ENB__Identifier_template::copy_value(const ENB__Identifier& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mccDigit1().is_bound()) {
  single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
  single_value->field_mccDigit1.clean_up();
}
if (other_value.mccDigit2().is_bound()) {
  single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
  single_value->field_mccDigit2.clean_up();
}
if (other_value.mccDigit3().is_bound()) {
  single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
  single_value->field_mccDigit3.clean_up();
}
if (other_value.mncDigit3().is_bound()) {
  single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
  single_value->field_mncDigit3.clean_up();
}
if (other_value.mncDigit1().is_bound()) {
  single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
  single_value->field_mncDigit1.clean_up();
}
if (other_value.mncDigit2().is_bound()) {
  single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
  single_value->field_mncDigit2.clean_up();
}
if (other_value.tac().is_bound()) {
  single_value->field_tac = other_value.tac();
} else {
  single_value->field_tac.clean_up();
}
if (other_value.globalEnbID().is_bound()) {
  single_value->field_globalEnbID = other_value.globalEnbID();
} else {
  single_value->field_globalEnbID.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ENB__Identifier_template::copy_template(const ENB__Identifier_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit1().get_selection()) {
single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
single_value->field_mccDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit2().get_selection()) {
single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
single_value->field_mccDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit3().get_selection()) {
single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
single_value->field_mccDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit3().get_selection()) {
single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
single_value->field_mncDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit1().get_selection()) {
single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
single_value->field_mncDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit2().get_selection()) {
single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
single_value->field_mncDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tac().get_selection()) {
single_value->field_tac = other_value.tac();
} else {
single_value->field_tac.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalEnbID().get_selection()) {
single_value->field_globalEnbID = other_value.globalEnbID();
} else {
single_value->field_globalEnbID.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 ENB__Identifier_template[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 ENB__Identifier_template(*other_value.implication_.precondition);
implication_.implied_template = new ENB__Identifier_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 @BSSGP_Types.ENB_Identifier.");
break;
}
set_selection(other_value);
}

ENB__Identifier_template::ENB__Identifier_template()
{
}

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

ENB__Identifier_template::ENB__Identifier_template(const ENB__Identifier& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

ENB__Identifier_template& ENB__Identifier_template::operator=(const OPTIONAL<ENB__Identifier>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ENB__Identifier&)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 @BSSGP_Types.ENB_Identifier.");
}
return *this;
}

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

boolean ENB__Identifier_template::match(const ENB__Identifier& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.mccDigit1().is_bound()) return FALSE;
if(!single_value->field_mccDigit1.match(other_value.mccDigit1(), legacy))return FALSE;
if(!other_value.mccDigit2().is_bound()) return FALSE;
if(!single_value->field_mccDigit2.match(other_value.mccDigit2(), legacy))return FALSE;
if(!other_value.mccDigit3().is_bound()) return FALSE;
if(!single_value->field_mccDigit3.match(other_value.mccDigit3(), legacy))return FALSE;
if(!other_value.mncDigit3().is_bound()) return FALSE;
if(!single_value->field_mncDigit3.match(other_value.mncDigit3(), legacy))return FALSE;
if(!other_value.mncDigit1().is_bound()) return FALSE;
if(!single_value->field_mncDigit1.match(other_value.mncDigit1(), legacy))return FALSE;
if(!other_value.mncDigit2().is_bound()) return FALSE;
if(!single_value->field_mncDigit2.match(other_value.mncDigit2(), legacy))return FALSE;
if(!other_value.tac().is_bound()) return FALSE;
if(!single_value->field_tac.match(other_value.tac(), legacy))return FALSE;
if(!other_value.globalEnbID().is_bound()) return FALSE;
if(!single_value->field_globalEnbID.match(other_value.globalEnbID(), 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 @BSSGP_Types.ENB_Identifier.");
}
return FALSE;
}

boolean ENB__Identifier_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_mccDigit1.is_bound()
 || single_value->field_mccDigit2.is_bound()
 || single_value->field_mccDigit3.is_bound()
 || single_value->field_mncDigit3.is_bound()
 || single_value->field_mncDigit1.is_bound()
 || single_value->field_mncDigit2.is_bound()
 || single_value->field_tac.is_bound()
 || single_value->field_globalEnbID.is_bound();
}

boolean ENB__Identifier_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_mccDigit1.is_value()
 && single_value->field_mccDigit2.is_value()
 && single_value->field_mccDigit3.is_value()
 && single_value->field_mncDigit3.is_value()
 && single_value->field_mncDigit1.is_value()
 && single_value->field_mncDigit2.is_value()
 && single_value->field_tac.is_value()
 && single_value->field_globalEnbID.is_value();
}

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

ENB__Identifier ENB__Identifier_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 @BSSGP_Types.ENB_Identifier.");
ENB__Identifier ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mccDigit1.is_bound()) {
ret_val.mccDigit1() = single_value->field_mccDigit1.valueof();
}
if (single_value->field_mccDigit2.is_bound()) {
ret_val.mccDigit2() = single_value->field_mccDigit2.valueof();
}
if (single_value->field_mccDigit3.is_bound()) {
ret_val.mccDigit3() = single_value->field_mccDigit3.valueof();
}
if (single_value->field_mncDigit3.is_bound()) {
ret_val.mncDigit3() = single_value->field_mncDigit3.valueof();
}
if (single_value->field_mncDigit1.is_bound()) {
ret_val.mncDigit1() = single_value->field_mncDigit1.valueof();
}
if (single_value->field_mncDigit2.is_bound()) {
ret_val.mncDigit2() = single_value->field_mncDigit2.valueof();
}
if (single_value->field_tac.is_bound()) {
ret_val.tac() = single_value->field_tac.valueof();
}
if (single_value->field_globalEnbID.is_bound()) {
ret_val.globalEnbID() = single_value->field_globalEnbID.valueof();
}
return ret_val;
}

void ENB__Identifier_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 @BSSGP_Types.ENB_Identifier.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ENB__Identifier_template[list_length];
}

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

OCTETSTRING_template& ENB__Identifier_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& ENB__Identifier_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_iEI;
}

BITSTRING_template& ENB__Identifier_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& ENB__Identifier_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_ext;
}

LIN2__2a_template& ENB__Identifier_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& ENB__Identifier_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_lengthIndicator;
}

HEXSTRING_template& ENB__Identifier_template::mccDigit1()
{
set_specific();
return single_value->field_mccDigit1;
}

const HEXSTRING_template& ENB__Identifier_template::mccDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit1 of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_mccDigit1;
}

HEXSTRING_template& ENB__Identifier_template::mccDigit2()
{
set_specific();
return single_value->field_mccDigit2;
}

const HEXSTRING_template& ENB__Identifier_template::mccDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit2 of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_mccDigit2;
}

HEXSTRING_template& ENB__Identifier_template::mccDigit3()
{
set_specific();
return single_value->field_mccDigit3;
}

const HEXSTRING_template& ENB__Identifier_template::mccDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit3 of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_mccDigit3;
}

HEXSTRING_template& ENB__Identifier_template::mncDigit3()
{
set_specific();
return single_value->field_mncDigit3;
}

const HEXSTRING_template& ENB__Identifier_template::mncDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit3 of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_mncDigit3;
}

HEXSTRING_template& ENB__Identifier_template::mncDigit1()
{
set_specific();
return single_value->field_mncDigit1;
}

const HEXSTRING_template& ENB__Identifier_template::mncDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit1 of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_mncDigit1;
}

HEXSTRING_template& ENB__Identifier_template::mncDigit2()
{
set_specific();
return single_value->field_mncDigit2;
}

const HEXSTRING_template& ENB__Identifier_template::mncDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit2 of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_mncDigit2;
}

OCTETSTRING_template& ENB__Identifier_template::tac()
{
set_specific();
return single_value->field_tac;
}

const OCTETSTRING_template& ENB__Identifier_template::tac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tac of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_tac;
}

OCTETSTRING_template& ENB__Identifier_template::globalEnbID()
{
set_specific();
return single_value->field_globalEnbID;
}

const OCTETSTRING_template& ENB__Identifier_template::globalEnbID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalEnbID of a non-specific template of type @BSSGP_Types.ENB_Identifier.");
return single_value->field_globalEnbID;
}

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

void ENB__Identifier_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log();
TTCN_Logger::log_event_str(", tac := ");
single_value->field_tac.log();
TTCN_Logger::log_event_str(", globalEnbID := ");
single_value->field_globalEnbID.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 ENB__Identifier_template::log_match(const ENB__Identifier& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit1.match(match_value.mccDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit1");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit2.match(match_value.mccDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit2");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit3.match(match_value.mccDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit3");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit3.match(match_value.mncDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit3");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit1.match(match_value.mncDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit1");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit2.match(match_value.mncDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit2");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tac.match(match_value.tac(), legacy)){
TTCN_Logger::log_logmatch_info(".tac");
single_value->field_tac.log_match(match_value.tac(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_globalEnbID.match(match_value.globalEnbID(), legacy)){
TTCN_Logger::log_logmatch_info(".globalEnbID");
single_value->field_globalEnbID.log_match(match_value.globalEnbID(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::log_event_str(", tac := ");
single_value->field_tac.log_match(match_value.tac(), legacy);
TTCN_Logger::log_event_str(", globalEnbID := ");
single_value->field_globalEnbID.log_match(match_value.globalEnbID(), 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 ENB__Identifier_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_mccDigit1.encode_text(text_buf);
single_value->field_mccDigit2.encode_text(text_buf);
single_value->field_mccDigit3.encode_text(text_buf);
single_value->field_mncDigit3.encode_text(text_buf);
single_value->field_mncDigit1.encode_text(text_buf);
single_value->field_mncDigit2.encode_text(text_buf);
single_value->field_tac.encode_text(text_buf);
single_value->field_globalEnbID.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 @BSSGP_Types.ENB_Identifier.");
}
}

void ENB__Identifier_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_mccDigit1.decode_text(text_buf);
single_value->field_mccDigit2.decode_text(text_buf);
single_value->field_mccDigit3.decode_text(text_buf);
single_value->field_mncDigit3.decode_text(text_buf);
single_value->field_mncDigit1.decode_text(text_buf);
single_value->field_mncDigit2.decode_text(text_buf);
single_value->field_tac.decode_text(text_buf);
single_value->field_globalEnbID.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 ENB__Identifier_template[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 @BSSGP_Types.ENB_Identifier.");
}
}

void ENB__Identifier_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: {
    ENB__Identifier_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (11<param.get_size()) {
      param.error("record template of type @BSSGP_Types.ENB_Identifier has 11 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tac().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) globalEnbID().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "globalEnbID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globalEnbID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.ENB_Identifier: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ENB__Identifier_template* precondition = new ENB__Identifier_template;
    precondition->set_param(*param.get_elem(0));
    ENB__Identifier_template* implied_template = new ENB__Identifier_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ENB__Identifier_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.ENB_Identifier");
  }
  is_ifpresent = param.get_ifpresent();
}

void ENB__Identifier_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_tac.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
single_value->field_globalEnbID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ENB_Identifier");
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 : "@BSSGP_Types.ENB_Identifier");
}

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

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

Subscriber__Profile__ID__For__RAT__Priority::Subscriber__Profile__ID__For__RAT__Priority()
{
}

Subscriber__Profile__ID__For__RAT__Priority::Subscriber__Profile__ID__For__RAT__Priority(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_profile__ID)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_profile__ID(par_profile__ID)
{
}

Subscriber__Profile__ID__For__RAT__Priority::Subscriber__Profile__ID__For__RAT__Priority(const Subscriber__Profile__ID__For__RAT__Priority& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.profile__ID().is_bound()) field_profile__ID = other_value.profile__ID();
else field_profile__ID.clean_up();
}

void Subscriber__Profile__ID__For__RAT__Priority::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_profile__ID.clean_up();
}

const TTCN_Typedescriptor_t* Subscriber__Profile__ID__For__RAT__Priority::get_descriptor() const { return &Subscriber__Profile__ID__For__RAT__Priority_descr_; }
Subscriber__Profile__ID__For__RAT__Priority& Subscriber__Profile__ID__For__RAT__Priority::operator=(const Subscriber__Profile__ID__For__RAT__Priority& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.profile__ID().is_bound()) field_profile__ID = other_value.profile__ID();
  else field_profile__ID.clean_up();
}
return *this;
}

boolean Subscriber__Profile__ID__For__RAT__Priority::operator==(const Subscriber__Profile__ID__For__RAT__Priority& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_profile__ID==other_value.field_profile__ID;
}

boolean Subscriber__Profile__ID__For__RAT__Priority::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_profile__ID.is_bound());
}
boolean Subscriber__Profile__ID__For__RAT__Priority::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_profile__ID.is_value();
}
void Subscriber__Profile__ID__For__RAT__Priority::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", profile_ID := ");
field_profile__ID.log();
TTCN_Logger::log_event_str(" }");
}

void Subscriber__Profile__ID__For__RAT__Priority::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (profile__ID().is_bound()) profile__ID().set_implicit_omit();
}

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

void Subscriber__Profile__ID__For__RAT__Priority::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_profile__ID.encode_text(text_buf);
}

void Subscriber__Profile__ID__For__RAT__Priority::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_profile__ID.decode_text(text_buf);
}

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

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

int Subscriber__Profile__ID__For__RAT__Priority::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Subscriber__Profile__ID__For__RAT__Priority_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Subscriber__Profile__ID__For__RAT__Priority_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Subscriber__Profile__ID__For__RAT__Priority_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Subscriber__Profile__ID__For__RAT__Priority_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_profile__ID.RAW_decode(General__Types::BIT8_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_10) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Subscriber__Profile__ID__For__RAT__Priority::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Subscriber__Profile__ID__For__RAT__Priority_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Subscriber__Profile__ID__For__RAT__Priority_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT8_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Subscriber__Profile__ID__For__RAT__Priority_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Subscriber__Profile__ID__For__RAT__Priority_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_profile__ID.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Subscriber__Profile__ID__For__RAT__Priority_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Subscriber__Profile__ID__For__RAT__Priority_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_10) {
  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_10.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct Subscriber__Profile__ID__For__RAT__Priority_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_profile__ID;
};

void Subscriber__Profile__ID__For__RAT__Priority_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_profile__ID = ANY_VALUE;
}
}
}

void Subscriber__Profile__ID__For__RAT__Priority_template::copy_value(const Subscriber__Profile__ID__For__RAT__Priority& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.profile__ID().is_bound()) {
  single_value->field_profile__ID = other_value.profile__ID();
} else {
  single_value->field_profile__ID.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Subscriber__Profile__ID__For__RAT__Priority_template::copy_template(const Subscriber__Profile__ID__For__RAT__Priority_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.profile__ID().get_selection()) {
single_value->field_profile__ID = other_value.profile__ID();
} else {
single_value->field_profile__ID.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 Subscriber__Profile__ID__For__RAT__Priority_template[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 Subscriber__Profile__ID__For__RAT__Priority_template(*other_value.implication_.precondition);
implication_.implied_template = new Subscriber__Profile__ID__For__RAT__Priority_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 @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
break;
}
set_selection(other_value);
}

Subscriber__Profile__ID__For__RAT__Priority_template::Subscriber__Profile__ID__For__RAT__Priority_template()
{
}

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

Subscriber__Profile__ID__For__RAT__Priority_template::Subscriber__Profile__ID__For__RAT__Priority_template(const Subscriber__Profile__ID__For__RAT__Priority& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Subscriber__Profile__ID__For__RAT__Priority_template& Subscriber__Profile__ID__For__RAT__Priority_template::operator=(const OPTIONAL<Subscriber__Profile__ID__For__RAT__Priority>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Subscriber__Profile__ID__For__RAT__Priority&)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 @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
}
return *this;
}

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

boolean Subscriber__Profile__ID__For__RAT__Priority_template::match(const Subscriber__Profile__ID__For__RAT__Priority& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.profile__ID().is_bound()) return FALSE;
if(!single_value->field_profile__ID.match(other_value.profile__ID(), 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 @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
}
return FALSE;
}

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

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

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

Subscriber__Profile__ID__For__RAT__Priority Subscriber__Profile__ID__For__RAT__Priority_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 @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
Subscriber__Profile__ID__For__RAT__Priority ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_profile__ID.is_bound()) {
ret_val.profile__ID() = single_value->field_profile__ID.valueof();
}
return ret_val;
}

void Subscriber__Profile__ID__For__RAT__Priority_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 @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Subscriber__Profile__ID__For__RAT__Priority_template[list_length];
}

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

OCTETSTRING_template& Subscriber__Profile__ID__For__RAT__Priority_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Subscriber__Profile__ID__For__RAT__Priority_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
return single_value->field_iEI;
}

BITSTRING_template& Subscriber__Profile__ID__For__RAT__Priority_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Subscriber__Profile__ID__For__RAT__Priority_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
return single_value->field_ext;
}

LIN2__2a_template& Subscriber__Profile__ID__For__RAT__Priority_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Subscriber__Profile__ID__For__RAT__Priority_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& Subscriber__Profile__ID__For__RAT__Priority_template::profile__ID()
{
set_specific();
return single_value->field_profile__ID;
}

const BITSTRING_template& Subscriber__Profile__ID__For__RAT__Priority_template::profile__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field profile_ID of a non-specific template of type @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
return single_value->field_profile__ID;
}

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

void Subscriber__Profile__ID__For__RAT__Priority_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", profile_ID := ");
single_value->field_profile__ID.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 Subscriber__Profile__ID__For__RAT__Priority_template::log_match(const Subscriber__Profile__ID__For__RAT__Priority& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_profile__ID.match(match_value.profile__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".profile_ID");
single_value->field_profile__ID.log_match(match_value.profile__ID(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", profile_ID := ");
single_value->field_profile__ID.log_match(match_value.profile__ID(), 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 Subscriber__Profile__ID__For__RAT__Priority_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_profile__ID.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 @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
}
}

void Subscriber__Profile__ID__For__RAT__Priority_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_profile__ID.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 Subscriber__Profile__ID__For__RAT__Priority_template[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 @BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority.");
}
}

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

void Subscriber__Profile__ID__For__RAT__Priority_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority");
single_value->field_profile__ID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority");
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 : "@BSSGP_Types.Subscriber_Profile_ID_For_RAT_Priority");
}

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

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

Request__For__Inter__RAT__Handover__Info::Request__For__Inter__RAT__Handover__Info()
{
}

Request__For__Inter__RAT__Handover__Info::Request__For__Inter__RAT__Handover__Info(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_interRATHandoverInfoRequest,
    const BITSTRING& par_eUTRANinterRATHandoverInfoRequest,
    const BITSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_interRATHandoverInfoRequest(par_interRATHandoverInfoRequest),
  field_eUTRANinterRATHandoverInfoRequest(par_eUTRANinterRATHandoverInfoRequest),
  field_spare(par_spare)
{
}

Request__For__Inter__RAT__Handover__Info::Request__For__Inter__RAT__Handover__Info(const Request__For__Inter__RAT__Handover__Info& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.interRATHandoverInfoRequest().is_bound()) field_interRATHandoverInfoRequest = other_value.interRATHandoverInfoRequest();
else field_interRATHandoverInfoRequest.clean_up();
if (other_value.eUTRANinterRATHandoverInfoRequest().is_bound()) field_eUTRANinterRATHandoverInfoRequest = other_value.eUTRANinterRATHandoverInfoRequest();
else field_eUTRANinterRATHandoverInfoRequest.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void Request__For__Inter__RAT__Handover__Info::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_interRATHandoverInfoRequest.clean_up();
field_eUTRANinterRATHandoverInfoRequest.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* Request__For__Inter__RAT__Handover__Info::get_descriptor() const { return &Request__For__Inter__RAT__Handover__Info_descr_; }
Request__For__Inter__RAT__Handover__Info& Request__For__Inter__RAT__Handover__Info::operator=(const Request__For__Inter__RAT__Handover__Info& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.interRATHandoverInfoRequest().is_bound()) field_interRATHandoverInfoRequest = other_value.interRATHandoverInfoRequest();
  else field_interRATHandoverInfoRequest.clean_up();
  if (other_value.eUTRANinterRATHandoverInfoRequest().is_bound()) field_eUTRANinterRATHandoverInfoRequest = other_value.eUTRANinterRATHandoverInfoRequest();
  else field_eUTRANinterRATHandoverInfoRequest.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean Request__For__Inter__RAT__Handover__Info::operator==(const Request__For__Inter__RAT__Handover__Info& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_interRATHandoverInfoRequest==other_value.field_interRATHandoverInfoRequest
  && field_eUTRANinterRATHandoverInfoRequest==other_value.field_eUTRANinterRATHandoverInfoRequest
  && field_spare==other_value.field_spare;
}

boolean Request__For__Inter__RAT__Handover__Info::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_interRATHandoverInfoRequest.is_bound())
  || (field_eUTRANinterRATHandoverInfoRequest.is_bound())
  || (field_spare.is_bound());
}
boolean Request__For__Inter__RAT__Handover__Info::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_interRATHandoverInfoRequest.is_value()
  && field_eUTRANinterRATHandoverInfoRequest.is_value()
  && field_spare.is_value();
}
void Request__For__Inter__RAT__Handover__Info::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", interRATHandoverInfoRequest := ");
field_interRATHandoverInfoRequest.log();
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInfoRequest := ");
field_eUTRANinterRATHandoverInfoRequest.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void Request__For__Inter__RAT__Handover__Info::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (interRATHandoverInfoRequest().is_bound()) interRATHandoverInfoRequest().set_implicit_omit();
if (eUTRANinterRATHandoverInfoRequest().is_bound()) eUTRANinterRATHandoverInfoRequest().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void Request__For__Inter__RAT__Handover__Info::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 @BSSGP_Types.Request_For_Inter_RAT_Handover_Info 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) interRATHandoverInfoRequest().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) eUTRANinterRATHandoverInfoRequest().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "interRATHandoverInfoRequest")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          interRATHandoverInfoRequest().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRANinterRATHandoverInfoRequest")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANinterRATHandoverInfoRequest().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Request_For_Inter_RAT_Handover_Info");
  }
}

void Request__For__Inter__RAT__Handover__Info::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_interRATHandoverInfoRequest.encode_text(text_buf);
field_eUTRANinterRATHandoverInfoRequest.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void Request__For__Inter__RAT__Handover__Info::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_interRATHandoverInfoRequest.decode_text(text_buf);
field_eUTRANinterRATHandoverInfoRequest.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int Request__For__Inter__RAT__Handover__Info::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Request__For__Inter__RAT__Handover__Info_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Request__For__Inter__RAT__Handover__Info_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Request__For__Inter__RAT__Handover__Info_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Request__For__Inter__RAT__Handover__Info_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_interRATHandoverInfoRequest.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_eUTRANinterRATHandoverInfoRequest.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT6_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_112) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Request__For__Inter__RAT__Handover__Info::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Request__For__Inter__RAT__Handover__Info_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Request__For__Inter__RAT__Handover__Info_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT6_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Request__For__Inter__RAT__Handover__Info_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Request__For__Inter__RAT__Handover__Info_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_interRATHandoverInfoRequest.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_eUTRANinterRATHandoverInfoRequest.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[5]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 3;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(3);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Request__For__Inter__RAT__Handover__Info_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Request__For__Inter__RAT__Handover__Info_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_112) {
  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_112.RAW_encode(General__Types::OCT1_descr_,*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 Request__For__Inter__RAT__Handover__Info_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_interRATHandoverInfoRequest;
BITSTRING_template field_eUTRANinterRATHandoverInfoRequest;
BITSTRING_template field_spare;
};

void Request__For__Inter__RAT__Handover__Info_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_interRATHandoverInfoRequest = ANY_VALUE;
single_value->field_eUTRANinterRATHandoverInfoRequest = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void Request__For__Inter__RAT__Handover__Info_template::copy_value(const Request__For__Inter__RAT__Handover__Info& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.interRATHandoverInfoRequest().is_bound()) {
  single_value->field_interRATHandoverInfoRequest = other_value.interRATHandoverInfoRequest();
} else {
  single_value->field_interRATHandoverInfoRequest.clean_up();
}
if (other_value.eUTRANinterRATHandoverInfoRequest().is_bound()) {
  single_value->field_eUTRANinterRATHandoverInfoRequest = other_value.eUTRANinterRATHandoverInfoRequest();
} else {
  single_value->field_eUTRANinterRATHandoverInfoRequest.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Request__For__Inter__RAT__Handover__Info_template::copy_template(const Request__For__Inter__RAT__Handover__Info_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.interRATHandoverInfoRequest().get_selection()) {
single_value->field_interRATHandoverInfoRequest = other_value.interRATHandoverInfoRequest();
} else {
single_value->field_interRATHandoverInfoRequest.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRANinterRATHandoverInfoRequest().get_selection()) {
single_value->field_eUTRANinterRATHandoverInfoRequest = other_value.eUTRANinterRATHandoverInfoRequest();
} else {
single_value->field_eUTRANinterRATHandoverInfoRequest.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Request__For__Inter__RAT__Handover__Info_template[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 Request__For__Inter__RAT__Handover__Info_template(*other_value.implication_.precondition);
implication_.implied_template = new Request__For__Inter__RAT__Handover__Info_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 @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
break;
}
set_selection(other_value);
}

Request__For__Inter__RAT__Handover__Info_template::Request__For__Inter__RAT__Handover__Info_template()
{
}

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

Request__For__Inter__RAT__Handover__Info_template::Request__For__Inter__RAT__Handover__Info_template(const Request__For__Inter__RAT__Handover__Info& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Request__For__Inter__RAT__Handover__Info_template& Request__For__Inter__RAT__Handover__Info_template::operator=(const OPTIONAL<Request__For__Inter__RAT__Handover__Info>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Request__For__Inter__RAT__Handover__Info&)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 @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
}
return *this;
}

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

boolean Request__For__Inter__RAT__Handover__Info_template::match(const Request__For__Inter__RAT__Handover__Info& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.interRATHandoverInfoRequest().is_bound()) return FALSE;
if(!single_value->field_interRATHandoverInfoRequest.match(other_value.interRATHandoverInfoRequest(), legacy))return FALSE;
if(!other_value.eUTRANinterRATHandoverInfoRequest().is_bound()) return FALSE;
if(!single_value->field_eUTRANinterRATHandoverInfoRequest.match(other_value.eUTRANinterRATHandoverInfoRequest(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
}
return FALSE;
}

boolean Request__For__Inter__RAT__Handover__Info_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_interRATHandoverInfoRequest.is_bound()
 || single_value->field_eUTRANinterRATHandoverInfoRequest.is_bound()
 || single_value->field_spare.is_bound();
}

boolean Request__For__Inter__RAT__Handover__Info_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_interRATHandoverInfoRequest.is_value()
 && single_value->field_eUTRANinterRATHandoverInfoRequest.is_value()
 && single_value->field_spare.is_value();
}

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

Request__For__Inter__RAT__Handover__Info Request__For__Inter__RAT__Handover__Info_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 @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
Request__For__Inter__RAT__Handover__Info ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_interRATHandoverInfoRequest.is_bound()) {
ret_val.interRATHandoverInfoRequest() = single_value->field_interRATHandoverInfoRequest.valueof();
}
if (single_value->field_eUTRANinterRATHandoverInfoRequest.is_bound()) {
ret_val.eUTRANinterRATHandoverInfoRequest() = single_value->field_eUTRANinterRATHandoverInfoRequest.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void Request__For__Inter__RAT__Handover__Info_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 @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Request__For__Inter__RAT__Handover__Info_template[list_length];
}

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

OCTETSTRING_template& Request__For__Inter__RAT__Handover__Info_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Request__For__Inter__RAT__Handover__Info_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
return single_value->field_iEI;
}

BITSTRING_template& Request__For__Inter__RAT__Handover__Info_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Request__For__Inter__RAT__Handover__Info_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
return single_value->field_ext;
}

LIN2__2a_template& Request__For__Inter__RAT__Handover__Info_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Request__For__Inter__RAT__Handover__Info_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& Request__For__Inter__RAT__Handover__Info_template::interRATHandoverInfoRequest()
{
set_specific();
return single_value->field_interRATHandoverInfoRequest;
}

const BITSTRING_template& Request__For__Inter__RAT__Handover__Info_template::interRATHandoverInfoRequest() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field interRATHandoverInfoRequest of a non-specific template of type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
return single_value->field_interRATHandoverInfoRequest;
}

BITSTRING_template& Request__For__Inter__RAT__Handover__Info_template::eUTRANinterRATHandoverInfoRequest()
{
set_specific();
return single_value->field_eUTRANinterRATHandoverInfoRequest;
}

const BITSTRING_template& Request__For__Inter__RAT__Handover__Info_template::eUTRANinterRATHandoverInfoRequest() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRANinterRATHandoverInfoRequest of a non-specific template of type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
return single_value->field_eUTRANinterRATHandoverInfoRequest;
}

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

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

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

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

void Request__For__Inter__RAT__Handover__Info_template::log_match(const Request__For__Inter__RAT__Handover__Info& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_interRATHandoverInfoRequest.match(match_value.interRATHandoverInfoRequest(), legacy)){
TTCN_Logger::log_logmatch_info(".interRATHandoverInfoRequest");
single_value->field_interRATHandoverInfoRequest.log_match(match_value.interRATHandoverInfoRequest(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRANinterRATHandoverInfoRequest.match(match_value.eUTRANinterRATHandoverInfoRequest(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRANinterRATHandoverInfoRequest");
single_value->field_eUTRANinterRATHandoverInfoRequest.log_match(match_value.eUTRANinterRATHandoverInfoRequest(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", interRATHandoverInfoRequest := ");
single_value->field_interRATHandoverInfoRequest.log_match(match_value.interRATHandoverInfoRequest(), legacy);
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInfoRequest := ");
single_value->field_eUTRANinterRATHandoverInfoRequest.log_match(match_value.eUTRANinterRATHandoverInfoRequest(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void Request__For__Inter__RAT__Handover__Info_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_interRATHandoverInfoRequest.decode_text(text_buf);
single_value->field_eUTRANinterRATHandoverInfoRequest.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Request__For__Inter__RAT__Handover__Info_template[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 @BSSGP_Types.Request_For_Inter_RAT_Handover_Info.");
}
}

void Request__For__Inter__RAT__Handover__Info_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: {
    Request__For__Inter__RAT__Handover__Info_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 @BSSGP_Types.Request_For_Inter_RAT_Handover_Info 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) interRATHandoverInfoRequest().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) eUTRANinterRATHandoverInfoRequest().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "interRATHandoverInfoRequest")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          interRATHandoverInfoRequest().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRANinterRATHandoverInfoRequest")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANinterRATHandoverInfoRequest().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Request_For_Inter_RAT_Handover_Info: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Request__For__Inter__RAT__Handover__Info_template* precondition = new Request__For__Inter__RAT__Handover__Info_template;
    precondition->set_param(*param.get_elem(0));
    Request__For__Inter__RAT__Handover__Info_template* implied_template = new Request__For__Inter__RAT__Handover__Info_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Request__For__Inter__RAT__Handover__Info_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Request_For_Inter_RAT_Handover_Info");
  }
  is_ifpresent = param.get_ifpresent();
}

void Request__For__Inter__RAT__Handover__Info_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Request_For_Inter_RAT_Handover_Info");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Request_For_Inter_RAT_Handover_Info");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Request_For_Inter_RAT_Handover_Info");
single_value->field_interRATHandoverInfoRequest.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Request_For_Inter_RAT_Handover_Info");
single_value->field_eUTRANinterRATHandoverInfoRequest.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Request_For_Inter_RAT_Handover_Info");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Request_For_Inter_RAT_Handover_Info");
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 : "@BSSGP_Types.Request_For_Inter_RAT_Handover_Info");
}

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

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

Reliable__Inter__RAT__Handover__Info::Reliable__Inter__RAT__Handover__Info()
{
}

Reliable__Inter__RAT__Handover__Info::Reliable__Inter__RAT__Handover__Info(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_reliableInterRATHandoverInfoIndicator,
    const BITSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reliableInterRATHandoverInfoIndicator(par_reliableInterRATHandoverInfoIndicator),
  field_spare(par_spare)
{
}

Reliable__Inter__RAT__Handover__Info::Reliable__Inter__RAT__Handover__Info(const Reliable__Inter__RAT__Handover__Info& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.reliableInterRATHandoverInfoIndicator().is_bound()) field_reliableInterRATHandoverInfoIndicator = other_value.reliableInterRATHandoverInfoIndicator();
else field_reliableInterRATHandoverInfoIndicator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void Reliable__Inter__RAT__Handover__Info::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reliableInterRATHandoverInfoIndicator.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* Reliable__Inter__RAT__Handover__Info::get_descriptor() const { return &Reliable__Inter__RAT__Handover__Info_descr_; }
Reliable__Inter__RAT__Handover__Info& Reliable__Inter__RAT__Handover__Info::operator=(const Reliable__Inter__RAT__Handover__Info& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.reliableInterRATHandoverInfoIndicator().is_bound()) field_reliableInterRATHandoverInfoIndicator = other_value.reliableInterRATHandoverInfoIndicator();
  else field_reliableInterRATHandoverInfoIndicator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean Reliable__Inter__RAT__Handover__Info::operator==(const Reliable__Inter__RAT__Handover__Info& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_reliableInterRATHandoverInfoIndicator==other_value.field_reliableInterRATHandoverInfoIndicator
  && field_spare==other_value.field_spare;
}

boolean Reliable__Inter__RAT__Handover__Info::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_reliableInterRATHandoverInfoIndicator.is_bound())
  || (field_spare.is_bound());
}
boolean Reliable__Inter__RAT__Handover__Info::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_reliableInterRATHandoverInfoIndicator.is_value()
  && field_spare.is_value();
}
void Reliable__Inter__RAT__Handover__Info::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", reliableInterRATHandoverInfoIndicator := ");
field_reliableInterRATHandoverInfoIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void Reliable__Inter__RAT__Handover__Info::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (reliableInterRATHandoverInfoIndicator().is_bound()) reliableInterRATHandoverInfoIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void Reliable__Inter__RAT__Handover__Info::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_reliableInterRATHandoverInfoIndicator.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void Reliable__Inter__RAT__Handover__Info::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_reliableInterRATHandoverInfoIndicator.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int Reliable__Inter__RAT__Handover__Info::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Reliable__Inter__RAT__Handover__Info_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Reliable__Inter__RAT__Handover__Info_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Reliable__Inter__RAT__Handover__Info_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Reliable__Inter__RAT__Handover__Info_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_reliableInterRATHandoverInfoIndicator.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT7_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_97) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Reliable__Inter__RAT__Handover__Info::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Reliable__Inter__RAT__Handover__Info_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Reliable__Inter__RAT__Handover__Info_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT7_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Reliable__Inter__RAT__Handover__Info_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Reliable__Inter__RAT__Handover__Info_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reliableInterRATHandoverInfoIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[4]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Reliable__Inter__RAT__Handover__Info_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Reliable__Inter__RAT__Handover__Info_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_97) {
  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_97.RAW_encode(General__Types::OCT1_descr_,*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 Reliable__Inter__RAT__Handover__Info_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_reliableInterRATHandoverInfoIndicator;
BITSTRING_template field_spare;
};

void Reliable__Inter__RAT__Handover__Info_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_reliableInterRATHandoverInfoIndicator = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void Reliable__Inter__RAT__Handover__Info_template::copy_value(const Reliable__Inter__RAT__Handover__Info& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.reliableInterRATHandoverInfoIndicator().is_bound()) {
  single_value->field_reliableInterRATHandoverInfoIndicator = other_value.reliableInterRATHandoverInfoIndicator();
} else {
  single_value->field_reliableInterRATHandoverInfoIndicator.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Reliable__Inter__RAT__Handover__Info_template::copy_template(const Reliable__Inter__RAT__Handover__Info_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reliableInterRATHandoverInfoIndicator().get_selection()) {
single_value->field_reliableInterRATHandoverInfoIndicator = other_value.reliableInterRATHandoverInfoIndicator();
} else {
single_value->field_reliableInterRATHandoverInfoIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Reliable__Inter__RAT__Handover__Info_template[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 Reliable__Inter__RAT__Handover__Info_template(*other_value.implication_.precondition);
implication_.implied_template = new Reliable__Inter__RAT__Handover__Info_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 @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
break;
}
set_selection(other_value);
}

Reliable__Inter__RAT__Handover__Info_template::Reliable__Inter__RAT__Handover__Info_template()
{
}

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

Reliable__Inter__RAT__Handover__Info_template::Reliable__Inter__RAT__Handover__Info_template(const Reliable__Inter__RAT__Handover__Info& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Reliable__Inter__RAT__Handover__Info_template& Reliable__Inter__RAT__Handover__Info_template::operator=(const OPTIONAL<Reliable__Inter__RAT__Handover__Info>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Reliable__Inter__RAT__Handover__Info&)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 @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
}
return *this;
}

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

boolean Reliable__Inter__RAT__Handover__Info_template::match(const Reliable__Inter__RAT__Handover__Info& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.reliableInterRATHandoverInfoIndicator().is_bound()) return FALSE;
if(!single_value->field_reliableInterRATHandoverInfoIndicator.match(other_value.reliableInterRATHandoverInfoIndicator(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
}
return FALSE;
}

boolean Reliable__Inter__RAT__Handover__Info_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_reliableInterRATHandoverInfoIndicator.is_bound()
 || single_value->field_spare.is_bound();
}

boolean Reliable__Inter__RAT__Handover__Info_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_reliableInterRATHandoverInfoIndicator.is_value()
 && single_value->field_spare.is_value();
}

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

Reliable__Inter__RAT__Handover__Info Reliable__Inter__RAT__Handover__Info_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 @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
Reliable__Inter__RAT__Handover__Info ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_reliableInterRATHandoverInfoIndicator.is_bound()) {
ret_val.reliableInterRATHandoverInfoIndicator() = single_value->field_reliableInterRATHandoverInfoIndicator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void Reliable__Inter__RAT__Handover__Info_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 @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Reliable__Inter__RAT__Handover__Info_template[list_length];
}

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

OCTETSTRING_template& Reliable__Inter__RAT__Handover__Info_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Reliable__Inter__RAT__Handover__Info_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
return single_value->field_iEI;
}

BITSTRING_template& Reliable__Inter__RAT__Handover__Info_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Reliable__Inter__RAT__Handover__Info_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
return single_value->field_ext;
}

LIN2__2a_template& Reliable__Inter__RAT__Handover__Info_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Reliable__Inter__RAT__Handover__Info_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& Reliable__Inter__RAT__Handover__Info_template::reliableInterRATHandoverInfoIndicator()
{
set_specific();
return single_value->field_reliableInterRATHandoverInfoIndicator;
}

const BITSTRING_template& Reliable__Inter__RAT__Handover__Info_template::reliableInterRATHandoverInfoIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reliableInterRATHandoverInfoIndicator of a non-specific template of type @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
return single_value->field_reliableInterRATHandoverInfoIndicator;
}

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

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

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

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

void Reliable__Inter__RAT__Handover__Info_template::log_match(const Reliable__Inter__RAT__Handover__Info& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reliableInterRATHandoverInfoIndicator.match(match_value.reliableInterRATHandoverInfoIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".reliableInterRATHandoverInfoIndicator");
single_value->field_reliableInterRATHandoverInfoIndicator.log_match(match_value.reliableInterRATHandoverInfoIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", reliableInterRATHandoverInfoIndicator := ");
single_value->field_reliableInterRATHandoverInfoIndicator.log_match(match_value.reliableInterRATHandoverInfoIndicator(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void Reliable__Inter__RAT__Handover__Info_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_reliableInterRATHandoverInfoIndicator.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Reliable__Inter__RAT__Handover__Info_template[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 @BSSGP_Types.Reliable_Inter_RAT_Handover_Info.");
}
}

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

void Reliable__Inter__RAT__Handover__Info_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Reliable_Inter_RAT_Handover_Info");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Reliable_Inter_RAT_Handover_Info");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Reliable_Inter_RAT_Handover_Info");
single_value->field_reliableInterRATHandoverInfoIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Reliable_Inter_RAT_Handover_Info");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Reliable_Inter_RAT_Handover_Info");
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 : "@BSSGP_Types.Reliable_Inter_RAT_Handover_Info");
}

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

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

CSG__Identity::CSG__Identity()
{
}

CSG__Identity::CSG__Identity(const OCTETSTRING& par_cSG__Id24,
    const BITSTRING& par_cSG__Id3,
    const BITSTRING& par_spare)
  :   field_cSG__Id24(par_cSG__Id24),
  field_cSG__Id3(par_cSG__Id3),
  field_spare(par_spare)
{
}

CSG__Identity::CSG__Identity(const CSG__Identity& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.CSG_Identity.");
if (other_value.cSG__Id24().is_bound()) field_cSG__Id24 = other_value.cSG__Id24();
else field_cSG__Id24.clean_up();
if (other_value.cSG__Id3().is_bound()) field_cSG__Id3 = other_value.cSG__Id3();
else field_cSG__Id3.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void CSG__Identity::clean_up()
{
field_cSG__Id24.clean_up();
field_cSG__Id3.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* CSG__Identity::get_descriptor() const { return &CSG__Identity_descr_; }
CSG__Identity& CSG__Identity::operator=(const CSG__Identity& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.CSG_Identity.");
  if (other_value.cSG__Id24().is_bound()) field_cSG__Id24 = other_value.cSG__Id24();
  else field_cSG__Id24.clean_up();
  if (other_value.cSG__Id3().is_bound()) field_cSG__Id3 = other_value.cSG__Id3();
  else field_cSG__Id3.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean CSG__Identity::operator==(const CSG__Identity& other_value) const
{
return field_cSG__Id24==other_value.field_cSG__Id24
  && field_cSG__Id3==other_value.field_cSG__Id3
  && field_spare==other_value.field_spare;
}

boolean CSG__Identity::is_bound() const
{
return (field_cSG__Id24.is_bound())
  || (field_cSG__Id3.is_bound())
  || (field_spare.is_bound());
}
boolean CSG__Identity::is_value() const
{
return field_cSG__Id24.is_value()
  && field_cSG__Id3.is_value()
  && field_spare.is_value();
}
void CSG__Identity::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cSG_Id24 := ");
field_cSG__Id24.log();
TTCN_Logger::log_event_str(", cSG_Id3 := ");
field_cSG__Id3.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void CSG__Identity::set_implicit_omit()
{
if (cSG__Id24().is_bound()) cSG__Id24().set_implicit_omit();
if (cSG__Id3().is_bound()) cSG__Id3().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void CSG__Identity::encode_text(Text_Buf& text_buf) const
{
field_cSG__Id24.encode_text(text_buf);
field_cSG__Id3.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void CSG__Identity::decode_text(Text_Buf& text_buf)
{
field_cSG__Id24.decode_text(text_buf);
field_cSG__Id3.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int CSG__Identity::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::OCT3_descr_.raw->forceomit);
  decoded_field_length = field_cSG__Id24.RAW_decode(General__Types::OCT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_cSG__Id3.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT5_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 CSG__Identity::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT5_descr_.raw);
  encoded_length += field_cSG__Id24.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cSG__Id3.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct CSG__Identity_template::single_value_struct {
OCTETSTRING_template field_cSG__Id24;
BITSTRING_template field_cSG__Id3;
BITSTRING_template field_spare;
};

void CSG__Identity_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_cSG__Id24 = ANY_VALUE;
single_value->field_cSG__Id3 = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void CSG__Identity_template::copy_value(const CSG__Identity& other_value)
{
single_value = new single_value_struct;
if (other_value.cSG__Id24().is_bound()) {
  single_value->field_cSG__Id24 = other_value.cSG__Id24();
} else {
  single_value->field_cSG__Id24.clean_up();
}
if (other_value.cSG__Id3().is_bound()) {
  single_value->field_cSG__Id3 = other_value.cSG__Id3();
} else {
  single_value->field_cSG__Id3.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CSG__Identity_template::copy_template(const CSG__Identity_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cSG__Id24().get_selection()) {
single_value->field_cSG__Id24 = other_value.cSG__Id24();
} else {
single_value->field_cSG__Id24.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cSG__Id3().get_selection()) {
single_value->field_cSG__Id3 = other_value.cSG__Id3();
} else {
single_value->field_cSG__Id3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CSG__Identity_template[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 CSG__Identity_template(*other_value.implication_.precondition);
implication_.implied_template = new CSG__Identity_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 @BSSGP_Types.CSG_Identity.");
break;
}
set_selection(other_value);
}

CSG__Identity_template::CSG__Identity_template()
{
}

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

CSG__Identity_template::CSG__Identity_template(const CSG__Identity& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

CSG__Identity_template& CSG__Identity_template::operator=(const OPTIONAL<CSG__Identity>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CSG__Identity&)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 @BSSGP_Types.CSG_Identity.");
}
return *this;
}

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

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

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

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

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

CSG__Identity CSG__Identity_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 @BSSGP_Types.CSG_Identity.");
CSG__Identity ret_val;
if (single_value->field_cSG__Id24.is_bound()) {
ret_val.cSG__Id24() = single_value->field_cSG__Id24.valueof();
}
if (single_value->field_cSG__Id3.is_bound()) {
ret_val.cSG__Id3() = single_value->field_cSG__Id3.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void CSG__Identity_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 @BSSGP_Types.CSG_Identity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CSG__Identity_template[list_length];
}

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

OCTETSTRING_template& CSG__Identity_template::cSG__Id24()
{
set_specific();
return single_value->field_cSG__Id24;
}

const OCTETSTRING_template& CSG__Identity_template::cSG__Id24() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cSG_Id24 of a non-specific template of type @BSSGP_Types.CSG_Identity.");
return single_value->field_cSG__Id24;
}

BITSTRING_template& CSG__Identity_template::cSG__Id3()
{
set_specific();
return single_value->field_cSG__Id3;
}

const BITSTRING_template& CSG__Identity_template::cSG__Id3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cSG_Id3 of a non-specific template of type @BSSGP_Types.CSG_Identity.");
return single_value->field_cSG__Id3;
}

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

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

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

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

void CSG__Identity_template::log_match(const CSG__Identity& 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_cSG__Id24.match(match_value.cSG__Id24(), legacy)){
TTCN_Logger::log_logmatch_info(".cSG_Id24");
single_value->field_cSG__Id24.log_match(match_value.cSG__Id24(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cSG__Id3.match(match_value.cSG__Id3(), legacy)){
TTCN_Logger::log_logmatch_info(".cSG_Id3");
single_value->field_cSG__Id3.log_match(match_value.cSG__Id3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ cSG_Id24 := ");
single_value->field_cSG__Id24.log_match(match_value.cSG__Id24(), legacy);
TTCN_Logger::log_event_str(", cSG_Id3 := ");
single_value->field_cSG__Id3.log_match(match_value.cSG__Id3(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void CSG__Identity_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_cSG__Id24.decode_text(text_buf);
single_value->field_cSG__Id3.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CSG__Identity_template[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 @BSSGP_Types.CSG_Identity.");
}
}

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

void CSG__Identity_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_cSG__Id24.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CSG_Identity");
single_value->field_cSG__Id3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CSG_Identity");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CSG_Identity");
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 : "@BSSGP_Types.CSG_Identity");
}

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

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

CSG__Identifier__TLV::CSG__Identifier__TLV()
{
}

CSG__Identifier__TLV::CSG__Identifier__TLV(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const CSG__Identity& par_cSG__Identity,
    const BITSTRING& par_cell__Acces__Mode,
    const BITSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_cSG__Identity(par_cSG__Identity),
  field_cell__Acces__Mode(par_cell__Acces__Mode),
  field_spare(par_spare)
{
}

CSG__Identifier__TLV::CSG__Identifier__TLV(const CSG__Identifier__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.CSG_Identifier_TLV.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.cSG__Identity().is_bound()) field_cSG__Identity = other_value.cSG__Identity();
else field_cSG__Identity.clean_up();
if (other_value.cell__Acces__Mode().is_bound()) field_cell__Acces__Mode = other_value.cell__Acces__Mode();
else field_cell__Acces__Mode.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void CSG__Identifier__TLV::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_cSG__Identity.clean_up();
field_cell__Acces__Mode.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* CSG__Identifier__TLV::get_descriptor() const { return &CSG__Identifier__TLV_descr_; }
CSG__Identifier__TLV& CSG__Identifier__TLV::operator=(const CSG__Identifier__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.CSG_Identifier_TLV.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.cSG__Identity().is_bound()) field_cSG__Identity = other_value.cSG__Identity();
  else field_cSG__Identity.clean_up();
  if (other_value.cell__Acces__Mode().is_bound()) field_cell__Acces__Mode = other_value.cell__Acces__Mode();
  else field_cell__Acces__Mode.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean CSG__Identifier__TLV::operator==(const CSG__Identifier__TLV& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_cSG__Identity==other_value.field_cSG__Identity
  && field_cell__Acces__Mode==other_value.field_cell__Acces__Mode
  && field_spare==other_value.field_spare;
}

boolean CSG__Identifier__TLV::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_cSG__Identity.is_bound())
  || (field_cell__Acces__Mode.is_bound())
  || (field_spare.is_bound());
}
boolean CSG__Identifier__TLV::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_cSG__Identity.is_value()
  && field_cell__Acces__Mode.is_value()
  && field_spare.is_value();
}
void CSG__Identifier__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", cSG_Identity := ");
field_cSG__Identity.log();
TTCN_Logger::log_event_str(", cell_Acces_Mode := ");
field_cell__Acces__Mode.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void CSG__Identifier__TLV::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (cSG__Identity().is_bound()) cSG__Identity().set_implicit_omit();
if (cell__Acces__Mode().is_bound()) cell__Acces__Mode().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void CSG__Identifier__TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @BSSGP_Types.CSG_Identifier_TLV has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cSG__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cell__Acces__Mode().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cSG_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cSG__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Acces_Mode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Acces__Mode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.CSG_Identifier_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.CSG_Identifier_TLV");
  }
}

void CSG__Identifier__TLV::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_cSG__Identity.encode_text(text_buf);
field_cell__Acces__Mode.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void CSG__Identifier__TLV::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_cSG__Identity.decode_text(text_buf);
field_cell__Acces__Mode.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int CSG__Identifier__TLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, CSG__Identifier__TLV_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(CSG__Identifier__TLV_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, CSG__Identifier__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(CSG__Identifier__TLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, CSG__Identity_descr_.raw->forceomit);
  decoded_field_length = field_cSG__Identity.RAW_decode(CSG__Identity_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cell__Acces__Mode.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT7_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_98) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CSG__Identifier__TLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CSG__Identifier__TLV_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, CSG__Identifier__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, CSG__Identity_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT7_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(CSG__Identifier__TLV_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(CSG__Identifier__TLV_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cSG__Identity.RAW_encode(CSG__Identity_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_cell__Acces__Mode.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[5]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 3;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(3);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(CSG__Identifier__TLV_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(CSG__Identifier__TLV_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_98) {
  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_98.RAW_encode(General__Types::OCT1_descr_,*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 CSG__Identifier__TLV_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
CSG__Identity_template field_cSG__Identity;
BITSTRING_template field_cell__Acces__Mode;
BITSTRING_template field_spare;
};

void CSG__Identifier__TLV_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_cSG__Identity = ANY_VALUE;
single_value->field_cell__Acces__Mode = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void CSG__Identifier__TLV_template::copy_value(const CSG__Identifier__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.cSG__Identity().is_bound()) {
  single_value->field_cSG__Identity = other_value.cSG__Identity();
} else {
  single_value->field_cSG__Identity.clean_up();
}
if (other_value.cell__Acces__Mode().is_bound()) {
  single_value->field_cell__Acces__Mode = other_value.cell__Acces__Mode();
} else {
  single_value->field_cell__Acces__Mode.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CSG__Identifier__TLV_template::copy_template(const CSG__Identifier__TLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cSG__Identity().get_selection()) {
single_value->field_cSG__Identity = other_value.cSG__Identity();
} else {
single_value->field_cSG__Identity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__Acces__Mode().get_selection()) {
single_value->field_cell__Acces__Mode = other_value.cell__Acces__Mode();
} else {
single_value->field_cell__Acces__Mode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CSG__Identifier__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new CSG__Identifier__TLV_template(*other_value.implication_.precondition);
implication_.implied_template = new CSG__Identifier__TLV_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.CSG_Identifier_TLV.");
break;
}
set_selection(other_value);
}

CSG__Identifier__TLV_template::CSG__Identifier__TLV_template()
{
}

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

CSG__Identifier__TLV_template::CSG__Identifier__TLV_template(const CSG__Identifier__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CSG__Identifier__TLV_template::match(const CSG__Identifier__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.cSG__Identity().is_bound()) return FALSE;
if(!single_value->field_cSG__Identity.match(other_value.cSG__Identity(), legacy))return FALSE;
if(!other_value.cell__Acces__Mode().is_bound()) return FALSE;
if(!single_value->field_cell__Acces__Mode.match(other_value.cell__Acces__Mode(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.CSG_Identifier_TLV.");
}
return FALSE;
}

boolean CSG__Identifier__TLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_cSG__Identity.is_bound()
 || single_value->field_cell__Acces__Mode.is_bound()
 || single_value->field_spare.is_bound();
}

boolean CSG__Identifier__TLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_cSG__Identity.is_value()
 && single_value->field_cell__Acces__Mode.is_value()
 && single_value->field_spare.is_value();
}

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

CSG__Identifier__TLV CSG__Identifier__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.CSG_Identifier_TLV.");
CSG__Identifier__TLV ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_cSG__Identity.is_bound()) {
ret_val.cSG__Identity() = single_value->field_cSG__Identity.valueof();
}
if (single_value->field_cell__Acces__Mode.is_bound()) {
ret_val.cell__Acces__Mode() = single_value->field_cell__Acces__Mode.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& CSG__Identifier__TLV_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& CSG__Identifier__TLV_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.CSG_Identifier_TLV.");
return single_value->field_iEI;
}

BITSTRING_template& CSG__Identifier__TLV_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& CSG__Identifier__TLV_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.CSG_Identifier_TLV.");
return single_value->field_ext;
}

LIN2__2a_template& CSG__Identifier__TLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& CSG__Identifier__TLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.CSG_Identifier_TLV.");
return single_value->field_lengthIndicator;
}

CSG__Identity_template& CSG__Identifier__TLV_template::cSG__Identity()
{
set_specific();
return single_value->field_cSG__Identity;
}

const CSG__Identity_template& CSG__Identifier__TLV_template::cSG__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cSG_Identity of a non-specific template of type @BSSGP_Types.CSG_Identifier_TLV.");
return single_value->field_cSG__Identity;
}

BITSTRING_template& CSG__Identifier__TLV_template::cell__Acces__Mode()
{
set_specific();
return single_value->field_cell__Acces__Mode;
}

const BITSTRING_template& CSG__Identifier__TLV_template::cell__Acces__Mode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_Acces_Mode of a non-specific template of type @BSSGP_Types.CSG_Identifier_TLV.");
return single_value->field_cell__Acces__Mode;
}

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

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

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

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

void CSG__Identifier__TLV_template::log_match(const CSG__Identifier__TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cSG__Identity.match(match_value.cSG__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".cSG_Identity");
single_value->field_cSG__Identity.log_match(match_value.cSG__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__Acces__Mode.match(match_value.cell__Acces__Mode(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_Acces_Mode");
single_value->field_cell__Acces__Mode.log_match(match_value.cell__Acces__Mode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", cSG_Identity := ");
single_value->field_cSG__Identity.log_match(match_value.cSG__Identity(), legacy);
TTCN_Logger::log_event_str(", cell_Acces_Mode := ");
single_value->field_cell__Acces__Mode.log_match(match_value.cell__Acces__Mode(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void CSG__Identifier__TLV_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_cSG__Identity.decode_text(text_buf);
single_value->field_cell__Acces__Mode.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CSG__Identifier__TLV_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.CSG_Identifier_TLV.");
}
}

void CSG__Identifier__TLV_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CSG__Identifier__TLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @BSSGP_Types.CSG_Identifier_TLV has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cSG__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cell__Acces__Mode().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) spare().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cSG_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cSG__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Acces_Mode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Acces__Mode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.CSG_Identifier_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CSG__Identifier__TLV_template* precondition = new CSG__Identifier__TLV_template;
    precondition->set_param(*param.get_elem(0));
    CSG__Identifier__TLV_template* implied_template = new CSG__Identifier__TLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CSG__Identifier__TLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.CSG_Identifier_TLV");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

Tracking__Area__Code__TLV::Tracking__Area__Code__TLV()
{
}

Tracking__Area__Code__TLV::Tracking__Area__Code__TLV(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_valueField)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

Tracking__Area__Code__TLV::Tracking__Area__Code__TLV(const Tracking__Area__Code__TLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Tracking_Area_Code_TLV.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void Tracking__Area__Code__TLV::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* Tracking__Area__Code__TLV::get_descriptor() const { return &Tracking__Area__Code__TLV_descr_; }
Tracking__Area__Code__TLV& Tracking__Area__Code__TLV::operator=(const Tracking__Area__Code__TLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Tracking_Area_Code_TLV.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

boolean Tracking__Area__Code__TLV::operator==(const Tracking__Area__Code__TLV& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_valueField==other_value.field_valueField;
}

boolean Tracking__Area__Code__TLV::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_valueField.is_bound());
}
boolean Tracking__Area__Code__TLV::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_valueField.is_value();
}
void Tracking__Area__Code__TLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(" }");
}

void Tracking__Area__Code__TLV::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

void Tracking__Area__Code__TLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Tracking_Area_Code_TLV has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) valueField().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Tracking_Area_Code_TLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Tracking_Area_Code_TLV");
  }
}

void Tracking__Area__Code__TLV::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void Tracking__Area__Code__TLV::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

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

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

int Tracking__Area__Code__TLV::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Tracking__Area__Code__TLV_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Tracking__Area__Code__TLV_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Tracking__Area__Code__TLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Tracking__Area__Code__TLV_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT3_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(General__Types::OCT3_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_99) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Tracking__Area__Code__TLV::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Tracking__Area__Code__TLV_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Tracking__Area__Code__TLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT3_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Tracking__Area__Code__TLV_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Tracking__Area__Code__TLV_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_valueField.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Tracking__Area__Code__TLV_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Tracking__Area__Code__TLV_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_99) {
  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_99.RAW_encode(General__Types::OCT1_descr_,*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 Tracking__Area__Code__TLV_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_valueField;
};

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

void Tracking__Area__Code__TLV_template::copy_value(const Tracking__Area__Code__TLV& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

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

Tracking__Area__Code__TLV_template::Tracking__Area__Code__TLV_template()
{
}

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

Tracking__Area__Code__TLV_template::Tracking__Area__Code__TLV_template(const Tracking__Area__Code__TLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Tracking__Area__Code__TLV_template::match(const Tracking__Area__Code__TLV& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), 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 @BSSGP_Types.Tracking_Area_Code_TLV.");
}
return FALSE;
}

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

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

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

Tracking__Area__Code__TLV Tracking__Area__Code__TLV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.Tracking_Area_Code_TLV.");
Tracking__Area__Code__TLV ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

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

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

OCTETSTRING_template& Tracking__Area__Code__TLV_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Tracking__Area__Code__TLV_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Tracking_Area_Code_TLV.");
return single_value->field_iEI;
}

BITSTRING_template& Tracking__Area__Code__TLV_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Tracking__Area__Code__TLV_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Tracking_Area_Code_TLV.");
return single_value->field_ext;
}

LIN2__2a_template& Tracking__Area__Code__TLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Tracking__Area__Code__TLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Tracking_Area_Code_TLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Tracking__Area__Code__TLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const OCTETSTRING_template& Tracking__Area__Code__TLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @BSSGP_Types.Tracking_Area_Code_TLV.");
return single_value->field_valueField;
}

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

void Tracking__Area__Code__TLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", valueField := ");
single_value->field_valueField.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 Tracking__Area__Code__TLV_template::log_match(const Tracking__Area__Code__TLV& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), 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 Tracking__Area__Code__TLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_valueField.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 @BSSGP_Types.Tracking_Area_Code_TLV.");
}
}

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

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

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

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

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

Redirect__Attempt__Flag::Redirect__Attempt__Flag()
{
}

Redirect__Attempt__Flag::Redirect__Attempt__Flag(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_spare(par_spare)
{
}

Redirect__Attempt__Flag::Redirect__Attempt__Flag(const Redirect__Attempt__Flag& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Redirect_Attempt_Flag.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void Redirect__Attempt__Flag::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* Redirect__Attempt__Flag::get_descriptor() const { return &Redirect__Attempt__Flag_descr_; }
Redirect__Attempt__Flag& Redirect__Attempt__Flag::operator=(const Redirect__Attempt__Flag& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Redirect_Attempt_Flag.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean Redirect__Attempt__Flag::operator==(const Redirect__Attempt__Flag& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_spare==other_value.field_spare;
}

boolean Redirect__Attempt__Flag::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_spare.is_bound());
}
boolean Redirect__Attempt__Flag::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_spare.is_value();
}
void Redirect__Attempt__Flag::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void Redirect__Attempt__Flag::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void Redirect__Attempt__Flag::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void Redirect__Attempt__Flag::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int Redirect__Attempt__Flag::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Redirect__Attempt__Flag_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Redirect__Attempt__Flag_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Redirect__Attempt__Flag_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Redirect__Attempt__Flag_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_23) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Redirect__Attempt__Flag::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Redirect__Attempt__Flag_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Redirect__Attempt__Flag_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Redirect__Attempt__Flag_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Redirect__Attempt__Flag_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Redirect__Attempt__Flag_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Redirect__Attempt__Flag_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_23) {
  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_23.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct Redirect__Attempt__Flag_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_spare;
};

void Redirect__Attempt__Flag_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void Redirect__Attempt__Flag_template::copy_value(const Redirect__Attempt__Flag& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Redirect__Attempt__Flag_template::copy_template(const Redirect__Attempt__Flag_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
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 Redirect__Attempt__Flag_template[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 Redirect__Attempt__Flag_template(*other_value.implication_.precondition);
implication_.implied_template = new Redirect__Attempt__Flag_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 @BSSGP_Types.Redirect_Attempt_Flag.");
break;
}
set_selection(other_value);
}

Redirect__Attempt__Flag_template::Redirect__Attempt__Flag_template()
{
}

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

Redirect__Attempt__Flag_template::Redirect__Attempt__Flag_template(const Redirect__Attempt__Flag& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Redirect__Attempt__Flag_template& Redirect__Attempt__Flag_template::operator=(const OPTIONAL<Redirect__Attempt__Flag>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Redirect__Attempt__Flag&)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 @BSSGP_Types.Redirect_Attempt_Flag.");
}
return *this;
}

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

boolean Redirect__Attempt__Flag_template::match(const Redirect__Attempt__Flag& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
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 @BSSGP_Types.Redirect_Attempt_Flag.");
}
return FALSE;
}

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

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

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

Redirect__Attempt__Flag Redirect__Attempt__Flag_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 @BSSGP_Types.Redirect_Attempt_Flag.");
Redirect__Attempt__Flag ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void Redirect__Attempt__Flag_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 @BSSGP_Types.Redirect_Attempt_Flag.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Redirect__Attempt__Flag_template[list_length];
}

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

OCTETSTRING_template& Redirect__Attempt__Flag_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Redirect__Attempt__Flag_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Redirect_Attempt_Flag.");
return single_value->field_iEI;
}

BITSTRING_template& Redirect__Attempt__Flag_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Redirect__Attempt__Flag_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Redirect_Attempt_Flag.");
return single_value->field_ext;
}

LIN2__2a_template& Redirect__Attempt__Flag_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Redirect__Attempt__Flag_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Redirect_Attempt_Flag.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Redirect__Attempt__Flag_template::spare()
{
set_specific();
return single_value->field_spare;
}

const OCTETSTRING_template& Redirect__Attempt__Flag_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @BSSGP_Types.Redirect_Attempt_Flag.");
return single_value->field_spare;
}

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

void Redirect__Attempt__Flag_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(" }");
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 Redirect__Attempt__Flag_template::log_match(const Redirect__Attempt__Flag& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} 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 Redirect__Attempt__Flag_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.Redirect_Attempt_Flag.");
}
}

void Redirect__Attempt__Flag_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Redirect__Attempt__Flag_template[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 @BSSGP_Types.Redirect_Attempt_Flag.");
}
}

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

void Redirect__Attempt__Flag_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirect_Attempt_Flag");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirect_Attempt_Flag");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirect_Attempt_Flag");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirect_Attempt_Flag");
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 : "@BSSGP_Types.Redirect_Attempt_Flag");
}

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

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

Redirection__Indication::Redirection__Indication()
{
}

Redirection__Indication::Redirection__Indication(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_reroute__Reject__Cause__value)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reroute__Reject__Cause__value(par_reroute__Reject__Cause__value)
{
}

Redirection__Indication::Redirection__Indication(const Redirection__Indication& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Redirection_Indication.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.reroute__Reject__Cause__value().is_bound()) field_reroute__Reject__Cause__value = other_value.reroute__Reject__Cause__value();
else field_reroute__Reject__Cause__value.clean_up();
}

void Redirection__Indication::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reroute__Reject__Cause__value.clean_up();
}

const TTCN_Typedescriptor_t* Redirection__Indication::get_descriptor() const { return &Redirection__Indication_descr_; }
Redirection__Indication& Redirection__Indication::operator=(const Redirection__Indication& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Redirection_Indication.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.reroute__Reject__Cause__value().is_bound()) field_reroute__Reject__Cause__value = other_value.reroute__Reject__Cause__value();
  else field_reroute__Reject__Cause__value.clean_up();
}
return *this;
}

boolean Redirection__Indication::operator==(const Redirection__Indication& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_reroute__Reject__Cause__value==other_value.field_reroute__Reject__Cause__value;
}

boolean Redirection__Indication::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_reroute__Reject__Cause__value.is_bound());
}
boolean Redirection__Indication::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_reroute__Reject__Cause__value.is_value();
}
void Redirection__Indication::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", reroute_Reject_Cause_value := ");
field_reroute__Reject__Cause__value.log();
TTCN_Logger::log_event_str(" }");
}

void Redirection__Indication::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (reroute__Reject__Cause__value().is_bound()) reroute__Reject__Cause__value().set_implicit_omit();
}

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

void Redirection__Indication::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_reroute__Reject__Cause__value.encode_text(text_buf);
}

void Redirection__Indication::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_reroute__Reject__Cause__value.decode_text(text_buf);
}

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

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

int Redirection__Indication::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Redirection__Indication_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Redirection__Indication_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Redirection__Indication_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Redirection__Indication_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_reroute__Reject__Cause__value.RAW_decode(General__Types::BIT8_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_11) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Redirection__Indication::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Redirection__Indication_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Redirection__Indication_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT8_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Redirection__Indication_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Redirection__Indication_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reroute__Reject__Cause__value.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Redirection__Indication_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Redirection__Indication_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_11) {
  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_11.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct Redirection__Indication_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_reroute__Reject__Cause__value;
};

void Redirection__Indication_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_reroute__Reject__Cause__value = ANY_VALUE;
}
}
}

void Redirection__Indication_template::copy_value(const Redirection__Indication& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.reroute__Reject__Cause__value().is_bound()) {
  single_value->field_reroute__Reject__Cause__value = other_value.reroute__Reject__Cause__value();
} else {
  single_value->field_reroute__Reject__Cause__value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Redirection__Indication_template::copy_template(const Redirection__Indication_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reroute__Reject__Cause__value().get_selection()) {
single_value->field_reroute__Reject__Cause__value = other_value.reroute__Reject__Cause__value();
} else {
single_value->field_reroute__Reject__Cause__value.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 Redirection__Indication_template[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 Redirection__Indication_template(*other_value.implication_.precondition);
implication_.implied_template = new Redirection__Indication_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 @BSSGP_Types.Redirection_Indication.");
break;
}
set_selection(other_value);
}

Redirection__Indication_template::Redirection__Indication_template()
{
}

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

Redirection__Indication_template::Redirection__Indication_template(const Redirection__Indication& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Redirection__Indication_template& Redirection__Indication_template::operator=(const OPTIONAL<Redirection__Indication>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Redirection__Indication&)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 @BSSGP_Types.Redirection_Indication.");
}
return *this;
}

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

boolean Redirection__Indication_template::match(const Redirection__Indication& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.reroute__Reject__Cause__value().is_bound()) return FALSE;
if(!single_value->field_reroute__Reject__Cause__value.match(other_value.reroute__Reject__Cause__value(), 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 @BSSGP_Types.Redirection_Indication.");
}
return FALSE;
}

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

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

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

Redirection__Indication Redirection__Indication_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 @BSSGP_Types.Redirection_Indication.");
Redirection__Indication ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_reroute__Reject__Cause__value.is_bound()) {
ret_val.reroute__Reject__Cause__value() = single_value->field_reroute__Reject__Cause__value.valueof();
}
return ret_val;
}

void Redirection__Indication_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 @BSSGP_Types.Redirection_Indication.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Redirection__Indication_template[list_length];
}

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

OCTETSTRING_template& Redirection__Indication_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Redirection__Indication_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Redirection_Indication.");
return single_value->field_iEI;
}

BITSTRING_template& Redirection__Indication_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Redirection__Indication_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Redirection_Indication.");
return single_value->field_ext;
}

LIN2__2a_template& Redirection__Indication_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Redirection__Indication_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Redirection_Indication.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& Redirection__Indication_template::reroute__Reject__Cause__value()
{
set_specific();
return single_value->field_reroute__Reject__Cause__value;
}

const BITSTRING_template& Redirection__Indication_template::reroute__Reject__Cause__value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reroute_Reject_Cause_value of a non-specific template of type @BSSGP_Types.Redirection_Indication.");
return single_value->field_reroute__Reject__Cause__value;
}

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

void Redirection__Indication_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", reroute_Reject_Cause_value := ");
single_value->field_reroute__Reject__Cause__value.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 Redirection__Indication_template::log_match(const Redirection__Indication& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reroute__Reject__Cause__value.match(match_value.reroute__Reject__Cause__value(), legacy)){
TTCN_Logger::log_logmatch_info(".reroute_Reject_Cause_value");
single_value->field_reroute__Reject__Cause__value.log_match(match_value.reroute__Reject__Cause__value(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", reroute_Reject_Cause_value := ");
single_value->field_reroute__Reject__Cause__value.log_match(match_value.reroute__Reject__Cause__value(), 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 Redirection__Indication_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_reroute__Reject__Cause__value.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 @BSSGP_Types.Redirection_Indication.");
}
}

void Redirection__Indication_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_reroute__Reject__Cause__value.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 Redirection__Indication_template[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 @BSSGP_Types.Redirection_Indication.");
}
}

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

void Redirection__Indication_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirection_Indication");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirection_Indication");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirection_Indication");
single_value->field_reroute__Reject__Cause__value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirection_Indication");
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 : "@BSSGP_Types.Redirection_Indication");
}

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

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

Redirection__Completed::Redirection__Completed()
{
}

Redirection__Completed::Redirection__Completed(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_outcome__value)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_outcome__value(par_outcome__value)
{
}

Redirection__Completed::Redirection__Completed(const Redirection__Completed& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Redirection_Completed.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.outcome__value().is_bound()) field_outcome__value = other_value.outcome__value();
else field_outcome__value.clean_up();
}

void Redirection__Completed::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_outcome__value.clean_up();
}

const TTCN_Typedescriptor_t* Redirection__Completed::get_descriptor() const { return &Redirection__Completed_descr_; }
Redirection__Completed& Redirection__Completed::operator=(const Redirection__Completed& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Redirection_Completed.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.outcome__value().is_bound()) field_outcome__value = other_value.outcome__value();
  else field_outcome__value.clean_up();
}
return *this;
}

boolean Redirection__Completed::operator==(const Redirection__Completed& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_outcome__value==other_value.field_outcome__value;
}

boolean Redirection__Completed::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_outcome__value.is_bound());
}
boolean Redirection__Completed::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_outcome__value.is_value();
}
void Redirection__Completed::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", outcome_value := ");
field_outcome__value.log();
TTCN_Logger::log_event_str(" }");
}

void Redirection__Completed::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (outcome__value().is_bound()) outcome__value().set_implicit_omit();
}

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

void Redirection__Completed::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_outcome__value.encode_text(text_buf);
}

void Redirection__Completed::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_outcome__value.decode_text(text_buf);
}

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

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

int Redirection__Completed::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Redirection__Completed_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Redirection__Completed_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Redirection__Completed_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Redirection__Completed_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_outcome__value.RAW_decode(General__Types::BIT8_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_12) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Redirection__Completed::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Redirection__Completed_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Redirection__Completed_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT8_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Redirection__Completed_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Redirection__Completed_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_outcome__value.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Redirection__Completed_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Redirection__Completed_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_12) {
  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_12.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct Redirection__Completed_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_outcome__value;
};

void Redirection__Completed_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_outcome__value = ANY_VALUE;
}
}
}

void Redirection__Completed_template::copy_value(const Redirection__Completed& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.outcome__value().is_bound()) {
  single_value->field_outcome__value = other_value.outcome__value();
} else {
  single_value->field_outcome__value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Redirection__Completed_template::copy_template(const Redirection__Completed_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.outcome__value().get_selection()) {
single_value->field_outcome__value = other_value.outcome__value();
} else {
single_value->field_outcome__value.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 Redirection__Completed_template[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 Redirection__Completed_template(*other_value.implication_.precondition);
implication_.implied_template = new Redirection__Completed_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 @BSSGP_Types.Redirection_Completed.");
break;
}
set_selection(other_value);
}

Redirection__Completed_template::Redirection__Completed_template()
{
}

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

Redirection__Completed_template::Redirection__Completed_template(const Redirection__Completed& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Redirection__Completed_template& Redirection__Completed_template::operator=(const OPTIONAL<Redirection__Completed>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Redirection__Completed&)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 @BSSGP_Types.Redirection_Completed.");
}
return *this;
}

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

boolean Redirection__Completed_template::match(const Redirection__Completed& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.outcome__value().is_bound()) return FALSE;
if(!single_value->field_outcome__value.match(other_value.outcome__value(), 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 @BSSGP_Types.Redirection_Completed.");
}
return FALSE;
}

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

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

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

Redirection__Completed Redirection__Completed_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 @BSSGP_Types.Redirection_Completed.");
Redirection__Completed ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_outcome__value.is_bound()) {
ret_val.outcome__value() = single_value->field_outcome__value.valueof();
}
return ret_val;
}

void Redirection__Completed_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 @BSSGP_Types.Redirection_Completed.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Redirection__Completed_template[list_length];
}

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

OCTETSTRING_template& Redirection__Completed_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Redirection__Completed_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Redirection_Completed.");
return single_value->field_iEI;
}

BITSTRING_template& Redirection__Completed_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Redirection__Completed_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Redirection_Completed.");
return single_value->field_ext;
}

LIN2__2a_template& Redirection__Completed_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Redirection__Completed_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Redirection_Completed.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& Redirection__Completed_template::outcome__value()
{
set_specific();
return single_value->field_outcome__value;
}

const BITSTRING_template& Redirection__Completed_template::outcome__value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field outcome_value of a non-specific template of type @BSSGP_Types.Redirection_Completed.");
return single_value->field_outcome__value;
}

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

void Redirection__Completed_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", outcome_value := ");
single_value->field_outcome__value.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 Redirection__Completed_template::log_match(const Redirection__Completed& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_outcome__value.match(match_value.outcome__value(), legacy)){
TTCN_Logger::log_logmatch_info(".outcome_value");
single_value->field_outcome__value.log_match(match_value.outcome__value(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", outcome_value := ");
single_value->field_outcome__value.log_match(match_value.outcome__value(), 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 Redirection__Completed_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_outcome__value.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 @BSSGP_Types.Redirection_Completed.");
}
}

void Redirection__Completed_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_outcome__value.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 Redirection__Completed_template[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 @BSSGP_Types.Redirection_Completed.");
}
}

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

void Redirection__Completed_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirection_Completed");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirection_Completed");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirection_Completed");
single_value->field_outcome__value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Redirection_Completed");
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 : "@BSSGP_Types.Redirection_Completed");
}

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

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

Unconfirmed__Send__State__Variable::Unconfirmed__Send__State__Variable()
{
}

Unconfirmed__Send__State__Variable::Unconfirmed__Send__State__Variable(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_spare,
    const INTEGER& par_vU)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_spare(par_spare),
  field_vU(par_vU)
{
}

Unconfirmed__Send__State__Variable::Unconfirmed__Send__State__Variable(const Unconfirmed__Send__State__Variable& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Unconfirmed_Send_State_Variable.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.vU().is_bound()) field_vU = other_value.vU();
else field_vU.clean_up();
}

void Unconfirmed__Send__State__Variable::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_spare.clean_up();
field_vU.clean_up();
}

const TTCN_Typedescriptor_t* Unconfirmed__Send__State__Variable::get_descriptor() const { return &Unconfirmed__Send__State__Variable_descr_; }
Unconfirmed__Send__State__Variable& Unconfirmed__Send__State__Variable::operator=(const Unconfirmed__Send__State__Variable& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Unconfirmed_Send_State_Variable.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.vU().is_bound()) field_vU = other_value.vU();
  else field_vU.clean_up();
}
return *this;
}

boolean Unconfirmed__Send__State__Variable::operator==(const Unconfirmed__Send__State__Variable& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_spare==other_value.field_spare
  && field_vU==other_value.field_vU;
}

boolean Unconfirmed__Send__State__Variable::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_spare.is_bound())
  || (field_vU.is_bound());
}
boolean Unconfirmed__Send__State__Variable::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_spare.is_value()
  && field_vU.is_value();
}
void Unconfirmed__Send__State__Variable::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", vU := ");
field_vU.log();
TTCN_Logger::log_event_str(" }");
}

void Unconfirmed__Send__State__Variable::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (vU().is_bound()) vU().set_implicit_omit();
}

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

void Unconfirmed__Send__State__Variable::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_vU.encode_text(text_buf);
}

void Unconfirmed__Send__State__Variable::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_vU.decode_text(text_buf);
}

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

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

int Unconfirmed__Send__State__Variable::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Unconfirmed__Send__State__Variable_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Unconfirmed__Send__State__Variable_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Unconfirmed__Send__State__Variable_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Unconfirmed__Send__State__Variable_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, Unconfirmed__Send__State__Variable_spare_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(Unconfirmed__Send__State__Variable_spare_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Unconfirmed__Send__State__Variable_vU_descr_.raw->forceomit);
  decoded_field_length = field_vU.RAW_decode(Unconfirmed__Send__State__Variable_vU_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_13) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Unconfirmed__Send__State__Variable::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Unconfirmed__Send__State__Variable_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Unconfirmed__Send__State__Variable_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Unconfirmed__Send__State__Variable_spare_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Unconfirmed__Send__State__Variable_vU_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Unconfirmed__Send__State__Variable_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Unconfirmed__Send__State__Variable_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(Unconfirmed__Send__State__Variable_spare_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_vU.RAW_encode(Unconfirmed__Send__State__Variable_vU_descr_, *myleaf.body.node.nodes[4]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Unconfirmed__Send__State__Variable_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Unconfirmed__Send__State__Variable_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_13) {
  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_13.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct Unconfirmed__Send__State__Variable_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_spare;
INTEGER_template field_vU;
};

void Unconfirmed__Send__State__Variable_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_vU = ANY_VALUE;
}
}
}

void Unconfirmed__Send__State__Variable_template::copy_value(const Unconfirmed__Send__State__Variable& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.vU().is_bound()) {
  single_value->field_vU = other_value.vU();
} else {
  single_value->field_vU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Unconfirmed__Send__State__Variable_template::copy_template(const Unconfirmed__Send__State__Variable_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vU().get_selection()) {
single_value->field_vU = other_value.vU();
} else {
single_value->field_vU.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 Unconfirmed__Send__State__Variable_template[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 Unconfirmed__Send__State__Variable_template(*other_value.implication_.precondition);
implication_.implied_template = new Unconfirmed__Send__State__Variable_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 @BSSGP_Types.Unconfirmed_Send_State_Variable.");
break;
}
set_selection(other_value);
}

Unconfirmed__Send__State__Variable_template::Unconfirmed__Send__State__Variable_template()
{
}

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

Unconfirmed__Send__State__Variable_template::Unconfirmed__Send__State__Variable_template(const Unconfirmed__Send__State__Variable& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Unconfirmed__Send__State__Variable_template& Unconfirmed__Send__State__Variable_template::operator=(const OPTIONAL<Unconfirmed__Send__State__Variable>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Unconfirmed__Send__State__Variable&)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 @BSSGP_Types.Unconfirmed_Send_State_Variable.");
}
return *this;
}

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

boolean Unconfirmed__Send__State__Variable_template::match(const Unconfirmed__Send__State__Variable& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.vU().is_bound()) return FALSE;
if(!single_value->field_vU.match(other_value.vU(), 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 @BSSGP_Types.Unconfirmed_Send_State_Variable.");
}
return FALSE;
}

boolean Unconfirmed__Send__State__Variable_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_vU.is_bound();
}

boolean Unconfirmed__Send__State__Variable_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_vU.is_value();
}

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

Unconfirmed__Send__State__Variable Unconfirmed__Send__State__Variable_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 @BSSGP_Types.Unconfirmed_Send_State_Variable.");
Unconfirmed__Send__State__Variable ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_vU.is_bound()) {
ret_val.vU() = single_value->field_vU.valueof();
}
return ret_val;
}

void Unconfirmed__Send__State__Variable_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 @BSSGP_Types.Unconfirmed_Send_State_Variable.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Unconfirmed__Send__State__Variable_template[list_length];
}

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

OCTETSTRING_template& Unconfirmed__Send__State__Variable_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Unconfirmed__Send__State__Variable_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Unconfirmed_Send_State_Variable.");
return single_value->field_iEI;
}

BITSTRING_template& Unconfirmed__Send__State__Variable_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Unconfirmed__Send__State__Variable_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Unconfirmed_Send_State_Variable.");
return single_value->field_ext;
}

LIN2__2a_template& Unconfirmed__Send__State__Variable_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Unconfirmed__Send__State__Variable_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Unconfirmed_Send_State_Variable.");
return single_value->field_lengthIndicator;
}

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

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

INTEGER_template& Unconfirmed__Send__State__Variable_template::vU()
{
set_specific();
return single_value->field_vU;
}

const INTEGER_template& Unconfirmed__Send__State__Variable_template::vU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vU of a non-specific template of type @BSSGP_Types.Unconfirmed_Send_State_Variable.");
return single_value->field_vU;
}

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

void Unconfirmed__Send__State__Variable_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", vU := ");
single_value->field_vU.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 Unconfirmed__Send__State__Variable_template::log_match(const Unconfirmed__Send__State__Variable& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_vU.match(match_value.vU(), legacy)){
TTCN_Logger::log_logmatch_info(".vU");
single_value->field_vU.log_match(match_value.vU(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", vU := ");
single_value->field_vU.log_match(match_value.vU(), 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 Unconfirmed__Send__State__Variable_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_vU.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 @BSSGP_Types.Unconfirmed_Send_State_Variable.");
}
}

void Unconfirmed__Send__State__Variable_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_vU.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 Unconfirmed__Send__State__Variable_template[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 @BSSGP_Types.Unconfirmed_Send_State_Variable.");
}
}

void Unconfirmed__Send__State__Variable_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: {
    Unconfirmed__Send__State__Variable_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 @BSSGP_Types.Unconfirmed_Send_State_Variable 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) vU().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "vU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Unconfirmed_Send_State_Variable: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Unconfirmed__Send__State__Variable_template* precondition = new Unconfirmed__Send__State__Variable_template;
    precondition->set_param(*param.get_elem(0));
    Unconfirmed__Send__State__Variable_template* implied_template = new Unconfirmed__Send__State__Variable_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Unconfirmed__Send__State__Variable_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Unconfirmed_Send_State_Variable");
  }
  is_ifpresent = param.get_ifpresent();
}

void Unconfirmed__Send__State__Variable_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Unconfirmed_Send_State_Variable");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Unconfirmed_Send_State_Variable");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Unconfirmed_Send_State_Variable");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Unconfirmed_Send_State_Variable");
single_value->field_vU.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Unconfirmed_Send_State_Variable");
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 : "@BSSGP_Types.Unconfirmed_Send_State_Variable");
}

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

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

RNC__Id__with__Transparent__Container__BSSGP::RNC__Id__with__Transparent__Container__BSSGP()
{
}

RNC__Id__with__Transparent__Container__BSSGP::RNC__Id__with__Transparent__Container__BSSGP(const RNC__Identifier__BSSGP& par_target__RNC__Identifier,
    const Source__to__Target__Transparent__Container& par_source__to__Target__Transparent__Container)
  :   field_target__RNC__Identifier(par_target__RNC__Identifier),
  field_source__to__Target__Transparent__Container(par_source__to__Target__Transparent__Container)
{
}

RNC__Id__with__Transparent__Container__BSSGP::RNC__Id__with__Transparent__Container__BSSGP(const RNC__Id__with__Transparent__Container__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
if (other_value.target__RNC__Identifier().is_bound()) field_target__RNC__Identifier = other_value.target__RNC__Identifier();
else field_target__RNC__Identifier.clean_up();
if (other_value.source__to__Target__Transparent__Container().is_bound()) field_source__to__Target__Transparent__Container = other_value.source__to__Target__Transparent__Container();
else field_source__to__Target__Transparent__Container.clean_up();
}

void RNC__Id__with__Transparent__Container__BSSGP::clean_up()
{
field_target__RNC__Identifier.clean_up();
field_source__to__Target__Transparent__Container.clean_up();
}

const TTCN_Typedescriptor_t* RNC__Id__with__Transparent__Container__BSSGP::get_descriptor() const { return &RNC__Id__with__Transparent__Container__BSSGP_descr_; }
RNC__Id__with__Transparent__Container__BSSGP& RNC__Id__with__Transparent__Container__BSSGP::operator=(const RNC__Id__with__Transparent__Container__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
  if (other_value.target__RNC__Identifier().is_bound()) field_target__RNC__Identifier = other_value.target__RNC__Identifier();
  else field_target__RNC__Identifier.clean_up();
  if (other_value.source__to__Target__Transparent__Container().is_bound()) field_source__to__Target__Transparent__Container = other_value.source__to__Target__Transparent__Container();
  else field_source__to__Target__Transparent__Container.clean_up();
}
return *this;
}

boolean RNC__Id__with__Transparent__Container__BSSGP::operator==(const RNC__Id__with__Transparent__Container__BSSGP& other_value) const
{
return field_target__RNC__Identifier==other_value.field_target__RNC__Identifier
  && field_source__to__Target__Transparent__Container==other_value.field_source__to__Target__Transparent__Container;
}

boolean RNC__Id__with__Transparent__Container__BSSGP::is_bound() const
{
return (field_target__RNC__Identifier.is_bound())
  || (field_source__to__Target__Transparent__Container.is_bound());
}
boolean RNC__Id__with__Transparent__Container__BSSGP::is_value() const
{
return field_target__RNC__Identifier.is_value()
  && field_source__to__Target__Transparent__Container.is_value();
}
void RNC__Id__with__Transparent__Container__BSSGP::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ target_RNC_Identifier := ");
field_target__RNC__Identifier.log();
TTCN_Logger::log_event_str(", source_to_Target_Transparent_Container := ");
field_source__to__Target__Transparent__Container.log();
TTCN_Logger::log_event_str(" }");
}

void RNC__Id__with__Transparent__Container__BSSGP::set_implicit_omit()
{
if (target__RNC__Identifier().is_bound()) target__RNC__Identifier().set_implicit_omit();
if (source__to__Target__Transparent__Container().is_bound()) source__to__Target__Transparent__Container().set_implicit_omit();
}

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

void RNC__Id__with__Transparent__Container__BSSGP::encode_text(Text_Buf& text_buf) const
{
field_target__RNC__Identifier.encode_text(text_buf);
field_source__to__Target__Transparent__Container.encode_text(text_buf);
}

void RNC__Id__with__Transparent__Container__BSSGP::decode_text(Text_Buf& text_buf)
{
field_target__RNC__Identifier.decode_text(text_buf);
field_source__to__Target__Transparent__Container.decode_text(text_buf);
}

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

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

int RNC__Id__with__Transparent__Container__BSSGP::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, RNC__Identifier__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_target__RNC__Identifier.RAW_decode(RNC__Identifier__BSSGP_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, Source__to__Target__Transparent__Container_descr_.raw->forceomit);
  decoded_field_length = field_source__to__Target__Transparent__Container.RAW_decode(Source__to__Target__Transparent__Container_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 RNC__Id__with__Transparent__Container__BSSGP::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, RNC__Identifier__BSSGP_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Source__to__Target__Transparent__Container_descr_.raw);
  encoded_length += field_target__RNC__Identifier.RAW_encode(RNC__Identifier__BSSGP_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_source__to__Target__Transparent__Container.RAW_encode(Source__to__Target__Transparent__Container_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct RNC__Id__with__Transparent__Container__BSSGP_template::single_value_struct {
RNC__Identifier__BSSGP_template field_target__RNC__Identifier;
Source__to__Target__Transparent__Container_template field_source__to__Target__Transparent__Container;
};

void RNC__Id__with__Transparent__Container__BSSGP_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_target__RNC__Identifier = ANY_VALUE;
single_value->field_source__to__Target__Transparent__Container = ANY_VALUE;
}
}
}

void RNC__Id__with__Transparent__Container__BSSGP_template::copy_value(const RNC__Id__with__Transparent__Container__BSSGP& other_value)
{
single_value = new single_value_struct;
if (other_value.target__RNC__Identifier().is_bound()) {
  single_value->field_target__RNC__Identifier = other_value.target__RNC__Identifier();
} else {
  single_value->field_target__RNC__Identifier.clean_up();
}
if (other_value.source__to__Target__Transparent__Container().is_bound()) {
  single_value->field_source__to__Target__Transparent__Container = other_value.source__to__Target__Transparent__Container();
} else {
  single_value->field_source__to__Target__Transparent__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RNC__Id__with__Transparent__Container__BSSGP_template::copy_template(const RNC__Id__with__Transparent__Container__BSSGP_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.target__RNC__Identifier().get_selection()) {
single_value->field_target__RNC__Identifier = other_value.target__RNC__Identifier();
} else {
single_value->field_target__RNC__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__to__Target__Transparent__Container().get_selection()) {
single_value->field_source__to__Target__Transparent__Container = other_value.source__to__Target__Transparent__Container();
} else {
single_value->field_source__to__Target__Transparent__Container.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RNC__Id__with__Transparent__Container__BSSGP_template[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 RNC__Id__with__Transparent__Container__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new RNC__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
break;
}
set_selection(other_value);
}

RNC__Id__with__Transparent__Container__BSSGP_template::RNC__Id__with__Transparent__Container__BSSGP_template()
{
}

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

RNC__Id__with__Transparent__Container__BSSGP_template::RNC__Id__with__Transparent__Container__BSSGP_template(const RNC__Id__with__Transparent__Container__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

RNC__Id__with__Transparent__Container__BSSGP_template& RNC__Id__with__Transparent__Container__BSSGP_template::operator=(const OPTIONAL<RNC__Id__with__Transparent__Container__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RNC__Id__with__Transparent__Container__BSSGP&)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 @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
}
return *this;
}

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

boolean RNC__Id__with__Transparent__Container__BSSGP_template::match(const RNC__Id__with__Transparent__Container__BSSGP& 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.target__RNC__Identifier().is_bound()) return FALSE;
if(!single_value->field_target__RNC__Identifier.match(other_value.target__RNC__Identifier(), legacy))return FALSE;
if(!other_value.source__to__Target__Transparent__Container().is_bound()) return FALSE;
if(!single_value->field_source__to__Target__Transparent__Container.match(other_value.source__to__Target__Transparent__Container(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
}
return FALSE;
}

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

boolean RNC__Id__with__Transparent__Container__BSSGP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_target__RNC__Identifier.is_value()
 && single_value->field_source__to__Target__Transparent__Container.is_value();
}

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

RNC__Id__with__Transparent__Container__BSSGP RNC__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
RNC__Id__with__Transparent__Container__BSSGP ret_val;
if (single_value->field_target__RNC__Identifier.is_bound()) {
ret_val.target__RNC__Identifier() = single_value->field_target__RNC__Identifier.valueof();
}
if (single_value->field_source__to__Target__Transparent__Container.is_bound()) {
ret_val.source__to__Target__Transparent__Container() = single_value->field_source__to__Target__Transparent__Container.valueof();
}
return ret_val;
}

void RNC__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RNC__Id__with__Transparent__Container__BSSGP_template[list_length];
}

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

RNC__Identifier__BSSGP_template& RNC__Id__with__Transparent__Container__BSSGP_template::target__RNC__Identifier()
{
set_specific();
return single_value->field_target__RNC__Identifier;
}

const RNC__Identifier__BSSGP_template& RNC__Id__with__Transparent__Container__BSSGP_template::target__RNC__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_RNC_Identifier of a non-specific template of type @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
return single_value->field_target__RNC__Identifier;
}

Source__to__Target__Transparent__Container_template& RNC__Id__with__Transparent__Container__BSSGP_template::source__to__Target__Transparent__Container()
{
set_specific();
return single_value->field_source__to__Target__Transparent__Container;
}

const Source__to__Target__Transparent__Container_template& RNC__Id__with__Transparent__Container__BSSGP_template::source__to__Target__Transparent__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_to_Target_Transparent_Container of a non-specific template of type @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
return single_value->field_source__to__Target__Transparent__Container;
}

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

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

void RNC__Id__with__Transparent__Container__BSSGP_template::log_match(const RNC__Id__with__Transparent__Container__BSSGP& 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_target__RNC__Identifier.match(match_value.target__RNC__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".target_RNC_Identifier");
single_value->field_target__RNC__Identifier.log_match(match_value.target__RNC__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_source__to__Target__Transparent__Container.match(match_value.source__to__Target__Transparent__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".source_to_Target_Transparent_Container");
single_value->field_source__to__Target__Transparent__Container.log_match(match_value.source__to__Target__Transparent__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ target_RNC_Identifier := ");
single_value->field_target__RNC__Identifier.log_match(match_value.target__RNC__Identifier(), legacy);
TTCN_Logger::log_event_str(", source_to_Target_Transparent_Container := ");
single_value->field_source__to__Target__Transparent__Container.log_match(match_value.source__to__Target__Transparent__Container(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void RNC__Id__with__Transparent__Container__BSSGP_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_target__RNC__Identifier.decode_text(text_buf);
single_value->field_source__to__Target__Transparent__Container.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RNC__Id__with__Transparent__Container__BSSGP_template[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 @BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP.");
}
}

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

void RNC__Id__with__Transparent__Container__BSSGP_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_target__RNC__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP");
single_value->field_source__to__Target__Transparent__Container.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP");
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 : "@BSSGP_Types.RNC_Id_with_Transparent_Container_BSSGP");
}

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

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

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP::copy_value(const Cell__or__RNC__Id__with__Transparent__Container__BSSGP& other_value)
{
switch (other_value.union_selection) {
case ALT_cell__Id__with__Transparent__Container:
field_cell__Id__with__Transparent__Container = new Cell__Id__with__Transparent__Container__BSSGP(*other_value.field_cell__Id__with__Transparent__Container);
break;
case ALT_rnc__Id__with__Transparent__Container:
field_rnc__Id__with__Transparent__Container = new RNC__Id__with__Transparent__Container__BSSGP(*other_value.field_rnc__Id__with__Transparent__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean Cell__or__RNC__Id__with__Transparent__Container__BSSGP::operator==(const Cell__or__RNC__Id__with__Transparent__Container__BSSGP& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_cell__Id__with__Transparent__Container:
return *field_cell__Id__with__Transparent__Container == *other_value.field_cell__Id__with__Transparent__Container;
case ALT_rnc__Id__with__Transparent__Container:
return *field_rnc__Id__with__Transparent__Container == *other_value.field_rnc__Id__with__Transparent__Container;
default:
return FALSE;
}
}

Cell__Id__with__Transparent__Container__BSSGP& Cell__or__RNC__Id__with__Transparent__Container__BSSGP::cell__Id__with__Transparent__Container()
{
if (union_selection != ALT_cell__Id__with__Transparent__Container) {
clean_up();
field_cell__Id__with__Transparent__Container = new Cell__Id__with__Transparent__Container__BSSGP;
union_selection = ALT_cell__Id__with__Transparent__Container;
}
return *field_cell__Id__with__Transparent__Container;
}

const Cell__Id__with__Transparent__Container__BSSGP& Cell__or__RNC__Id__with__Transparent__Container__BSSGP::cell__Id__with__Transparent__Container() const
{
if (union_selection != ALT_cell__Id__with__Transparent__Container) TTCN_error("Using non-selected field cell_Id_with_Transparent_Container in a value of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
return *field_cell__Id__with__Transparent__Container;
}

RNC__Id__with__Transparent__Container__BSSGP& Cell__or__RNC__Id__with__Transparent__Container__BSSGP::rnc__Id__with__Transparent__Container()
{
if (union_selection != ALT_rnc__Id__with__Transparent__Container) {
clean_up();
field_rnc__Id__with__Transparent__Container = new RNC__Id__with__Transparent__Container__BSSGP;
union_selection = ALT_rnc__Id__with__Transparent__Container;
}
return *field_rnc__Id__with__Transparent__Container;
}

const RNC__Id__with__Transparent__Container__BSSGP& Cell__or__RNC__Id__with__Transparent__Container__BSSGP::rnc__Id__with__Transparent__Container() const
{
if (union_selection != ALT_rnc__Id__with__Transparent__Container) TTCN_error("Using non-selected field rnc_Id_with_Transparent_Container in a value of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
return *field_rnc__Id__with__Transparent__Container;
}

boolean Cell__or__RNC__Id__with__Transparent__Container__BSSGP::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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
return union_selection == checked_selection;
}

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

boolean Cell__or__RNC__Id__with__Transparent__Container__BSSGP::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_cell__Id__with__Transparent__Container: return field_cell__Id__with__Transparent__Container->is_value();
case ALT_rnc__Id__with__Transparent__Container: return field_rnc__Id__with__Transparent__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP::clean_up()
{
switch (union_selection) {
case ALT_cell__Id__with__Transparent__Container:
  delete field_cell__Id__with__Transparent__Container;
  break;
case ALT_rnc__Id__with__Transparent__Container:
  delete field_rnc__Id__with__Transparent__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP::log() const
{
switch (union_selection) {
case ALT_cell__Id__with__Transparent__Container:
TTCN_Logger::log_event_str("{ cell_Id_with_Transparent_Container := ");
field_cell__Id__with__Transparent__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_rnc__Id__with__Transparent__Container:
TTCN_Logger::log_event_str("{ rnc_Id_with_Transparent_Container := ");
field_rnc__Id__with__Transparent__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP::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, "cell_Id_with_Transparent_Container")) {
    cell__Id__with__Transparent__Container().set_param(*mp_last);
    if (!cell__Id__with__Transparent__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "rnc_Id_with_Transparent_Container")) {
    rnc__Id__with__Transparent__Container().set_param(*mp_last);
    if (!rnc__Id__with__Transparent__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.", last_name);
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP::set_implicit_omit()
{
switch (union_selection) {
case ALT_cell__Id__with__Transparent__Container:
field_cell__Id__with__Transparent__Container->set_implicit_omit(); break;
case ALT_rnc__Id__with__Transparent__Container:
field_rnc__Id__with__Transparent__Container->set_implicit_omit(); break;
default: break;
}
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_cell__Id__with__Transparent__Container:
field_cell__Id__with__Transparent__Container->encode_text(text_buf);
break;
case ALT_rnc__Id__with__Transparent__Container:
field_rnc__Id__with__Transparent__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_cell__Id__with__Transparent__Container:
cell__Id__with__Transparent__Container().decode_text(text_buf);
break;
case ALT_rnc__Id__with__Transparent__Container:
rnc__Id__with__Transparent__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
}

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

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

int Cell__or__RNC__Id__with__Transparent__Container__BSSGP::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, Cell__Id__with__Transparent__Container__BSSGP_descr_.raw->forceomit);
      decoded_length = cell__Id__with__Transparent__Container().RAW_decode(Cell__Id__with__Transparent__Container__BSSGP_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, RNC__Id__with__Transparent__Container__BSSGP_descr_.raw->forceomit);
      decoded_length = rnc__Id__with__Transparent__Container().RAW_decode(RNC__Id__with__Transparent__Container__BSSGP_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, Cell__Id__with__Transparent__Container__BSSGP_descr_.raw->forceomit);
      decoded_length = cell__Id__with__Transparent__Container().RAW_decode(Cell__Id__with__Transparent__Container__BSSGP_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, RNC__Id__with__Transparent__Container__BSSGP_descr_.raw->forceomit);
      decoded_length = rnc__Id__with__Transparent__Container().RAW_decode(RNC__Id__with__Transparent__Container__BSSGP_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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP::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_cell__Id__with__Transparent__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, Cell__Id__with__Transparent__Container__BSSGP_descr_.raw);
    encoded_length = field_cell__Id__with__Transparent__Container->RAW_encode(Cell__Id__with__Transparent__Container__BSSGP_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &Cell__Id__with__Transparent__Container__BSSGP_descr_;
    break;
  case ALT_rnc__Id__with__Transparent__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RNC__Id__with__Transparent__Container__BSSGP_descr_.raw);
    encoded_length = field_rnc__Id__with__Transparent__Container->RAW_encode(RNC__Id__with__Transparent__Container__BSSGP_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RNC__Id__with__Transparent__Container__BSSGP_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::copy_value(const Cell__or__RNC__Id__with__Transparent__Container__BSSGP& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
single_value.field_cell__Id__with__Transparent__Container = new Cell__Id__with__Transparent__Container__BSSGP_template(other_value.cell__Id__with__Transparent__Container());
break;
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
single_value.field_rnc__Id__with__Transparent__Container = new RNC__Id__with__Transparent__Container__BSSGP_template(other_value.rnc__Id__with__Transparent__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
set_selection(SPECIFIC_VALUE);
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::copy_template(const Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
single_value.field_cell__Id__with__Transparent__Container = new Cell__Id__with__Transparent__Container__BSSGP_template(*other_value.single_value.field_cell__Id__with__Transparent__Container);
break;
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
single_value.field_rnc__Id__with__Transparent__Container = new RNC__Id__with__Transparent__Container__BSSGP_template(*other_value.single_value.field_rnc__Id__with__Transparent__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template[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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
set_selection(other_value);
}

Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template()
{
}

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

Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template(const Cell__or__RNC__Id__with__Transparent__Container__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
delete single_value.field_cell__Id__with__Transparent__Container;
break;
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
delete single_value.field_rnc__Id__with__Transparent__Container;
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;
}

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

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

Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template& Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::operator=(const OPTIONAL<Cell__or__RNC__Id__with__Transparent__Container__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Cell__or__RNC__Id__with__Transparent__Container__BSSGP&)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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
return *this;
}

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

boolean Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::match(const Cell__or__RNC__Id__with__Transparent__Container__BSSGP& 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:
{
Cell__or__RNC__Id__with__Transparent__Container__BSSGP::union_selection_type value_selection = other_value.get_selection();
if (value_selection == Cell__or__RNC__Id__with__Transparent__Container__BSSGP::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
return single_value.field_cell__Id__with__Transparent__Container->match(other_value.cell__Id__with__Transparent__Container(), legacy);
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
return single_value.field_rnc__Id__with__Transparent__Container->match(other_value.rnc__Id__with__Transparent__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
}
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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
return FALSE;
}

boolean Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
return single_value.field_cell__Id__with__Transparent__Container->is_value();
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
return single_value.field_rnc__Id__with__Transparent__Container->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
}

Cell__or__RNC__Id__with__Transparent__Container__BSSGP Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
Cell__or__RNC__Id__with__Transparent__Container__BSSGP ret_val;
switch (single_value.union_selection) {
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
ret_val.cell__Id__with__Transparent__Container() = single_value.field_cell__Id__with__Transparent__Container->valueof();
break;
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
ret_val.rnc__Id__with__Transparent__Container() = single_value.field_rnc__Id__with__Transparent__Container->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
return ret_val;
}

Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template& Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
return value_list.list_value[list_index];
}
void Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template[list_length];
}

Cell__Id__with__Transparent__Container__BSSGP_template& Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::cell__Id__with__Transparent__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_cell__Id__with__Transparent__Container = new Cell__Id__with__Transparent__Container__BSSGP_template(ANY_VALUE);
else single_value.field_cell__Id__with__Transparent__Container = new Cell__Id__with__Transparent__Container__BSSGP_template;
single_value.union_selection = Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_cell__Id__with__Transparent__Container;
}

const Cell__Id__with__Transparent__Container__BSSGP_template& Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::cell__Id__with__Transparent__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cell_Id_with_Transparent_Container in a non-specific template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
if (single_value.union_selection != Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container) TTCN_error("Accessing non-selected field cell_Id_with_Transparent_Container in a template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
return *single_value.field_cell__Id__with__Transparent__Container;
}

RNC__Id__with__Transparent__Container__BSSGP_template& Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::rnc__Id__with__Transparent__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rnc__Id__with__Transparent__Container = new RNC__Id__with__Transparent__Container__BSSGP_template(ANY_VALUE);
else single_value.field_rnc__Id__with__Transparent__Container = new RNC__Id__with__Transparent__Container__BSSGP_template;
single_value.union_selection = Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rnc__Id__with__Transparent__Container;
}

const RNC__Id__with__Transparent__Container__BSSGP_template& Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::rnc__Id__with__Transparent__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rnc_Id_with_Transparent_Container in a non-specific template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
if (single_value.union_selection != Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container) TTCN_error("Accessing non-selected field rnc_Id_with_Transparent_Container in a template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
return *single_value.field_rnc__Id__with__Transparent__Container;
}

boolean Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::ischosen(Cell__or__RNC__Id__with__Transparent__Container__BSSGP::union_selection_type checked_selection) const
{
if (checked_selection == Cell__or__RNC__Id__with__Transparent__Container__BSSGP::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == Cell__or__RNC__Id__with__Transparent__Container__BSSGP::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP 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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
TTCN_Logger::log_event_str("{ cell_Id_with_Transparent_Container := ");
single_value.field_cell__Id__with__Transparent__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
TTCN_Logger::log_event_str("{ rnc_Id_with_Transparent_Container := ");
single_value.field_rnc__Id__with__Transparent__Container->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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::log_match(const Cell__or__RNC__Id__with__Transparent__Container__BSSGP& 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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".cell_Id_with_Transparent_Container");
single_value.field_cell__Id__with__Transparent__Container->log_match(match_value.cell__Id__with__Transparent__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ cell_Id_with_Transparent_Container := ");
single_value.field_cell__Id__with__Transparent__Container->log_match(match_value.cell__Id__with__Transparent__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rnc_Id_with_Transparent_Container");
single_value.field_rnc__Id__with__Transparent__Container->log_match(match_value.rnc__Id__with__Transparent__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rnc_Id_with_Transparent_Container := ");
single_value.field_rnc__Id__with__Transparent__Container->log_match(match_value.rnc__Id__with__Transparent__Container(), 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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
single_value.field_cell__Id__with__Transparent__Container->encode_text(text_buf);
break;
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
single_value.field_rnc__Id__with__Transparent__Container->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = Cell__or__RNC__Id__with__Transparent__Container__BSSGP::UNBOUND_VALUE;
Cell__or__RNC__Id__with__Transparent__Container__BSSGP::union_selection_type new_selection = (Cell__or__RNC__Id__with__Transparent__Container__BSSGP::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
single_value.field_cell__Id__with__Transparent__Container = new Cell__Id__with__Transparent__Container__BSSGP_template;
single_value.field_cell__Id__with__Transparent__Container->decode_text(text_buf);
break;
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
single_value.field_rnc__Id__with__Transparent__Container = new RNC__Id__with__Transparent__Container__BSSGP_template;
single_value.field_rnc__Id__with__Transparent__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template[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 @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
}

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

boolean Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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 `@BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP'");
    }
    if (strcmp("cell_Id_with_Transparent_Container", param_field) == 0) {
      cell__Id__with__Transparent__Container().set_param(param);
      return;
    } else if (strcmp("rnc_Id_with_Transparent_Container", param_field) == 0) {
      rnc__Id__with__Transparent__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP'", 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: {
    Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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", "@BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP");
    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, "cell_Id_with_Transparent_Container")) {
      cell__Id__with__Transparent__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "rnc_Id_with_Transparent_Container")) {
      rnc__Id__with__Transparent__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template* precondition = new Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template;
    precondition->set_param(*m_p->get_elem(0));
    Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template* implied_template = new Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Cell__or__RNC__Id__with__Transparent__Container__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void Cell__or__RNC__Id__with__Transparent__Container__BSSGP_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 Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_cell__Id__with__Transparent__Container:
single_value.field_cell__Id__with__Transparent__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP");
return;
case Cell__or__RNC__Id__with__Transparent__Container__BSSGP::ALT_rnc__Id__with__Transparent__Container:
single_value.field_rnc__Id__with__Transparent__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP.");
}
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 : "@BSSGP_Types.Cell_or_RNC_Id_with_Transparent_Container_BSSGP");
}

Cell__Id__with__Transparent__Container__BSSGP::Cell__Id__with__Transparent__Container__BSSGP()
{
}

Cell__Id__with__Transparent__Container__BSSGP::Cell__Id__with__Transparent__Container__BSSGP(const Cell__Identifier& par_target__Cell__Identifier,
    const Source__BSS__to__Target__BSS__Transparent__Container__BSSGP& par_source__BSS__to__Target__BSS__Transparent__Container)
  :   field_target__Cell__Identifier(par_target__Cell__Identifier),
  field_source__BSS__to__Target__BSS__Transparent__Container(par_source__BSS__to__Target__BSS__Transparent__Container)
{
}

Cell__Id__with__Transparent__Container__BSSGP::Cell__Id__with__Transparent__Container__BSSGP(const Cell__Id__with__Transparent__Container__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
if (other_value.target__Cell__Identifier().is_bound()) field_target__Cell__Identifier = other_value.target__Cell__Identifier();
else field_target__Cell__Identifier.clean_up();
if (other_value.source__BSS__to__Target__BSS__Transparent__Container().is_bound()) field_source__BSS__to__Target__BSS__Transparent__Container = other_value.source__BSS__to__Target__BSS__Transparent__Container();
else field_source__BSS__to__Target__BSS__Transparent__Container.clean_up();
}

void Cell__Id__with__Transparent__Container__BSSGP::clean_up()
{
field_target__Cell__Identifier.clean_up();
field_source__BSS__to__Target__BSS__Transparent__Container.clean_up();
}

const TTCN_Typedescriptor_t* Cell__Id__with__Transparent__Container__BSSGP::get_descriptor() const { return &Cell__Id__with__Transparent__Container__BSSGP_descr_; }
Cell__Id__with__Transparent__Container__BSSGP& Cell__Id__with__Transparent__Container__BSSGP::operator=(const Cell__Id__with__Transparent__Container__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
  if (other_value.target__Cell__Identifier().is_bound()) field_target__Cell__Identifier = other_value.target__Cell__Identifier();
  else field_target__Cell__Identifier.clean_up();
  if (other_value.source__BSS__to__Target__BSS__Transparent__Container().is_bound()) field_source__BSS__to__Target__BSS__Transparent__Container = other_value.source__BSS__to__Target__BSS__Transparent__Container();
  else field_source__BSS__to__Target__BSS__Transparent__Container.clean_up();
}
return *this;
}

boolean Cell__Id__with__Transparent__Container__BSSGP::operator==(const Cell__Id__with__Transparent__Container__BSSGP& other_value) const
{
return field_target__Cell__Identifier==other_value.field_target__Cell__Identifier
  && field_source__BSS__to__Target__BSS__Transparent__Container==other_value.field_source__BSS__to__Target__BSS__Transparent__Container;
}

boolean Cell__Id__with__Transparent__Container__BSSGP::is_bound() const
{
return (field_target__Cell__Identifier.is_bound())
  || (field_source__BSS__to__Target__BSS__Transparent__Container.is_bound());
}
boolean Cell__Id__with__Transparent__Container__BSSGP::is_value() const
{
return field_target__Cell__Identifier.is_value()
  && field_source__BSS__to__Target__BSS__Transparent__Container.is_value();
}
void Cell__Id__with__Transparent__Container__BSSGP::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ target_Cell_Identifier := ");
field_target__Cell__Identifier.log();
TTCN_Logger::log_event_str(", source_BSS_to_Target_BSS_Transparent_Container := ");
field_source__BSS__to__Target__BSS__Transparent__Container.log();
TTCN_Logger::log_event_str(" }");
}

void Cell__Id__with__Transparent__Container__BSSGP::set_implicit_omit()
{
if (target__Cell__Identifier().is_bound()) target__Cell__Identifier().set_implicit_omit();
if (source__BSS__to__Target__BSS__Transparent__Container().is_bound()) source__BSS__to__Target__BSS__Transparent__Container().set_implicit_omit();
}

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

void Cell__Id__with__Transparent__Container__BSSGP::encode_text(Text_Buf& text_buf) const
{
field_target__Cell__Identifier.encode_text(text_buf);
field_source__BSS__to__Target__BSS__Transparent__Container.encode_text(text_buf);
}

void Cell__Id__with__Transparent__Container__BSSGP::decode_text(Text_Buf& text_buf)
{
field_target__Cell__Identifier.decode_text(text_buf);
field_source__BSS__to__Target__BSS__Transparent__Container.decode_text(text_buf);
}

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

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

int Cell__Id__with__Transparent__Container__BSSGP::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, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_target__Cell__Identifier.RAW_decode(Cell__Identifier_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, Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_source__BSS__to__Target__BSS__Transparent__Container.RAW_decode(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_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 Cell__Id__with__Transparent__Container__BSSGP::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, Cell__Identifier_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_descr_.raw);
  encoded_length += field_target__Cell__Identifier.RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_source__BSS__to__Target__BSS__Transparent__Container.RAW_encode(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct Cell__Id__with__Transparent__Container__BSSGP_template::single_value_struct {
Cell__Identifier_template field_target__Cell__Identifier;
Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template field_source__BSS__to__Target__BSS__Transparent__Container;
};

void Cell__Id__with__Transparent__Container__BSSGP_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_target__Cell__Identifier = ANY_VALUE;
single_value->field_source__BSS__to__Target__BSS__Transparent__Container = ANY_VALUE;
}
}
}

void Cell__Id__with__Transparent__Container__BSSGP_template::copy_value(const Cell__Id__with__Transparent__Container__BSSGP& other_value)
{
single_value = new single_value_struct;
if (other_value.target__Cell__Identifier().is_bound()) {
  single_value->field_target__Cell__Identifier = other_value.target__Cell__Identifier();
} else {
  single_value->field_target__Cell__Identifier.clean_up();
}
if (other_value.source__BSS__to__Target__BSS__Transparent__Container().is_bound()) {
  single_value->field_source__BSS__to__Target__BSS__Transparent__Container = other_value.source__BSS__to__Target__BSS__Transparent__Container();
} else {
  single_value->field_source__BSS__to__Target__BSS__Transparent__Container.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Cell__Id__with__Transparent__Container__BSSGP_template::copy_template(const Cell__Id__with__Transparent__Container__BSSGP_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.target__Cell__Identifier().get_selection()) {
single_value->field_target__Cell__Identifier = other_value.target__Cell__Identifier();
} else {
single_value->field_target__Cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__BSS__to__Target__BSS__Transparent__Container().get_selection()) {
single_value->field_source__BSS__to__Target__BSS__Transparent__Container = other_value.source__BSS__to__Target__BSS__Transparent__Container();
} else {
single_value->field_source__BSS__to__Target__BSS__Transparent__Container.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Cell__Id__with__Transparent__Container__BSSGP_template[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 Cell__Id__with__Transparent__Container__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Cell__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
break;
}
set_selection(other_value);
}

Cell__Id__with__Transparent__Container__BSSGP_template::Cell__Id__with__Transparent__Container__BSSGP_template()
{
}

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

Cell__Id__with__Transparent__Container__BSSGP_template::Cell__Id__with__Transparent__Container__BSSGP_template(const Cell__Id__with__Transparent__Container__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Cell__Id__with__Transparent__Container__BSSGP_template& Cell__Id__with__Transparent__Container__BSSGP_template::operator=(const OPTIONAL<Cell__Id__with__Transparent__Container__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Cell__Id__with__Transparent__Container__BSSGP&)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 @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
}
return *this;
}

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

boolean Cell__Id__with__Transparent__Container__BSSGP_template::match(const Cell__Id__with__Transparent__Container__BSSGP& 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.target__Cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_target__Cell__Identifier.match(other_value.target__Cell__Identifier(), legacy))return FALSE;
if(!other_value.source__BSS__to__Target__BSS__Transparent__Container().is_bound()) return FALSE;
if(!single_value->field_source__BSS__to__Target__BSS__Transparent__Container.match(other_value.source__BSS__to__Target__BSS__Transparent__Container(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
}
return FALSE;
}

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

boolean Cell__Id__with__Transparent__Container__BSSGP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_target__Cell__Identifier.is_value()
 && single_value->field_source__BSS__to__Target__BSS__Transparent__Container.is_value();
}

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

Cell__Id__with__Transparent__Container__BSSGP Cell__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
Cell__Id__with__Transparent__Container__BSSGP ret_val;
if (single_value->field_target__Cell__Identifier.is_bound()) {
ret_val.target__Cell__Identifier() = single_value->field_target__Cell__Identifier.valueof();
}
if (single_value->field_source__BSS__to__Target__BSS__Transparent__Container.is_bound()) {
ret_val.source__BSS__to__Target__BSS__Transparent__Container() = single_value->field_source__BSS__to__Target__BSS__Transparent__Container.valueof();
}
return ret_val;
}

void Cell__Id__with__Transparent__Container__BSSGP_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 @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Cell__Id__with__Transparent__Container__BSSGP_template[list_length];
}

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

Cell__Identifier_template& Cell__Id__with__Transparent__Container__BSSGP_template::target__Cell__Identifier()
{
set_specific();
return single_value->field_target__Cell__Identifier;
}

const Cell__Identifier_template& Cell__Id__with__Transparent__Container__BSSGP_template::target__Cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_Cell_Identifier of a non-specific template of type @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
return single_value->field_target__Cell__Identifier;
}

Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template& Cell__Id__with__Transparent__Container__BSSGP_template::source__BSS__to__Target__BSS__Transparent__Container()
{
set_specific();
return single_value->field_source__BSS__to__Target__BSS__Transparent__Container;
}

const Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template& Cell__Id__with__Transparent__Container__BSSGP_template::source__BSS__to__Target__BSS__Transparent__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_BSS_to_Target_BSS_Transparent_Container of a non-specific template of type @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
return single_value->field_source__BSS__to__Target__BSS__Transparent__Container;
}

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

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

void Cell__Id__with__Transparent__Container__BSSGP_template::log_match(const Cell__Id__with__Transparent__Container__BSSGP& 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_target__Cell__Identifier.match(match_value.target__Cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".target_Cell_Identifier");
single_value->field_target__Cell__Identifier.log_match(match_value.target__Cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_source__BSS__to__Target__BSS__Transparent__Container.match(match_value.source__BSS__to__Target__BSS__Transparent__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".source_BSS_to_Target_BSS_Transparent_Container");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container.log_match(match_value.source__BSS__to__Target__BSS__Transparent__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ target_Cell_Identifier := ");
single_value->field_target__Cell__Identifier.log_match(match_value.target__Cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", source_BSS_to_Target_BSS_Transparent_Container := ");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container.log_match(match_value.source__BSS__to__Target__BSS__Transparent__Container(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void Cell__Id__with__Transparent__Container__BSSGP_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_target__Cell__Identifier.decode_text(text_buf);
single_value->field_source__BSS__to__Target__BSS__Transparent__Container.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Cell__Id__with__Transparent__Container__BSSGP_template[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 @BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP.");
}
}

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

void Cell__Id__with__Transparent__Container__BSSGP_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_target__Cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP");
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 : "@BSSGP_Types.Cell_Id_with_Transparent_Container_BSSGP");
}

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

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

SCI::SCI()
{
}

SCI::SCI(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_service__Class__Value)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_service__Class__Value(par_service__Class__Value)
{
}

SCI::SCI(const SCI& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.SCI.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.service__Class__Value().is_bound()) field_service__Class__Value = other_value.service__Class__Value();
else field_service__Class__Value.clean_up();
}

void SCI::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_service__Class__Value.clean_up();
}

const TTCN_Typedescriptor_t* SCI::get_descriptor() const { return &SCI_descr_; }
SCI& SCI::operator=(const SCI& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.SCI.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.service__Class__Value().is_bound()) field_service__Class__Value = other_value.service__Class__Value();
  else field_service__Class__Value.clean_up();
}
return *this;
}

boolean SCI::operator==(const SCI& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_service__Class__Value==other_value.field_service__Class__Value;
}

boolean SCI::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_service__Class__Value.is_bound());
}
boolean SCI::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_service__Class__Value.is_value();
}
void SCI::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", service_Class_Value := ");
field_service__Class__Value.log();
TTCN_Logger::log_event_str(" }");
}

void SCI::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (service__Class__Value().is_bound()) service__Class__Value().set_implicit_omit();
}

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

void SCI::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_service__Class__Value.encode_text(text_buf);
}

void SCI::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_service__Class__Value.decode_text(text_buf);
}

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

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

int SCI::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, SCI_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(SCI_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCI_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(SCI_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_service__Class__Value.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_14) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCI::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCI_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCI_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(SCI_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(SCI_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_service__Class__Value.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(SCI_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(SCI_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_14) {
  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_14.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct SCI_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_service__Class__Value;
};

void SCI_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_service__Class__Value = ANY_VALUE;
}
}
}

void SCI_template::copy_value(const SCI& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.service__Class__Value().is_bound()) {
  single_value->field_service__Class__Value = other_value.service__Class__Value();
} else {
  single_value->field_service__Class__Value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCI_template::copy_template(const SCI_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.service__Class__Value().get_selection()) {
single_value->field_service__Class__Value = other_value.service__Class__Value();
} else {
single_value->field_service__Class__Value.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 SCI_template[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 SCI_template(*other_value.implication_.precondition);
implication_.implied_template = new SCI_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 @BSSGP_Types.SCI.");
break;
}
set_selection(other_value);
}

SCI_template::SCI_template()
{
}

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

SCI_template::SCI_template(const SCI& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCI_template::match(const SCI& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.service__Class__Value().is_bound()) return FALSE;
if(!single_value->field_service__Class__Value.match(other_value.service__Class__Value(), 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 @BSSGP_Types.SCI.");
}
return FALSE;
}

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

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

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

SCI SCI_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 @BSSGP_Types.SCI.");
SCI ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_service__Class__Value.is_bound()) {
ret_val.service__Class__Value() = single_value->field_service__Class__Value.valueof();
}
return ret_val;
}

void SCI_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 @BSSGP_Types.SCI.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCI_template[list_length];
}

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

OCTETSTRING_template& SCI_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& SCI_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.SCI.");
return single_value->field_iEI;
}

BITSTRING_template& SCI_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& SCI_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.SCI.");
return single_value->field_ext;
}

LIN2__2a_template& SCI_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& SCI_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.SCI.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& SCI_template::service__Class__Value()
{
set_specific();
return single_value->field_service__Class__Value;
}

const OCTETSTRING_template& SCI_template::service__Class__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field service_Class_Value of a non-specific template of type @BSSGP_Types.SCI.");
return single_value->field_service__Class__Value;
}

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

void SCI_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", service_Class_Value := ");
single_value->field_service__Class__Value.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 SCI_template::log_match(const SCI& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_service__Class__Value.match(match_value.service__Class__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".service_Class_Value");
single_value->field_service__Class__Value.log_match(match_value.service__Class__Value(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", service_Class_Value := ");
single_value->field_service__Class__Value.log_match(match_value.service__Class__Value(), 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 SCI_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_service__Class__Value.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 @BSSGP_Types.SCI.");
}
}

void SCI_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_service__Class__Value.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 SCI_template[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 @BSSGP_Types.SCI.");
}
}

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

void SCI_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SCI");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SCI");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SCI");
single_value->field_service__Class__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SCI");
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 : "@BSSGP_Types.SCI");
}

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

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

GGSN__PGW__Location::GGSN__PGW__Location()
{
}

GGSN__PGW__Location::GGSN__PGW__Location(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_gGSN__PGW__Location__Value,
    const BITSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_gGSN__PGW__Location__Value(par_gGSN__PGW__Location__Value),
  field_spare(par_spare)
{
}

GGSN__PGW__Location::GGSN__PGW__Location(const GGSN__PGW__Location& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.GGSN_PGW_Location.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.gGSN__PGW__Location__Value().is_bound()) field_gGSN__PGW__Location__Value = other_value.gGSN__PGW__Location__Value();
else field_gGSN__PGW__Location__Value.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void GGSN__PGW__Location::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_gGSN__PGW__Location__Value.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* GGSN__PGW__Location::get_descriptor() const { return &GGSN__PGW__Location_descr_; }
GGSN__PGW__Location& GGSN__PGW__Location::operator=(const GGSN__PGW__Location& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.GGSN_PGW_Location.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.gGSN__PGW__Location__Value().is_bound()) field_gGSN__PGW__Location__Value = other_value.gGSN__PGW__Location__Value();
  else field_gGSN__PGW__Location__Value.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean GGSN__PGW__Location::operator==(const GGSN__PGW__Location& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_gGSN__PGW__Location__Value==other_value.field_gGSN__PGW__Location__Value
  && field_spare==other_value.field_spare;
}

boolean GGSN__PGW__Location::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_gGSN__PGW__Location__Value.is_bound())
  || (field_spare.is_bound());
}
boolean GGSN__PGW__Location::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_gGSN__PGW__Location__Value.is_value()
  && field_spare.is_value();
}
void GGSN__PGW__Location::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", gGSN_PGW_Location_Value := ");
field_gGSN__PGW__Location__Value.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void GGSN__PGW__Location::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (gGSN__PGW__Location__Value().is_bound()) gGSN__PGW__Location__Value().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void GGSN__PGW__Location::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_gGSN__PGW__Location__Value.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void GGSN__PGW__Location::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_gGSN__PGW__Location__Value.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int GGSN__PGW__Location::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, GGSN__PGW__Location_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(GGSN__PGW__Location_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, GGSN__PGW__Location_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(GGSN__PGW__Location_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_gGSN__PGW__Location__Value.RAW_decode(General__Types::BIT3_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT5_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 (field_iEI !=  os_15) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int GGSN__PGW__Location::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GGSN__PGW__Location_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, GGSN__PGW__Location_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT5_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(GGSN__PGW__Location_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(GGSN__PGW__Location_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_gGSN__PGW__Location__Value.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[4]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(GGSN__PGW__Location_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(GGSN__PGW__Location_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_15) {
  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_15.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct GGSN__PGW__Location_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_gGSN__PGW__Location__Value;
BITSTRING_template field_spare;
};

void GGSN__PGW__Location_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_gGSN__PGW__Location__Value = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void GGSN__PGW__Location_template::copy_value(const GGSN__PGW__Location& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.gGSN__PGW__Location__Value().is_bound()) {
  single_value->field_gGSN__PGW__Location__Value = other_value.gGSN__PGW__Location__Value();
} else {
  single_value->field_gGSN__PGW__Location__Value.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void GGSN__PGW__Location_template::copy_template(const GGSN__PGW__Location_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gGSN__PGW__Location__Value().get_selection()) {
single_value->field_gGSN__PGW__Location__Value = other_value.gGSN__PGW__Location__Value();
} else {
single_value->field_gGSN__PGW__Location__Value.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new GGSN__PGW__Location_template[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 GGSN__PGW__Location_template(*other_value.implication_.precondition);
implication_.implied_template = new GGSN__PGW__Location_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 @BSSGP_Types.GGSN_PGW_Location.");
break;
}
set_selection(other_value);
}

GGSN__PGW__Location_template::GGSN__PGW__Location_template()
{
}

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

GGSN__PGW__Location_template::GGSN__PGW__Location_template(const GGSN__PGW__Location& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

GGSN__PGW__Location_template& GGSN__PGW__Location_template::operator=(const OPTIONAL<GGSN__PGW__Location>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const GGSN__PGW__Location&)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 @BSSGP_Types.GGSN_PGW_Location.");
}
return *this;
}

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

boolean GGSN__PGW__Location_template::match(const GGSN__PGW__Location& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.gGSN__PGW__Location__Value().is_bound()) return FALSE;
if(!single_value->field_gGSN__PGW__Location__Value.match(other_value.gGSN__PGW__Location__Value(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.GGSN_PGW_Location.");
}
return FALSE;
}

boolean GGSN__PGW__Location_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_gGSN__PGW__Location__Value.is_bound()
 || single_value->field_spare.is_bound();
}

boolean GGSN__PGW__Location_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_gGSN__PGW__Location__Value.is_value()
 && single_value->field_spare.is_value();
}

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

GGSN__PGW__Location GGSN__PGW__Location_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 @BSSGP_Types.GGSN_PGW_Location.");
GGSN__PGW__Location ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_gGSN__PGW__Location__Value.is_bound()) {
ret_val.gGSN__PGW__Location__Value() = single_value->field_gGSN__PGW__Location__Value.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void GGSN__PGW__Location_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 @BSSGP_Types.GGSN_PGW_Location.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new GGSN__PGW__Location_template[list_length];
}

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

OCTETSTRING_template& GGSN__PGW__Location_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& GGSN__PGW__Location_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.GGSN_PGW_Location.");
return single_value->field_iEI;
}

BITSTRING_template& GGSN__PGW__Location_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& GGSN__PGW__Location_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.GGSN_PGW_Location.");
return single_value->field_ext;
}

LIN2__2a_template& GGSN__PGW__Location_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& GGSN__PGW__Location_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.GGSN_PGW_Location.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& GGSN__PGW__Location_template::gGSN__PGW__Location__Value()
{
set_specific();
return single_value->field_gGSN__PGW__Location__Value;
}

const BITSTRING_template& GGSN__PGW__Location_template::gGSN__PGW__Location__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gGSN_PGW_Location_Value of a non-specific template of type @BSSGP_Types.GGSN_PGW_Location.");
return single_value->field_gGSN__PGW__Location__Value;
}

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

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

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

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

void GGSN__PGW__Location_template::log_match(const GGSN__PGW__Location& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gGSN__PGW__Location__Value.match(match_value.gGSN__PGW__Location__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".gGSN_PGW_Location_Value");
single_value->field_gGSN__PGW__Location__Value.log_match(match_value.gGSN__PGW__Location__Value(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", gGSN_PGW_Location_Value := ");
single_value->field_gGSN__PGW__Location__Value.log_match(match_value.gGSN__PGW__Location__Value(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void GGSN__PGW__Location_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_gGSN__PGW__Location__Value.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new GGSN__PGW__Location_template[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 @BSSGP_Types.GGSN_PGW_Location.");
}
}

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

void GGSN__PGW__Location_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GGSN_PGW_Location");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GGSN_PGW_Location");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GGSN_PGW_Location");
single_value->field_gGSN__PGW__Location__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GGSN_PGW_Location");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GGSN_PGW_Location");
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 : "@BSSGP_Types.GGSN_PGW_Location");
}

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

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

Selected__PLMN__ID::Selected__PLMN__ID()
{
}

Selected__PLMN__ID::Selected__PLMN__ID(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const HEXSTRING& par_mccDigit1,
    const HEXSTRING& par_mccDigit2,
    const HEXSTRING& par_mccDigit3,
    const HEXSTRING& par_mncDigit3,
    const HEXSTRING& par_mncDigit1,
    const HEXSTRING& par_mncDigit2)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_mccDigit1(par_mccDigit1),
  field_mccDigit2(par_mccDigit2),
  field_mccDigit3(par_mccDigit3),
  field_mncDigit3(par_mncDigit3),
  field_mncDigit1(par_mncDigit1),
  field_mncDigit2(par_mncDigit2)
{
}

Selected__PLMN__ID::Selected__PLMN__ID(const Selected__PLMN__ID& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Selected_PLMN_ID.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
else field_mccDigit1.clean_up();
if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
else field_mccDigit2.clean_up();
if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
else field_mccDigit3.clean_up();
if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
else field_mncDigit3.clean_up();
if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
else field_mncDigit1.clean_up();
if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
else field_mncDigit2.clean_up();
}

void Selected__PLMN__ID::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_mccDigit1.clean_up();
field_mccDigit2.clean_up();
field_mccDigit3.clean_up();
field_mncDigit3.clean_up();
field_mncDigit1.clean_up();
field_mncDigit2.clean_up();
}

const TTCN_Typedescriptor_t* Selected__PLMN__ID::get_descriptor() const { return &Selected__PLMN__ID_descr_; }
Selected__PLMN__ID& Selected__PLMN__ID::operator=(const Selected__PLMN__ID& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Selected_PLMN_ID.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
  else field_mccDigit1.clean_up();
  if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
  else field_mccDigit2.clean_up();
  if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
  else field_mccDigit3.clean_up();
  if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
  else field_mncDigit3.clean_up();
  if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
  else field_mncDigit1.clean_up();
  if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
  else field_mncDigit2.clean_up();
}
return *this;
}

boolean Selected__PLMN__ID::operator==(const Selected__PLMN__ID& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_mccDigit1==other_value.field_mccDigit1
  && field_mccDigit2==other_value.field_mccDigit2
  && field_mccDigit3==other_value.field_mccDigit3
  && field_mncDigit3==other_value.field_mncDigit3
  && field_mncDigit1==other_value.field_mncDigit1
  && field_mncDigit2==other_value.field_mncDigit2;
}

boolean Selected__PLMN__ID::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mccDigit1.is_bound())
  || (field_mccDigit2.is_bound())
  || (field_mccDigit3.is_bound())
  || (field_mncDigit3.is_bound())
  || (field_mncDigit1.is_bound())
  || (field_mncDigit2.is_bound());
}
boolean Selected__PLMN__ID::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_mccDigit1.is_value()
  && field_mccDigit2.is_value()
  && field_mccDigit3.is_value()
  && field_mncDigit3.is_value()
  && field_mncDigit1.is_value()
  && field_mncDigit2.is_value();
}
void Selected__PLMN__ID::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
field_mncDigit2.log();
TTCN_Logger::log_event_str(" }");
}

void Selected__PLMN__ID::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
}

void Selected__PLMN__ID::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 @BSSGP_Types.Selected_PLMN_ID 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Selected_PLMN_ID: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Selected_PLMN_ID");
  }
}

void Selected__PLMN__ID::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mccDigit1.encode_text(text_buf);
field_mccDigit2.encode_text(text_buf);
field_mccDigit3.encode_text(text_buf);
field_mncDigit3.encode_text(text_buf);
field_mncDigit1.encode_text(text_buf);
field_mncDigit2.encode_text(text_buf);
}

void Selected__PLMN__ID::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mccDigit1.decode_text(text_buf);
field_mccDigit2.decode_text(text_buf);
field_mccDigit3.decode_text(text_buf);
field_mncDigit3.decode_text(text_buf);
field_mncDigit1.decode_text(text_buf);
field_mncDigit2.decode_text(text_buf);
}

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

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

int Selected__PLMN__ID::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Selected__PLMN__ID_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Selected__PLMN__ID_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Selected__PLMN__ID_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Selected__PLMN__ID_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), 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());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_24) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Selected__PLMN__ID::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Selected__PLMN__ID_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Selected__PLMN__ID_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::HEX1_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Selected__PLMN__ID_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Selected__PLMN__ID_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[8]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 6;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(6);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[8]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[8]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Selected__PLMN__ID_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Selected__PLMN__ID_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_24) {
  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_24.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct Selected__PLMN__ID_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
HEXSTRING_template field_mccDigit1;
HEXSTRING_template field_mccDigit2;
HEXSTRING_template field_mccDigit3;
HEXSTRING_template field_mncDigit3;
HEXSTRING_template field_mncDigit1;
HEXSTRING_template field_mncDigit2;
};

void Selected__PLMN__ID_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_mccDigit1 = ANY_VALUE;
single_value->field_mccDigit2 = ANY_VALUE;
single_value->field_mccDigit3 = ANY_VALUE;
single_value->field_mncDigit3 = ANY_VALUE;
single_value->field_mncDigit1 = ANY_VALUE;
single_value->field_mncDigit2 = ANY_VALUE;
}
}
}

void Selected__PLMN__ID_template::copy_value(const Selected__PLMN__ID& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mccDigit1().is_bound()) {
  single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
  single_value->field_mccDigit1.clean_up();
}
if (other_value.mccDigit2().is_bound()) {
  single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
  single_value->field_mccDigit2.clean_up();
}
if (other_value.mccDigit3().is_bound()) {
  single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
  single_value->field_mccDigit3.clean_up();
}
if (other_value.mncDigit3().is_bound()) {
  single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
  single_value->field_mncDigit3.clean_up();
}
if (other_value.mncDigit1().is_bound()) {
  single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
  single_value->field_mncDigit1.clean_up();
}
if (other_value.mncDigit2().is_bound()) {
  single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
  single_value->field_mncDigit2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Selected__PLMN__ID_template::copy_template(const Selected__PLMN__ID_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit1().get_selection()) {
single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
single_value->field_mccDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit2().get_selection()) {
single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
single_value->field_mccDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit3().get_selection()) {
single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
single_value->field_mccDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit3().get_selection()) {
single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
single_value->field_mncDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit1().get_selection()) {
single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
single_value->field_mncDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit2().get_selection()) {
single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
single_value->field_mncDigit2.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 Selected__PLMN__ID_template[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 Selected__PLMN__ID_template(*other_value.implication_.precondition);
implication_.implied_template = new Selected__PLMN__ID_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 @BSSGP_Types.Selected_PLMN_ID.");
break;
}
set_selection(other_value);
}

Selected__PLMN__ID_template::Selected__PLMN__ID_template()
{
}

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

Selected__PLMN__ID_template::Selected__PLMN__ID_template(const Selected__PLMN__ID& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Selected__PLMN__ID_template& Selected__PLMN__ID_template::operator=(const OPTIONAL<Selected__PLMN__ID>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Selected__PLMN__ID&)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 @BSSGP_Types.Selected_PLMN_ID.");
}
return *this;
}

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

boolean Selected__PLMN__ID_template::match(const Selected__PLMN__ID& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.mccDigit1().is_bound()) return FALSE;
if(!single_value->field_mccDigit1.match(other_value.mccDigit1(), legacy))return FALSE;
if(!other_value.mccDigit2().is_bound()) return FALSE;
if(!single_value->field_mccDigit2.match(other_value.mccDigit2(), legacy))return FALSE;
if(!other_value.mccDigit3().is_bound()) return FALSE;
if(!single_value->field_mccDigit3.match(other_value.mccDigit3(), legacy))return FALSE;
if(!other_value.mncDigit3().is_bound()) return FALSE;
if(!single_value->field_mncDigit3.match(other_value.mncDigit3(), legacy))return FALSE;
if(!other_value.mncDigit1().is_bound()) return FALSE;
if(!single_value->field_mncDigit1.match(other_value.mncDigit1(), legacy))return FALSE;
if(!other_value.mncDigit2().is_bound()) return FALSE;
if(!single_value->field_mncDigit2.match(other_value.mncDigit2(), 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 @BSSGP_Types.Selected_PLMN_ID.");
}
return FALSE;
}

boolean Selected__PLMN__ID_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_mccDigit1.is_bound()
 || single_value->field_mccDigit2.is_bound()
 || single_value->field_mccDigit3.is_bound()
 || single_value->field_mncDigit3.is_bound()
 || single_value->field_mncDigit1.is_bound()
 || single_value->field_mncDigit2.is_bound();
}

boolean Selected__PLMN__ID_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_mccDigit1.is_value()
 && single_value->field_mccDigit2.is_value()
 && single_value->field_mccDigit3.is_value()
 && single_value->field_mncDigit3.is_value()
 && single_value->field_mncDigit1.is_value()
 && single_value->field_mncDigit2.is_value();
}

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

Selected__PLMN__ID Selected__PLMN__ID_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 @BSSGP_Types.Selected_PLMN_ID.");
Selected__PLMN__ID ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mccDigit1.is_bound()) {
ret_val.mccDigit1() = single_value->field_mccDigit1.valueof();
}
if (single_value->field_mccDigit2.is_bound()) {
ret_val.mccDigit2() = single_value->field_mccDigit2.valueof();
}
if (single_value->field_mccDigit3.is_bound()) {
ret_val.mccDigit3() = single_value->field_mccDigit3.valueof();
}
if (single_value->field_mncDigit3.is_bound()) {
ret_val.mncDigit3() = single_value->field_mncDigit3.valueof();
}
if (single_value->field_mncDigit1.is_bound()) {
ret_val.mncDigit1() = single_value->field_mncDigit1.valueof();
}
if (single_value->field_mncDigit2.is_bound()) {
ret_val.mncDigit2() = single_value->field_mncDigit2.valueof();
}
return ret_val;
}

void Selected__PLMN__ID_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 @BSSGP_Types.Selected_PLMN_ID.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Selected__PLMN__ID_template[list_length];
}

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

OCTETSTRING_template& Selected__PLMN__ID_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Selected__PLMN__ID_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Selected_PLMN_ID.");
return single_value->field_iEI;
}

BITSTRING_template& Selected__PLMN__ID_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Selected__PLMN__ID_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Selected_PLMN_ID.");
return single_value->field_ext;
}

LIN2__2a_template& Selected__PLMN__ID_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Selected__PLMN__ID_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Selected_PLMN_ID.");
return single_value->field_lengthIndicator;
}

HEXSTRING_template& Selected__PLMN__ID_template::mccDigit1()
{
set_specific();
return single_value->field_mccDigit1;
}

const HEXSTRING_template& Selected__PLMN__ID_template::mccDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit1 of a non-specific template of type @BSSGP_Types.Selected_PLMN_ID.");
return single_value->field_mccDigit1;
}

HEXSTRING_template& Selected__PLMN__ID_template::mccDigit2()
{
set_specific();
return single_value->field_mccDigit2;
}

const HEXSTRING_template& Selected__PLMN__ID_template::mccDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit2 of a non-specific template of type @BSSGP_Types.Selected_PLMN_ID.");
return single_value->field_mccDigit2;
}

HEXSTRING_template& Selected__PLMN__ID_template::mccDigit3()
{
set_specific();
return single_value->field_mccDigit3;
}

const HEXSTRING_template& Selected__PLMN__ID_template::mccDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit3 of a non-specific template of type @BSSGP_Types.Selected_PLMN_ID.");
return single_value->field_mccDigit3;
}

HEXSTRING_template& Selected__PLMN__ID_template::mncDigit3()
{
set_specific();
return single_value->field_mncDigit3;
}

const HEXSTRING_template& Selected__PLMN__ID_template::mncDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit3 of a non-specific template of type @BSSGP_Types.Selected_PLMN_ID.");
return single_value->field_mncDigit3;
}

HEXSTRING_template& Selected__PLMN__ID_template::mncDigit1()
{
set_specific();
return single_value->field_mncDigit1;
}

const HEXSTRING_template& Selected__PLMN__ID_template::mncDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit1 of a non-specific template of type @BSSGP_Types.Selected_PLMN_ID.");
return single_value->field_mncDigit1;
}

HEXSTRING_template& Selected__PLMN__ID_template::mncDigit2()
{
set_specific();
return single_value->field_mncDigit2;
}

const HEXSTRING_template& Selected__PLMN__ID_template::mncDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit2 of a non-specific template of type @BSSGP_Types.Selected_PLMN_ID.");
return single_value->field_mncDigit2;
}

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

void Selected__PLMN__ID_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.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 Selected__PLMN__ID_template::log_match(const Selected__PLMN__ID& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit1.match(match_value.mccDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit1");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit2.match(match_value.mccDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit2");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit3.match(match_value.mccDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit3");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit3.match(match_value.mncDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit3");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit1.match(match_value.mncDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit1");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit2.match(match_value.mncDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit2");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), 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 Selected__PLMN__ID_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_mccDigit1.encode_text(text_buf);
single_value->field_mccDigit2.encode_text(text_buf);
single_value->field_mccDigit3.encode_text(text_buf);
single_value->field_mncDigit3.encode_text(text_buf);
single_value->field_mncDigit1.encode_text(text_buf);
single_value->field_mncDigit2.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 @BSSGP_Types.Selected_PLMN_ID.");
}
}

void Selected__PLMN__ID_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_mccDigit1.decode_text(text_buf);
single_value->field_mccDigit2.decode_text(text_buf);
single_value->field_mccDigit3.decode_text(text_buf);
single_value->field_mncDigit3.decode_text(text_buf);
single_value->field_mncDigit1.decode_text(text_buf);
single_value->field_mncDigit2.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 Selected__PLMN__ID_template[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 @BSSGP_Types.Selected_PLMN_ID.");
}
}

void Selected__PLMN__ID_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: {
    Selected__PLMN__ID_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 @BSSGP_Types.Selected_PLMN_ID 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Selected_PLMN_ID: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Selected__PLMN__ID_template* precondition = new Selected__PLMN__ID_template;
    precondition->set_param(*param.get_elem(0));
    Selected__PLMN__ID_template* implied_template = new Selected__PLMN__ID_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Selected__PLMN__ID_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Selected_PLMN_ID");
  }
  is_ifpresent = param.get_ifpresent();
}

void Selected__PLMN__ID_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Selected_PLMN_ID");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Selected_PLMN_ID");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Selected_PLMN_ID");
single_value->field_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Selected_PLMN_ID");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Selected_PLMN_ID");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Selected_PLMN_ID");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Selected_PLMN_ID");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Selected_PLMN_ID");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Selected_PLMN_ID");
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 : "@BSSGP_Types.Selected_PLMN_ID");
}

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

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

Priority__Class__Indicator::Priority__Class__Indicator()
{
}

Priority__Class__Indicator::Priority__Class__Indicator(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_priority__Class__Indicator__Value,
    const BITSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_priority__Class__Indicator__Value(par_priority__Class__Indicator__Value),
  field_spare(par_spare)
{
}

Priority__Class__Indicator::Priority__Class__Indicator(const Priority__Class__Indicator& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Priority_Class_Indicator.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.priority__Class__Indicator__Value().is_bound()) field_priority__Class__Indicator__Value = other_value.priority__Class__Indicator__Value();
else field_priority__Class__Indicator__Value.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void Priority__Class__Indicator::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_priority__Class__Indicator__Value.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* Priority__Class__Indicator::get_descriptor() const { return &Priority__Class__Indicator_descr_; }
Priority__Class__Indicator& Priority__Class__Indicator::operator=(const Priority__Class__Indicator& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Priority_Class_Indicator.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.priority__Class__Indicator__Value().is_bound()) field_priority__Class__Indicator__Value = other_value.priority__Class__Indicator__Value();
  else field_priority__Class__Indicator__Value.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean Priority__Class__Indicator::operator==(const Priority__Class__Indicator& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_priority__Class__Indicator__Value==other_value.field_priority__Class__Indicator__Value
  && field_spare==other_value.field_spare;
}

boolean Priority__Class__Indicator::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_priority__Class__Indicator__Value.is_bound())
  || (field_spare.is_bound());
}
boolean Priority__Class__Indicator::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_priority__Class__Indicator__Value.is_value()
  && field_spare.is_value();
}
void Priority__Class__Indicator::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", priority_Class_Indicator_Value := ");
field_priority__Class__Indicator__Value.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void Priority__Class__Indicator::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (priority__Class__Indicator__Value().is_bound()) priority__Class__Indicator__Value().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void Priority__Class__Indicator::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_priority__Class__Indicator__Value.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void Priority__Class__Indicator::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_priority__Class__Indicator__Value.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int Priority__Class__Indicator::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Priority__Class__Indicator_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Priority__Class__Indicator_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Priority__Class__Indicator_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Priority__Class__Indicator_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_priority__Class__Indicator__Value.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT7_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_113) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Priority__Class__Indicator::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Priority__Class__Indicator_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Priority__Class__Indicator_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT7_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Priority__Class__Indicator_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Priority__Class__Indicator_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_priority__Class__Indicator__Value.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[4]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Priority__Class__Indicator_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Priority__Class__Indicator_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_113) {
  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_113.RAW_encode(General__Types::OCT1_descr_,*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 Priority__Class__Indicator_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_priority__Class__Indicator__Value;
BITSTRING_template field_spare;
};

void Priority__Class__Indicator_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_priority__Class__Indicator__Value = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void Priority__Class__Indicator_template::copy_value(const Priority__Class__Indicator& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.priority__Class__Indicator__Value().is_bound()) {
  single_value->field_priority__Class__Indicator__Value = other_value.priority__Class__Indicator__Value();
} else {
  single_value->field_priority__Class__Indicator__Value.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Priority__Class__Indicator_template::copy_template(const Priority__Class__Indicator_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.priority__Class__Indicator__Value().get_selection()) {
single_value->field_priority__Class__Indicator__Value = other_value.priority__Class__Indicator__Value();
} else {
single_value->field_priority__Class__Indicator__Value.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Priority__Class__Indicator_template[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 Priority__Class__Indicator_template(*other_value.implication_.precondition);
implication_.implied_template = new Priority__Class__Indicator_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 @BSSGP_Types.Priority_Class_Indicator.");
break;
}
set_selection(other_value);
}

Priority__Class__Indicator_template::Priority__Class__Indicator_template()
{
}

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

Priority__Class__Indicator_template::Priority__Class__Indicator_template(const Priority__Class__Indicator& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Priority__Class__Indicator_template& Priority__Class__Indicator_template::operator=(const OPTIONAL<Priority__Class__Indicator>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Priority__Class__Indicator&)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 @BSSGP_Types.Priority_Class_Indicator.");
}
return *this;
}

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

boolean Priority__Class__Indicator_template::match(const Priority__Class__Indicator& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.priority__Class__Indicator__Value().is_bound()) return FALSE;
if(!single_value->field_priority__Class__Indicator__Value.match(other_value.priority__Class__Indicator__Value(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.Priority_Class_Indicator.");
}
return FALSE;
}

boolean Priority__Class__Indicator_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_priority__Class__Indicator__Value.is_bound()
 || single_value->field_spare.is_bound();
}

boolean Priority__Class__Indicator_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_priority__Class__Indicator__Value.is_value()
 && single_value->field_spare.is_value();
}

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

Priority__Class__Indicator Priority__Class__Indicator_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 @BSSGP_Types.Priority_Class_Indicator.");
Priority__Class__Indicator ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_priority__Class__Indicator__Value.is_bound()) {
ret_val.priority__Class__Indicator__Value() = single_value->field_priority__Class__Indicator__Value.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void Priority__Class__Indicator_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 @BSSGP_Types.Priority_Class_Indicator.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Priority__Class__Indicator_template[list_length];
}

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

OCTETSTRING_template& Priority__Class__Indicator_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Priority__Class__Indicator_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Priority_Class_Indicator.");
return single_value->field_iEI;
}

BITSTRING_template& Priority__Class__Indicator_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Priority__Class__Indicator_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Priority_Class_Indicator.");
return single_value->field_ext;
}

LIN2__2a_template& Priority__Class__Indicator_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Priority__Class__Indicator_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Priority_Class_Indicator.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& Priority__Class__Indicator_template::priority__Class__Indicator__Value()
{
set_specific();
return single_value->field_priority__Class__Indicator__Value;
}

const BITSTRING_template& Priority__Class__Indicator_template::priority__Class__Indicator__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priority_Class_Indicator_Value of a non-specific template of type @BSSGP_Types.Priority_Class_Indicator.");
return single_value->field_priority__Class__Indicator__Value;
}

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

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

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

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

void Priority__Class__Indicator_template::log_match(const Priority__Class__Indicator& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_priority__Class__Indicator__Value.match(match_value.priority__Class__Indicator__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".priority_Class_Indicator_Value");
single_value->field_priority__Class__Indicator__Value.log_match(match_value.priority__Class__Indicator__Value(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", priority_Class_Indicator_Value := ");
single_value->field_priority__Class__Indicator__Value.log_match(match_value.priority__Class__Indicator__Value(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void Priority__Class__Indicator_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_priority__Class__Indicator__Value.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Priority__Class__Indicator_template[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 @BSSGP_Types.Priority_Class_Indicator.");
}
}

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

void Priority__Class__Indicator_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_Class_Indicator");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_Class_Indicator");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_Class_Indicator");
single_value->field_priority__Class__Indicator__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_Class_Indicator");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_Class_Indicator");
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 : "@BSSGP_Types.Priority_Class_Indicator");
}

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

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

EDRX__Parameters::EDRX__Parameters()
{
}

EDRX__Parameters::EDRX__Parameters(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_eDRX__Cycle__Value,
    const BITSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_eDRX__Cycle__Value(par_eDRX__Cycle__Value),
  field_spare(par_spare)
{
}

EDRX__Parameters::EDRX__Parameters(const EDRX__Parameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.EDRX_Parameters.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.eDRX__Cycle__Value().is_bound()) field_eDRX__Cycle__Value = other_value.eDRX__Cycle__Value();
else field_eDRX__Cycle__Value.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void EDRX__Parameters::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_eDRX__Cycle__Value.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* EDRX__Parameters::get_descriptor() const { return &EDRX__Parameters_descr_; }
EDRX__Parameters& EDRX__Parameters::operator=(const EDRX__Parameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.EDRX_Parameters.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.eDRX__Cycle__Value().is_bound()) field_eDRX__Cycle__Value = other_value.eDRX__Cycle__Value();
  else field_eDRX__Cycle__Value.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean EDRX__Parameters::operator==(const EDRX__Parameters& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_eDRX__Cycle__Value==other_value.field_eDRX__Cycle__Value
  && field_spare==other_value.field_spare;
}

boolean EDRX__Parameters::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_eDRX__Cycle__Value.is_bound())
  || (field_spare.is_bound());
}
boolean EDRX__Parameters::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_eDRX__Cycle__Value.is_value()
  && field_spare.is_value();
}
void EDRX__Parameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", eDRX_Cycle_Value := ");
field_eDRX__Cycle__Value.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void EDRX__Parameters::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (eDRX__Cycle__Value().is_bound()) eDRX__Cycle__Value().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void EDRX__Parameters::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_eDRX__Cycle__Value.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void EDRX__Parameters::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_eDRX__Cycle__Value.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int EDRX__Parameters::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, EDRX__Parameters_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(EDRX__Parameters_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, EDRX__Parameters_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(EDRX__Parameters_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_eDRX__Cycle__Value.RAW_decode(General__Types::BIT4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_16) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int EDRX__Parameters::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, EDRX__Parameters_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, EDRX__Parameters_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT4_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(EDRX__Parameters_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(EDRX__Parameters_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_eDRX__Cycle__Value.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[4]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(EDRX__Parameters_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(EDRX__Parameters_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_16) {
  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_16.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct EDRX__Parameters_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_eDRX__Cycle__Value;
BITSTRING_template field_spare;
};

void EDRX__Parameters_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_eDRX__Cycle__Value = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void EDRX__Parameters_template::copy_value(const EDRX__Parameters& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.eDRX__Cycle__Value().is_bound()) {
  single_value->field_eDRX__Cycle__Value = other_value.eDRX__Cycle__Value();
} else {
  single_value->field_eDRX__Cycle__Value.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void EDRX__Parameters_template::copy_template(const EDRX__Parameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eDRX__Cycle__Value().get_selection()) {
single_value->field_eDRX__Cycle__Value = other_value.eDRX__Cycle__Value();
} else {
single_value->field_eDRX__Cycle__Value.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new EDRX__Parameters_template[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 EDRX__Parameters_template(*other_value.implication_.precondition);
implication_.implied_template = new EDRX__Parameters_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 @BSSGP_Types.EDRX_Parameters.");
break;
}
set_selection(other_value);
}

EDRX__Parameters_template::EDRX__Parameters_template()
{
}

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

EDRX__Parameters_template::EDRX__Parameters_template(const EDRX__Parameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

EDRX__Parameters_template& EDRX__Parameters_template::operator=(const OPTIONAL<EDRX__Parameters>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const EDRX__Parameters&)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 @BSSGP_Types.EDRX_Parameters.");
}
return *this;
}

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

boolean EDRX__Parameters_template::match(const EDRX__Parameters& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.eDRX__Cycle__Value().is_bound()) return FALSE;
if(!single_value->field_eDRX__Cycle__Value.match(other_value.eDRX__Cycle__Value(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.EDRX_Parameters.");
}
return FALSE;
}

boolean EDRX__Parameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_eDRX__Cycle__Value.is_bound()
 || single_value->field_spare.is_bound();
}

boolean EDRX__Parameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_eDRX__Cycle__Value.is_value()
 && single_value->field_spare.is_value();
}

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

EDRX__Parameters EDRX__Parameters_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 @BSSGP_Types.EDRX_Parameters.");
EDRX__Parameters ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_eDRX__Cycle__Value.is_bound()) {
ret_val.eDRX__Cycle__Value() = single_value->field_eDRX__Cycle__Value.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void EDRX__Parameters_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 @BSSGP_Types.EDRX_Parameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new EDRX__Parameters_template[list_length];
}

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

OCTETSTRING_template& EDRX__Parameters_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& EDRX__Parameters_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.EDRX_Parameters.");
return single_value->field_iEI;
}

BITSTRING_template& EDRX__Parameters_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& EDRX__Parameters_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.EDRX_Parameters.");
return single_value->field_ext;
}

LIN2__2a_template& EDRX__Parameters_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& EDRX__Parameters_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.EDRX_Parameters.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& EDRX__Parameters_template::eDRX__Cycle__Value()
{
set_specific();
return single_value->field_eDRX__Cycle__Value;
}

const BITSTRING_template& EDRX__Parameters_template::eDRX__Cycle__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eDRX_Cycle_Value of a non-specific template of type @BSSGP_Types.EDRX_Parameters.");
return single_value->field_eDRX__Cycle__Value;
}

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

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

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

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

void EDRX__Parameters_template::log_match(const EDRX__Parameters& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eDRX__Cycle__Value.match(match_value.eDRX__Cycle__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".eDRX_Cycle_Value");
single_value->field_eDRX__Cycle__Value.log_match(match_value.eDRX__Cycle__Value(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", eDRX_Cycle_Value := ");
single_value->field_eDRX__Cycle__Value.log_match(match_value.eDRX__Cycle__Value(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void EDRX__Parameters_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_eDRX__Cycle__Value.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new EDRX__Parameters_template[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 @BSSGP_Types.EDRX_Parameters.");
}
}

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

void EDRX__Parameters_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.EDRX_Parameters");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.EDRX_Parameters");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.EDRX_Parameters");
single_value->field_eDRX__Cycle__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.EDRX_Parameters");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.EDRX_Parameters");
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 : "@BSSGP_Types.EDRX_Parameters");
}

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

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

Time__Until__Next__Paging__Occasion::Time__Until__Next__Paging__Occasion()
{
}

Time__Until__Next__Paging__Occasion::Time__Until__Next__Paging__Occasion(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const INTEGER& par_minutes,
    const BITSTRING& par_spare,
    const INTEGER& par_seconds,
    const BITSTRING& par_spare2)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_minutes(par_minutes),
  field_spare(par_spare),
  field_seconds(par_seconds),
  field_spare2(par_spare2)
{
}

Time__Until__Next__Paging__Occasion::Time__Until__Next__Paging__Occasion(const Time__Until__Next__Paging__Occasion& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.minutes().is_bound()) field_minutes = other_value.minutes();
else field_minutes.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.seconds().is_bound()) field_seconds = other_value.seconds();
else field_seconds.clean_up();
if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
else field_spare2.clean_up();
}

void Time__Until__Next__Paging__Occasion::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_minutes.clean_up();
field_spare.clean_up();
field_seconds.clean_up();
field_spare2.clean_up();
}

const TTCN_Typedescriptor_t* Time__Until__Next__Paging__Occasion::get_descriptor() const { return &Time__Until__Next__Paging__Occasion_descr_; }
Time__Until__Next__Paging__Occasion& Time__Until__Next__Paging__Occasion::operator=(const Time__Until__Next__Paging__Occasion& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.minutes().is_bound()) field_minutes = other_value.minutes();
  else field_minutes.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.seconds().is_bound()) field_seconds = other_value.seconds();
  else field_seconds.clean_up();
  if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
  else field_spare2.clean_up();
}
return *this;
}

boolean Time__Until__Next__Paging__Occasion::operator==(const Time__Until__Next__Paging__Occasion& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_minutes==other_value.field_minutes
  && field_spare==other_value.field_spare
  && field_seconds==other_value.field_seconds
  && field_spare2==other_value.field_spare2;
}

boolean Time__Until__Next__Paging__Occasion::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_minutes.is_bound())
  || (field_spare.is_bound())
  || (field_seconds.is_bound())
  || (field_spare2.is_bound());
}
boolean Time__Until__Next__Paging__Occasion::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_minutes.is_value()
  && field_spare.is_value()
  && field_seconds.is_value()
  && field_spare2.is_value();
}
void Time__Until__Next__Paging__Occasion::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", minutes := ");
field_minutes.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", seconds := ");
field_seconds.log();
TTCN_Logger::log_event_str(", spare2 := ");
field_spare2.log();
TTCN_Logger::log_event_str(" }");
}

void Time__Until__Next__Paging__Occasion::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (minutes().is_bound()) minutes().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (seconds().is_bound()) seconds().set_implicit_omit();
if (spare2().is_bound()) spare2().set_implicit_omit();
}

void Time__Until__Next__Paging__Occasion::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 @BSSGP_Types.Time_Until_Next_Paging_Occasion 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) minutes().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) seconds().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare2().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "minutes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          minutes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "seconds")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seconds().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Time_Until_Next_Paging_Occasion: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
  }
}

void Time__Until__Next__Paging__Occasion::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_minutes.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_seconds.encode_text(text_buf);
field_spare2.encode_text(text_buf);
}

void Time__Until__Next__Paging__Occasion::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_minutes.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_seconds.decode_text(text_buf);
field_spare2.decode_text(text_buf);
}

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

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

int Time__Until__Next__Paging__Occasion::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Time__Until__Next__Paging__Occasion_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Time__Until__Next__Paging__Occasion_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Time__Until__Next__Paging__Occasion_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Time__Until__Next__Paging__Occasion_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::INT6b_descr_.raw->forceomit);
  decoded_field_length = field_minutes.RAW_decode(General__Types::INT6b_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::INT6b_descr_.raw->forceomit);
  decoded_field_length = field_seconds.RAW_decode(General__Types::INT6b_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_spare2.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_48) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Time__Until__Next__Paging__Occasion::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Time__Until__Next__Paging__Occasion_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Time__Until__Next__Paging__Occasion_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::INT6b_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::INT6b_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT2_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Time__Until__Next__Paging__Occasion_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Time__Until__Next__Paging__Occasion_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_minutes.RAW_encode(General__Types::INT6b_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_seconds.RAW_encode(General__Types::INT6b_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_spare2.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[6]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 4;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(4);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Time__Until__Next__Paging__Occasion_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Time__Until__Next__Paging__Occasion_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_48) {
  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_48.RAW_encode(General__Types::OCT1_descr_,*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 Time__Until__Next__Paging__Occasion_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
INTEGER_template field_minutes;
BITSTRING_template field_spare;
INTEGER_template field_seconds;
BITSTRING_template field_spare2;
};

void Time__Until__Next__Paging__Occasion_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_minutes = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_seconds = ANY_VALUE;
single_value->field_spare2 = ANY_VALUE;
}
}
}

void Time__Until__Next__Paging__Occasion_template::copy_value(const Time__Until__Next__Paging__Occasion& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.minutes().is_bound()) {
  single_value->field_minutes = other_value.minutes();
} else {
  single_value->field_minutes.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.seconds().is_bound()) {
  single_value->field_seconds = other_value.seconds();
} else {
  single_value->field_seconds.clean_up();
}
if (other_value.spare2().is_bound()) {
  single_value->field_spare2 = other_value.spare2();
} else {
  single_value->field_spare2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Time__Until__Next__Paging__Occasion_template::copy_template(const Time__Until__Next__Paging__Occasion_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.minutes().get_selection()) {
single_value->field_minutes = other_value.minutes();
} else {
single_value->field_minutes.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.seconds().get_selection()) {
single_value->field_seconds = other_value.seconds();
} else {
single_value->field_seconds.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare2().get_selection()) {
single_value->field_spare2 = other_value.spare2();
} else {
single_value->field_spare2.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Time__Until__Next__Paging__Occasion_template[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 Time__Until__Next__Paging__Occasion_template(*other_value.implication_.precondition);
implication_.implied_template = new Time__Until__Next__Paging__Occasion_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 @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
break;
}
set_selection(other_value);
}

Time__Until__Next__Paging__Occasion_template::Time__Until__Next__Paging__Occasion_template()
{
}

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

Time__Until__Next__Paging__Occasion_template::Time__Until__Next__Paging__Occasion_template(const Time__Until__Next__Paging__Occasion& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Time__Until__Next__Paging__Occasion_template& Time__Until__Next__Paging__Occasion_template::operator=(const OPTIONAL<Time__Until__Next__Paging__Occasion>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Time__Until__Next__Paging__Occasion&)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 @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
}
return *this;
}

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

boolean Time__Until__Next__Paging__Occasion_template::match(const Time__Until__Next__Paging__Occasion& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.minutes().is_bound()) return FALSE;
if(!single_value->field_minutes.match(other_value.minutes(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.seconds().is_bound()) return FALSE;
if(!single_value->field_seconds.match(other_value.seconds(), legacy))return FALSE;
if(!other_value.spare2().is_bound()) return FALSE;
if(!single_value->field_spare2.match(other_value.spare2(), 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 @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
}
return FALSE;
}

boolean Time__Until__Next__Paging__Occasion_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_minutes.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_seconds.is_bound()
 || single_value->field_spare2.is_bound();
}

boolean Time__Until__Next__Paging__Occasion_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_minutes.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_seconds.is_value()
 && single_value->field_spare2.is_value();
}

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

Time__Until__Next__Paging__Occasion Time__Until__Next__Paging__Occasion_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 @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
Time__Until__Next__Paging__Occasion ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_minutes.is_bound()) {
ret_val.minutes() = single_value->field_minutes.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_seconds.is_bound()) {
ret_val.seconds() = single_value->field_seconds.valueof();
}
if (single_value->field_spare2.is_bound()) {
ret_val.spare2() = single_value->field_spare2.valueof();
}
return ret_val;
}

void Time__Until__Next__Paging__Occasion_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 @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Time__Until__Next__Paging__Occasion_template[list_length];
}

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

OCTETSTRING_template& Time__Until__Next__Paging__Occasion_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Time__Until__Next__Paging__Occasion_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
return single_value->field_iEI;
}

BITSTRING_template& Time__Until__Next__Paging__Occasion_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Time__Until__Next__Paging__Occasion_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
return single_value->field_ext;
}

LIN2__2a_template& Time__Until__Next__Paging__Occasion_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Time__Until__Next__Paging__Occasion_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
return single_value->field_lengthIndicator;
}

INTEGER_template& Time__Until__Next__Paging__Occasion_template::minutes()
{
set_specific();
return single_value->field_minutes;
}

const INTEGER_template& Time__Until__Next__Paging__Occasion_template::minutes() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field minutes of a non-specific template of type @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
return single_value->field_minutes;
}

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

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

INTEGER_template& Time__Until__Next__Paging__Occasion_template::seconds()
{
set_specific();
return single_value->field_seconds;
}

const INTEGER_template& Time__Until__Next__Paging__Occasion_template::seconds() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field seconds of a non-specific template of type @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
return single_value->field_seconds;
}

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

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

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

void Time__Until__Next__Paging__Occasion_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", minutes := ");
single_value->field_minutes.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", seconds := ");
single_value->field_seconds.log();
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Time__Until__Next__Paging__Occasion_template::log_match(const Time__Until__Next__Paging__Occasion& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_minutes.match(match_value.minutes(), legacy)){
TTCN_Logger::log_logmatch_info(".minutes");
single_value->field_minutes.log_match(match_value.minutes(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_seconds.match(match_value.seconds(), legacy)){
TTCN_Logger::log_logmatch_info(".seconds");
single_value->field_seconds.log_match(match_value.seconds(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare2.match(match_value.spare2(), legacy)){
TTCN_Logger::log_logmatch_info(".spare2");
single_value->field_spare2.log_match(match_value.spare2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", minutes := ");
single_value->field_minutes.log_match(match_value.minutes(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", seconds := ");
single_value->field_seconds.log_match(match_value.seconds(), legacy);
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log_match(match_value.spare2(), 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 Time__Until__Next__Paging__Occasion_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_minutes.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_seconds.encode_text(text_buf);
single_value->field_spare2.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
}
}

void Time__Until__Next__Paging__Occasion_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_minutes.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_seconds.decode_text(text_buf);
single_value->field_spare2.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Time__Until__Next__Paging__Occasion_template[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 @BSSGP_Types.Time_Until_Next_Paging_Occasion.");
}
}

void Time__Until__Next__Paging__Occasion_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: {
    Time__Until__Next__Paging__Occasion_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 @BSSGP_Types.Time_Until_Next_Paging_Occasion 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) minutes().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) seconds().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare2().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "minutes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          minutes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "seconds")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seconds().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Time_Until_Next_Paging_Occasion: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Time__Until__Next__Paging__Occasion_template* precondition = new Time__Until__Next__Paging__Occasion_template;
    precondition->set_param(*param.get_elem(0));
    Time__Until__Next__Paging__Occasion_template* implied_template = new Time__Until__Next__Paging__Occasion_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Time__Until__Next__Paging__Occasion_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
  }
  is_ifpresent = param.get_ifpresent();
}

void Time__Until__Next__Paging__Occasion_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
single_value->field_minutes.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
single_value->field_seconds.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
single_value->field_spare2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
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 : "@BSSGP_Types.Time_Until_Next_Paging_Occasion");
}

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

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

Old__Routing__Area__Identification::Old__Routing__Area__Identification()
{
}

Old__Routing__Area__Identification::Old__Routing__Area__Identification(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const HEXSTRING& par_mccDigit1,
    const HEXSTRING& par_mccDigit2,
    const HEXSTRING& par_mccDigit3,
    const HEXSTRING& par_mncDigit3,
    const HEXSTRING& par_mncDigit1,
    const HEXSTRING& par_mncDigit2,
    const OCTETSTRING& par_lac,
    const OCTETSTRING& par_rac)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_mccDigit1(par_mccDigit1),
  field_mccDigit2(par_mccDigit2),
  field_mccDigit3(par_mccDigit3),
  field_mncDigit3(par_mncDigit3),
  field_mncDigit1(par_mncDigit1),
  field_mncDigit2(par_mncDigit2),
  field_lac(par_lac),
  field_rac(par_rac)
{
}

Old__Routing__Area__Identification::Old__Routing__Area__Identification(const Old__Routing__Area__Identification& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Old_Routing_Area_Identification.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
else field_mccDigit1.clean_up();
if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
else field_mccDigit2.clean_up();
if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
else field_mccDigit3.clean_up();
if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
else field_mncDigit3.clean_up();
if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
else field_mncDigit1.clean_up();
if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
else field_mncDigit2.clean_up();
if (other_value.lac().is_bound()) field_lac = other_value.lac();
else field_lac.clean_up();
if (other_value.rac().is_bound()) field_rac = other_value.rac();
else field_rac.clean_up();
}

void Old__Routing__Area__Identification::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_mccDigit1.clean_up();
field_mccDigit2.clean_up();
field_mccDigit3.clean_up();
field_mncDigit3.clean_up();
field_mncDigit1.clean_up();
field_mncDigit2.clean_up();
field_lac.clean_up();
field_rac.clean_up();
}

const TTCN_Typedescriptor_t* Old__Routing__Area__Identification::get_descriptor() const { return &Old__Routing__Area__Identification_descr_; }
Old__Routing__Area__Identification& Old__Routing__Area__Identification::operator=(const Old__Routing__Area__Identification& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Old_Routing_Area_Identification.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
  else field_mccDigit1.clean_up();
  if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
  else field_mccDigit2.clean_up();
  if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
  else field_mccDigit3.clean_up();
  if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
  else field_mncDigit3.clean_up();
  if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
  else field_mncDigit1.clean_up();
  if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
  else field_mncDigit2.clean_up();
  if (other_value.lac().is_bound()) field_lac = other_value.lac();
  else field_lac.clean_up();
  if (other_value.rac().is_bound()) field_rac = other_value.rac();
  else field_rac.clean_up();
}
return *this;
}

boolean Old__Routing__Area__Identification::operator==(const Old__Routing__Area__Identification& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_mccDigit1==other_value.field_mccDigit1
  && field_mccDigit2==other_value.field_mccDigit2
  && field_mccDigit3==other_value.field_mccDigit3
  && field_mncDigit3==other_value.field_mncDigit3
  && field_mncDigit1==other_value.field_mncDigit1
  && field_mncDigit2==other_value.field_mncDigit2
  && field_lac==other_value.field_lac
  && field_rac==other_value.field_rac;
}

boolean Old__Routing__Area__Identification::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mccDigit1.is_bound())
  || (field_mccDigit2.is_bound())
  || (field_mccDigit3.is_bound())
  || (field_mncDigit3.is_bound())
  || (field_mncDigit1.is_bound())
  || (field_mncDigit2.is_bound())
  || (field_lac.is_bound())
  || (field_rac.is_bound());
}
boolean Old__Routing__Area__Identification::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_mccDigit1.is_value()
  && field_mccDigit2.is_value()
  && field_mccDigit3.is_value()
  && field_mncDigit3.is_value()
  && field_mncDigit1.is_value()
  && field_mncDigit2.is_value()
  && field_lac.is_value()
  && field_rac.is_value();
}
void Old__Routing__Area__Identification::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
field_mncDigit2.log();
TTCN_Logger::log_event_str(", lac := ");
field_lac.log();
TTCN_Logger::log_event_str(", rac := ");
field_rac.log();
TTCN_Logger::log_event_str(" }");
}

void Old__Routing__Area__Identification::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
if (lac().is_bound()) lac().set_implicit_omit();
if (rac().is_bound()) rac().set_implicit_omit();
}

void Old__Routing__Area__Identification::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (11<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Old_Routing_Area_Identification has 11 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) lac().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) rac().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Old_Routing_Area_Identification: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Old_Routing_Area_Identification");
  }
}

void Old__Routing__Area__Identification::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mccDigit1.encode_text(text_buf);
field_mccDigit2.encode_text(text_buf);
field_mccDigit3.encode_text(text_buf);
field_mncDigit3.encode_text(text_buf);
field_mncDigit1.encode_text(text_buf);
field_mncDigit2.encode_text(text_buf);
field_lac.encode_text(text_buf);
field_rac.encode_text(text_buf);
}

void Old__Routing__Area__Identification::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mccDigit1.decode_text(text_buf);
field_mccDigit2.decode_text(text_buf);
field_mccDigit3.decode_text(text_buf);
field_mncDigit3.decode_text(text_buf);
field_mncDigit1.decode_text(text_buf);
field_mncDigit2.decode_text(text_buf);
field_lac.decode_text(text_buf);
field_rac.decode_text(text_buf);
}

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

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

int Old__Routing__Area__Identification::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Old__Routing__Area__Identification_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Old__Routing__Area__Identification_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Old__Routing__Area__Identification_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Old__Routing__Area__Identification_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), 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());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_9_force_omit(9, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_lac.RAW_decode(General__Types::OCT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_10_force_omit(10, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_rac.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_17) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Old__Routing__Area__Identification::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 11;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(11);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Old__Routing__Area__Identification_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Old__Routing__Area__Identification_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, General__Types::OCT1_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Old__Routing__Area__Identification_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Old__Routing__Area__Identification_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_lac.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_rac.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[10]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(8);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[8]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[8]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[6].level = myleaf.body.node.nodes[9]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[6].pos = myleaf.body.node.nodes[9]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[7].level = myleaf.body.node.nodes[10]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[7].pos = myleaf.body.node.nodes[10]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Old__Routing__Area__Identification_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Old__Routing__Area__Identification_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_17) {
  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_17.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct Old__Routing__Area__Identification_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
HEXSTRING_template field_mccDigit1;
HEXSTRING_template field_mccDigit2;
HEXSTRING_template field_mccDigit3;
HEXSTRING_template field_mncDigit3;
HEXSTRING_template field_mncDigit1;
HEXSTRING_template field_mncDigit2;
OCTETSTRING_template field_lac;
OCTETSTRING_template field_rac;
};

void Old__Routing__Area__Identification_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_mccDigit1 = ANY_VALUE;
single_value->field_mccDigit2 = ANY_VALUE;
single_value->field_mccDigit3 = ANY_VALUE;
single_value->field_mncDigit3 = ANY_VALUE;
single_value->field_mncDigit1 = ANY_VALUE;
single_value->field_mncDigit2 = ANY_VALUE;
single_value->field_lac = ANY_VALUE;
single_value->field_rac = ANY_VALUE;
}
}
}

void Old__Routing__Area__Identification_template::copy_value(const Old__Routing__Area__Identification& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mccDigit1().is_bound()) {
  single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
  single_value->field_mccDigit1.clean_up();
}
if (other_value.mccDigit2().is_bound()) {
  single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
  single_value->field_mccDigit2.clean_up();
}
if (other_value.mccDigit3().is_bound()) {
  single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
  single_value->field_mccDigit3.clean_up();
}
if (other_value.mncDigit3().is_bound()) {
  single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
  single_value->field_mncDigit3.clean_up();
}
if (other_value.mncDigit1().is_bound()) {
  single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
  single_value->field_mncDigit1.clean_up();
}
if (other_value.mncDigit2().is_bound()) {
  single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
  single_value->field_mncDigit2.clean_up();
}
if (other_value.lac().is_bound()) {
  single_value->field_lac = other_value.lac();
} else {
  single_value->field_lac.clean_up();
}
if (other_value.rac().is_bound()) {
  single_value->field_rac = other_value.rac();
} else {
  single_value->field_rac.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Old__Routing__Area__Identification_template::copy_template(const Old__Routing__Area__Identification_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit1().get_selection()) {
single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
single_value->field_mccDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit2().get_selection()) {
single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
single_value->field_mccDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit3().get_selection()) {
single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
single_value->field_mccDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit3().get_selection()) {
single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
single_value->field_mncDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit1().get_selection()) {
single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
single_value->field_mncDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit2().get_selection()) {
single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
single_value->field_mncDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lac().get_selection()) {
single_value->field_lac = other_value.lac();
} else {
single_value->field_lac.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rac().get_selection()) {
single_value->field_rac = other_value.rac();
} else {
single_value->field_rac.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 Old__Routing__Area__Identification_template[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 Old__Routing__Area__Identification_template(*other_value.implication_.precondition);
implication_.implied_template = new Old__Routing__Area__Identification_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 @BSSGP_Types.Old_Routing_Area_Identification.");
break;
}
set_selection(other_value);
}

Old__Routing__Area__Identification_template::Old__Routing__Area__Identification_template()
{
}

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

Old__Routing__Area__Identification_template::Old__Routing__Area__Identification_template(const Old__Routing__Area__Identification& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Old__Routing__Area__Identification_template& Old__Routing__Area__Identification_template::operator=(const OPTIONAL<Old__Routing__Area__Identification>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Old__Routing__Area__Identification&)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 @BSSGP_Types.Old_Routing_Area_Identification.");
}
return *this;
}

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

boolean Old__Routing__Area__Identification_template::match(const Old__Routing__Area__Identification& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.mccDigit1().is_bound()) return FALSE;
if(!single_value->field_mccDigit1.match(other_value.mccDigit1(), legacy))return FALSE;
if(!other_value.mccDigit2().is_bound()) return FALSE;
if(!single_value->field_mccDigit2.match(other_value.mccDigit2(), legacy))return FALSE;
if(!other_value.mccDigit3().is_bound()) return FALSE;
if(!single_value->field_mccDigit3.match(other_value.mccDigit3(), legacy))return FALSE;
if(!other_value.mncDigit3().is_bound()) return FALSE;
if(!single_value->field_mncDigit3.match(other_value.mncDigit3(), legacy))return FALSE;
if(!other_value.mncDigit1().is_bound()) return FALSE;
if(!single_value->field_mncDigit1.match(other_value.mncDigit1(), legacy))return FALSE;
if(!other_value.mncDigit2().is_bound()) return FALSE;
if(!single_value->field_mncDigit2.match(other_value.mncDigit2(), legacy))return FALSE;
if(!other_value.lac().is_bound()) return FALSE;
if(!single_value->field_lac.match(other_value.lac(), legacy))return FALSE;
if(!other_value.rac().is_bound()) return FALSE;
if(!single_value->field_rac.match(other_value.rac(), 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 @BSSGP_Types.Old_Routing_Area_Identification.");
}
return FALSE;
}

boolean Old__Routing__Area__Identification_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_mccDigit1.is_bound()
 || single_value->field_mccDigit2.is_bound()
 || single_value->field_mccDigit3.is_bound()
 || single_value->field_mncDigit3.is_bound()
 || single_value->field_mncDigit1.is_bound()
 || single_value->field_mncDigit2.is_bound()
 || single_value->field_lac.is_bound()
 || single_value->field_rac.is_bound();
}

boolean Old__Routing__Area__Identification_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_mccDigit1.is_value()
 && single_value->field_mccDigit2.is_value()
 && single_value->field_mccDigit3.is_value()
 && single_value->field_mncDigit3.is_value()
 && single_value->field_mncDigit1.is_value()
 && single_value->field_mncDigit2.is_value()
 && single_value->field_lac.is_value()
 && single_value->field_rac.is_value();
}

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

Old__Routing__Area__Identification Old__Routing__Area__Identification_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 @BSSGP_Types.Old_Routing_Area_Identification.");
Old__Routing__Area__Identification ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mccDigit1.is_bound()) {
ret_val.mccDigit1() = single_value->field_mccDigit1.valueof();
}
if (single_value->field_mccDigit2.is_bound()) {
ret_val.mccDigit2() = single_value->field_mccDigit2.valueof();
}
if (single_value->field_mccDigit3.is_bound()) {
ret_val.mccDigit3() = single_value->field_mccDigit3.valueof();
}
if (single_value->field_mncDigit3.is_bound()) {
ret_val.mncDigit3() = single_value->field_mncDigit3.valueof();
}
if (single_value->field_mncDigit1.is_bound()) {
ret_val.mncDigit1() = single_value->field_mncDigit1.valueof();
}
if (single_value->field_mncDigit2.is_bound()) {
ret_val.mncDigit2() = single_value->field_mncDigit2.valueof();
}
if (single_value->field_lac.is_bound()) {
ret_val.lac() = single_value->field_lac.valueof();
}
if (single_value->field_rac.is_bound()) {
ret_val.rac() = single_value->field_rac.valueof();
}
return ret_val;
}

void Old__Routing__Area__Identification_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 @BSSGP_Types.Old_Routing_Area_Identification.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Old__Routing__Area__Identification_template[list_length];
}

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

OCTETSTRING_template& Old__Routing__Area__Identification_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Old__Routing__Area__Identification_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_iEI;
}

BITSTRING_template& Old__Routing__Area__Identification_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Old__Routing__Area__Identification_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_ext;
}

LIN2__2a_template& Old__Routing__Area__Identification_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Old__Routing__Area__Identification_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_lengthIndicator;
}

HEXSTRING_template& Old__Routing__Area__Identification_template::mccDigit1()
{
set_specific();
return single_value->field_mccDigit1;
}

const HEXSTRING_template& Old__Routing__Area__Identification_template::mccDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit1 of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_mccDigit1;
}

HEXSTRING_template& Old__Routing__Area__Identification_template::mccDigit2()
{
set_specific();
return single_value->field_mccDigit2;
}

const HEXSTRING_template& Old__Routing__Area__Identification_template::mccDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit2 of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_mccDigit2;
}

HEXSTRING_template& Old__Routing__Area__Identification_template::mccDigit3()
{
set_specific();
return single_value->field_mccDigit3;
}

const HEXSTRING_template& Old__Routing__Area__Identification_template::mccDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit3 of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_mccDigit3;
}

HEXSTRING_template& Old__Routing__Area__Identification_template::mncDigit3()
{
set_specific();
return single_value->field_mncDigit3;
}

const HEXSTRING_template& Old__Routing__Area__Identification_template::mncDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit3 of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_mncDigit3;
}

HEXSTRING_template& Old__Routing__Area__Identification_template::mncDigit1()
{
set_specific();
return single_value->field_mncDigit1;
}

const HEXSTRING_template& Old__Routing__Area__Identification_template::mncDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit1 of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_mncDigit1;
}

HEXSTRING_template& Old__Routing__Area__Identification_template::mncDigit2()
{
set_specific();
return single_value->field_mncDigit2;
}

const HEXSTRING_template& Old__Routing__Area__Identification_template::mncDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit2 of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_mncDigit2;
}

OCTETSTRING_template& Old__Routing__Area__Identification_template::lac()
{
set_specific();
return single_value->field_lac;
}

const OCTETSTRING_template& Old__Routing__Area__Identification_template::lac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lac of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_lac;
}

OCTETSTRING_template& Old__Routing__Area__Identification_template::rac()
{
set_specific();
return single_value->field_rac;
}

const OCTETSTRING_template& Old__Routing__Area__Identification_template::rac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rac of a non-specific template of type @BSSGP_Types.Old_Routing_Area_Identification.");
return single_value->field_rac;
}

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

void Old__Routing__Area__Identification_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log();
TTCN_Logger::log_event_str(", lac := ");
single_value->field_lac.log();
TTCN_Logger::log_event_str(", rac := ");
single_value->field_rac.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 Old__Routing__Area__Identification_template::log_match(const Old__Routing__Area__Identification& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit1.match(match_value.mccDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit1");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit2.match(match_value.mccDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit2");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit3.match(match_value.mccDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit3");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit3.match(match_value.mncDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit3");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit1.match(match_value.mncDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit1");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit2.match(match_value.mncDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit2");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lac.match(match_value.lac(), legacy)){
TTCN_Logger::log_logmatch_info(".lac");
single_value->field_lac.log_match(match_value.lac(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rac.match(match_value.rac(), legacy)){
TTCN_Logger::log_logmatch_info(".rac");
single_value->field_rac.log_match(match_value.rac(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), legacy);
TTCN_Logger::log_event_str(", lac := ");
single_value->field_lac.log_match(match_value.lac(), legacy);
TTCN_Logger::log_event_str(", rac := ");
single_value->field_rac.log_match(match_value.rac(), 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 Old__Routing__Area__Identification_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_mccDigit1.encode_text(text_buf);
single_value->field_mccDigit2.encode_text(text_buf);
single_value->field_mccDigit3.encode_text(text_buf);
single_value->field_mncDigit3.encode_text(text_buf);
single_value->field_mncDigit1.encode_text(text_buf);
single_value->field_mncDigit2.encode_text(text_buf);
single_value->field_lac.encode_text(text_buf);
single_value->field_rac.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 @BSSGP_Types.Old_Routing_Area_Identification.");
}
}

void Old__Routing__Area__Identification_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_mccDigit1.decode_text(text_buf);
single_value->field_mccDigit2.decode_text(text_buf);
single_value->field_mccDigit3.decode_text(text_buf);
single_value->field_mncDigit3.decode_text(text_buf);
single_value->field_mncDigit1.decode_text(text_buf);
single_value->field_mncDigit2.decode_text(text_buf);
single_value->field_lac.decode_text(text_buf);
single_value->field_rac.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 Old__Routing__Area__Identification_template[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 @BSSGP_Types.Old_Routing_Area_Identification.");
}
}

void Old__Routing__Area__Identification_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: {
    Old__Routing__Area__Identification_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (11<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Old_Routing_Area_Identification has 11 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) lac().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) rac().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rac")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rac().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Old_Routing_Area_Identification: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Old__Routing__Area__Identification_template* precondition = new Old__Routing__Area__Identification_template;
    precondition->set_param(*param.get_elem(0));
    Old__Routing__Area__Identification_template* implied_template = new Old__Routing__Area__Identification_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Old__Routing__Area__Identification_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Old_Routing_Area_Identification");
  }
  is_ifpresent = param.get_ifpresent();
}

void Old__Routing__Area__Identification_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_lac.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
single_value->field_rac.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Old_Routing_Area_Identification");
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 : "@BSSGP_Types.Old_Routing_Area_Identification");
}

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

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

Attach__Indicator::Attach__Indicator()
{
}

Attach__Indicator::Attach__Indicator(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_spare(par_spare)
{
}

Attach__Indicator::Attach__Indicator(const Attach__Indicator& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Attach_Indicator.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void Attach__Indicator::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* Attach__Indicator::get_descriptor() const { return &Attach__Indicator_descr_; }
Attach__Indicator& Attach__Indicator::operator=(const Attach__Indicator& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Attach_Indicator.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean Attach__Indicator::operator==(const Attach__Indicator& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_spare==other_value.field_spare;
}

boolean Attach__Indicator::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_spare.is_bound());
}
boolean Attach__Indicator::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_spare.is_value();
}
void Attach__Indicator::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void Attach__Indicator::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void Attach__Indicator::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void Attach__Indicator::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int Attach__Indicator::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, Attach__Indicator_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Attach__Indicator_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Attach__Indicator_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Attach__Indicator_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_18) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Attach__Indicator::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Attach__Indicator_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Attach__Indicator_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Attach__Indicator_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Attach__Indicator_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(Attach__Indicator_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(Attach__Indicator_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_18) {
  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_18.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct Attach__Indicator_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_spare;
};

void Attach__Indicator_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void Attach__Indicator_template::copy_value(const Attach__Indicator& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Attach__Indicator_template::copy_template(const Attach__Indicator_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
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 Attach__Indicator_template[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 Attach__Indicator_template(*other_value.implication_.precondition);
implication_.implied_template = new Attach__Indicator_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 @BSSGP_Types.Attach_Indicator.");
break;
}
set_selection(other_value);
}

Attach__Indicator_template::Attach__Indicator_template()
{
}

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

Attach__Indicator_template::Attach__Indicator_template(const Attach__Indicator& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

Attach__Indicator_template& Attach__Indicator_template::operator=(const OPTIONAL<Attach__Indicator>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Attach__Indicator&)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 @BSSGP_Types.Attach_Indicator.");
}
return *this;
}

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

boolean Attach__Indicator_template::match(const Attach__Indicator& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
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 @BSSGP_Types.Attach_Indicator.");
}
return FALSE;
}

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

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

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

Attach__Indicator Attach__Indicator_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 @BSSGP_Types.Attach_Indicator.");
Attach__Indicator ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void Attach__Indicator_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 @BSSGP_Types.Attach_Indicator.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Attach__Indicator_template[list_length];
}

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

OCTETSTRING_template& Attach__Indicator_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Attach__Indicator_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Attach_Indicator.");
return single_value->field_iEI;
}

BITSTRING_template& Attach__Indicator_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Attach__Indicator_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Attach_Indicator.");
return single_value->field_ext;
}

LIN2__2a_template& Attach__Indicator_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Attach__Indicator_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Attach_Indicator.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Attach__Indicator_template::spare()
{
set_specific();
return single_value->field_spare;
}

const OCTETSTRING_template& Attach__Indicator_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @BSSGP_Types.Attach_Indicator.");
return single_value->field_spare;
}

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

void Attach__Indicator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(" }");
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 Attach__Indicator_template::log_match(const Attach__Indicator& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} 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 Attach__Indicator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.Attach_Indicator.");
}
}

void Attach__Indicator_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Attach__Indicator_template[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 @BSSGP_Types.Attach_Indicator.");
}
}

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

void Attach__Indicator_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Attach_Indicator");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Attach_Indicator");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Attach_Indicator");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Attach_Indicator");
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 : "@BSSGP_Types.Attach_Indicator");
}

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

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

PLMN__Identity::PLMN__Identity()
{
}

PLMN__Identity::PLMN__Identity(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const HEXSTRING& par_mccDigit1,
    const HEXSTRING& par_mccDigit2,
    const HEXSTRING& par_mccDigit3,
    const HEXSTRING& par_mncDigit3,
    const HEXSTRING& par_mncDigit1,
    const HEXSTRING& par_mncDigit2)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_mccDigit1(par_mccDigit1),
  field_mccDigit2(par_mccDigit2),
  field_mccDigit3(par_mccDigit3),
  field_mncDigit3(par_mncDigit3),
  field_mncDigit1(par_mncDigit1),
  field_mncDigit2(par_mncDigit2)
{
}

PLMN__Identity::PLMN__Identity(const PLMN__Identity& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PLMN_Identity.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
else field_mccDigit1.clean_up();
if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
else field_mccDigit2.clean_up();
if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
else field_mccDigit3.clean_up();
if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
else field_mncDigit3.clean_up();
if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
else field_mncDigit1.clean_up();
if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
else field_mncDigit2.clean_up();
}

void PLMN__Identity::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_mccDigit1.clean_up();
field_mccDigit2.clean_up();
field_mccDigit3.clean_up();
field_mncDigit3.clean_up();
field_mncDigit1.clean_up();
field_mncDigit2.clean_up();
}

const TTCN_Typedescriptor_t* PLMN__Identity::get_descriptor() const { return &PLMN__Identity_descr_; }
PLMN__Identity& PLMN__Identity::operator=(const PLMN__Identity& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PLMN_Identity.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mccDigit1().is_bound()) field_mccDigit1 = other_value.mccDigit1();
  else field_mccDigit1.clean_up();
  if (other_value.mccDigit2().is_bound()) field_mccDigit2 = other_value.mccDigit2();
  else field_mccDigit2.clean_up();
  if (other_value.mccDigit3().is_bound()) field_mccDigit3 = other_value.mccDigit3();
  else field_mccDigit3.clean_up();
  if (other_value.mncDigit3().is_bound()) field_mncDigit3 = other_value.mncDigit3();
  else field_mncDigit3.clean_up();
  if (other_value.mncDigit1().is_bound()) field_mncDigit1 = other_value.mncDigit1();
  else field_mncDigit1.clean_up();
  if (other_value.mncDigit2().is_bound()) field_mncDigit2 = other_value.mncDigit2();
  else field_mncDigit2.clean_up();
}
return *this;
}

boolean PLMN__Identity::operator==(const PLMN__Identity& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_mccDigit1==other_value.field_mccDigit1
  && field_mccDigit2==other_value.field_mccDigit2
  && field_mccDigit3==other_value.field_mccDigit3
  && field_mncDigit3==other_value.field_mncDigit3
  && field_mncDigit1==other_value.field_mncDigit1
  && field_mncDigit2==other_value.field_mncDigit2;
}

boolean PLMN__Identity::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mccDigit1.is_bound())
  || (field_mccDigit2.is_bound())
  || (field_mccDigit3.is_bound())
  || (field_mncDigit3.is_bound())
  || (field_mncDigit1.is_bound())
  || (field_mncDigit2.is_bound());
}
boolean PLMN__Identity::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_mccDigit1.is_value()
  && field_mccDigit2.is_value()
  && field_mccDigit3.is_value()
  && field_mncDigit3.is_value()
  && field_mncDigit1.is_value()
  && field_mncDigit2.is_value();
}
void PLMN__Identity::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
field_mncDigit2.log();
TTCN_Logger::log_event_str(" }");
}

void PLMN__Identity::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mccDigit1().is_bound()) mccDigit1().set_implicit_omit();
if (mccDigit2().is_bound()) mccDigit2().set_implicit_omit();
if (mccDigit3().is_bound()) mccDigit3().set_implicit_omit();
if (mncDigit3().is_bound()) mncDigit3().set_implicit_omit();
if (mncDigit1().is_bound()) mncDigit1().set_implicit_omit();
if (mncDigit2().is_bound()) mncDigit2().set_implicit_omit();
}

void PLMN__Identity::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 @BSSGP_Types.PLMN_Identity 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PLMN_Identity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PLMN_Identity");
  }
}

void PLMN__Identity::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mccDigit1.encode_text(text_buf);
field_mccDigit2.encode_text(text_buf);
field_mccDigit3.encode_text(text_buf);
field_mncDigit3.encode_text(text_buf);
field_mncDigit1.encode_text(text_buf);
field_mncDigit2.encode_text(text_buf);
}

void PLMN__Identity::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mccDigit1.decode_text(text_buf);
field_mccDigit2.decode_text(text_buf);
field_mccDigit3.decode_text(text_buf);
field_mncDigit3.decode_text(text_buf);
field_mncDigit1.decode_text(text_buf);
field_mncDigit2.decode_text(text_buf);
}

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

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

int PLMN__Identity::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, PLMN__Identity_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(PLMN__Identity_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, PLMN__Identity_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PLMN__Identity_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), 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());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_25) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PLMN__Identity::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PLMN__Identity_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PLMN__Identity_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::HEX1_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(PLMN__Identity_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(PLMN__Identity_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[8]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 6;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(6);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[8]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[8]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(PLMN__Identity_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(PLMN__Identity_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_25) {
  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_25.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PLMN__Identity_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
HEXSTRING_template field_mccDigit1;
HEXSTRING_template field_mccDigit2;
HEXSTRING_template field_mccDigit3;
HEXSTRING_template field_mncDigit3;
HEXSTRING_template field_mncDigit1;
HEXSTRING_template field_mncDigit2;
};

void PLMN__Identity_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_mccDigit1 = ANY_VALUE;
single_value->field_mccDigit2 = ANY_VALUE;
single_value->field_mccDigit3 = ANY_VALUE;
single_value->field_mncDigit3 = ANY_VALUE;
single_value->field_mncDigit1 = ANY_VALUE;
single_value->field_mncDigit2 = ANY_VALUE;
}
}
}

void PLMN__Identity_template::copy_value(const PLMN__Identity& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.mccDigit1().is_bound()) {
  single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
  single_value->field_mccDigit1.clean_up();
}
if (other_value.mccDigit2().is_bound()) {
  single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
  single_value->field_mccDigit2.clean_up();
}
if (other_value.mccDigit3().is_bound()) {
  single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
  single_value->field_mccDigit3.clean_up();
}
if (other_value.mncDigit3().is_bound()) {
  single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
  single_value->field_mncDigit3.clean_up();
}
if (other_value.mncDigit1().is_bound()) {
  single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
  single_value->field_mncDigit1.clean_up();
}
if (other_value.mncDigit2().is_bound()) {
  single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
  single_value->field_mncDigit2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PLMN__Identity_template::copy_template(const PLMN__Identity_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit1().get_selection()) {
single_value->field_mccDigit1 = other_value.mccDigit1();
} else {
single_value->field_mccDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit2().get_selection()) {
single_value->field_mccDigit2 = other_value.mccDigit2();
} else {
single_value->field_mccDigit2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mccDigit3().get_selection()) {
single_value->field_mccDigit3 = other_value.mccDigit3();
} else {
single_value->field_mccDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit3().get_selection()) {
single_value->field_mncDigit3 = other_value.mncDigit3();
} else {
single_value->field_mncDigit3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit1().get_selection()) {
single_value->field_mncDigit1 = other_value.mncDigit1();
} else {
single_value->field_mncDigit1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mncDigit2().get_selection()) {
single_value->field_mncDigit2 = other_value.mncDigit2();
} else {
single_value->field_mncDigit2.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 PLMN__Identity_template[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 PLMN__Identity_template(*other_value.implication_.precondition);
implication_.implied_template = new PLMN__Identity_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 @BSSGP_Types.PLMN_Identity.");
break;
}
set_selection(other_value);
}

PLMN__Identity_template::PLMN__Identity_template()
{
}

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

PLMN__Identity_template::PLMN__Identity_template(const PLMN__Identity& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PLMN__Identity_template& PLMN__Identity_template::operator=(const OPTIONAL<PLMN__Identity>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PLMN__Identity&)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 @BSSGP_Types.PLMN_Identity.");
}
return *this;
}

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

boolean PLMN__Identity_template::match(const PLMN__Identity& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.mccDigit1().is_bound()) return FALSE;
if(!single_value->field_mccDigit1.match(other_value.mccDigit1(), legacy))return FALSE;
if(!other_value.mccDigit2().is_bound()) return FALSE;
if(!single_value->field_mccDigit2.match(other_value.mccDigit2(), legacy))return FALSE;
if(!other_value.mccDigit3().is_bound()) return FALSE;
if(!single_value->field_mccDigit3.match(other_value.mccDigit3(), legacy))return FALSE;
if(!other_value.mncDigit3().is_bound()) return FALSE;
if(!single_value->field_mncDigit3.match(other_value.mncDigit3(), legacy))return FALSE;
if(!other_value.mncDigit1().is_bound()) return FALSE;
if(!single_value->field_mncDigit1.match(other_value.mncDigit1(), legacy))return FALSE;
if(!other_value.mncDigit2().is_bound()) return FALSE;
if(!single_value->field_mncDigit2.match(other_value.mncDigit2(), 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 @BSSGP_Types.PLMN_Identity.");
}
return FALSE;
}

boolean PLMN__Identity_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_mccDigit1.is_bound()
 || single_value->field_mccDigit2.is_bound()
 || single_value->field_mccDigit3.is_bound()
 || single_value->field_mncDigit3.is_bound()
 || single_value->field_mncDigit1.is_bound()
 || single_value->field_mncDigit2.is_bound();
}

boolean PLMN__Identity_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iEI.is_value()
 && single_value->field_ext.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_mccDigit1.is_value()
 && single_value->field_mccDigit2.is_value()
 && single_value->field_mccDigit3.is_value()
 && single_value->field_mncDigit3.is_value()
 && single_value->field_mncDigit1.is_value()
 && single_value->field_mncDigit2.is_value();
}

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

PLMN__Identity PLMN__Identity_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 @BSSGP_Types.PLMN_Identity.");
PLMN__Identity ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mccDigit1.is_bound()) {
ret_val.mccDigit1() = single_value->field_mccDigit1.valueof();
}
if (single_value->field_mccDigit2.is_bound()) {
ret_val.mccDigit2() = single_value->field_mccDigit2.valueof();
}
if (single_value->field_mccDigit3.is_bound()) {
ret_val.mccDigit3() = single_value->field_mccDigit3.valueof();
}
if (single_value->field_mncDigit3.is_bound()) {
ret_val.mncDigit3() = single_value->field_mncDigit3.valueof();
}
if (single_value->field_mncDigit1.is_bound()) {
ret_val.mncDigit1() = single_value->field_mncDigit1.valueof();
}
if (single_value->field_mncDigit2.is_bound()) {
ret_val.mncDigit2() = single_value->field_mncDigit2.valueof();
}
return ret_val;
}

void PLMN__Identity_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 @BSSGP_Types.PLMN_Identity.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PLMN__Identity_template[list_length];
}

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

OCTETSTRING_template& PLMN__Identity_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& PLMN__Identity_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.PLMN_Identity.");
return single_value->field_iEI;
}

BITSTRING_template& PLMN__Identity_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& PLMN__Identity_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.PLMN_Identity.");
return single_value->field_ext;
}

LIN2__2a_template& PLMN__Identity_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& PLMN__Identity_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.PLMN_Identity.");
return single_value->field_lengthIndicator;
}

HEXSTRING_template& PLMN__Identity_template::mccDigit1()
{
set_specific();
return single_value->field_mccDigit1;
}

const HEXSTRING_template& PLMN__Identity_template::mccDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit1 of a non-specific template of type @BSSGP_Types.PLMN_Identity.");
return single_value->field_mccDigit1;
}

HEXSTRING_template& PLMN__Identity_template::mccDigit2()
{
set_specific();
return single_value->field_mccDigit2;
}

const HEXSTRING_template& PLMN__Identity_template::mccDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit2 of a non-specific template of type @BSSGP_Types.PLMN_Identity.");
return single_value->field_mccDigit2;
}

HEXSTRING_template& PLMN__Identity_template::mccDigit3()
{
set_specific();
return single_value->field_mccDigit3;
}

const HEXSTRING_template& PLMN__Identity_template::mccDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit3 of a non-specific template of type @BSSGP_Types.PLMN_Identity.");
return single_value->field_mccDigit3;
}

HEXSTRING_template& PLMN__Identity_template::mncDigit3()
{
set_specific();
return single_value->field_mncDigit3;
}

const HEXSTRING_template& PLMN__Identity_template::mncDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit3 of a non-specific template of type @BSSGP_Types.PLMN_Identity.");
return single_value->field_mncDigit3;
}

HEXSTRING_template& PLMN__Identity_template::mncDigit1()
{
set_specific();
return single_value->field_mncDigit1;
}

const HEXSTRING_template& PLMN__Identity_template::mncDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit1 of a non-specific template of type @BSSGP_Types.PLMN_Identity.");
return single_value->field_mncDigit1;
}

HEXSTRING_template& PLMN__Identity_template::mncDigit2()
{
set_specific();
return single_value->field_mncDigit2;
}

const HEXSTRING_template& PLMN__Identity_template::mncDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit2 of a non-specific template of type @BSSGP_Types.PLMN_Identity.");
return single_value->field_mncDigit2;
}

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

void PLMN__Identity_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log();
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log();
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log();
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log();
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log();
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.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 PLMN__Identity_template::log_match(const PLMN__Identity& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit1.match(match_value.mccDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit1");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit2.match(match_value.mccDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit2");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mccDigit3.match(match_value.mccDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mccDigit3");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit3.match(match_value.mncDigit3(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit3");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit1.match(match_value.mncDigit1(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit1");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mncDigit2.match(match_value.mncDigit2(), legacy)){
TTCN_Logger::log_logmatch_info(".mncDigit2");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), 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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", mccDigit1 := ");
single_value->field_mccDigit1.log_match(match_value.mccDigit1(), legacy);
TTCN_Logger::log_event_str(", mccDigit2 := ");
single_value->field_mccDigit2.log_match(match_value.mccDigit2(), legacy);
TTCN_Logger::log_event_str(", mccDigit3 := ");
single_value->field_mccDigit3.log_match(match_value.mccDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit3 := ");
single_value->field_mncDigit3.log_match(match_value.mncDigit3(), legacy);
TTCN_Logger::log_event_str(", mncDigit1 := ");
single_value->field_mncDigit1.log_match(match_value.mncDigit1(), legacy);
TTCN_Logger::log_event_str(", mncDigit2 := ");
single_value->field_mncDigit2.log_match(match_value.mncDigit2(), 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 PLMN__Identity_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_mccDigit1.encode_text(text_buf);
single_value->field_mccDigit2.encode_text(text_buf);
single_value->field_mccDigit3.encode_text(text_buf);
single_value->field_mncDigit3.encode_text(text_buf);
single_value->field_mncDigit1.encode_text(text_buf);
single_value->field_mncDigit2.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 @BSSGP_Types.PLMN_Identity.");
}
}

void PLMN__Identity_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_mccDigit1.decode_text(text_buf);
single_value->field_mccDigit2.decode_text(text_buf);
single_value->field_mccDigit3.decode_text(text_buf);
single_value->field_mncDigit3.decode_text(text_buf);
single_value->field_mncDigit1.decode_text(text_buf);
single_value->field_mncDigit2.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 PLMN__Identity_template[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 @BSSGP_Types.PLMN_Identity.");
}
}

void PLMN__Identity_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: {
    PLMN__Identity_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 @BSSGP_Types.PLMN_Identity 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) iEI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().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(), "iEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mccDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mccDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mncDigit2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mncDigit2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PLMN_Identity: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PLMN__Identity_template* precondition = new PLMN__Identity_template;
    precondition->set_param(*param.get_elem(0));
    PLMN__Identity_template* implied_template = new PLMN__Identity_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PLMN__Identity_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PLMN_Identity");
  }
  is_ifpresent = param.get_ifpresent();
}

void PLMN__Identity_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PLMN_Identity");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PLMN_Identity");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PLMN_Identity");
single_value->field_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PLMN_Identity");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PLMN_Identity");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PLMN_Identity");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PLMN_Identity");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PLMN_Identity");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PLMN_Identity");
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 : "@BSSGP_Types.PLMN_Identity");
}

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

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

MME__Query::MME__Query()
{
}

MME__Query::MME__Query(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_spare(par_spare)
{
}

MME__Query::MME__Query(const MME__Query& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MME_Query.");
if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
else field_iEI.clean_up();
if (other_value.ext().is_bound()) field_ext = other_value.ext();
else field_ext.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void MME__Query::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* MME__Query::get_descriptor() const { return &MME__Query_descr_; }
MME__Query& MME__Query::operator=(const MME__Query& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MME_Query.");
  if (other_value.iEI().is_bound()) field_iEI = other_value.iEI();
  else field_iEI.clean_up();
  if (other_value.ext().is_bound()) field_ext = other_value.ext();
  else field_ext.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean MME__Query::operator==(const MME__Query& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_spare==other_value.field_spare;
}

boolean MME__Query::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_spare.is_bound());
}
boolean MME__Query::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_spare.is_value();
}
void MME__Query::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iEI := ");
field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void MME__Query::set_implicit_omit()
{
if (iEI().is_bound()) iEI().set_implicit_omit();
if (ext().is_bound()) ext().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void MME__Query::encode_text(Text_Buf& text_buf) const
{
field_iEI.encode_text(text_buf);
field_ext.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void MME__Query::decode_text(Text_Buf& text_buf)
{
field_iEI.decode_text(text_buf);
field_ext.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int MME__Query::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;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field2 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_iEI.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, MME__Query_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(MME__Query_ext_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_ext ==  bs_0) selected_field = 0;
  else if (field_ext ==  bs_1) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, MME__Query_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MME__Query_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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());
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1: {
    INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_);
    field_lengthIndicator.length1() = tmp1;
    value_of_length_field2 += tmp1.get_long_long_val() * 8;
    break; }
  case LIN2__2a::ALT_length2: {
    INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_);
    field_lengthIndicator.length2() = tmp2;
    value_of_length_field2 += tmp2.get_long_long_val() * 8;
    break; }
  default:
    value_of_length_field2 = 0;
  }
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_52) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MME__Query::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MME__Query_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MME__Query_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT1_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(MME__Query_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(MME__Query_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[3]);
  {
  int sel_field = 0;
  while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; }
  const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr;
  int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length;
  delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field];
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  }
  switch (field_lengthIndicator.get_selection()) {
  case LIN2__2a::ALT_length1:
  if (field_ext !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_0.RAW_encode(MME__Query_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case LIN2__2a::ALT_length2:
  if (field_ext !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 1 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(MME__Query_ext_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_52) {
  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_52.RAW_encode(General__Types::OCT1_descr_,*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 MME__Query_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_spare;
};

void MME__Query_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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void MME__Query_template::copy_value(const MME__Query& other_value)
{
single_value = new single_value_struct;
if (other_value.iEI().is_bound()) {
  single_value->field_iEI = other_value.iEI();
} else {
  single_value->field_iEI.clean_up();
}
if (other_value.ext().is_bound()) {
  single_value->field_ext = other_value.ext();
} else {
  single_value->field_ext.clean_up();
}
if (other_value.lengthIndicator().is_bound()) {
  single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
  single_value->field_lengthIndicator.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MME__Query_template::copy_template(const MME__Query_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) {
single_value->field_iEI = other_value.iEI();
} else {
single_value->field_iEI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) {
single_value->field_ext = other_value.ext();
} else {
single_value->field_ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) {
single_value->field_lengthIndicator = other_value.lengthIndicator();
} else {
single_value->field_lengthIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
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 MME__Query_template[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 MME__Query_template(*other_value.implication_.precondition);
implication_.implied_template = new MME__Query_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 @BSSGP_Types.MME_Query.");
break;
}
set_selection(other_value);
}

MME__Query_template::MME__Query_template()
{
}

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

MME__Query_template::MME__Query_template(const MME__Query& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

MME__Query_template& MME__Query_template::operator=(const OPTIONAL<MME__Query>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MME__Query&)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 @BSSGP_Types.MME_Query.");
}
return *this;
}

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

boolean MME__Query_template::match(const MME__Query& 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.iEI().is_bound()) return FALSE;
if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE;
if(!other_value.ext().is_bound()) return FALSE;
if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE;
if(!other_value.lengthIndicator().is_bound()) return FALSE;
if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
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 @BSSGP_Types.MME_Query.");
}
return FALSE;
}

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

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

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

MME__Query MME__Query_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 @BSSGP_Types.MME_Query.");
MME__Query ret_val;
if (single_value->field_iEI.is_bound()) {
ret_val.iEI() = single_value->field_iEI.valueof();
}
if (single_value->field_ext.is_bound()) {
ret_val.ext() = single_value->field_ext.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void MME__Query_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 @BSSGP_Types.MME_Query.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MME__Query_template[list_length];
}

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

OCTETSTRING_template& MME__Query_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& MME__Query_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.MME_Query.");
return single_value->field_iEI;
}

BITSTRING_template& MME__Query_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& MME__Query_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.MME_Query.");
return single_value->field_ext;
}

LIN2__2a_template& MME__Query_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& MME__Query_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.MME_Query.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& MME__Query_template::spare()
{
set_specific();
return single_value->field_spare;
}

const OCTETSTRING_template& MME__Query_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @BSSGP_Types.MME_Query.");
return single_value->field_spare;
}

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

void MME__Query_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iEI := ");
single_value->field_iEI.log();
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(" }");
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 MME__Query_template::log_match(const MME__Query& 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_iEI.match(match_value.iEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iEI");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext.match(match_value.ext(), legacy)){
TTCN_Logger::log_logmatch_info(".ext");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthIndicator");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ iEI := ");
single_value->field_iEI.log_match(match_value.iEI(), legacy);
TTCN_Logger::log_event_str(", ext := ");
single_value->field_ext.log_match(match_value.ext(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(" }");
} 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 MME__Query_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.MME_Query.");
}
}

void MME__Query_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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MME__Query_template[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 @BSSGP_Types.MME_Query.");
}
}

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

void MME__Query_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MME_Query");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MME_Query");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MME_Query");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MME_Query");
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 : "@BSSGP_Types.MME_Query");
}

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

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

PDU__BSSGP__DL__UNITDATA::PDU__BSSGP__DL__UNITDATA()
{
}

PDU__BSSGP__DL__UNITDATA::PDU__BSSGP__DL__UNITDATA(const OCTETSTRING& par_bssgpPduType,
    const OCTETSTRING& par_tLLI__current,
    const QoS__Profile__V& par_qoS__Profile,
    const PDU__Lifetime& par_pDU__Lifetime,
    const OPTIONAL< MS__Radio__Access__Capability >& par_mS__Radio__Access__Capability,
    const OPTIONAL< Priority__BSSGP >& par_priority,
    const OPTIONAL< DRX__Parameters >& par_dRX__Parameters,
    const OPTIONAL< IMSI__BSSGP >& par_iMSI,
    const OPTIONAL< TLLI__BSSGP >& par_tLLI__old,
    const OPTIONAL< PFI >& par_pFI,
    const OPTIONAL< LSA__Information__BSSGP >& par_lSA__Information,
    const OPTIONAL< Service__UTRAN__CCO >& par_service__UTRAN__CCO,
    const OPTIONAL< Service__Class__Indicator >& par_service__Class__Indicator,
    const OPTIONAL< Subscriber__Profile__ID__For__RAT__Priority >& par_subscriber__Profile__ID__For__RAT__Priority,
    const OPTIONAL< Redirection__Indication >& par_redirection__Indication,
    const OPTIONAL< Redirection__Completed >& par_redirection__Completed,
    const OPTIONAL< Unconfirmed__Send__State__Variable >& par_unconfirmed__Send__State__Variable,
    const OPTIONAL< SCI >& par_sCI,
    const OPTIONAL< GGSN__PGW__Location >& par_gGSN__PGW__Location,
    const OPTIONAL< EDRX__Parameters >& par_eDRX__Paremeters,
    const OPTIONAL< Old__Routing__Area__Identification >& par_old__Routing__Area__Identification,
    const OPTIONAL< Attach__Indicator >& par_attach__Indicator,
    const OPTIONAL< Alignment__octets >& par_alignment__octets,
    const LLC__PDU& par_lLC__PDU,
    const OPTIONAL< LLC__PDU >& par_initialLLC__PDU)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI__current(par_tLLI__current),
  field_qoS__Profile(par_qoS__Profile),
  field_pDU__Lifetime(par_pDU__Lifetime),
  field_mS__Radio__Access__Capability(par_mS__Radio__Access__Capability),
  field_priority(par_priority),
  field_dRX__Parameters(par_dRX__Parameters),
  field_iMSI(par_iMSI),
  field_tLLI__old(par_tLLI__old),
  field_pFI(par_pFI),
  field_lSA__Information(par_lSA__Information),
  field_service__UTRAN__CCO(par_service__UTRAN__CCO),
  field_service__Class__Indicator(par_service__Class__Indicator),
  field_subscriber__Profile__ID__For__RAT__Priority(par_subscriber__Profile__ID__For__RAT__Priority),
  field_redirection__Indication(par_redirection__Indication),
  field_redirection__Completed(par_redirection__Completed),
  field_unconfirmed__Send__State__Variable(par_unconfirmed__Send__State__Variable),
  field_sCI(par_sCI),
  field_gGSN__PGW__Location(par_gGSN__PGW__Location),
  field_eDRX__Paremeters(par_eDRX__Paremeters),
  field_old__Routing__Area__Identification(par_old__Routing__Area__Identification),
  field_attach__Indicator(par_attach__Indicator),
  field_alignment__octets(par_alignment__octets),
  field_lLC__PDU(par_lLC__PDU),
  field_initialLLC__PDU(par_initialLLC__PDU)
{
}

PDU__BSSGP__DL__UNITDATA::PDU__BSSGP__DL__UNITDATA(const PDU__BSSGP__DL__UNITDATA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI__current().is_bound()) field_tLLI__current = other_value.tLLI__current();
else field_tLLI__current.clean_up();
if (other_value.qoS__Profile().is_bound()) field_qoS__Profile = other_value.qoS__Profile();
else field_qoS__Profile.clean_up();
if (other_value.pDU__Lifetime().is_bound()) field_pDU__Lifetime = other_value.pDU__Lifetime();
else field_pDU__Lifetime.clean_up();
if (other_value.mS__Radio__Access__Capability().is_bound()) field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
else field_mS__Radio__Access__Capability.clean_up();
if (other_value.priority().is_bound()) field_priority = other_value.priority();
else field_priority.clean_up();
if (other_value.dRX__Parameters().is_bound()) field_dRX__Parameters = other_value.dRX__Parameters();
else field_dRX__Parameters.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.tLLI__old().is_bound()) field_tLLI__old = other_value.tLLI__old();
else field_tLLI__old.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.lSA__Information().is_bound()) field_lSA__Information = other_value.lSA__Information();
else field_lSA__Information.clean_up();
if (other_value.service__UTRAN__CCO().is_bound()) field_service__UTRAN__CCO = other_value.service__UTRAN__CCO();
else field_service__UTRAN__CCO.clean_up();
if (other_value.service__Class__Indicator().is_bound()) field_service__Class__Indicator = other_value.service__Class__Indicator();
else field_service__Class__Indicator.clean_up();
if (other_value.subscriber__Profile__ID__For__RAT__Priority().is_bound()) field_subscriber__Profile__ID__For__RAT__Priority = other_value.subscriber__Profile__ID__For__RAT__Priority();
else field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
if (other_value.redirection__Indication().is_bound()) field_redirection__Indication = other_value.redirection__Indication();
else field_redirection__Indication.clean_up();
if (other_value.redirection__Completed().is_bound()) field_redirection__Completed = other_value.redirection__Completed();
else field_redirection__Completed.clean_up();
if (other_value.unconfirmed__Send__State__Variable().is_bound()) field_unconfirmed__Send__State__Variable = other_value.unconfirmed__Send__State__Variable();
else field_unconfirmed__Send__State__Variable.clean_up();
if (other_value.sCI().is_bound()) field_sCI = other_value.sCI();
else field_sCI.clean_up();
if (other_value.gGSN__PGW__Location().is_bound()) field_gGSN__PGW__Location = other_value.gGSN__PGW__Location();
else field_gGSN__PGW__Location.clean_up();
if (other_value.eDRX__Paremeters().is_bound()) field_eDRX__Paremeters = other_value.eDRX__Paremeters();
else field_eDRX__Paremeters.clean_up();
if (other_value.old__Routing__Area__Identification().is_bound()) field_old__Routing__Area__Identification = other_value.old__Routing__Area__Identification();
else field_old__Routing__Area__Identification.clean_up();
if (other_value.attach__Indicator().is_bound()) field_attach__Indicator = other_value.attach__Indicator();
else field_attach__Indicator.clean_up();
if (other_value.alignment__octets().is_bound()) field_alignment__octets = other_value.alignment__octets();
else field_alignment__octets.clean_up();
if (other_value.lLC__PDU().is_bound()) field_lLC__PDU = other_value.lLC__PDU();
else field_lLC__PDU.clean_up();
if (other_value.initialLLC__PDU().is_bound()) field_initialLLC__PDU = other_value.initialLLC__PDU();
else field_initialLLC__PDU.clean_up();
}

void PDU__BSSGP__DL__UNITDATA::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI__current.clean_up();
field_qoS__Profile.clean_up();
field_pDU__Lifetime.clean_up();
field_mS__Radio__Access__Capability.clean_up();
field_priority.clean_up();
field_dRX__Parameters.clean_up();
field_iMSI.clean_up();
field_tLLI__old.clean_up();
field_pFI.clean_up();
field_lSA__Information.clean_up();
field_service__UTRAN__CCO.clean_up();
field_service__Class__Indicator.clean_up();
field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
field_redirection__Indication.clean_up();
field_redirection__Completed.clean_up();
field_unconfirmed__Send__State__Variable.clean_up();
field_sCI.clean_up();
field_gGSN__PGW__Location.clean_up();
field_eDRX__Paremeters.clean_up();
field_old__Routing__Area__Identification.clean_up();
field_attach__Indicator.clean_up();
field_alignment__octets.clean_up();
field_lLC__PDU.clean_up();
field_initialLLC__PDU.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__DL__UNITDATA::get_descriptor() const { return &PDU__BSSGP__DL__UNITDATA_descr_; }
PDU__BSSGP__DL__UNITDATA& PDU__BSSGP__DL__UNITDATA::operator=(const PDU__BSSGP__DL__UNITDATA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI__current().is_bound()) field_tLLI__current = other_value.tLLI__current();
  else field_tLLI__current.clean_up();
  if (other_value.qoS__Profile().is_bound()) field_qoS__Profile = other_value.qoS__Profile();
  else field_qoS__Profile.clean_up();
  if (other_value.pDU__Lifetime().is_bound()) field_pDU__Lifetime = other_value.pDU__Lifetime();
  else field_pDU__Lifetime.clean_up();
  if (other_value.mS__Radio__Access__Capability().is_bound()) field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
  else field_mS__Radio__Access__Capability.clean_up();
  if (other_value.priority().is_bound()) field_priority = other_value.priority();
  else field_priority.clean_up();
  if (other_value.dRX__Parameters().is_bound()) field_dRX__Parameters = other_value.dRX__Parameters();
  else field_dRX__Parameters.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.tLLI__old().is_bound()) field_tLLI__old = other_value.tLLI__old();
  else field_tLLI__old.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.lSA__Information().is_bound()) field_lSA__Information = other_value.lSA__Information();
  else field_lSA__Information.clean_up();
  if (other_value.service__UTRAN__CCO().is_bound()) field_service__UTRAN__CCO = other_value.service__UTRAN__CCO();
  else field_service__UTRAN__CCO.clean_up();
  if (other_value.service__Class__Indicator().is_bound()) field_service__Class__Indicator = other_value.service__Class__Indicator();
  else field_service__Class__Indicator.clean_up();
  if (other_value.subscriber__Profile__ID__For__RAT__Priority().is_bound()) field_subscriber__Profile__ID__For__RAT__Priority = other_value.subscriber__Profile__ID__For__RAT__Priority();
  else field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
  if (other_value.redirection__Indication().is_bound()) field_redirection__Indication = other_value.redirection__Indication();
  else field_redirection__Indication.clean_up();
  if (other_value.redirection__Completed().is_bound()) field_redirection__Completed = other_value.redirection__Completed();
  else field_redirection__Completed.clean_up();
  if (other_value.unconfirmed__Send__State__Variable().is_bound()) field_unconfirmed__Send__State__Variable = other_value.unconfirmed__Send__State__Variable();
  else field_unconfirmed__Send__State__Variable.clean_up();
  if (other_value.sCI().is_bound()) field_sCI = other_value.sCI();
  else field_sCI.clean_up();
  if (other_value.gGSN__PGW__Location().is_bound()) field_gGSN__PGW__Location = other_value.gGSN__PGW__Location();
  else field_gGSN__PGW__Location.clean_up();
  if (other_value.eDRX__Paremeters().is_bound()) field_eDRX__Paremeters = other_value.eDRX__Paremeters();
  else field_eDRX__Paremeters.clean_up();
  if (other_value.old__Routing__Area__Identification().is_bound()) field_old__Routing__Area__Identification = other_value.old__Routing__Area__Identification();
  else field_old__Routing__Area__Identification.clean_up();
  if (other_value.attach__Indicator().is_bound()) field_attach__Indicator = other_value.attach__Indicator();
  else field_attach__Indicator.clean_up();
  if (other_value.alignment__octets().is_bound()) field_alignment__octets = other_value.alignment__octets();
  else field_alignment__octets.clean_up();
  if (other_value.lLC__PDU().is_bound()) field_lLC__PDU = other_value.lLC__PDU();
  else field_lLC__PDU.clean_up();
  if (other_value.initialLLC__PDU().is_bound()) field_initialLLC__PDU = other_value.initialLLC__PDU();
  else field_initialLLC__PDU.clean_up();
}
return *this;
}

boolean PDU__BSSGP__DL__UNITDATA::operator==(const PDU__BSSGP__DL__UNITDATA& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI__current==other_value.field_tLLI__current
  && field_qoS__Profile==other_value.field_qoS__Profile
  && field_pDU__Lifetime==other_value.field_pDU__Lifetime
  && field_mS__Radio__Access__Capability==other_value.field_mS__Radio__Access__Capability
  && field_priority==other_value.field_priority
  && field_dRX__Parameters==other_value.field_dRX__Parameters
  && field_iMSI==other_value.field_iMSI
  && field_tLLI__old==other_value.field_tLLI__old
  && field_pFI==other_value.field_pFI
  && field_lSA__Information==other_value.field_lSA__Information
  && field_service__UTRAN__CCO==other_value.field_service__UTRAN__CCO
  && field_service__Class__Indicator==other_value.field_service__Class__Indicator
  && field_subscriber__Profile__ID__For__RAT__Priority==other_value.field_subscriber__Profile__ID__For__RAT__Priority
  && field_redirection__Indication==other_value.field_redirection__Indication
  && field_redirection__Completed==other_value.field_redirection__Completed
  && field_unconfirmed__Send__State__Variable==other_value.field_unconfirmed__Send__State__Variable
  && field_sCI==other_value.field_sCI
  && field_gGSN__PGW__Location==other_value.field_gGSN__PGW__Location
  && field_eDRX__Paremeters==other_value.field_eDRX__Paremeters
  && field_old__Routing__Area__Identification==other_value.field_old__Routing__Area__Identification
  && field_attach__Indicator==other_value.field_attach__Indicator
  && field_alignment__octets==other_value.field_alignment__octets
  && field_lLC__PDU==other_value.field_lLC__PDU
  && field_initialLLC__PDU==other_value.field_initialLLC__PDU;
}

boolean PDU__BSSGP__DL__UNITDATA::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI__current.is_bound())
  || (field_qoS__Profile.is_bound())
  || (field_pDU__Lifetime.is_bound())
  || (OPTIONAL_OMIT == field_mS__Radio__Access__Capability.get_selection() || field_mS__Radio__Access__Capability.is_bound())
  || (OPTIONAL_OMIT == field_priority.get_selection() || field_priority.is_bound())
  || (OPTIONAL_OMIT == field_dRX__Parameters.get_selection() || field_dRX__Parameters.is_bound())
  || (OPTIONAL_OMIT == field_iMSI.get_selection() || field_iMSI.is_bound())
  || (OPTIONAL_OMIT == field_tLLI__old.get_selection() || field_tLLI__old.is_bound())
  || (OPTIONAL_OMIT == field_pFI.get_selection() || field_pFI.is_bound())
  || (OPTIONAL_OMIT == field_lSA__Information.get_selection() || field_lSA__Information.is_bound())
  || (OPTIONAL_OMIT == field_service__UTRAN__CCO.get_selection() || field_service__UTRAN__CCO.is_bound())
  || (OPTIONAL_OMIT == field_service__Class__Indicator.get_selection() || field_service__Class__Indicator.is_bound())
  || (OPTIONAL_OMIT == field_subscriber__Profile__ID__For__RAT__Priority.get_selection() || field_subscriber__Profile__ID__For__RAT__Priority.is_bound())
  || (OPTIONAL_OMIT == field_redirection__Indication.get_selection() || field_redirection__Indication.is_bound())
  || (OPTIONAL_OMIT == field_redirection__Completed.get_selection() || field_redirection__Completed.is_bound())
  || (OPTIONAL_OMIT == field_unconfirmed__Send__State__Variable.get_selection() || field_unconfirmed__Send__State__Variable.is_bound())
  || (OPTIONAL_OMIT == field_sCI.get_selection() || field_sCI.is_bound())
  || (OPTIONAL_OMIT == field_gGSN__PGW__Location.get_selection() || field_gGSN__PGW__Location.is_bound())
  || (OPTIONAL_OMIT == field_eDRX__Paremeters.get_selection() || field_eDRX__Paremeters.is_bound())
  || (OPTIONAL_OMIT == field_old__Routing__Area__Identification.get_selection() || field_old__Routing__Area__Identification.is_bound())
  || (OPTIONAL_OMIT == field_attach__Indicator.get_selection() || field_attach__Indicator.is_bound())
  || (OPTIONAL_OMIT == field_alignment__octets.get_selection() || field_alignment__octets.is_bound())
  || (field_lLC__PDU.is_bound())
  || (OPTIONAL_OMIT == field_initialLLC__PDU.get_selection() || field_initialLLC__PDU.is_bound());
}
boolean PDU__BSSGP__DL__UNITDATA::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI__current.is_value()
  && field_qoS__Profile.is_value()
  && field_pDU__Lifetime.is_value()
  && (OPTIONAL_OMIT == field_mS__Radio__Access__Capability.get_selection() || field_mS__Radio__Access__Capability.is_value())
  && (OPTIONAL_OMIT == field_priority.get_selection() || field_priority.is_value())
  && (OPTIONAL_OMIT == field_dRX__Parameters.get_selection() || field_dRX__Parameters.is_value())
  && (OPTIONAL_OMIT == field_iMSI.get_selection() || field_iMSI.is_value())
  && (OPTIONAL_OMIT == field_tLLI__old.get_selection() || field_tLLI__old.is_value())
  && (OPTIONAL_OMIT == field_pFI.get_selection() || field_pFI.is_value())
  && (OPTIONAL_OMIT == field_lSA__Information.get_selection() || field_lSA__Information.is_value())
  && (OPTIONAL_OMIT == field_service__UTRAN__CCO.get_selection() || field_service__UTRAN__CCO.is_value())
  && (OPTIONAL_OMIT == field_service__Class__Indicator.get_selection() || field_service__Class__Indicator.is_value())
  && (OPTIONAL_OMIT == field_subscriber__Profile__ID__For__RAT__Priority.get_selection() || field_subscriber__Profile__ID__For__RAT__Priority.is_value())
  && (OPTIONAL_OMIT == field_redirection__Indication.get_selection() || field_redirection__Indication.is_value())
  && (OPTIONAL_OMIT == field_redirection__Completed.get_selection() || field_redirection__Completed.is_value())
  && (OPTIONAL_OMIT == field_unconfirmed__Send__State__Variable.get_selection() || field_unconfirmed__Send__State__Variable.is_value())
  && (OPTIONAL_OMIT == field_sCI.get_selection() || field_sCI.is_value())
  && (OPTIONAL_OMIT == field_gGSN__PGW__Location.get_selection() || field_gGSN__PGW__Location.is_value())
  && (OPTIONAL_OMIT == field_eDRX__Paremeters.get_selection() || field_eDRX__Paremeters.is_value())
  && (OPTIONAL_OMIT == field_old__Routing__Area__Identification.get_selection() || field_old__Routing__Area__Identification.is_value())
  && (OPTIONAL_OMIT == field_attach__Indicator.get_selection() || field_attach__Indicator.is_value())
  && (OPTIONAL_OMIT == field_alignment__octets.get_selection() || field_alignment__octets.is_value())
  && field_lLC__PDU.is_value()
  && (OPTIONAL_OMIT == field_initialLLC__PDU.get_selection() || field_initialLLC__PDU.is_value());
}
int PDU__BSSGP__DL__UNITDATA::size_of() const
{
  int ret_val = 5;
  if (field_mS__Radio__Access__Capability.ispresent()) ret_val++;
  if (field_priority.ispresent()) ret_val++;
  if (field_dRX__Parameters.ispresent()) ret_val++;
  if (field_iMSI.ispresent()) ret_val++;
  if (field_tLLI__old.ispresent()) ret_val++;
  if (field_pFI.ispresent()) ret_val++;
  if (field_lSA__Information.ispresent()) ret_val++;
  if (field_service__UTRAN__CCO.ispresent()) ret_val++;
  if (field_service__Class__Indicator.ispresent()) ret_val++;
  if (field_subscriber__Profile__ID__For__RAT__Priority.ispresent()) ret_val++;
  if (field_redirection__Indication.ispresent()) ret_val++;
  if (field_redirection__Completed.ispresent()) ret_val++;
  if (field_unconfirmed__Send__State__Variable.ispresent()) ret_val++;
  if (field_sCI.ispresent()) ret_val++;
  if (field_gGSN__PGW__Location.ispresent()) ret_val++;
  if (field_eDRX__Paremeters.ispresent()) ret_val++;
  if (field_old__Routing__Area__Identification.ispresent()) ret_val++;
  if (field_attach__Indicator.ispresent()) ret_val++;
  if (field_alignment__octets.ispresent()) ret_val++;
  if (field_initialLLC__PDU.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__DL__UNITDATA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI_current := ");
field_tLLI__current.log();
TTCN_Logger::log_event_str(", qoS_Profile := ");
field_qoS__Profile.log();
TTCN_Logger::log_event_str(", pDU_Lifetime := ");
field_pDU__Lifetime.log();
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(", priority := ");
field_priority.log();
TTCN_Logger::log_event_str(", dRX_Parameters := ");
field_dRX__Parameters.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", tLLI_old := ");
field_tLLI__old.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", lSA_Information := ");
field_lSA__Information.log();
TTCN_Logger::log_event_str(", service_UTRAN_CCO := ");
field_service__UTRAN__CCO.log();
TTCN_Logger::log_event_str(", service_Class_Indicator := ");
field_service__Class__Indicator.log();
TTCN_Logger::log_event_str(", subscriber_Profile_ID_For_RAT_Priority := ");
field_subscriber__Profile__ID__For__RAT__Priority.log();
TTCN_Logger::log_event_str(", redirection_Indication := ");
field_redirection__Indication.log();
TTCN_Logger::log_event_str(", redirection_Completed := ");
field_redirection__Completed.log();
TTCN_Logger::log_event_str(", unconfirmed_Send_State_Variable := ");
field_unconfirmed__Send__State__Variable.log();
TTCN_Logger::log_event_str(", sCI := ");
field_sCI.log();
TTCN_Logger::log_event_str(", gGSN_PGW_Location := ");
field_gGSN__PGW__Location.log();
TTCN_Logger::log_event_str(", eDRX_Paremeters := ");
field_eDRX__Paremeters.log();
TTCN_Logger::log_event_str(", old_Routing_Area_Identification := ");
field_old__Routing__Area__Identification.log();
TTCN_Logger::log_event_str(", attach_Indicator := ");
field_attach__Indicator.log();
TTCN_Logger::log_event_str(", alignment_octets := ");
field_alignment__octets.log();
TTCN_Logger::log_event_str(", lLC_PDU := ");
field_lLC__PDU.log();
TTCN_Logger::log_event_str(", initialLLC_PDU := ");
field_initialLLC__PDU.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__DL__UNITDATA::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI__current().is_bound()) tLLI__current().set_implicit_omit();
if (qoS__Profile().is_bound()) qoS__Profile().set_implicit_omit();
if (pDU__Lifetime().is_bound()) pDU__Lifetime().set_implicit_omit();
if (!mS__Radio__Access__Capability().is_bound()) mS__Radio__Access__Capability() = OMIT_VALUE;
else mS__Radio__Access__Capability().set_implicit_omit();
if (!priority().is_bound()) priority() = OMIT_VALUE;
else priority().set_implicit_omit();
if (!dRX__Parameters().is_bound()) dRX__Parameters() = OMIT_VALUE;
else dRX__Parameters().set_implicit_omit();
if (!iMSI().is_bound()) iMSI() = OMIT_VALUE;
else iMSI().set_implicit_omit();
if (!tLLI__old().is_bound()) tLLI__old() = OMIT_VALUE;
else tLLI__old().set_implicit_omit();
if (!pFI().is_bound()) pFI() = OMIT_VALUE;
else pFI().set_implicit_omit();
if (!lSA__Information().is_bound()) lSA__Information() = OMIT_VALUE;
else lSA__Information().set_implicit_omit();
if (!service__UTRAN__CCO().is_bound()) service__UTRAN__CCO() = OMIT_VALUE;
else service__UTRAN__CCO().set_implicit_omit();
if (!service__Class__Indicator().is_bound()) service__Class__Indicator() = OMIT_VALUE;
else service__Class__Indicator().set_implicit_omit();
if (!subscriber__Profile__ID__For__RAT__Priority().is_bound()) subscriber__Profile__ID__For__RAT__Priority() = OMIT_VALUE;
else subscriber__Profile__ID__For__RAT__Priority().set_implicit_omit();
if (!redirection__Indication().is_bound()) redirection__Indication() = OMIT_VALUE;
else redirection__Indication().set_implicit_omit();
if (!redirection__Completed().is_bound()) redirection__Completed() = OMIT_VALUE;
else redirection__Completed().set_implicit_omit();
if (!unconfirmed__Send__State__Variable().is_bound()) unconfirmed__Send__State__Variable() = OMIT_VALUE;
else unconfirmed__Send__State__Variable().set_implicit_omit();
if (!sCI().is_bound()) sCI() = OMIT_VALUE;
else sCI().set_implicit_omit();
if (!gGSN__PGW__Location().is_bound()) gGSN__PGW__Location() = OMIT_VALUE;
else gGSN__PGW__Location().set_implicit_omit();
if (!eDRX__Paremeters().is_bound()) eDRX__Paremeters() = OMIT_VALUE;
else eDRX__Paremeters().set_implicit_omit();
if (!old__Routing__Area__Identification().is_bound()) old__Routing__Area__Identification() = OMIT_VALUE;
else old__Routing__Area__Identification().set_implicit_omit();
if (!attach__Indicator().is_bound()) attach__Indicator() = OMIT_VALUE;
else attach__Indicator().set_implicit_omit();
if (!alignment__octets().is_bound()) alignment__octets() = OMIT_VALUE;
else alignment__octets().set_implicit_omit();
if (lLC__PDU().is_bound()) lLC__PDU().set_implicit_omit();
if (!initialLLC__PDU().is_bound()) initialLLC__PDU() = OMIT_VALUE;
else initialLLC__PDU().set_implicit_omit();
}

void PDU__BSSGP__DL__UNITDATA::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (25<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA has 25 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI__current().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) qoS__Profile().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pDU__Lifetime().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mS__Radio__Access__Capability().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) priority().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) dRX__Parameters().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tLLI__old().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) lSA__Information().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) service__UTRAN__CCO().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) service__Class__Indicator().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) subscriber__Profile__ID__For__RAT__Priority().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) redirection__Indication().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) redirection__Completed().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) unconfirmed__Send__State__Variable().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) sCI().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) gGSN__PGW__Location().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) eDRX__Paremeters().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) old__Routing__Area__Identification().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) attach__Indicator().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) alignment__octets().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) lLC__PDU().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) initialLLC__PDU().set_param(*param.get_elem(24));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI_current")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI__current().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "qoS_Profile")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          qoS__Profile().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pDU_Lifetime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pDU__Lifetime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Radio_Access_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Radio__Access__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI_old")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI__old().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lSA_Information")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lSA__Information().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_UTRAN_CCO")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__UTRAN__CCO().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_Class_Indicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__Class__Indicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "subscriber_Profile_ID_For_RAT_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          subscriber__Profile__ID__For__RAT__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirection_Indication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirection__Indication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirection_Completed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirection__Completed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unconfirmed_Send_State_Variable")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unconfirmed__Send__State__Variable().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gGSN_PGW_Location")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gGSN__PGW__Location().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eDRX_Paremeters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eDRX__Paremeters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "old_Routing_Area_Identification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          old__Routing__Area__Identification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attach_Indicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attach__Indicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alignment_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alignment__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "initialLLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          initialLLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
  }
}

void PDU__BSSGP__DL__UNITDATA::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI__current.encode_text(text_buf);
field_qoS__Profile.encode_text(text_buf);
field_pDU__Lifetime.encode_text(text_buf);
field_mS__Radio__Access__Capability.encode_text(text_buf);
field_priority.encode_text(text_buf);
field_dRX__Parameters.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_tLLI__old.encode_text(text_buf);
field_pFI.encode_text(text_buf);
field_lSA__Information.encode_text(text_buf);
field_service__UTRAN__CCO.encode_text(text_buf);
field_service__Class__Indicator.encode_text(text_buf);
field_subscriber__Profile__ID__For__RAT__Priority.encode_text(text_buf);
field_redirection__Indication.encode_text(text_buf);
field_redirection__Completed.encode_text(text_buf);
field_unconfirmed__Send__State__Variable.encode_text(text_buf);
field_sCI.encode_text(text_buf);
field_gGSN__PGW__Location.encode_text(text_buf);
field_eDRX__Paremeters.encode_text(text_buf);
field_old__Routing__Area__Identification.encode_text(text_buf);
field_attach__Indicator.encode_text(text_buf);
field_alignment__octets.encode_text(text_buf);
field_lLC__PDU.encode_text(text_buf);
field_initialLLC__PDU.encode_text(text_buf);
}

void PDU__BSSGP__DL__UNITDATA::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI__current.decode_text(text_buf);
field_qoS__Profile.decode_text(text_buf);
field_pDU__Lifetime.decode_text(text_buf);
field_mS__Radio__Access__Capability.decode_text(text_buf);
field_priority.decode_text(text_buf);
field_dRX__Parameters.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_tLLI__old.decode_text(text_buf);
field_pFI.decode_text(text_buf);
field_lSA__Information.decode_text(text_buf);
field_service__UTRAN__CCO.decode_text(text_buf);
field_service__Class__Indicator.decode_text(text_buf);
field_subscriber__Profile__ID__For__RAT__Priority.decode_text(text_buf);
field_redirection__Indication.decode_text(text_buf);
field_redirection__Completed.decode_text(text_buf);
field_unconfirmed__Send__State__Variable.decode_text(text_buf);
field_sCI.decode_text(text_buf);
field_gGSN__PGW__Location.decode_text(text_buf);
field_eDRX__Paremeters.decode_text(text_buf);
field_old__Routing__Area__Identification.decode_text(text_buf);
field_attach__Indicator.decode_text(text_buf);
field_alignment__octets.decode_text(text_buf);
field_lLC__PDU.decode_text(text_buf);
field_initialLLC__PDU.decode_text(text_buf);
}

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

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

int PDU__BSSGP__DL__UNITDATA::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_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_tLLI__current.RAW_decode(General__Types::OCT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, QoS__Profile__V_descr_.raw->forceomit);
  decoded_field_length = field_qoS__Profile.RAW_decode(QoS__Profile__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__Lifetime_descr_.raw->forceomit);
  decoded_field_length = field_pDU__Lifetime.RAW_decode(PDU__Lifetime_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_mS__Radio__Access__Capability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, MS__Radio__Access__Capability_descr_.raw->forceomit);
  decoded_field_length = field_mS__Radio__Access__Capability().RAW_decode(MS__Radio__Access__Capability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_mS__Radio__Access__Capability = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_mS__Radio__Access__Capability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_priority = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, Priority__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_priority().RAW_decode(Priority__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_priority = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_priority=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_dRX__Parameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, DRX__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_dRX__Parameters().RAW_decode(DRX__Parameters_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_dRX__Parameters = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dRX__Parameters=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_iMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI().RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_iMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iMSI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_tLLI__old = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI__old().RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_tLLI__old = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_tLLI__old=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_pFI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI().RAW_decode(PFI_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_pFI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pFI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_lSA__Information = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, LSA__Information__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_lSA__Information().RAW_decode(LSA__Information__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_lSA__Information = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lSA__Information=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_service__UTRAN__CCO = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, Service__UTRAN__CCO_descr_.raw->forceomit);
  decoded_field_length = field_service__UTRAN__CCO().RAW_decode(Service__UTRAN__CCO_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_service__UTRAN__CCO = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_service__UTRAN__CCO=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_service__Class__Indicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, Service__Class__Indicator_descr_.raw->forceomit);
  decoded_field_length = field_service__Class__Indicator().RAW_decode(Service__Class__Indicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_service__Class__Indicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_service__Class__Indicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_subscriber__Profile__ID__For__RAT__Priority = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, Subscriber__Profile__ID__For__RAT__Priority_descr_.raw->forceomit);
  decoded_field_length = field_subscriber__Profile__ID__For__RAT__Priority().RAW_decode(Subscriber__Profile__ID__For__RAT__Priority_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_subscriber__Profile__ID__For__RAT__Priority = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_subscriber__Profile__ID__For__RAT__Priority=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_redirection__Indication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, Redirection__Indication_descr_.raw->forceomit);
  decoded_field_length = field_redirection__Indication().RAW_decode(Redirection__Indication_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_redirection__Indication = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_redirection__Indication=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_redirection__Completed = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, Redirection__Completed_descr_.raw->forceomit);
  decoded_field_length = field_redirection__Completed().RAW_decode(Redirection__Completed_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_redirection__Completed = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_redirection__Completed=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_unconfirmed__Send__State__Variable = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, Unconfirmed__Send__State__Variable_descr_.raw->forceomit);
  decoded_field_length = field_unconfirmed__Send__State__Variable().RAW_decode(Unconfirmed__Send__State__Variable_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_unconfirmed__Send__State__Variable = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_unconfirmed__Send__State__Variable=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_sCI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, SCI_descr_.raw->forceomit);
  decoded_field_length = field_sCI().RAW_decode(SCI_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_sCI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_sCI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_gGSN__PGW__Location = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, GGSN__PGW__Location_descr_.raw->forceomit);
  decoded_field_length = field_gGSN__PGW__Location().RAW_decode(GGSN__PGW__Location_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_gGSN__PGW__Location = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_gGSN__PGW__Location=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_eDRX__Paremeters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, EDRX__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_eDRX__Paremeters().RAW_decode(EDRX__Parameters_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_eDRX__Paremeters = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_eDRX__Paremeters=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_old__Routing__Area__Identification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, Old__Routing__Area__Identification_descr_.raw->forceomit);
  decoded_field_length = field_old__Routing__Area__Identification().RAW_decode(Old__Routing__Area__Identification_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_old__Routing__Area__Identification = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_old__Routing__Area__Identification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_attach__Indicator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, Attach__Indicator_descr_.raw->forceomit);
  decoded_field_length = field_attach__Indicator().RAW_decode(Attach__Indicator_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_attach__Indicator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_attach__Indicator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_alignment__octets = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, Alignment__octets_descr_.raw->forceomit);
  decoded_field_length = field_alignment__octets().RAW_decode(Alignment__octets_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_alignment__octets = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_alignment__octets=OMIT_VALUE;
  RAW_Force_Omit field_23_force_omit(23, force_omit, LLC__PDU_descr_.raw->forceomit);
  decoded_field_length = field_lLC__PDU.RAW_decode(LLC__PDU_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 0) return 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)(24)) {
    field_initialLLC__PDU = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, LLC__PDU_descr_.raw->forceomit);
  decoded_field_length = field_initialLLC__PDU().RAW_decode(LLC__PDU_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_initialLLC__PDU = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_initialLLC__PDU=OMIT_VALUE;
  if (field_bssgpPduType !=  os_19) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__DL__UNITDATA::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 25;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(25);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, QoS__Profile__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__Lifetime_descr_.raw);
  if (field_mS__Radio__Access__Capability.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MS__Radio__Access__Capability_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_priority.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Priority__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_dRX__Parameters.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, DRX__Parameters_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_iMSI.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, IMSI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_tLLI__old.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, TLLI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_pFI.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, PFI_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_lSA__Information.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, LSA__Information__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_service__UTRAN__CCO.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, Service__UTRAN__CCO_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_service__Class__Indicator.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, Service__Class__Indicator_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_subscriber__Profile__ID__For__RAT__Priority.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, Subscriber__Profile__ID__For__RAT__Priority_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_redirection__Indication.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, Redirection__Indication_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_redirection__Completed.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, Redirection__Completed_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_unconfirmed__Send__State__Variable.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, Unconfirmed__Send__State__Variable_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_sCI.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, SCI_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_gGSN__PGW__Location.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, GGSN__PGW__Location_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_eDRX__Paremeters.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, EDRX__Parameters_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_old__Routing__Area__Identification.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, Old__Routing__Area__Identification_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_attach__Indicator.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, Attach__Indicator_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_alignment__octets.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, Alignment__octets_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, LLC__PDU_descr_.raw);
  if (field_initialLLC__PDU.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, LLC__PDU_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI__current.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_qoS__Profile.RAW_encode(QoS__Profile__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_pDU__Lifetime.RAW_encode(PDU__Lifetime_descr_, *myleaf.body.node.nodes[3]);
  if (field_mS__Radio__Access__Capability.ispresent()) {
  encoded_length += field_mS__Radio__Access__Capability().RAW_encode(MS__Radio__Access__Capability_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_priority.ispresent()) {
  encoded_length += field_priority().RAW_encode(Priority__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_dRX__Parameters.ispresent()) {
  encoded_length += field_dRX__Parameters().RAW_encode(DRX__Parameters_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_iMSI.ispresent()) {
  encoded_length += field_iMSI().RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_tLLI__old.ispresent()) {
  encoded_length += field_tLLI__old().RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_pFI.ispresent()) {
  encoded_length += field_pFI().RAW_encode(PFI_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_lSA__Information.ispresent()) {
  encoded_length += field_lSA__Information().RAW_encode(LSA__Information__BSSGP_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_service__UTRAN__CCO.ispresent()) {
  encoded_length += field_service__UTRAN__CCO().RAW_encode(Service__UTRAN__CCO_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_service__Class__Indicator.ispresent()) {
  encoded_length += field_service__Class__Indicator().RAW_encode(Service__Class__Indicator_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_subscriber__Profile__ID__For__RAT__Priority.ispresent()) {
  encoded_length += field_subscriber__Profile__ID__For__RAT__Priority().RAW_encode(Subscriber__Profile__ID__For__RAT__Priority_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_redirection__Indication.ispresent()) {
  encoded_length += field_redirection__Indication().RAW_encode(Redirection__Indication_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_redirection__Completed.ispresent()) {
  encoded_length += field_redirection__Completed().RAW_encode(Redirection__Completed_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_unconfirmed__Send__State__Variable.ispresent()) {
  encoded_length += field_unconfirmed__Send__State__Variable().RAW_encode(Unconfirmed__Send__State__Variable_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_sCI.ispresent()) {
  encoded_length += field_sCI().RAW_encode(SCI_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_gGSN__PGW__Location.ispresent()) {
  encoded_length += field_gGSN__PGW__Location().RAW_encode(GGSN__PGW__Location_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_eDRX__Paremeters.ispresent()) {
  encoded_length += field_eDRX__Paremeters().RAW_encode(EDRX__Parameters_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_old__Routing__Area__Identification.ispresent()) {
  encoded_length += field_old__Routing__Area__Identification().RAW_encode(Old__Routing__Area__Identification_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_attach__Indicator.ispresent()) {
  encoded_length += field_attach__Indicator().RAW_encode(Attach__Indicator_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_alignment__octets.ispresent()) {
  encoded_length += field_alignment__octets().RAW_encode(Alignment__octets_descr_, *myleaf.body.node.nodes[22]);
  }
  encoded_length += field_lLC__PDU.RAW_encode(LLC__PDU_descr_, *myleaf.body.node.nodes[23]);
  if (field_initialLLC__PDU.ispresent()) {
  encoded_length += field_initialLLC__PDU().RAW_encode(LLC__PDU_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_bssgpPduType !=  os_19) {
  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_19.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__DL__UNITDATA_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
OCTETSTRING_template field_tLLI__current;
QoS__Profile__V_template field_qoS__Profile;
PDU__Lifetime_template field_pDU__Lifetime;
MS__Radio__Access__Capability_template field_mS__Radio__Access__Capability;
Priority__BSSGP_template field_priority;
DRX__Parameters_template field_dRX__Parameters;
IMSI__BSSGP_template field_iMSI;
TLLI__BSSGP_template field_tLLI__old;
PFI_template field_pFI;
LSA__Information__BSSGP_template field_lSA__Information;
Service__UTRAN__CCO_template field_service__UTRAN__CCO;
Service__Class__Indicator_template field_service__Class__Indicator;
Subscriber__Profile__ID__For__RAT__Priority_template field_subscriber__Profile__ID__For__RAT__Priority;
Redirection__Indication_template field_redirection__Indication;
Redirection__Completed_template field_redirection__Completed;
Unconfirmed__Send__State__Variable_template field_unconfirmed__Send__State__Variable;
SCI_template field_sCI;
GGSN__PGW__Location_template field_gGSN__PGW__Location;
EDRX__Parameters_template field_eDRX__Paremeters;
Old__Routing__Area__Identification_template field_old__Routing__Area__Identification;
Attach__Indicator_template field_attach__Indicator;
Alignment__octets_template field_alignment__octets;
LLC__PDU_template field_lLC__PDU;
LLC__PDU_template field_initialLLC__PDU;
};

void PDU__BSSGP__DL__UNITDATA_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI__current = ANY_VALUE;
single_value->field_qoS__Profile = ANY_VALUE;
single_value->field_pDU__Lifetime = ANY_VALUE;
single_value->field_mS__Radio__Access__Capability = ANY_OR_OMIT;
single_value->field_priority = ANY_OR_OMIT;
single_value->field_dRX__Parameters = ANY_OR_OMIT;
single_value->field_iMSI = ANY_OR_OMIT;
single_value->field_tLLI__old = ANY_OR_OMIT;
single_value->field_pFI = ANY_OR_OMIT;
single_value->field_lSA__Information = ANY_OR_OMIT;
single_value->field_service__UTRAN__CCO = ANY_OR_OMIT;
single_value->field_service__Class__Indicator = ANY_OR_OMIT;
single_value->field_subscriber__Profile__ID__For__RAT__Priority = ANY_OR_OMIT;
single_value->field_redirection__Indication = ANY_OR_OMIT;
single_value->field_redirection__Completed = ANY_OR_OMIT;
single_value->field_unconfirmed__Send__State__Variable = ANY_OR_OMIT;
single_value->field_sCI = ANY_OR_OMIT;
single_value->field_gGSN__PGW__Location = ANY_OR_OMIT;
single_value->field_eDRX__Paremeters = ANY_OR_OMIT;
single_value->field_old__Routing__Area__Identification = ANY_OR_OMIT;
single_value->field_attach__Indicator = ANY_OR_OMIT;
single_value->field_alignment__octets = ANY_OR_OMIT;
single_value->field_lLC__PDU = ANY_VALUE;
single_value->field_initialLLC__PDU = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__DL__UNITDATA_template::copy_value(const PDU__BSSGP__DL__UNITDATA& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI__current().is_bound()) {
  single_value->field_tLLI__current = other_value.tLLI__current();
} else {
  single_value->field_tLLI__current.clean_up();
}
if (other_value.qoS__Profile().is_bound()) {
  single_value->field_qoS__Profile = other_value.qoS__Profile();
} else {
  single_value->field_qoS__Profile.clean_up();
}
if (other_value.pDU__Lifetime().is_bound()) {
  single_value->field_pDU__Lifetime = other_value.pDU__Lifetime();
} else {
  single_value->field_pDU__Lifetime.clean_up();
}
if (other_value.mS__Radio__Access__Capability().is_bound()) {
  if (other_value.mS__Radio__Access__Capability().ispresent()) single_value->field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability()();
  else single_value->field_mS__Radio__Access__Capability = OMIT_VALUE;
} else {
  single_value->field_mS__Radio__Access__Capability.clean_up();
}
if (other_value.priority().is_bound()) {
  if (other_value.priority().ispresent()) single_value->field_priority = other_value.priority()();
  else single_value->field_priority = OMIT_VALUE;
} else {
  single_value->field_priority.clean_up();
}
if (other_value.dRX__Parameters().is_bound()) {
  if (other_value.dRX__Parameters().ispresent()) single_value->field_dRX__Parameters = other_value.dRX__Parameters()();
  else single_value->field_dRX__Parameters = OMIT_VALUE;
} else {
  single_value->field_dRX__Parameters.clean_up();
}
if (other_value.iMSI().is_bound()) {
  if (other_value.iMSI().ispresent()) single_value->field_iMSI = other_value.iMSI()();
  else single_value->field_iMSI = OMIT_VALUE;
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.tLLI__old().is_bound()) {
  if (other_value.tLLI__old().ispresent()) single_value->field_tLLI__old = other_value.tLLI__old()();
  else single_value->field_tLLI__old = OMIT_VALUE;
} else {
  single_value->field_tLLI__old.clean_up();
}
if (other_value.pFI().is_bound()) {
  if (other_value.pFI().ispresent()) single_value->field_pFI = other_value.pFI()();
  else single_value->field_pFI = OMIT_VALUE;
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.lSA__Information().is_bound()) {
  if (other_value.lSA__Information().ispresent()) single_value->field_lSA__Information = other_value.lSA__Information()();
  else single_value->field_lSA__Information = OMIT_VALUE;
} else {
  single_value->field_lSA__Information.clean_up();
}
if (other_value.service__UTRAN__CCO().is_bound()) {
  if (other_value.service__UTRAN__CCO().ispresent()) single_value->field_service__UTRAN__CCO = other_value.service__UTRAN__CCO()();
  else single_value->field_service__UTRAN__CCO = OMIT_VALUE;
} else {
  single_value->field_service__UTRAN__CCO.clean_up();
}
if (other_value.service__Class__Indicator().is_bound()) {
  if (other_value.service__Class__Indicator().ispresent()) single_value->field_service__Class__Indicator = other_value.service__Class__Indicator()();
  else single_value->field_service__Class__Indicator = OMIT_VALUE;
} else {
  single_value->field_service__Class__Indicator.clean_up();
}
if (other_value.subscriber__Profile__ID__For__RAT__Priority().is_bound()) {
  if (other_value.subscriber__Profile__ID__For__RAT__Priority().ispresent()) single_value->field_subscriber__Profile__ID__For__RAT__Priority = other_value.subscriber__Profile__ID__For__RAT__Priority()();
  else single_value->field_subscriber__Profile__ID__For__RAT__Priority = OMIT_VALUE;
} else {
  single_value->field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
}
if (other_value.redirection__Indication().is_bound()) {
  if (other_value.redirection__Indication().ispresent()) single_value->field_redirection__Indication = other_value.redirection__Indication()();
  else single_value->field_redirection__Indication = OMIT_VALUE;
} else {
  single_value->field_redirection__Indication.clean_up();
}
if (other_value.redirection__Completed().is_bound()) {
  if (other_value.redirection__Completed().ispresent()) single_value->field_redirection__Completed = other_value.redirection__Completed()();
  else single_value->field_redirection__Completed = OMIT_VALUE;
} else {
  single_value->field_redirection__Completed.clean_up();
}
if (other_value.unconfirmed__Send__State__Variable().is_bound()) {
  if (other_value.unconfirmed__Send__State__Variable().ispresent()) single_value->field_unconfirmed__Send__State__Variable = other_value.unconfirmed__Send__State__Variable()();
  else single_value->field_unconfirmed__Send__State__Variable = OMIT_VALUE;
} else {
  single_value->field_unconfirmed__Send__State__Variable.clean_up();
}
if (other_value.sCI().is_bound()) {
  if (other_value.sCI().ispresent()) single_value->field_sCI = other_value.sCI()();
  else single_value->field_sCI = OMIT_VALUE;
} else {
  single_value->field_sCI.clean_up();
}
if (other_value.gGSN__PGW__Location().is_bound()) {
  if (other_value.gGSN__PGW__Location().ispresent()) single_value->field_gGSN__PGW__Location = other_value.gGSN__PGW__Location()();
  else single_value->field_gGSN__PGW__Location = OMIT_VALUE;
} else {
  single_value->field_gGSN__PGW__Location.clean_up();
}
if (other_value.eDRX__Paremeters().is_bound()) {
  if (other_value.eDRX__Paremeters().ispresent()) single_value->field_eDRX__Paremeters = other_value.eDRX__Paremeters()();
  else single_value->field_eDRX__Paremeters = OMIT_VALUE;
} else {
  single_value->field_eDRX__Paremeters.clean_up();
}
if (other_value.old__Routing__Area__Identification().is_bound()) {
  if (other_value.old__Routing__Area__Identification().ispresent()) single_value->field_old__Routing__Area__Identification = other_value.old__Routing__Area__Identification()();
  else single_value->field_old__Routing__Area__Identification = OMIT_VALUE;
} else {
  single_value->field_old__Routing__Area__Identification.clean_up();
}
if (other_value.attach__Indicator().is_bound()) {
  if (other_value.attach__Indicator().ispresent()) single_value->field_attach__Indicator = other_value.attach__Indicator()();
  else single_value->field_attach__Indicator = OMIT_VALUE;
} else {
  single_value->field_attach__Indicator.clean_up();
}
if (other_value.alignment__octets().is_bound()) {
  if (other_value.alignment__octets().ispresent()) single_value->field_alignment__octets = other_value.alignment__octets()();
  else single_value->field_alignment__octets = OMIT_VALUE;
} else {
  single_value->field_alignment__octets.clean_up();
}
if (other_value.lLC__PDU().is_bound()) {
  single_value->field_lLC__PDU = other_value.lLC__PDU();
} else {
  single_value->field_lLC__PDU.clean_up();
}
if (other_value.initialLLC__PDU().is_bound()) {
  if (other_value.initialLLC__PDU().ispresent()) single_value->field_initialLLC__PDU = other_value.initialLLC__PDU()();
  else single_value->field_initialLLC__PDU = OMIT_VALUE;
} else {
  single_value->field_initialLLC__PDU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__DL__UNITDATA_template::copy_template(const PDU__BSSGP__DL__UNITDATA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI__current().get_selection()) {
single_value->field_tLLI__current = other_value.tLLI__current();
} else {
single_value->field_tLLI__current.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.qoS__Profile().get_selection()) {
single_value->field_qoS__Profile = other_value.qoS__Profile();
} else {
single_value->field_qoS__Profile.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pDU__Lifetime().get_selection()) {
single_value->field_pDU__Lifetime = other_value.pDU__Lifetime();
} else {
single_value->field_pDU__Lifetime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__Radio__Access__Capability().get_selection()) {
single_value->field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
} else {
single_value->field_mS__Radio__Access__Capability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.priority().get_selection()) {
single_value->field_priority = other_value.priority();
} else {
single_value->field_priority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dRX__Parameters().get_selection()) {
single_value->field_dRX__Parameters = other_value.dRX__Parameters();
} else {
single_value->field_dRX__Parameters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI__old().get_selection()) {
single_value->field_tLLI__old = other_value.tLLI__old();
} else {
single_value->field_tLLI__old.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lSA__Information().get_selection()) {
single_value->field_lSA__Information = other_value.lSA__Information();
} else {
single_value->field_lSA__Information.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.service__UTRAN__CCO().get_selection()) {
single_value->field_service__UTRAN__CCO = other_value.service__UTRAN__CCO();
} else {
single_value->field_service__UTRAN__CCO.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.service__Class__Indicator().get_selection()) {
single_value->field_service__Class__Indicator = other_value.service__Class__Indicator();
} else {
single_value->field_service__Class__Indicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.subscriber__Profile__ID__For__RAT__Priority().get_selection()) {
single_value->field_subscriber__Profile__ID__For__RAT__Priority = other_value.subscriber__Profile__ID__For__RAT__Priority();
} else {
single_value->field_subscriber__Profile__ID__For__RAT__Priority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.redirection__Indication().get_selection()) {
single_value->field_redirection__Indication = other_value.redirection__Indication();
} else {
single_value->field_redirection__Indication.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.redirection__Completed().get_selection()) {
single_value->field_redirection__Completed = other_value.redirection__Completed();
} else {
single_value->field_redirection__Completed.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.unconfirmed__Send__State__Variable().get_selection()) {
single_value->field_unconfirmed__Send__State__Variable = other_value.unconfirmed__Send__State__Variable();
} else {
single_value->field_unconfirmed__Send__State__Variable.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sCI().get_selection()) {
single_value->field_sCI = other_value.sCI();
} else {
single_value->field_sCI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gGSN__PGW__Location().get_selection()) {
single_value->field_gGSN__PGW__Location = other_value.gGSN__PGW__Location();
} else {
single_value->field_gGSN__PGW__Location.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eDRX__Paremeters().get_selection()) {
single_value->field_eDRX__Paremeters = other_value.eDRX__Paremeters();
} else {
single_value->field_eDRX__Paremeters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.old__Routing__Area__Identification().get_selection()) {
single_value->field_old__Routing__Area__Identification = other_value.old__Routing__Area__Identification();
} else {
single_value->field_old__Routing__Area__Identification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.attach__Indicator().get_selection()) {
single_value->field_attach__Indicator = other_value.attach__Indicator();
} else {
single_value->field_attach__Indicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.alignment__octets().get_selection()) {
single_value->field_alignment__octets = other_value.alignment__octets();
} else {
single_value->field_alignment__octets.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lLC__PDU().get_selection()) {
single_value->field_lLC__PDU = other_value.lLC__PDU();
} else {
single_value->field_lLC__PDU.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.initialLLC__PDU().get_selection()) {
single_value->field_initialLLC__PDU = other_value.initialLLC__PDU();
} else {
single_value->field_initialLLC__PDU.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__DL__UNITDATA_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__DL__UNITDATA_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__DL__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__DL__UNITDATA_template::PDU__BSSGP__DL__UNITDATA_template()
{
}

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

PDU__BSSGP__DL__UNITDATA_template::PDU__BSSGP__DL__UNITDATA_template(const PDU__BSSGP__DL__UNITDATA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__BSSGP__DL__UNITDATA_template& PDU__BSSGP__DL__UNITDATA_template::operator=(const OPTIONAL<PDU__BSSGP__DL__UNITDATA>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__DL__UNITDATA&)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 @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
}
return *this;
}

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

boolean PDU__BSSGP__DL__UNITDATA_template::match(const PDU__BSSGP__DL__UNITDATA& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI__current().is_bound()) return FALSE;
if(!single_value->field_tLLI__current.match(other_value.tLLI__current(), legacy))return FALSE;
if(!other_value.qoS__Profile().is_bound()) return FALSE;
if(!single_value->field_qoS__Profile.match(other_value.qoS__Profile(), legacy))return FALSE;
if(!other_value.pDU__Lifetime().is_bound()) return FALSE;
if(!single_value->field_pDU__Lifetime.match(other_value.pDU__Lifetime(), legacy))return FALSE;
if(!other_value.mS__Radio__Access__Capability().is_bound()) return FALSE;
if((other_value.mS__Radio__Access__Capability().ispresent() ? !single_value->field_mS__Radio__Access__Capability.match((const MS__Radio__Access__Capability&)other_value.mS__Radio__Access__Capability(), legacy) : !single_value->field_mS__Radio__Access__Capability.match_omit(legacy)))return FALSE;
if(!other_value.priority().is_bound()) return FALSE;
if((other_value.priority().ispresent() ? !single_value->field_priority.match((const Priority__BSSGP&)other_value.priority(), legacy) : !single_value->field_priority.match_omit(legacy)))return FALSE;
if(!other_value.dRX__Parameters().is_bound()) return FALSE;
if((other_value.dRX__Parameters().ispresent() ? !single_value->field_dRX__Parameters.match((const DRX__Parameters&)other_value.dRX__Parameters(), legacy) : !single_value->field_dRX__Parameters.match_omit(legacy)))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if((other_value.iMSI().ispresent() ? !single_value->field_iMSI.match((const IMSI__BSSGP&)other_value.iMSI(), legacy) : !single_value->field_iMSI.match_omit(legacy)))return FALSE;
if(!other_value.tLLI__old().is_bound()) return FALSE;
if((other_value.tLLI__old().ispresent() ? !single_value->field_tLLI__old.match((const TLLI__BSSGP&)other_value.tLLI__old(), legacy) : !single_value->field_tLLI__old.match_omit(legacy)))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if((other_value.pFI().ispresent() ? !single_value->field_pFI.match((const PFI&)other_value.pFI(), legacy) : !single_value->field_pFI.match_omit(legacy)))return FALSE;
if(!other_value.lSA__Information().is_bound()) return FALSE;
if((other_value.lSA__Information().ispresent() ? !single_value->field_lSA__Information.match((const LSA__Information__BSSGP&)other_value.lSA__Information(), legacy) : !single_value->field_lSA__Information.match_omit(legacy)))return FALSE;
if(!other_value.service__UTRAN__CCO().is_bound()) return FALSE;
if((other_value.service__UTRAN__CCO().ispresent() ? !single_value->field_service__UTRAN__CCO.match((const Service__UTRAN__CCO&)other_value.service__UTRAN__CCO(), legacy) : !single_value->field_service__UTRAN__CCO.match_omit(legacy)))return FALSE;
if(!other_value.service__Class__Indicator().is_bound()) return FALSE;
if((other_value.service__Class__Indicator().ispresent() ? !single_value->field_service__Class__Indicator.match((const Service__Class__Indicator&)other_value.service__Class__Indicator(), legacy) : !single_value->field_service__Class__Indicator.match_omit(legacy)))return FALSE;
if(!other_value.subscriber__Profile__ID__For__RAT__Priority().is_bound()) return FALSE;
if((other_value.subscriber__Profile__ID__For__RAT__Priority().ispresent() ? !single_value->field_subscriber__Profile__ID__For__RAT__Priority.match((const Subscriber__Profile__ID__For__RAT__Priority&)other_value.subscriber__Profile__ID__For__RAT__Priority(), legacy) : !single_value->field_subscriber__Profile__ID__For__RAT__Priority.match_omit(legacy)))return FALSE;
if(!other_value.redirection__Indication().is_bound()) return FALSE;
if((other_value.redirection__Indication().ispresent() ? !single_value->field_redirection__Indication.match((const Redirection__Indication&)other_value.redirection__Indication(), legacy) : !single_value->field_redirection__Indication.match_omit(legacy)))return FALSE;
if(!other_value.redirection__Completed().is_bound()) return FALSE;
if((other_value.redirection__Completed().ispresent() ? !single_value->field_redirection__Completed.match((const Redirection__Completed&)other_value.redirection__Completed(), legacy) : !single_value->field_redirection__Completed.match_omit(legacy)))return FALSE;
if(!other_value.unconfirmed__Send__State__Variable().is_bound()) return FALSE;
if((other_value.unconfirmed__Send__State__Variable().ispresent() ? !single_value->field_unconfirmed__Send__State__Variable.match((const Unconfirmed__Send__State__Variable&)other_value.unconfirmed__Send__State__Variable(), legacy) : !single_value->field_unconfirmed__Send__State__Variable.match_omit(legacy)))return FALSE;
if(!other_value.sCI().is_bound()) return FALSE;
if((other_value.sCI().ispresent() ? !single_value->field_sCI.match((const SCI&)other_value.sCI(), legacy) : !single_value->field_sCI.match_omit(legacy)))return FALSE;
if(!other_value.gGSN__PGW__Location().is_bound()) return FALSE;
if((other_value.gGSN__PGW__Location().ispresent() ? !single_value->field_gGSN__PGW__Location.match((const GGSN__PGW__Location&)other_value.gGSN__PGW__Location(), legacy) : !single_value->field_gGSN__PGW__Location.match_omit(legacy)))return FALSE;
if(!other_value.eDRX__Paremeters().is_bound()) return FALSE;
if((other_value.eDRX__Paremeters().ispresent() ? !single_value->field_eDRX__Paremeters.match((const EDRX__Parameters&)other_value.eDRX__Paremeters(), legacy) : !single_value->field_eDRX__Paremeters.match_omit(legacy)))return FALSE;
if(!other_value.old__Routing__Area__Identification().is_bound()) return FALSE;
if((other_value.old__Routing__Area__Identification().ispresent() ? !single_value->field_old__Routing__Area__Identification.match((const Old__Routing__Area__Identification&)other_value.old__Routing__Area__Identification(), legacy) : !single_value->field_old__Routing__Area__Identification.match_omit(legacy)))return FALSE;
if(!other_value.attach__Indicator().is_bound()) return FALSE;
if((other_value.attach__Indicator().ispresent() ? !single_value->field_attach__Indicator.match((const Attach__Indicator&)other_value.attach__Indicator(), legacy) : !single_value->field_attach__Indicator.match_omit(legacy)))return FALSE;
if(!other_value.alignment__octets().is_bound()) return FALSE;
if((other_value.alignment__octets().ispresent() ? !single_value->field_alignment__octets.match((const Alignment__octets&)other_value.alignment__octets(), legacy) : !single_value->field_alignment__octets.match_omit(legacy)))return FALSE;
if(!other_value.lLC__PDU().is_bound()) return FALSE;
if(!single_value->field_lLC__PDU.match(other_value.lLC__PDU(), legacy))return FALSE;
if(!other_value.initialLLC__PDU().is_bound()) return FALSE;
if((other_value.initialLLC__PDU().ispresent() ? !single_value->field_initialLLC__PDU.match((const LLC__PDU&)other_value.initialLLC__PDU(), legacy) : !single_value->field_initialLLC__PDU.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 @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
}
return FALSE;
}

boolean PDU__BSSGP__DL__UNITDATA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI__current.is_bound()
 || single_value->field_qoS__Profile.is_bound()
 || single_value->field_pDU__Lifetime.is_bound()
 || (single_value->field_mS__Radio__Access__Capability.is_omit() || single_value->field_mS__Radio__Access__Capability.is_bound())
 || (single_value->field_priority.is_omit() || single_value->field_priority.is_bound())
 || (single_value->field_dRX__Parameters.is_omit() || single_value->field_dRX__Parameters.is_bound())
 || (single_value->field_iMSI.is_omit() || single_value->field_iMSI.is_bound())
 || (single_value->field_tLLI__old.is_omit() || single_value->field_tLLI__old.is_bound())
 || (single_value->field_pFI.is_omit() || single_value->field_pFI.is_bound())
 || (single_value->field_lSA__Information.is_omit() || single_value->field_lSA__Information.is_bound())
 || (single_value->field_service__UTRAN__CCO.is_omit() || single_value->field_service__UTRAN__CCO.is_bound())
 || (single_value->field_service__Class__Indicator.is_omit() || single_value->field_service__Class__Indicator.is_bound())
 || (single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_omit() || single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_bound())
 || (single_value->field_redirection__Indication.is_omit() || single_value->field_redirection__Indication.is_bound())
 || (single_value->field_redirection__Completed.is_omit() || single_value->field_redirection__Completed.is_bound())
 || (single_value->field_unconfirmed__Send__State__Variable.is_omit() || single_value->field_unconfirmed__Send__State__Variable.is_bound())
 || (single_value->field_sCI.is_omit() || single_value->field_sCI.is_bound())
 || (single_value->field_gGSN__PGW__Location.is_omit() || single_value->field_gGSN__PGW__Location.is_bound())
 || (single_value->field_eDRX__Paremeters.is_omit() || single_value->field_eDRX__Paremeters.is_bound())
 || (single_value->field_old__Routing__Area__Identification.is_omit() || single_value->field_old__Routing__Area__Identification.is_bound())
 || (single_value->field_attach__Indicator.is_omit() || single_value->field_attach__Indicator.is_bound())
 || (single_value->field_alignment__octets.is_omit() || single_value->field_alignment__octets.is_bound())
 || single_value->field_lLC__PDU.is_bound()
 || (single_value->field_initialLLC__PDU.is_omit() || single_value->field_initialLLC__PDU.is_bound());
}

boolean PDU__BSSGP__DL__UNITDATA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI__current.is_value()
 && single_value->field_qoS__Profile.is_value()
 && single_value->field_pDU__Lifetime.is_value()
 && (single_value->field_mS__Radio__Access__Capability.is_omit() || single_value->field_mS__Radio__Access__Capability.is_value())
 && (single_value->field_priority.is_omit() || single_value->field_priority.is_value())
 && (single_value->field_dRX__Parameters.is_omit() || single_value->field_dRX__Parameters.is_value())
 && (single_value->field_iMSI.is_omit() || single_value->field_iMSI.is_value())
 && (single_value->field_tLLI__old.is_omit() || single_value->field_tLLI__old.is_value())
 && (single_value->field_pFI.is_omit() || single_value->field_pFI.is_value())
 && (single_value->field_lSA__Information.is_omit() || single_value->field_lSA__Information.is_value())
 && (single_value->field_service__UTRAN__CCO.is_omit() || single_value->field_service__UTRAN__CCO.is_value())
 && (single_value->field_service__Class__Indicator.is_omit() || single_value->field_service__Class__Indicator.is_value())
 && (single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_omit() || single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_value())
 && (single_value->field_redirection__Indication.is_omit() || single_value->field_redirection__Indication.is_value())
 && (single_value->field_redirection__Completed.is_omit() || single_value->field_redirection__Completed.is_value())
 && (single_value->field_unconfirmed__Send__State__Variable.is_omit() || single_value->field_unconfirmed__Send__State__Variable.is_value())
 && (single_value->field_sCI.is_omit() || single_value->field_sCI.is_value())
 && (single_value->field_gGSN__PGW__Location.is_omit() || single_value->field_gGSN__PGW__Location.is_value())
 && (single_value->field_eDRX__Paremeters.is_omit() || single_value->field_eDRX__Paremeters.is_value())
 && (single_value->field_old__Routing__Area__Identification.is_omit() || single_value->field_old__Routing__Area__Identification.is_value())
 && (single_value->field_attach__Indicator.is_omit() || single_value->field_attach__Indicator.is_value())
 && (single_value->field_alignment__octets.is_omit() || single_value->field_alignment__octets.is_value())
 && single_value->field_lLC__PDU.is_value()
 && (single_value->field_initialLLC__PDU.is_omit() || single_value->field_initialLLC__PDU.is_value());
}

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

PDU__BSSGP__DL__UNITDATA PDU__BSSGP__DL__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
PDU__BSSGP__DL__UNITDATA ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI__current.is_bound()) {
ret_val.tLLI__current() = single_value->field_tLLI__current.valueof();
}
if (single_value->field_qoS__Profile.is_bound()) {
ret_val.qoS__Profile() = single_value->field_qoS__Profile.valueof();
}
if (single_value->field_pDU__Lifetime.is_bound()) {
ret_val.pDU__Lifetime() = single_value->field_pDU__Lifetime.valueof();
}
if (single_value->field_mS__Radio__Access__Capability.is_omit()) ret_val.mS__Radio__Access__Capability() = OMIT_VALUE;
else if (single_value->field_mS__Radio__Access__Capability.is_bound()) {
ret_val.mS__Radio__Access__Capability() = single_value->field_mS__Radio__Access__Capability.valueof();
}
if (single_value->field_priority.is_omit()) ret_val.priority() = OMIT_VALUE;
else if (single_value->field_priority.is_bound()) {
ret_val.priority() = single_value->field_priority.valueof();
}
if (single_value->field_dRX__Parameters.is_omit()) ret_val.dRX__Parameters() = OMIT_VALUE;
else if (single_value->field_dRX__Parameters.is_bound()) {
ret_val.dRX__Parameters() = single_value->field_dRX__Parameters.valueof();
}
if (single_value->field_iMSI.is_omit()) ret_val.iMSI() = OMIT_VALUE;
else if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_tLLI__old.is_omit()) ret_val.tLLI__old() = OMIT_VALUE;
else if (single_value->field_tLLI__old.is_bound()) {
ret_val.tLLI__old() = single_value->field_tLLI__old.valueof();
}
if (single_value->field_pFI.is_omit()) ret_val.pFI() = OMIT_VALUE;
else if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_lSA__Information.is_omit()) ret_val.lSA__Information() = OMIT_VALUE;
else if (single_value->field_lSA__Information.is_bound()) {
ret_val.lSA__Information() = single_value->field_lSA__Information.valueof();
}
if (single_value->field_service__UTRAN__CCO.is_omit()) ret_val.service__UTRAN__CCO() = OMIT_VALUE;
else if (single_value->field_service__UTRAN__CCO.is_bound()) {
ret_val.service__UTRAN__CCO() = single_value->field_service__UTRAN__CCO.valueof();
}
if (single_value->field_service__Class__Indicator.is_omit()) ret_val.service__Class__Indicator() = OMIT_VALUE;
else if (single_value->field_service__Class__Indicator.is_bound()) {
ret_val.service__Class__Indicator() = single_value->field_service__Class__Indicator.valueof();
}
if (single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_omit()) ret_val.subscriber__Profile__ID__For__RAT__Priority() = OMIT_VALUE;
else if (single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_bound()) {
ret_val.subscriber__Profile__ID__For__RAT__Priority() = single_value->field_subscriber__Profile__ID__For__RAT__Priority.valueof();
}
if (single_value->field_redirection__Indication.is_omit()) ret_val.redirection__Indication() = OMIT_VALUE;
else if (single_value->field_redirection__Indication.is_bound()) {
ret_val.redirection__Indication() = single_value->field_redirection__Indication.valueof();
}
if (single_value->field_redirection__Completed.is_omit()) ret_val.redirection__Completed() = OMIT_VALUE;
else if (single_value->field_redirection__Completed.is_bound()) {
ret_val.redirection__Completed() = single_value->field_redirection__Completed.valueof();
}
if (single_value->field_unconfirmed__Send__State__Variable.is_omit()) ret_val.unconfirmed__Send__State__Variable() = OMIT_VALUE;
else if (single_value->field_unconfirmed__Send__State__Variable.is_bound()) {
ret_val.unconfirmed__Send__State__Variable() = single_value->field_unconfirmed__Send__State__Variable.valueof();
}
if (single_value->field_sCI.is_omit()) ret_val.sCI() = OMIT_VALUE;
else if (single_value->field_sCI.is_bound()) {
ret_val.sCI() = single_value->field_sCI.valueof();
}
if (single_value->field_gGSN__PGW__Location.is_omit()) ret_val.gGSN__PGW__Location() = OMIT_VALUE;
else if (single_value->field_gGSN__PGW__Location.is_bound()) {
ret_val.gGSN__PGW__Location() = single_value->field_gGSN__PGW__Location.valueof();
}
if (single_value->field_eDRX__Paremeters.is_omit()) ret_val.eDRX__Paremeters() = OMIT_VALUE;
else if (single_value->field_eDRX__Paremeters.is_bound()) {
ret_val.eDRX__Paremeters() = single_value->field_eDRX__Paremeters.valueof();
}
if (single_value->field_old__Routing__Area__Identification.is_omit()) ret_val.old__Routing__Area__Identification() = OMIT_VALUE;
else if (single_value->field_old__Routing__Area__Identification.is_bound()) {
ret_val.old__Routing__Area__Identification() = single_value->field_old__Routing__Area__Identification.valueof();
}
if (single_value->field_attach__Indicator.is_omit()) ret_val.attach__Indicator() = OMIT_VALUE;
else if (single_value->field_attach__Indicator.is_bound()) {
ret_val.attach__Indicator() = single_value->field_attach__Indicator.valueof();
}
if (single_value->field_alignment__octets.is_omit()) ret_val.alignment__octets() = OMIT_VALUE;
else if (single_value->field_alignment__octets.is_bound()) {
ret_val.alignment__octets() = single_value->field_alignment__octets.valueof();
}
if (single_value->field_lLC__PDU.is_bound()) {
ret_val.lLC__PDU() = single_value->field_lLC__PDU.valueof();
}
if (single_value->field_initialLLC__PDU.is_omit()) ret_val.initialLLC__PDU() = OMIT_VALUE;
else if (single_value->field_initialLLC__PDU.is_bound()) {
ret_val.initialLLC__PDU() = single_value->field_initialLLC__PDU.valueof();
}
return ret_val;
}

void PDU__BSSGP__DL__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__DL__UNITDATA_template[list_length];
}

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

OCTETSTRING_template& PDU__BSSGP__DL__UNITDATA_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__DL__UNITDATA_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_bssgpPduType;
}

OCTETSTRING_template& PDU__BSSGP__DL__UNITDATA_template::tLLI__current()
{
set_specific();
return single_value->field_tLLI__current;
}

const OCTETSTRING_template& PDU__BSSGP__DL__UNITDATA_template::tLLI__current() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI_current of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_tLLI__current;
}

QoS__Profile__V_template& PDU__BSSGP__DL__UNITDATA_template::qoS__Profile()
{
set_specific();
return single_value->field_qoS__Profile;
}

const QoS__Profile__V_template& PDU__BSSGP__DL__UNITDATA_template::qoS__Profile() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field qoS_Profile of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_qoS__Profile;
}

PDU__Lifetime_template& PDU__BSSGP__DL__UNITDATA_template::pDU__Lifetime()
{
set_specific();
return single_value->field_pDU__Lifetime;
}

const PDU__Lifetime_template& PDU__BSSGP__DL__UNITDATA_template::pDU__Lifetime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pDU_Lifetime of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_pDU__Lifetime;
}

MS__Radio__Access__Capability_template& PDU__BSSGP__DL__UNITDATA_template::mS__Radio__Access__Capability()
{
set_specific();
return single_value->field_mS__Radio__Access__Capability;
}

const MS__Radio__Access__Capability_template& PDU__BSSGP__DL__UNITDATA_template::mS__Radio__Access__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_Radio_Access_Capability of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_mS__Radio__Access__Capability;
}

Priority__BSSGP_template& PDU__BSSGP__DL__UNITDATA_template::priority()
{
set_specific();
return single_value->field_priority;
}

const Priority__BSSGP_template& PDU__BSSGP__DL__UNITDATA_template::priority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priority of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_priority;
}

DRX__Parameters_template& PDU__BSSGP__DL__UNITDATA_template::dRX__Parameters()
{
set_specific();
return single_value->field_dRX__Parameters;
}

const DRX__Parameters_template& PDU__BSSGP__DL__UNITDATA_template::dRX__Parameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dRX_Parameters of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_dRX__Parameters;
}

IMSI__BSSGP_template& PDU__BSSGP__DL__UNITDATA_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__DL__UNITDATA_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_iMSI;
}

TLLI__BSSGP_template& PDU__BSSGP__DL__UNITDATA_template::tLLI__old()
{
set_specific();
return single_value->field_tLLI__old;
}

const TLLI__BSSGP_template& PDU__BSSGP__DL__UNITDATA_template::tLLI__old() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI_old of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_tLLI__old;
}

PFI_template& PDU__BSSGP__DL__UNITDATA_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__DL__UNITDATA_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_pFI;
}

LSA__Information__BSSGP_template& PDU__BSSGP__DL__UNITDATA_template::lSA__Information()
{
set_specific();
return single_value->field_lSA__Information;
}

const LSA__Information__BSSGP_template& PDU__BSSGP__DL__UNITDATA_template::lSA__Information() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lSA_Information of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_lSA__Information;
}

Service__UTRAN__CCO_template& PDU__BSSGP__DL__UNITDATA_template::service__UTRAN__CCO()
{
set_specific();
return single_value->field_service__UTRAN__CCO;
}

const Service__UTRAN__CCO_template& PDU__BSSGP__DL__UNITDATA_template::service__UTRAN__CCO() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field service_UTRAN_CCO of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_service__UTRAN__CCO;
}

Service__Class__Indicator_template& PDU__BSSGP__DL__UNITDATA_template::service__Class__Indicator()
{
set_specific();
return single_value->field_service__Class__Indicator;
}

const Service__Class__Indicator_template& PDU__BSSGP__DL__UNITDATA_template::service__Class__Indicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field service_Class_Indicator of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_service__Class__Indicator;
}

Subscriber__Profile__ID__For__RAT__Priority_template& PDU__BSSGP__DL__UNITDATA_template::subscriber__Profile__ID__For__RAT__Priority()
{
set_specific();
return single_value->field_subscriber__Profile__ID__For__RAT__Priority;
}

const Subscriber__Profile__ID__For__RAT__Priority_template& PDU__BSSGP__DL__UNITDATA_template::subscriber__Profile__ID__For__RAT__Priority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field subscriber_Profile_ID_For_RAT_Priority of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_subscriber__Profile__ID__For__RAT__Priority;
}

Redirection__Indication_template& PDU__BSSGP__DL__UNITDATA_template::redirection__Indication()
{
set_specific();
return single_value->field_redirection__Indication;
}

const Redirection__Indication_template& PDU__BSSGP__DL__UNITDATA_template::redirection__Indication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field redirection_Indication of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_redirection__Indication;
}

Redirection__Completed_template& PDU__BSSGP__DL__UNITDATA_template::redirection__Completed()
{
set_specific();
return single_value->field_redirection__Completed;
}

const Redirection__Completed_template& PDU__BSSGP__DL__UNITDATA_template::redirection__Completed() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field redirection_Completed of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_redirection__Completed;
}

Unconfirmed__Send__State__Variable_template& PDU__BSSGP__DL__UNITDATA_template::unconfirmed__Send__State__Variable()
{
set_specific();
return single_value->field_unconfirmed__Send__State__Variable;
}

const Unconfirmed__Send__State__Variable_template& PDU__BSSGP__DL__UNITDATA_template::unconfirmed__Send__State__Variable() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field unconfirmed_Send_State_Variable of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_unconfirmed__Send__State__Variable;
}

SCI_template& PDU__BSSGP__DL__UNITDATA_template::sCI()
{
set_specific();
return single_value->field_sCI;
}

const SCI_template& PDU__BSSGP__DL__UNITDATA_template::sCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sCI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_sCI;
}

GGSN__PGW__Location_template& PDU__BSSGP__DL__UNITDATA_template::gGSN__PGW__Location()
{
set_specific();
return single_value->field_gGSN__PGW__Location;
}

const GGSN__PGW__Location_template& PDU__BSSGP__DL__UNITDATA_template::gGSN__PGW__Location() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gGSN_PGW_Location of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_gGSN__PGW__Location;
}

EDRX__Parameters_template& PDU__BSSGP__DL__UNITDATA_template::eDRX__Paremeters()
{
set_specific();
return single_value->field_eDRX__Paremeters;
}

const EDRX__Parameters_template& PDU__BSSGP__DL__UNITDATA_template::eDRX__Paremeters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eDRX_Paremeters of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_eDRX__Paremeters;
}

Old__Routing__Area__Identification_template& PDU__BSSGP__DL__UNITDATA_template::old__Routing__Area__Identification()
{
set_specific();
return single_value->field_old__Routing__Area__Identification;
}

const Old__Routing__Area__Identification_template& PDU__BSSGP__DL__UNITDATA_template::old__Routing__Area__Identification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field old_Routing_Area_Identification of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_old__Routing__Area__Identification;
}

Attach__Indicator_template& PDU__BSSGP__DL__UNITDATA_template::attach__Indicator()
{
set_specific();
return single_value->field_attach__Indicator;
}

const Attach__Indicator_template& PDU__BSSGP__DL__UNITDATA_template::attach__Indicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field attach_Indicator of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_attach__Indicator;
}

Alignment__octets_template& PDU__BSSGP__DL__UNITDATA_template::alignment__octets()
{
set_specific();
return single_value->field_alignment__octets;
}

const Alignment__octets_template& PDU__BSSGP__DL__UNITDATA_template::alignment__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field alignment_octets of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_alignment__octets;
}

LLC__PDU_template& PDU__BSSGP__DL__UNITDATA_template::lLC__PDU()
{
set_specific();
return single_value->field_lLC__PDU;
}

const LLC__PDU_template& PDU__BSSGP__DL__UNITDATA_template::lLC__PDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lLC_PDU of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_lLC__PDU;
}

LLC__PDU_template& PDU__BSSGP__DL__UNITDATA_template::initialLLC__PDU()
{
set_specific();
return single_value->field_initialLLC__PDU;
}

const LLC__PDU_template& PDU__BSSGP__DL__UNITDATA_template::initialLLC__PDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field initialLLC_PDU of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
return single_value->field_initialLLC__PDU;
}

int PDU__BSSGP__DL__UNITDATA_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_mS__Radio__Access__Capability.is_present()) ret_val++;
      if (single_value->field_priority.is_present()) ret_val++;
      if (single_value->field_dRX__Parameters.is_present()) ret_val++;
      if (single_value->field_iMSI.is_present()) ret_val++;
      if (single_value->field_tLLI__old.is_present()) ret_val++;
      if (single_value->field_pFI.is_present()) ret_val++;
      if (single_value->field_lSA__Information.is_present()) ret_val++;
      if (single_value->field_service__UTRAN__CCO.is_present()) ret_val++;
      if (single_value->field_service__Class__Indicator.is_present()) ret_val++;
      if (single_value->field_subscriber__Profile__ID__For__RAT__Priority.is_present()) ret_val++;
      if (single_value->field_redirection__Indication.is_present()) ret_val++;
      if (single_value->field_redirection__Completed.is_present()) ret_val++;
      if (single_value->field_unconfirmed__Send__State__Variable.is_present()) ret_val++;
      if (single_value->field_sCI.is_present()) ret_val++;
      if (single_value->field_gGSN__PGW__Location.is_present()) ret_val++;
      if (single_value->field_eDRX__Paremeters.is_present()) ret_val++;
      if (single_value->field_old__Routing__Area__Identification.is_present()) ret_val++;
      if (single_value->field_attach__Indicator.is_present()) ret_val++;
      if (single_value->field_alignment__octets.is_present()) ret_val++;
      if (single_value->field_initialLLC__PDU.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 @BSSGP_Types.PDU_BSSGP_DL_UNITDATA 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 @BSSGP_Types.PDU_BSSGP_DL_UNITDATA containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
  }
  return 0;
}

void PDU__BSSGP__DL__UNITDATA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI_current := ");
single_value->field_tLLI__current.log();
TTCN_Logger::log_event_str(", qoS_Profile := ");
single_value->field_qoS__Profile.log();
TTCN_Logger::log_event_str(", pDU_Lifetime := ");
single_value->field_pDU__Lifetime.log();
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
single_value->field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(", priority := ");
single_value->field_priority.log();
TTCN_Logger::log_event_str(", dRX_Parameters := ");
single_value->field_dRX__Parameters.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", tLLI_old := ");
single_value->field_tLLI__old.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", lSA_Information := ");
single_value->field_lSA__Information.log();
TTCN_Logger::log_event_str(", service_UTRAN_CCO := ");
single_value->field_service__UTRAN__CCO.log();
TTCN_Logger::log_event_str(", service_Class_Indicator := ");
single_value->field_service__Class__Indicator.log();
TTCN_Logger::log_event_str(", subscriber_Profile_ID_For_RAT_Priority := ");
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log();
TTCN_Logger::log_event_str(", redirection_Indication := ");
single_value->field_redirection__Indication.log();
TTCN_Logger::log_event_str(", redirection_Completed := ");
single_value->field_redirection__Completed.log();
TTCN_Logger::log_event_str(", unconfirmed_Send_State_Variable := ");
single_value->field_unconfirmed__Send__State__Variable.log();
TTCN_Logger::log_event_str(", sCI := ");
single_value->field_sCI.log();
TTCN_Logger::log_event_str(", gGSN_PGW_Location := ");
single_value->field_gGSN__PGW__Location.log();
TTCN_Logger::log_event_str(", eDRX_Paremeters := ");
single_value->field_eDRX__Paremeters.log();
TTCN_Logger::log_event_str(", old_Routing_Area_Identification := ");
single_value->field_old__Routing__Area__Identification.log();
TTCN_Logger::log_event_str(", attach_Indicator := ");
single_value->field_attach__Indicator.log();
TTCN_Logger::log_event_str(", alignment_octets := ");
single_value->field_alignment__octets.log();
TTCN_Logger::log_event_str(", lLC_PDU := ");
single_value->field_lLC__PDU.log();
TTCN_Logger::log_event_str(", initialLLC_PDU := ");
single_value->field_initialLLC__PDU.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__DL__UNITDATA_template::log_match(const PDU__BSSGP__DL__UNITDATA& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI__current.match(match_value.tLLI__current(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI_current");
single_value->field_tLLI__current.log_match(match_value.tLLI__current(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_qoS__Profile.match(match_value.qoS__Profile(), legacy)){
TTCN_Logger::log_logmatch_info(".qoS_Profile");
single_value->field_qoS__Profile.log_match(match_value.qoS__Profile(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pDU__Lifetime.match(match_value.pDU__Lifetime(), legacy)){
TTCN_Logger::log_logmatch_info(".pDU_Lifetime");
single_value->field_pDU__Lifetime.log_match(match_value.pDU__Lifetime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mS__Radio__Access__Capability().ispresent()){
if(!single_value->field_mS__Radio__Access__Capability.match(match_value.mS__Radio__Access__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_Radio_Access_Capability");
single_value->field_mS__Radio__Access__Capability.log_match(match_value.mS__Radio__Access__Capability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mS__Radio__Access__Capability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mS_Radio_Access_Capability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.priority().ispresent()){
if(!single_value->field_priority.match(match_value.priority(), legacy)){
TTCN_Logger::log_logmatch_info(".priority");
single_value->field_priority.log_match(match_value.priority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_priority.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".priority := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_priority.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.dRX__Parameters().ispresent()){
if(!single_value->field_dRX__Parameters.match(match_value.dRX__Parameters(), legacy)){
TTCN_Logger::log_logmatch_info(".dRX_Parameters");
single_value->field_dRX__Parameters.log_match(match_value.dRX__Parameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dRX__Parameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dRX_Parameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dRX__Parameters.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.iMSI().ispresent()){
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tLLI__old().ispresent()){
if(!single_value->field_tLLI__old.match(match_value.tLLI__old(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI_old");
single_value->field_tLLI__old.log_match(match_value.tLLI__old(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tLLI__old.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tLLI_old := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tLLI__old.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pFI().ispresent()){
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pFI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pFI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pFI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lSA__Information().ispresent()){
if(!single_value->field_lSA__Information.match(match_value.lSA__Information(), legacy)){
TTCN_Logger::log_logmatch_info(".lSA_Information");
single_value->field_lSA__Information.log_match(match_value.lSA__Information(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lSA__Information.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lSA_Information := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lSA__Information.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.service__UTRAN__CCO().ispresent()){
if(!single_value->field_service__UTRAN__CCO.match(match_value.service__UTRAN__CCO(), legacy)){
TTCN_Logger::log_logmatch_info(".service_UTRAN_CCO");
single_value->field_service__UTRAN__CCO.log_match(match_value.service__UTRAN__CCO(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_service__UTRAN__CCO.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".service_UTRAN_CCO := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_service__UTRAN__CCO.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.service__Class__Indicator().ispresent()){
if(!single_value->field_service__Class__Indicator.match(match_value.service__Class__Indicator(), legacy)){
TTCN_Logger::log_logmatch_info(".service_Class_Indicator");
single_value->field_service__Class__Indicator.log_match(match_value.service__Class__Indicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_service__Class__Indicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".service_Class_Indicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_service__Class__Indicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.subscriber__Profile__ID__For__RAT__Priority().ispresent()){
if(!single_value->field_subscriber__Profile__ID__For__RAT__Priority.match(match_value.subscriber__Profile__ID__For__RAT__Priority(), legacy)){
TTCN_Logger::log_logmatch_info(".subscriber_Profile_ID_For_RAT_Priority");
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log_match(match_value.subscriber__Profile__ID__For__RAT__Priority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_subscriber__Profile__ID__For__RAT__Priority.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".subscriber_Profile_ID_For_RAT_Priority := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.redirection__Indication().ispresent()){
if(!single_value->field_redirection__Indication.match(match_value.redirection__Indication(), legacy)){
TTCN_Logger::log_logmatch_info(".redirection_Indication");
single_value->field_redirection__Indication.log_match(match_value.redirection__Indication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_redirection__Indication.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".redirection_Indication := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_redirection__Indication.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.redirection__Completed().ispresent()){
if(!single_value->field_redirection__Completed.match(match_value.redirection__Completed(), legacy)){
TTCN_Logger::log_logmatch_info(".redirection_Completed");
single_value->field_redirection__Completed.log_match(match_value.redirection__Completed(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_redirection__Completed.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".redirection_Completed := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_redirection__Completed.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.unconfirmed__Send__State__Variable().ispresent()){
if(!single_value->field_unconfirmed__Send__State__Variable.match(match_value.unconfirmed__Send__State__Variable(), legacy)){
TTCN_Logger::log_logmatch_info(".unconfirmed_Send_State_Variable");
single_value->field_unconfirmed__Send__State__Variable.log_match(match_value.unconfirmed__Send__State__Variable(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_unconfirmed__Send__State__Variable.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".unconfirmed_Send_State_Variable := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_unconfirmed__Send__State__Variable.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sCI().ispresent()){
if(!single_value->field_sCI.match(match_value.sCI(), legacy)){
TTCN_Logger::log_logmatch_info(".sCI");
single_value->field_sCI.log_match(match_value.sCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sCI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sCI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sCI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.gGSN__PGW__Location().ispresent()){
if(!single_value->field_gGSN__PGW__Location.match(match_value.gGSN__PGW__Location(), legacy)){
TTCN_Logger::log_logmatch_info(".gGSN_PGW_Location");
single_value->field_gGSN__PGW__Location.log_match(match_value.gGSN__PGW__Location(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gGSN__PGW__Location.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gGSN_PGW_Location := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gGSN__PGW__Location.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eDRX__Paremeters().ispresent()){
if(!single_value->field_eDRX__Paremeters.match(match_value.eDRX__Paremeters(), legacy)){
TTCN_Logger::log_logmatch_info(".eDRX_Paremeters");
single_value->field_eDRX__Paremeters.log_match(match_value.eDRX__Paremeters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eDRX__Paremeters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eDRX_Paremeters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eDRX__Paremeters.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.old__Routing__Area__Identification().ispresent()){
if(!single_value->field_old__Routing__Area__Identification.match(match_value.old__Routing__Area__Identification(), legacy)){
TTCN_Logger::log_logmatch_info(".old_Routing_Area_Identification");
single_value->field_old__Routing__Area__Identification.log_match(match_value.old__Routing__Area__Identification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_old__Routing__Area__Identification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".old_Routing_Area_Identification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_old__Routing__Area__Identification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.attach__Indicator().ispresent()){
if(!single_value->field_attach__Indicator.match(match_value.attach__Indicator(), legacy)){
TTCN_Logger::log_logmatch_info(".attach_Indicator");
single_value->field_attach__Indicator.log_match(match_value.attach__Indicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_attach__Indicator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".attach_Indicator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_attach__Indicator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.alignment__octets().ispresent()){
if(!single_value->field_alignment__octets.match(match_value.alignment__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".alignment_octets");
single_value->field_alignment__octets.log_match(match_value.alignment__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_alignment__octets.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".alignment_octets := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_alignment__octets.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_lLC__PDU.match(match_value.lLC__PDU(), legacy)){
TTCN_Logger::log_logmatch_info(".lLC_PDU");
single_value->field_lLC__PDU.log_match(match_value.lLC__PDU(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.initialLLC__PDU().ispresent()){
if(!single_value->field_initialLLC__PDU.match(match_value.initialLLC__PDU(), legacy)){
TTCN_Logger::log_logmatch_info(".initialLLC_PDU");
single_value->field_initialLLC__PDU.log_match(match_value.initialLLC__PDU(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_initialLLC__PDU.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".initialLLC_PDU := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_initialLLC__PDU.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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI_current := ");
single_value->field_tLLI__current.log_match(match_value.tLLI__current(), legacy);
TTCN_Logger::log_event_str(", qoS_Profile := ");
single_value->field_qoS__Profile.log_match(match_value.qoS__Profile(), legacy);
TTCN_Logger::log_event_str(", pDU_Lifetime := ");
single_value->field_pDU__Lifetime.log_match(match_value.pDU__Lifetime(), legacy);
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
if (match_value.mS__Radio__Access__Capability().ispresent()) {
single_value->field_mS__Radio__Access__Capability.log_match(match_value.mS__Radio__Access__Capability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mS__Radio__Access__Capability.log();
if (single_value->field_mS__Radio__Access__Capability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", priority := ");
if (match_value.priority().ispresent()) {
single_value->field_priority.log_match(match_value.priority(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_priority.log();
if (single_value->field_priority.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", dRX_Parameters := ");
if (match_value.dRX__Parameters().ispresent()) {
single_value->field_dRX__Parameters.log_match(match_value.dRX__Parameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dRX__Parameters.log();
if (single_value->field_dRX__Parameters.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", iMSI := ");
if (match_value.iMSI().ispresent()) {
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iMSI.log();
if (single_value->field_iMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tLLI_old := ");
if (match_value.tLLI__old().ispresent()) {
single_value->field_tLLI__old.log_match(match_value.tLLI__old(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tLLI__old.log();
if (single_value->field_tLLI__old.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pFI := ");
if (match_value.pFI().ispresent()) {
single_value->field_pFI.log_match(match_value.pFI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pFI.log();
if (single_value->field_pFI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lSA_Information := ");
if (match_value.lSA__Information().ispresent()) {
single_value->field_lSA__Information.log_match(match_value.lSA__Information(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lSA__Information.log();
if (single_value->field_lSA__Information.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", service_UTRAN_CCO := ");
if (match_value.service__UTRAN__CCO().ispresent()) {
single_value->field_service__UTRAN__CCO.log_match(match_value.service__UTRAN__CCO(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_service__UTRAN__CCO.log();
if (single_value->field_service__UTRAN__CCO.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", service_Class_Indicator := ");
if (match_value.service__Class__Indicator().ispresent()) {
single_value->field_service__Class__Indicator.log_match(match_value.service__Class__Indicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_service__Class__Indicator.log();
if (single_value->field_service__Class__Indicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", subscriber_Profile_ID_For_RAT_Priority := ");
if (match_value.subscriber__Profile__ID__For__RAT__Priority().ispresent()) {
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log_match(match_value.subscriber__Profile__ID__For__RAT__Priority(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_subscriber__Profile__ID__For__RAT__Priority.log();
if (single_value->field_subscriber__Profile__ID__For__RAT__Priority.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", redirection_Indication := ");
if (match_value.redirection__Indication().ispresent()) {
single_value->field_redirection__Indication.log_match(match_value.redirection__Indication(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_redirection__Indication.log();
if (single_value->field_redirection__Indication.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", redirection_Completed := ");
if (match_value.redirection__Completed().ispresent()) {
single_value->field_redirection__Completed.log_match(match_value.redirection__Completed(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_redirection__Completed.log();
if (single_value->field_redirection__Completed.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", unconfirmed_Send_State_Variable := ");
if (match_value.unconfirmed__Send__State__Variable().ispresent()) {
single_value->field_unconfirmed__Send__State__Variable.log_match(match_value.unconfirmed__Send__State__Variable(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_unconfirmed__Send__State__Variable.log();
if (single_value->field_unconfirmed__Send__State__Variable.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sCI := ");
if (match_value.sCI().ispresent()) {
single_value->field_sCI.log_match(match_value.sCI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sCI.log();
if (single_value->field_sCI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", gGSN_PGW_Location := ");
if (match_value.gGSN__PGW__Location().ispresent()) {
single_value->field_gGSN__PGW__Location.log_match(match_value.gGSN__PGW__Location(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gGSN__PGW__Location.log();
if (single_value->field_gGSN__PGW__Location.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eDRX_Paremeters := ");
if (match_value.eDRX__Paremeters().ispresent()) {
single_value->field_eDRX__Paremeters.log_match(match_value.eDRX__Paremeters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eDRX__Paremeters.log();
if (single_value->field_eDRX__Paremeters.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", old_Routing_Area_Identification := ");
if (match_value.old__Routing__Area__Identification().ispresent()) {
single_value->field_old__Routing__Area__Identification.log_match(match_value.old__Routing__Area__Identification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_old__Routing__Area__Identification.log();
if (single_value->field_old__Routing__Area__Identification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", attach_Indicator := ");
if (match_value.attach__Indicator().ispresent()) {
single_value->field_attach__Indicator.log_match(match_value.attach__Indicator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_attach__Indicator.log();
if (single_value->field_attach__Indicator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", alignment_octets := ");
if (match_value.alignment__octets().ispresent()) {
single_value->field_alignment__octets.log_match(match_value.alignment__octets(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_alignment__octets.log();
if (single_value->field_alignment__octets.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lLC_PDU := ");
single_value->field_lLC__PDU.log_match(match_value.lLC__PDU(), legacy);
TTCN_Logger::log_event_str(", initialLLC_PDU := ");
if (match_value.initialLLC__PDU().ispresent()) {
single_value->field_initialLLC__PDU.log_match(match_value.initialLLC__PDU(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_initialLLC__PDU.log();
if (single_value->field_initialLLC__PDU.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__DL__UNITDATA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI__current.encode_text(text_buf);
single_value->field_qoS__Profile.encode_text(text_buf);
single_value->field_pDU__Lifetime.encode_text(text_buf);
single_value->field_mS__Radio__Access__Capability.encode_text(text_buf);
single_value->field_priority.encode_text(text_buf);
single_value->field_dRX__Parameters.encode_text(text_buf);
single_value->field_iMSI.encode_text(text_buf);
single_value->field_tLLI__old.encode_text(text_buf);
single_value->field_pFI.encode_text(text_buf);
single_value->field_lSA__Information.encode_text(text_buf);
single_value->field_service__UTRAN__CCO.encode_text(text_buf);
single_value->field_service__Class__Indicator.encode_text(text_buf);
single_value->field_subscriber__Profile__ID__For__RAT__Priority.encode_text(text_buf);
single_value->field_redirection__Indication.encode_text(text_buf);
single_value->field_redirection__Completed.encode_text(text_buf);
single_value->field_unconfirmed__Send__State__Variable.encode_text(text_buf);
single_value->field_sCI.encode_text(text_buf);
single_value->field_gGSN__PGW__Location.encode_text(text_buf);
single_value->field_eDRX__Paremeters.encode_text(text_buf);
single_value->field_old__Routing__Area__Identification.encode_text(text_buf);
single_value->field_attach__Indicator.encode_text(text_buf);
single_value->field_alignment__octets.encode_text(text_buf);
single_value->field_lLC__PDU.encode_text(text_buf);
single_value->field_initialLLC__PDU.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 @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
}
}

void PDU__BSSGP__DL__UNITDATA_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI__current.decode_text(text_buf);
single_value->field_qoS__Profile.decode_text(text_buf);
single_value->field_pDU__Lifetime.decode_text(text_buf);
single_value->field_mS__Radio__Access__Capability.decode_text(text_buf);
single_value->field_priority.decode_text(text_buf);
single_value->field_dRX__Parameters.decode_text(text_buf);
single_value->field_iMSI.decode_text(text_buf);
single_value->field_tLLI__old.decode_text(text_buf);
single_value->field_pFI.decode_text(text_buf);
single_value->field_lSA__Information.decode_text(text_buf);
single_value->field_service__UTRAN__CCO.decode_text(text_buf);
single_value->field_service__Class__Indicator.decode_text(text_buf);
single_value->field_subscriber__Profile__ID__For__RAT__Priority.decode_text(text_buf);
single_value->field_redirection__Indication.decode_text(text_buf);
single_value->field_redirection__Completed.decode_text(text_buf);
single_value->field_unconfirmed__Send__State__Variable.decode_text(text_buf);
single_value->field_sCI.decode_text(text_buf);
single_value->field_gGSN__PGW__Location.decode_text(text_buf);
single_value->field_eDRX__Paremeters.decode_text(text_buf);
single_value->field_old__Routing__Area__Identification.decode_text(text_buf);
single_value->field_attach__Indicator.decode_text(text_buf);
single_value->field_alignment__octets.decode_text(text_buf);
single_value->field_lLC__PDU.decode_text(text_buf);
single_value->field_initialLLC__PDU.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__DL__UNITDATA_template[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 @BSSGP_Types.PDU_BSSGP_DL_UNITDATA.");
}
}

void PDU__BSSGP__DL__UNITDATA_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__DL__UNITDATA_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (25<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA has 25 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI__current().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) qoS__Profile().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pDU__Lifetime().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mS__Radio__Access__Capability().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) priority().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) dRX__Parameters().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tLLI__old().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) lSA__Information().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) service__UTRAN__CCO().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) service__Class__Indicator().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) subscriber__Profile__ID__For__RAT__Priority().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) redirection__Indication().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) redirection__Completed().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) unconfirmed__Send__State__Variable().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) sCI().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) gGSN__PGW__Location().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) eDRX__Paremeters().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) old__Routing__Area__Identification().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) attach__Indicator().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) alignment__octets().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) lLC__PDU().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) initialLLC__PDU().set_param(*param.get_elem(24));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI_current")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI__current().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "qoS_Profile")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          qoS__Profile().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pDU_Lifetime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pDU__Lifetime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Radio_Access_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Radio__Access__Capability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI_old")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI__old().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lSA_Information")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lSA__Information().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_UTRAN_CCO")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__UTRAN__CCO().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_Class_Indicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__Class__Indicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "subscriber_Profile_ID_For_RAT_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          subscriber__Profile__ID__For__RAT__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirection_Indication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirection__Indication().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirection_Completed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirection__Completed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unconfirmed_Send_State_Variable")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unconfirmed__Send__State__Variable().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gGSN_PGW_Location")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gGSN__PGW__Location().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eDRX_Paremeters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eDRX__Paremeters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "old_Routing_Area_Identification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          old__Routing__Area__Identification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attach_Indicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attach__Indicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alignment_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alignment__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "initialLLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          initialLLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_DL_UNITDATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__DL__UNITDATA_template* precondition = new PDU__BSSGP__DL__UNITDATA_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__DL__UNITDATA_template* implied_template = new PDU__BSSGP__DL__UNITDATA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__DL__UNITDATA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__DL__UNITDATA_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_tLLI__current.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_qoS__Profile.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_pDU__Lifetime.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_mS__Radio__Access__Capability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_priority.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_dRX__Parameters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_iMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_tLLI__old.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_pFI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_lSA__Information.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_service__UTRAN__CCO.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_service__Class__Indicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_subscriber__Profile__ID__For__RAT__Priority.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_redirection__Indication.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_redirection__Completed.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_unconfirmed__Send__State__Variable.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_sCI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_gGSN__PGW__Location.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_eDRX__Paremeters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_old__Routing__Area__Identification.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_attach__Indicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_alignment__octets.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_lLC__PDU.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
single_value->field_initialLLC__PDU.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
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 : "@BSSGP_Types.PDU_BSSGP_DL_UNITDATA");
}

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

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

PDU__BSSGP__UL__UNITDATA::PDU__BSSGP__UL__UNITDATA()
{
}

PDU__BSSGP__UL__UNITDATA::PDU__BSSGP__UL__UNITDATA(const OCTETSTRING& par_bssgpPduType,
    const OCTETSTRING& par_tLLI,
    const QoS__Profile__V& par_qoS__Profile,
    const Cell__Identifier& par_cell__Identifier,
    const OPTIONAL< PFI >& par_pFI,
    const OPTIONAL< LSA__Identifier__List__BSSGP >& par_lSA__Identifier__List,
    const OPTIONAL< Redirect__Attempt__Flag >& par_redirect__Attempt__Flag,
    const OPTIONAL< IMSI__BSSGP >& par_iMSI__BSSGP,
    const OPTIONAL< Unconfirmed__Send__State__Variable >& par_unconfirmed__Send__State__Variable,
    const OPTIONAL< Selected__PLMN__ID >& par_selected__PLMN__ID,
    const OPTIONAL< PLMN__Identity >& par_selected__Operator,
    const OPTIONAL< PLMN__Identity >& par_cS__Registered__Operator,
    const OPTIONAL< Alignment__octets >& par_alignment__octets,
    const LLC__PDU& par_lLC__PDU)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_qoS__Profile(par_qoS__Profile),
  field_cell__Identifier(par_cell__Identifier),
  field_pFI(par_pFI),
  field_lSA__Identifier__List(par_lSA__Identifier__List),
  field_redirect__Attempt__Flag(par_redirect__Attempt__Flag),
  field_iMSI__BSSGP(par_iMSI__BSSGP),
  field_unconfirmed__Send__State__Variable(par_unconfirmed__Send__State__Variable),
  field_selected__PLMN__ID(par_selected__PLMN__ID),
  field_selected__Operator(par_selected__Operator),
  field_cS__Registered__Operator(par_cS__Registered__Operator),
  field_alignment__octets(par_alignment__octets),
  field_lLC__PDU(par_lLC__PDU)
{
}

PDU__BSSGP__UL__UNITDATA::PDU__BSSGP__UL__UNITDATA(const PDU__BSSGP__UL__UNITDATA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.qoS__Profile().is_bound()) field_qoS__Profile = other_value.qoS__Profile();
else field_qoS__Profile.clean_up();
if (other_value.cell__Identifier().is_bound()) field_cell__Identifier = other_value.cell__Identifier();
else field_cell__Identifier.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.lSA__Identifier__List().is_bound()) field_lSA__Identifier__List = other_value.lSA__Identifier__List();
else field_lSA__Identifier__List.clean_up();
if (other_value.redirect__Attempt__Flag().is_bound()) field_redirect__Attempt__Flag = other_value.redirect__Attempt__Flag();
else field_redirect__Attempt__Flag.clean_up();
if (other_value.iMSI__BSSGP().is_bound()) field_iMSI__BSSGP = other_value.iMSI__BSSGP();
else field_iMSI__BSSGP.clean_up();
if (other_value.unconfirmed__Send__State__Variable().is_bound()) field_unconfirmed__Send__State__Variable = other_value.unconfirmed__Send__State__Variable();
else field_unconfirmed__Send__State__Variable.clean_up();
if (other_value.selected__PLMN__ID().is_bound()) field_selected__PLMN__ID = other_value.selected__PLMN__ID();
else field_selected__PLMN__ID.clean_up();
if (other_value.selected__Operator().is_bound()) field_selected__Operator = other_value.selected__Operator();
else field_selected__Operator.clean_up();
if (other_value.cS__Registered__Operator().is_bound()) field_cS__Registered__Operator = other_value.cS__Registered__Operator();
else field_cS__Registered__Operator.clean_up();
if (other_value.alignment__octets().is_bound()) field_alignment__octets = other_value.alignment__octets();
else field_alignment__octets.clean_up();
if (other_value.lLC__PDU().is_bound()) field_lLC__PDU = other_value.lLC__PDU();
else field_lLC__PDU.clean_up();
}

void PDU__BSSGP__UL__UNITDATA::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_qoS__Profile.clean_up();
field_cell__Identifier.clean_up();
field_pFI.clean_up();
field_lSA__Identifier__List.clean_up();
field_redirect__Attempt__Flag.clean_up();
field_iMSI__BSSGP.clean_up();
field_unconfirmed__Send__State__Variable.clean_up();
field_selected__PLMN__ID.clean_up();
field_selected__Operator.clean_up();
field_cS__Registered__Operator.clean_up();
field_alignment__octets.clean_up();
field_lLC__PDU.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__UL__UNITDATA::get_descriptor() const { return &PDU__BSSGP__UL__UNITDATA_descr_; }
PDU__BSSGP__UL__UNITDATA& PDU__BSSGP__UL__UNITDATA::operator=(const PDU__BSSGP__UL__UNITDATA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.qoS__Profile().is_bound()) field_qoS__Profile = other_value.qoS__Profile();
  else field_qoS__Profile.clean_up();
  if (other_value.cell__Identifier().is_bound()) field_cell__Identifier = other_value.cell__Identifier();
  else field_cell__Identifier.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.lSA__Identifier__List().is_bound()) field_lSA__Identifier__List = other_value.lSA__Identifier__List();
  else field_lSA__Identifier__List.clean_up();
  if (other_value.redirect__Attempt__Flag().is_bound()) field_redirect__Attempt__Flag = other_value.redirect__Attempt__Flag();
  else field_redirect__Attempt__Flag.clean_up();
  if (other_value.iMSI__BSSGP().is_bound()) field_iMSI__BSSGP = other_value.iMSI__BSSGP();
  else field_iMSI__BSSGP.clean_up();
  if (other_value.unconfirmed__Send__State__Variable().is_bound()) field_unconfirmed__Send__State__Variable = other_value.unconfirmed__Send__State__Variable();
  else field_unconfirmed__Send__State__Variable.clean_up();
  if (other_value.selected__PLMN__ID().is_bound()) field_selected__PLMN__ID = other_value.selected__PLMN__ID();
  else field_selected__PLMN__ID.clean_up();
  if (other_value.selected__Operator().is_bound()) field_selected__Operator = other_value.selected__Operator();
  else field_selected__Operator.clean_up();
  if (other_value.cS__Registered__Operator().is_bound()) field_cS__Registered__Operator = other_value.cS__Registered__Operator();
  else field_cS__Registered__Operator.clean_up();
  if (other_value.alignment__octets().is_bound()) field_alignment__octets = other_value.alignment__octets();
  else field_alignment__octets.clean_up();
  if (other_value.lLC__PDU().is_bound()) field_lLC__PDU = other_value.lLC__PDU();
  else field_lLC__PDU.clean_up();
}
return *this;
}

boolean PDU__BSSGP__UL__UNITDATA::operator==(const PDU__BSSGP__UL__UNITDATA& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_qoS__Profile==other_value.field_qoS__Profile
  && field_cell__Identifier==other_value.field_cell__Identifier
  && field_pFI==other_value.field_pFI
  && field_lSA__Identifier__List==other_value.field_lSA__Identifier__List
  && field_redirect__Attempt__Flag==other_value.field_redirect__Attempt__Flag
  && field_iMSI__BSSGP==other_value.field_iMSI__BSSGP
  && field_unconfirmed__Send__State__Variable==other_value.field_unconfirmed__Send__State__Variable
  && field_selected__PLMN__ID==other_value.field_selected__PLMN__ID
  && field_selected__Operator==other_value.field_selected__Operator
  && field_cS__Registered__Operator==other_value.field_cS__Registered__Operator
  && field_alignment__octets==other_value.field_alignment__octets
  && field_lLC__PDU==other_value.field_lLC__PDU;
}

boolean PDU__BSSGP__UL__UNITDATA::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_qoS__Profile.is_bound())
  || (field_cell__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_pFI.get_selection() || field_pFI.is_bound())
  || (OPTIONAL_OMIT == field_lSA__Identifier__List.get_selection() || field_lSA__Identifier__List.is_bound())
  || (OPTIONAL_OMIT == field_redirect__Attempt__Flag.get_selection() || field_redirect__Attempt__Flag.is_bound())
  || (OPTIONAL_OMIT == field_iMSI__BSSGP.get_selection() || field_iMSI__BSSGP.is_bound())
  || (OPTIONAL_OMIT == field_unconfirmed__Send__State__Variable.get_selection() || field_unconfirmed__Send__State__Variable.is_bound())
  || (OPTIONAL_OMIT == field_selected__PLMN__ID.get_selection() || field_selected__PLMN__ID.is_bound())
  || (OPTIONAL_OMIT == field_selected__Operator.get_selection() || field_selected__Operator.is_bound())
  || (OPTIONAL_OMIT == field_cS__Registered__Operator.get_selection() || field_cS__Registered__Operator.is_bound())
  || (OPTIONAL_OMIT == field_alignment__octets.get_selection() || field_alignment__octets.is_bound())
  || (field_lLC__PDU.is_bound());
}
boolean PDU__BSSGP__UL__UNITDATA::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_qoS__Profile.is_value()
  && field_cell__Identifier.is_value()
  && (OPTIONAL_OMIT == field_pFI.get_selection() || field_pFI.is_value())
  && (OPTIONAL_OMIT == field_lSA__Identifier__List.get_selection() || field_lSA__Identifier__List.is_value())
  && (OPTIONAL_OMIT == field_redirect__Attempt__Flag.get_selection() || field_redirect__Attempt__Flag.is_value())
  && (OPTIONAL_OMIT == field_iMSI__BSSGP.get_selection() || field_iMSI__BSSGP.is_value())
  && (OPTIONAL_OMIT == field_unconfirmed__Send__State__Variable.get_selection() || field_unconfirmed__Send__State__Variable.is_value())
  && (OPTIONAL_OMIT == field_selected__PLMN__ID.get_selection() || field_selected__PLMN__ID.is_value())
  && (OPTIONAL_OMIT == field_selected__Operator.get_selection() || field_selected__Operator.is_value())
  && (OPTIONAL_OMIT == field_cS__Registered__Operator.get_selection() || field_cS__Registered__Operator.is_value())
  && (OPTIONAL_OMIT == field_alignment__octets.get_selection() || field_alignment__octets.is_value())
  && field_lLC__PDU.is_value();
}
int PDU__BSSGP__UL__UNITDATA::size_of() const
{
  int ret_val = 5;
  if (field_pFI.ispresent()) ret_val++;
  if (field_lSA__Identifier__List.ispresent()) ret_val++;
  if (field_redirect__Attempt__Flag.ispresent()) ret_val++;
  if (field_iMSI__BSSGP.ispresent()) ret_val++;
  if (field_unconfirmed__Send__State__Variable.ispresent()) ret_val++;
  if (field_selected__PLMN__ID.ispresent()) ret_val++;
  if (field_selected__Operator.ispresent()) ret_val++;
  if (field_cS__Registered__Operator.ispresent()) ret_val++;
  if (field_alignment__octets.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__UL__UNITDATA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", qoS_Profile := ");
field_qoS__Profile.log();
TTCN_Logger::log_event_str(", cell_Identifier := ");
field_cell__Identifier.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", lSA_Identifier_List := ");
field_lSA__Identifier__List.log();
TTCN_Logger::log_event_str(", redirect_Attempt_Flag := ");
field_redirect__Attempt__Flag.log();
TTCN_Logger::log_event_str(", iMSI_BSSGP := ");
field_iMSI__BSSGP.log();
TTCN_Logger::log_event_str(", unconfirmed_Send_State_Variable := ");
field_unconfirmed__Send__State__Variable.log();
TTCN_Logger::log_event_str(", selected_PLMN_ID := ");
field_selected__PLMN__ID.log();
TTCN_Logger::log_event_str(", selected_Operator := ");
field_selected__Operator.log();
TTCN_Logger::log_event_str(", cS_Registered_Operator := ");
field_cS__Registered__Operator.log();
TTCN_Logger::log_event_str(", alignment_octets := ");
field_alignment__octets.log();
TTCN_Logger::log_event_str(", lLC_PDU := ");
field_lLC__PDU.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__UL__UNITDATA::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (qoS__Profile().is_bound()) qoS__Profile().set_implicit_omit();
if (cell__Identifier().is_bound()) cell__Identifier().set_implicit_omit();
if (!pFI().is_bound()) pFI() = OMIT_VALUE;
else pFI().set_implicit_omit();
if (!lSA__Identifier__List().is_bound()) lSA__Identifier__List() = OMIT_VALUE;
else lSA__Identifier__List().set_implicit_omit();
if (!redirect__Attempt__Flag().is_bound()) redirect__Attempt__Flag() = OMIT_VALUE;
else redirect__Attempt__Flag().set_implicit_omit();
if (!iMSI__BSSGP().is_bound()) iMSI__BSSGP() = OMIT_VALUE;
else iMSI__BSSGP().set_implicit_omit();
if (!unconfirmed__Send__State__Variable().is_bound()) unconfirmed__Send__State__Variable() = OMIT_VALUE;
else unconfirmed__Send__State__Variable().set_implicit_omit();
if (!selected__PLMN__ID().is_bound()) selected__PLMN__ID() = OMIT_VALUE;
else selected__PLMN__ID().set_implicit_omit();
if (!selected__Operator().is_bound()) selected__Operator() = OMIT_VALUE;
else selected__Operator().set_implicit_omit();
if (!cS__Registered__Operator().is_bound()) cS__Registered__Operator() = OMIT_VALUE;
else cS__Registered__Operator().set_implicit_omit();
if (!alignment__octets().is_bound()) alignment__octets() = OMIT_VALUE;
else alignment__octets().set_implicit_omit();
if (lLC__PDU().is_bound()) lLC__PDU().set_implicit_omit();
}

void PDU__BSSGP__UL__UNITDATA::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (14<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA has 14 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) qoS__Profile().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lSA__Identifier__List().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) redirect__Attempt__Flag().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) iMSI__BSSGP().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) unconfirmed__Send__State__Variable().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) selected__PLMN__ID().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) selected__Operator().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) cS__Registered__Operator().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) alignment__octets().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) lLC__PDU().set_param(*param.get_elem(13));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "qoS_Profile")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          qoS__Profile().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lSA_Identifier_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lSA__Identifier__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirect_Attempt_Flag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirect__Attempt__Flag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI_BSSGP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI__BSSGP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unconfirmed_Send_State_Variable")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unconfirmed__Send__State__Variable().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "selected_PLMN_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          selected__PLMN__ID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "selected_Operator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          selected__Operator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cS_Registered_Operator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__Registered__Operator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alignment_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alignment__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
  }
}

void PDU__BSSGP__UL__UNITDATA::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_qoS__Profile.encode_text(text_buf);
field_cell__Identifier.encode_text(text_buf);
field_pFI.encode_text(text_buf);
field_lSA__Identifier__List.encode_text(text_buf);
field_redirect__Attempt__Flag.encode_text(text_buf);
field_iMSI__BSSGP.encode_text(text_buf);
field_unconfirmed__Send__State__Variable.encode_text(text_buf);
field_selected__PLMN__ID.encode_text(text_buf);
field_selected__Operator.encode_text(text_buf);
field_cS__Registered__Operator.encode_text(text_buf);
field_alignment__octets.encode_text(text_buf);
field_lLC__PDU.encode_text(text_buf);
}

void PDU__BSSGP__UL__UNITDATA::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_qoS__Profile.decode_text(text_buf);
field_cell__Identifier.decode_text(text_buf);
field_pFI.decode_text(text_buf);
field_lSA__Identifier__List.decode_text(text_buf);
field_redirect__Attempt__Flag.decode_text(text_buf);
field_iMSI__BSSGP.decode_text(text_buf);
field_unconfirmed__Send__State__Variable.decode_text(text_buf);
field_selected__PLMN__ID.decode_text(text_buf);
field_selected__Operator.decode_text(text_buf);
field_cS__Registered__Operator.decode_text(text_buf);
field_alignment__octets.decode_text(text_buf);
field_lLC__PDU.decode_text(text_buf);
}

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

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

int PDU__BSSGP__UL__UNITDATA::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_bssgpPduType.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(General__Types::OCT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, QoS__Profile__V_descr_.raw->forceomit);
  decoded_field_length = field_qoS__Profile.RAW_decode(QoS__Profile__V_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, Cell__Identifier_descr_.raw->forceomit);
  decoded_field_length = field_cell__Identifier.RAW_decode(Cell__Identifier_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_pFI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI().RAW_decode(PFI_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_pFI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pFI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_lSA__Identifier__List = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, LSA__Identifier__List__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_lSA__Identifier__List().RAW_decode(LSA__Identifier__List__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_lSA__Identifier__List = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_lSA__Identifier__List=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_redirect__Attempt__Flag = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, Redirect__Attempt__Flag_descr_.raw->forceomit);
  decoded_field_length = field_redirect__Attempt__Flag().RAW_decode(Redirect__Attempt__Flag_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_redirect__Attempt__Flag = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_redirect__Attempt__Flag=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_iMSI__BSSGP = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI__BSSGP().RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_iMSI__BSSGP = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iMSI__BSSGP=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_unconfirmed__Send__State__Variable = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, Unconfirmed__Send__State__Variable_descr_.raw->forceomit);
  decoded_field_length = field_unconfirmed__Send__State__Variable().RAW_decode(Unconfirmed__Send__State__Variable_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_unconfirmed__Send__State__Variable = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_unconfirmed__Send__State__Variable=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_selected__PLMN__ID = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, Selected__PLMN__ID_descr_.raw->forceomit);
  decoded_field_length = field_selected__PLMN__ID().RAW_decode(Selected__PLMN__ID_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_selected__PLMN__ID = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_selected__PLMN__ID=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_selected__Operator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, PLMN__Identity_descr_.raw->forceomit);
  decoded_field_length = field_selected__Operator().RAW_decode(PLMN__Identity_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_selected__Operator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_selected__Operator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_cS__Registered__Operator = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, PLMN__Identity_descr_.raw->forceomit);
  decoded_field_length = field_cS__Registered__Operator().RAW_decode(PLMN__Identity_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_cS__Registered__Operator = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_cS__Registered__Operator=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_alignment__octets = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, Alignment__octets_descr_.raw->forceomit);
  decoded_field_length = field_alignment__octets().RAW_decode(Alignment__octets_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_alignment__octets = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_alignment__octets=OMIT_VALUE;
  RAW_Force_Omit field_13_force_omit(13, force_omit, LLC__PDU_descr_.raw->forceomit);
  decoded_field_length = field_lLC__PDU.RAW_decode(LLC__PDU_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_26) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__UL__UNITDATA::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 14;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(14);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::OCT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, QoS__Profile__V_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cell__Identifier_descr_.raw);
  if (field_pFI.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PFI_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_lSA__Identifier__List.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, LSA__Identifier__List__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_redirect__Attempt__Flag.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, Redirect__Attempt__Flag_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_iMSI__BSSGP.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, IMSI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_unconfirmed__Send__State__Variable.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, Unconfirmed__Send__State__Variable_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_selected__PLMN__ID.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, Selected__PLMN__ID_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_selected__Operator.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, PLMN__Identity_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_cS__Registered__Operator.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, PLMN__Identity_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_alignment__octets.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, Alignment__octets_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, LLC__PDU_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_qoS__Profile.RAW_encode(QoS__Profile__V_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cell__Identifier.RAW_encode(Cell__Identifier_descr_, *myleaf.body.node.nodes[3]);
  if (field_pFI.ispresent()) {
  encoded_length += field_pFI().RAW_encode(PFI_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_lSA__Identifier__List.ispresent()) {
  encoded_length += field_lSA__Identifier__List().RAW_encode(LSA__Identifier__List__BSSGP_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_redirect__Attempt__Flag.ispresent()) {
  encoded_length += field_redirect__Attempt__Flag().RAW_encode(Redirect__Attempt__Flag_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_iMSI__BSSGP.ispresent()) {
  encoded_length += field_iMSI__BSSGP().RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_unconfirmed__Send__State__Variable.ispresent()) {
  encoded_length += field_unconfirmed__Send__State__Variable().RAW_encode(Unconfirmed__Send__State__Variable_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_selected__PLMN__ID.ispresent()) {
  encoded_length += field_selected__PLMN__ID().RAW_encode(Selected__PLMN__ID_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_selected__Operator.ispresent()) {
  encoded_length += field_selected__Operator().RAW_encode(PLMN__Identity_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_cS__Registered__Operator.ispresent()) {
  encoded_length += field_cS__Registered__Operator().RAW_encode(PLMN__Identity_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_alignment__octets.ispresent()) {
  encoded_length += field_alignment__octets().RAW_encode(Alignment__octets_descr_, *myleaf.body.node.nodes[12]);
  }
  encoded_length += field_lLC__PDU.RAW_encode(LLC__PDU_descr_, *myleaf.body.node.nodes[13]);
  if (field_bssgpPduType !=  os_26) {
  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_26.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__UL__UNITDATA_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
OCTETSTRING_template field_tLLI;
QoS__Profile__V_template field_qoS__Profile;
Cell__Identifier_template field_cell__Identifier;
PFI_template field_pFI;
LSA__Identifier__List__BSSGP_template field_lSA__Identifier__List;
Redirect__Attempt__Flag_template field_redirect__Attempt__Flag;
IMSI__BSSGP_template field_iMSI__BSSGP;
Unconfirmed__Send__State__Variable_template field_unconfirmed__Send__State__Variable;
Selected__PLMN__ID_template field_selected__PLMN__ID;
PLMN__Identity_template field_selected__Operator;
PLMN__Identity_template field_cS__Registered__Operator;
Alignment__octets_template field_alignment__octets;
LLC__PDU_template field_lLC__PDU;
};

void PDU__BSSGP__UL__UNITDATA_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_qoS__Profile = ANY_VALUE;
single_value->field_cell__Identifier = ANY_VALUE;
single_value->field_pFI = ANY_OR_OMIT;
single_value->field_lSA__Identifier__List = ANY_OR_OMIT;
single_value->field_redirect__Attempt__Flag = ANY_OR_OMIT;
single_value->field_iMSI__BSSGP = ANY_OR_OMIT;
single_value->field_unconfirmed__Send__State__Variable = ANY_OR_OMIT;
single_value->field_selected__PLMN__ID = ANY_OR_OMIT;
single_value->field_selected__Operator = ANY_OR_OMIT;
single_value->field_cS__Registered__Operator = ANY_OR_OMIT;
single_value->field_alignment__octets = ANY_OR_OMIT;
single_value->field_lLC__PDU = ANY_VALUE;
}
}
}

void PDU__BSSGP__UL__UNITDATA_template::copy_value(const PDU__BSSGP__UL__UNITDATA& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.qoS__Profile().is_bound()) {
  single_value->field_qoS__Profile = other_value.qoS__Profile();
} else {
  single_value->field_qoS__Profile.clean_up();
}
if (other_value.cell__Identifier().is_bound()) {
  single_value->field_cell__Identifier = other_value.cell__Identifier();
} else {
  single_value->field_cell__Identifier.clean_up();
}
if (other_value.pFI().is_bound()) {
  if (other_value.pFI().ispresent()) single_value->field_pFI = other_value.pFI()();
  else single_value->field_pFI = OMIT_VALUE;
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.lSA__Identifier__List().is_bound()) {
  if (other_value.lSA__Identifier__List().ispresent()) single_value->field_lSA__Identifier__List = other_value.lSA__Identifier__List()();
  else single_value->field_lSA__Identifier__List = OMIT_VALUE;
} else {
  single_value->field_lSA__Identifier__List.clean_up();
}
if (other_value.redirect__Attempt__Flag().is_bound()) {
  if (other_value.redirect__Attempt__Flag().ispresent()) single_value->field_redirect__Attempt__Flag = other_value.redirect__Attempt__Flag()();
  else single_value->field_redirect__Attempt__Flag = OMIT_VALUE;
} else {
  single_value->field_redirect__Attempt__Flag.clean_up();
}
if (other_value.iMSI__BSSGP().is_bound()) {
  if (other_value.iMSI__BSSGP().ispresent()) single_value->field_iMSI__BSSGP = other_value.iMSI__BSSGP()();
  else single_value->field_iMSI__BSSGP = OMIT_VALUE;
} else {
  single_value->field_iMSI__BSSGP.clean_up();
}
if (other_value.unconfirmed__Send__State__Variable().is_bound()) {
  if (other_value.unconfirmed__Send__State__Variable().ispresent()) single_value->field_unconfirmed__Send__State__Variable = other_value.unconfirmed__Send__State__Variable()();
  else single_value->field_unconfirmed__Send__State__Variable = OMIT_VALUE;
} else {
  single_value->field_unconfirmed__Send__State__Variable.clean_up();
}
if (other_value.selected__PLMN__ID().is_bound()) {
  if (other_value.selected__PLMN__ID().ispresent()) single_value->field_selected__PLMN__ID = other_value.selected__PLMN__ID()();
  else single_value->field_selected__PLMN__ID = OMIT_VALUE;
} else {
  single_value->field_selected__PLMN__ID.clean_up();
}
if (other_value.selected__Operator().is_bound()) {
  if (other_value.selected__Operator().ispresent()) single_value->field_selected__Operator = other_value.selected__Operator()();
  else single_value->field_selected__Operator = OMIT_VALUE;
} else {
  single_value->field_selected__Operator.clean_up();
}
if (other_value.cS__Registered__Operator().is_bound()) {
  if (other_value.cS__Registered__Operator().ispresent()) single_value->field_cS__Registered__Operator = other_value.cS__Registered__Operator()();
  else single_value->field_cS__Registered__Operator = OMIT_VALUE;
} else {
  single_value->field_cS__Registered__Operator.clean_up();
}
if (other_value.alignment__octets().is_bound()) {
  if (other_value.alignment__octets().ispresent()) single_value->field_alignment__octets = other_value.alignment__octets()();
  else single_value->field_alignment__octets = OMIT_VALUE;
} else {
  single_value->field_alignment__octets.clean_up();
}
if (other_value.lLC__PDU().is_bound()) {
  single_value->field_lLC__PDU = other_value.lLC__PDU();
} else {
  single_value->field_lLC__PDU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__UL__UNITDATA_template::copy_template(const PDU__BSSGP__UL__UNITDATA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.qoS__Profile().get_selection()) {
single_value->field_qoS__Profile = other_value.qoS__Profile();
} else {
single_value->field_qoS__Profile.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__Identifier().get_selection()) {
single_value->field_cell__Identifier = other_value.cell__Identifier();
} else {
single_value->field_cell__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lSA__Identifier__List().get_selection()) {
single_value->field_lSA__Identifier__List = other_value.lSA__Identifier__List();
} else {
single_value->field_lSA__Identifier__List.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.redirect__Attempt__Flag().get_selection()) {
single_value->field_redirect__Attempt__Flag = other_value.redirect__Attempt__Flag();
} else {
single_value->field_redirect__Attempt__Flag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI__BSSGP().get_selection()) {
single_value->field_iMSI__BSSGP = other_value.iMSI__BSSGP();
} else {
single_value->field_iMSI__BSSGP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.unconfirmed__Send__State__Variable().get_selection()) {
single_value->field_unconfirmed__Send__State__Variable = other_value.unconfirmed__Send__State__Variable();
} else {
single_value->field_unconfirmed__Send__State__Variable.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.selected__PLMN__ID().get_selection()) {
single_value->field_selected__PLMN__ID = other_value.selected__PLMN__ID();
} else {
single_value->field_selected__PLMN__ID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.selected__Operator().get_selection()) {
single_value->field_selected__Operator = other_value.selected__Operator();
} else {
single_value->field_selected__Operator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cS__Registered__Operator().get_selection()) {
single_value->field_cS__Registered__Operator = other_value.cS__Registered__Operator();
} else {
single_value->field_cS__Registered__Operator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.alignment__octets().get_selection()) {
single_value->field_alignment__octets = other_value.alignment__octets();
} else {
single_value->field_alignment__octets.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lLC__PDU().get_selection()) {
single_value->field_lLC__PDU = other_value.lLC__PDU();
} else {
single_value->field_lLC__PDU.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__UL__UNITDATA_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__UL__UNITDATA_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__UL__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__UL__UNITDATA_template::PDU__BSSGP__UL__UNITDATA_template()
{
}

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

PDU__BSSGP__UL__UNITDATA_template::PDU__BSSGP__UL__UNITDATA_template(const PDU__BSSGP__UL__UNITDATA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__BSSGP__UL__UNITDATA_template& PDU__BSSGP__UL__UNITDATA_template::operator=(const OPTIONAL<PDU__BSSGP__UL__UNITDATA>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__UL__UNITDATA&)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 @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
}
return *this;
}

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

boolean PDU__BSSGP__UL__UNITDATA_template::match(const PDU__BSSGP__UL__UNITDATA& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.qoS__Profile().is_bound()) return FALSE;
if(!single_value->field_qoS__Profile.match(other_value.qoS__Profile(), legacy))return FALSE;
if(!other_value.cell__Identifier().is_bound()) return FALSE;
if(!single_value->field_cell__Identifier.match(other_value.cell__Identifier(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if((other_value.pFI().ispresent() ? !single_value->field_pFI.match((const PFI&)other_value.pFI(), legacy) : !single_value->field_pFI.match_omit(legacy)))return FALSE;
if(!other_value.lSA__Identifier__List().is_bound()) return FALSE;
if((other_value.lSA__Identifier__List().ispresent() ? !single_value->field_lSA__Identifier__List.match((const LSA__Identifier__List__BSSGP&)other_value.lSA__Identifier__List(), legacy) : !single_value->field_lSA__Identifier__List.match_omit(legacy)))return FALSE;
if(!other_value.redirect__Attempt__Flag().is_bound()) return FALSE;
if((other_value.redirect__Attempt__Flag().ispresent() ? !single_value->field_redirect__Attempt__Flag.match((const Redirect__Attempt__Flag&)other_value.redirect__Attempt__Flag(), legacy) : !single_value->field_redirect__Attempt__Flag.match_omit(legacy)))return FALSE;
if(!other_value.iMSI__BSSGP().is_bound()) return FALSE;
if((other_value.iMSI__BSSGP().ispresent() ? !single_value->field_iMSI__BSSGP.match((const IMSI__BSSGP&)other_value.iMSI__BSSGP(), legacy) : !single_value->field_iMSI__BSSGP.match_omit(legacy)))return FALSE;
if(!other_value.unconfirmed__Send__State__Variable().is_bound()) return FALSE;
if((other_value.unconfirmed__Send__State__Variable().ispresent() ? !single_value->field_unconfirmed__Send__State__Variable.match((const Unconfirmed__Send__State__Variable&)other_value.unconfirmed__Send__State__Variable(), legacy) : !single_value->field_unconfirmed__Send__State__Variable.match_omit(legacy)))return FALSE;
if(!other_value.selected__PLMN__ID().is_bound()) return FALSE;
if((other_value.selected__PLMN__ID().ispresent() ? !single_value->field_selected__PLMN__ID.match((const Selected__PLMN__ID&)other_value.selected__PLMN__ID(), legacy) : !single_value->field_selected__PLMN__ID.match_omit(legacy)))return FALSE;
if(!other_value.selected__Operator().is_bound()) return FALSE;
if((other_value.selected__Operator().ispresent() ? !single_value->field_selected__Operator.match((const PLMN__Identity&)other_value.selected__Operator(), legacy) : !single_value->field_selected__Operator.match_omit(legacy)))return FALSE;
if(!other_value.cS__Registered__Operator().is_bound()) return FALSE;
if((other_value.cS__Registered__Operator().ispresent() ? !single_value->field_cS__Registered__Operator.match((const PLMN__Identity&)other_value.cS__Registered__Operator(), legacy) : !single_value->field_cS__Registered__Operator.match_omit(legacy)))return FALSE;
if(!other_value.alignment__octets().is_bound()) return FALSE;
if((other_value.alignment__octets().ispresent() ? !single_value->field_alignment__octets.match((const Alignment__octets&)other_value.alignment__octets(), legacy) : !single_value->field_alignment__octets.match_omit(legacy)))return FALSE;
if(!other_value.lLC__PDU().is_bound()) return FALSE;
if(!single_value->field_lLC__PDU.match(other_value.lLC__PDU(), 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 @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
}
return FALSE;
}

boolean PDU__BSSGP__UL__UNITDATA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_qoS__Profile.is_bound()
 || single_value->field_cell__Identifier.is_bound()
 || (single_value->field_pFI.is_omit() || single_value->field_pFI.is_bound())
 || (single_value->field_lSA__Identifier__List.is_omit() || single_value->field_lSA__Identifier__List.is_bound())
 || (single_value->field_redirect__Attempt__Flag.is_omit() || single_value->field_redirect__Attempt__Flag.is_bound())
 || (single_value->field_iMSI__BSSGP.is_omit() || single_value->field_iMSI__BSSGP.is_bound())
 || (single_value->field_unconfirmed__Send__State__Variable.is_omit() || single_value->field_unconfirmed__Send__State__Variable.is_bound())
 || (single_value->field_selected__PLMN__ID.is_omit() || single_value->field_selected__PLMN__ID.is_bound())
 || (single_value->field_selected__Operator.is_omit() || single_value->field_selected__Operator.is_bound())
 || (single_value->field_cS__Registered__Operator.is_omit() || single_value->field_cS__Registered__Operator.is_bound())
 || (single_value->field_alignment__octets.is_omit() || single_value->field_alignment__octets.is_bound())
 || single_value->field_lLC__PDU.is_bound();
}

boolean PDU__BSSGP__UL__UNITDATA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_qoS__Profile.is_value()
 && single_value->field_cell__Identifier.is_value()
 && (single_value->field_pFI.is_omit() || single_value->field_pFI.is_value())
 && (single_value->field_lSA__Identifier__List.is_omit() || single_value->field_lSA__Identifier__List.is_value())
 && (single_value->field_redirect__Attempt__Flag.is_omit() || single_value->field_redirect__Attempt__Flag.is_value())
 && (single_value->field_iMSI__BSSGP.is_omit() || single_value->field_iMSI__BSSGP.is_value())
 && (single_value->field_unconfirmed__Send__State__Variable.is_omit() || single_value->field_unconfirmed__Send__State__Variable.is_value())
 && (single_value->field_selected__PLMN__ID.is_omit() || single_value->field_selected__PLMN__ID.is_value())
 && (single_value->field_selected__Operator.is_omit() || single_value->field_selected__Operator.is_value())
 && (single_value->field_cS__Registered__Operator.is_omit() || single_value->field_cS__Registered__Operator.is_value())
 && (single_value->field_alignment__octets.is_omit() || single_value->field_alignment__octets.is_value())
 && single_value->field_lLC__PDU.is_value();
}

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

PDU__BSSGP__UL__UNITDATA PDU__BSSGP__UL__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
PDU__BSSGP__UL__UNITDATA ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_qoS__Profile.is_bound()) {
ret_val.qoS__Profile() = single_value->field_qoS__Profile.valueof();
}
if (single_value->field_cell__Identifier.is_bound()) {
ret_val.cell__Identifier() = single_value->field_cell__Identifier.valueof();
}
if (single_value->field_pFI.is_omit()) ret_val.pFI() = OMIT_VALUE;
else if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_lSA__Identifier__List.is_omit()) ret_val.lSA__Identifier__List() = OMIT_VALUE;
else if (single_value->field_lSA__Identifier__List.is_bound()) {
ret_val.lSA__Identifier__List() = single_value->field_lSA__Identifier__List.valueof();
}
if (single_value->field_redirect__Attempt__Flag.is_omit()) ret_val.redirect__Attempt__Flag() = OMIT_VALUE;
else if (single_value->field_redirect__Attempt__Flag.is_bound()) {
ret_val.redirect__Attempt__Flag() = single_value->field_redirect__Attempt__Flag.valueof();
}
if (single_value->field_iMSI__BSSGP.is_omit()) ret_val.iMSI__BSSGP() = OMIT_VALUE;
else if (single_value->field_iMSI__BSSGP.is_bound()) {
ret_val.iMSI__BSSGP() = single_value->field_iMSI__BSSGP.valueof();
}
if (single_value->field_unconfirmed__Send__State__Variable.is_omit()) ret_val.unconfirmed__Send__State__Variable() = OMIT_VALUE;
else if (single_value->field_unconfirmed__Send__State__Variable.is_bound()) {
ret_val.unconfirmed__Send__State__Variable() = single_value->field_unconfirmed__Send__State__Variable.valueof();
}
if (single_value->field_selected__PLMN__ID.is_omit()) ret_val.selected__PLMN__ID() = OMIT_VALUE;
else if (single_value->field_selected__PLMN__ID.is_bound()) {
ret_val.selected__PLMN__ID() = single_value->field_selected__PLMN__ID.valueof();
}
if (single_value->field_selected__Operator.is_omit()) ret_val.selected__Operator() = OMIT_VALUE;
else if (single_value->field_selected__Operator.is_bound()) {
ret_val.selected__Operator() = single_value->field_selected__Operator.valueof();
}
if (single_value->field_cS__Registered__Operator.is_omit()) ret_val.cS__Registered__Operator() = OMIT_VALUE;
else if (single_value->field_cS__Registered__Operator.is_bound()) {
ret_val.cS__Registered__Operator() = single_value->field_cS__Registered__Operator.valueof();
}
if (single_value->field_alignment__octets.is_omit()) ret_val.alignment__octets() = OMIT_VALUE;
else if (single_value->field_alignment__octets.is_bound()) {
ret_val.alignment__octets() = single_value->field_alignment__octets.valueof();
}
if (single_value->field_lLC__PDU.is_bound()) {
ret_val.lLC__PDU() = single_value->field_lLC__PDU.valueof();
}
return ret_val;
}

void PDU__BSSGP__UL__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__UL__UNITDATA_template[list_length];
}

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

OCTETSTRING_template& PDU__BSSGP__UL__UNITDATA_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__UL__UNITDATA_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_bssgpPduType;
}

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

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

QoS__Profile__V_template& PDU__BSSGP__UL__UNITDATA_template::qoS__Profile()
{
set_specific();
return single_value->field_qoS__Profile;
}

const QoS__Profile__V_template& PDU__BSSGP__UL__UNITDATA_template::qoS__Profile() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field qoS_Profile of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_qoS__Profile;
}

Cell__Identifier_template& PDU__BSSGP__UL__UNITDATA_template::cell__Identifier()
{
set_specific();
return single_value->field_cell__Identifier;
}

const Cell__Identifier_template& PDU__BSSGP__UL__UNITDATA_template::cell__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_Identifier of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_cell__Identifier;
}

PFI_template& PDU__BSSGP__UL__UNITDATA_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__UL__UNITDATA_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_pFI;
}

LSA__Identifier__List__BSSGP_template& PDU__BSSGP__UL__UNITDATA_template::lSA__Identifier__List()
{
set_specific();
return single_value->field_lSA__Identifier__List;
}

const LSA__Identifier__List__BSSGP_template& PDU__BSSGP__UL__UNITDATA_template::lSA__Identifier__List() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lSA_Identifier_List of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_lSA__Identifier__List;
}

Redirect__Attempt__Flag_template& PDU__BSSGP__UL__UNITDATA_template::redirect__Attempt__Flag()
{
set_specific();
return single_value->field_redirect__Attempt__Flag;
}

const Redirect__Attempt__Flag_template& PDU__BSSGP__UL__UNITDATA_template::redirect__Attempt__Flag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field redirect_Attempt_Flag of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_redirect__Attempt__Flag;
}

IMSI__BSSGP_template& PDU__BSSGP__UL__UNITDATA_template::iMSI__BSSGP()
{
set_specific();
return single_value->field_iMSI__BSSGP;
}

const IMSI__BSSGP_template& PDU__BSSGP__UL__UNITDATA_template::iMSI__BSSGP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI_BSSGP of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_iMSI__BSSGP;
}

Unconfirmed__Send__State__Variable_template& PDU__BSSGP__UL__UNITDATA_template::unconfirmed__Send__State__Variable()
{
set_specific();
return single_value->field_unconfirmed__Send__State__Variable;
}

const Unconfirmed__Send__State__Variable_template& PDU__BSSGP__UL__UNITDATA_template::unconfirmed__Send__State__Variable() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field unconfirmed_Send_State_Variable of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_unconfirmed__Send__State__Variable;
}

Selected__PLMN__ID_template& PDU__BSSGP__UL__UNITDATA_template::selected__PLMN__ID()
{
set_specific();
return single_value->field_selected__PLMN__ID;
}

const Selected__PLMN__ID_template& PDU__BSSGP__UL__UNITDATA_template::selected__PLMN__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field selected_PLMN_ID of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_selected__PLMN__ID;
}

PLMN__Identity_template& PDU__BSSGP__UL__UNITDATA_template::selected__Operator()
{
set_specific();
return single_value->field_selected__Operator;
}

const PLMN__Identity_template& PDU__BSSGP__UL__UNITDATA_template::selected__Operator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field selected_Operator of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_selected__Operator;
}

PLMN__Identity_template& PDU__BSSGP__UL__UNITDATA_template::cS__Registered__Operator()
{
set_specific();
return single_value->field_cS__Registered__Operator;
}

const PLMN__Identity_template& PDU__BSSGP__UL__UNITDATA_template::cS__Registered__Operator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cS_Registered_Operator of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_cS__Registered__Operator;
}

Alignment__octets_template& PDU__BSSGP__UL__UNITDATA_template::alignment__octets()
{
set_specific();
return single_value->field_alignment__octets;
}

const Alignment__octets_template& PDU__BSSGP__UL__UNITDATA_template::alignment__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field alignment_octets of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_alignment__octets;
}

LLC__PDU_template& PDU__BSSGP__UL__UNITDATA_template::lLC__PDU()
{
set_specific();
return single_value->field_lLC__PDU;
}

const LLC__PDU_template& PDU__BSSGP__UL__UNITDATA_template::lLC__PDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lLC_PDU of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
return single_value->field_lLC__PDU;
}

int PDU__BSSGP__UL__UNITDATA_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_pFI.is_present()) ret_val++;
      if (single_value->field_lSA__Identifier__List.is_present()) ret_val++;
      if (single_value->field_redirect__Attempt__Flag.is_present()) ret_val++;
      if (single_value->field_iMSI__BSSGP.is_present()) ret_val++;
      if (single_value->field_unconfirmed__Send__State__Variable.is_present()) ret_val++;
      if (single_value->field_selected__PLMN__ID.is_present()) ret_val++;
      if (single_value->field_selected__Operator.is_present()) ret_val++;
      if (single_value->field_cS__Registered__Operator.is_present()) ret_val++;
      if (single_value->field_alignment__octets.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 @BSSGP_Types.PDU_BSSGP_UL_UNITDATA 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 @BSSGP_Types.PDU_BSSGP_UL_UNITDATA containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
  }
  return 0;
}

void PDU__BSSGP__UL__UNITDATA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", qoS_Profile := ");
single_value->field_qoS__Profile.log();
TTCN_Logger::log_event_str(", cell_Identifier := ");
single_value->field_cell__Identifier.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", lSA_Identifier_List := ");
single_value->field_lSA__Identifier__List.log();
TTCN_Logger::log_event_str(", redirect_Attempt_Flag := ");
single_value->field_redirect__Attempt__Flag.log();
TTCN_Logger::log_event_str(", iMSI_BSSGP := ");
single_value->field_iMSI__BSSGP.log();
TTCN_Logger::log_event_str(", unconfirmed_Send_State_Variable := ");
single_value->field_unconfirmed__Send__State__Variable.log();
TTCN_Logger::log_event_str(", selected_PLMN_ID := ");
single_value->field_selected__PLMN__ID.log();
TTCN_Logger::log_event_str(", selected_Operator := ");
single_value->field_selected__Operator.log();
TTCN_Logger::log_event_str(", cS_Registered_Operator := ");
single_value->field_cS__Registered__Operator.log();
TTCN_Logger::log_event_str(", alignment_octets := ");
single_value->field_alignment__octets.log();
TTCN_Logger::log_event_str(", lLC_PDU := ");
single_value->field_lLC__PDU.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__UL__UNITDATA_template::log_match(const PDU__BSSGP__UL__UNITDATA& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_qoS__Profile.match(match_value.qoS__Profile(), legacy)){
TTCN_Logger::log_logmatch_info(".qoS_Profile");
single_value->field_qoS__Profile.log_match(match_value.qoS__Profile(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__Identifier.match(match_value.cell__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_Identifier");
single_value->field_cell__Identifier.log_match(match_value.cell__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pFI().ispresent()){
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pFI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pFI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pFI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.lSA__Identifier__List().ispresent()){
if(!single_value->field_lSA__Identifier__List.match(match_value.lSA__Identifier__List(), legacy)){
TTCN_Logger::log_logmatch_info(".lSA_Identifier_List");
single_value->field_lSA__Identifier__List.log_match(match_value.lSA__Identifier__List(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_lSA__Identifier__List.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".lSA_Identifier_List := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_lSA__Identifier__List.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.redirect__Attempt__Flag().ispresent()){
if(!single_value->field_redirect__Attempt__Flag.match(match_value.redirect__Attempt__Flag(), legacy)){
TTCN_Logger::log_logmatch_info(".redirect_Attempt_Flag");
single_value->field_redirect__Attempt__Flag.log_match(match_value.redirect__Attempt__Flag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_redirect__Attempt__Flag.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".redirect_Attempt_Flag := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_redirect__Attempt__Flag.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.iMSI__BSSGP().ispresent()){
if(!single_value->field_iMSI__BSSGP.match(match_value.iMSI__BSSGP(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI_BSSGP");
single_value->field_iMSI__BSSGP.log_match(match_value.iMSI__BSSGP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iMSI__BSSGP.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iMSI_BSSGP := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iMSI__BSSGP.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.unconfirmed__Send__State__Variable().ispresent()){
if(!single_value->field_unconfirmed__Send__State__Variable.match(match_value.unconfirmed__Send__State__Variable(), legacy)){
TTCN_Logger::log_logmatch_info(".unconfirmed_Send_State_Variable");
single_value->field_unconfirmed__Send__State__Variable.log_match(match_value.unconfirmed__Send__State__Variable(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_unconfirmed__Send__State__Variable.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".unconfirmed_Send_State_Variable := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_unconfirmed__Send__State__Variable.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.selected__PLMN__ID().ispresent()){
if(!single_value->field_selected__PLMN__ID.match(match_value.selected__PLMN__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".selected_PLMN_ID");
single_value->field_selected__PLMN__ID.log_match(match_value.selected__PLMN__ID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_selected__PLMN__ID.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".selected_PLMN_ID := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_selected__PLMN__ID.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.selected__Operator().ispresent()){
if(!single_value->field_selected__Operator.match(match_value.selected__Operator(), legacy)){
TTCN_Logger::log_logmatch_info(".selected_Operator");
single_value->field_selected__Operator.log_match(match_value.selected__Operator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_selected__Operator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".selected_Operator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_selected__Operator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cS__Registered__Operator().ispresent()){
if(!single_value->field_cS__Registered__Operator.match(match_value.cS__Registered__Operator(), legacy)){
TTCN_Logger::log_logmatch_info(".cS_Registered_Operator");
single_value->field_cS__Registered__Operator.log_match(match_value.cS__Registered__Operator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cS__Registered__Operator.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cS_Registered_Operator := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cS__Registered__Operator.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.alignment__octets().ispresent()){
if(!single_value->field_alignment__octets.match(match_value.alignment__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".alignment_octets");
single_value->field_alignment__octets.log_match(match_value.alignment__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_alignment__octets.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".alignment_octets := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_alignment__octets.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_lLC__PDU.match(match_value.lLC__PDU(), legacy)){
TTCN_Logger::log_logmatch_info(".lLC_PDU");
single_value->field_lLC__PDU.log_match(match_value.lLC__PDU(), 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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", qoS_Profile := ");
single_value->field_qoS__Profile.log_match(match_value.qoS__Profile(), legacy);
TTCN_Logger::log_event_str(", cell_Identifier := ");
single_value->field_cell__Identifier.log_match(match_value.cell__Identifier(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
if (match_value.pFI().ispresent()) {
single_value->field_pFI.log_match(match_value.pFI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pFI.log();
if (single_value->field_pFI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lSA_Identifier_List := ");
if (match_value.lSA__Identifier__List().ispresent()) {
single_value->field_lSA__Identifier__List.log_match(match_value.lSA__Identifier__List(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_lSA__Identifier__List.log();
if (single_value->field_lSA__Identifier__List.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", redirect_Attempt_Flag := ");
if (match_value.redirect__Attempt__Flag().ispresent()) {
single_value->field_redirect__Attempt__Flag.log_match(match_value.redirect__Attempt__Flag(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_redirect__Attempt__Flag.log();
if (single_value->field_redirect__Attempt__Flag.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", iMSI_BSSGP := ");
if (match_value.iMSI__BSSGP().ispresent()) {
single_value->field_iMSI__BSSGP.log_match(match_value.iMSI__BSSGP(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iMSI__BSSGP.log();
if (single_value->field_iMSI__BSSGP.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", unconfirmed_Send_State_Variable := ");
if (match_value.unconfirmed__Send__State__Variable().ispresent()) {
single_value->field_unconfirmed__Send__State__Variable.log_match(match_value.unconfirmed__Send__State__Variable(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_unconfirmed__Send__State__Variable.log();
if (single_value->field_unconfirmed__Send__State__Variable.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", selected_PLMN_ID := ");
if (match_value.selected__PLMN__ID().ispresent()) {
single_value->field_selected__PLMN__ID.log_match(match_value.selected__PLMN__ID(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_selected__PLMN__ID.log();
if (single_value->field_selected__PLMN__ID.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", selected_Operator := ");
if (match_value.selected__Operator().ispresent()) {
single_value->field_selected__Operator.log_match(match_value.selected__Operator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_selected__Operator.log();
if (single_value->field_selected__Operator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cS_Registered_Operator := ");
if (match_value.cS__Registered__Operator().ispresent()) {
single_value->field_cS__Registered__Operator.log_match(match_value.cS__Registered__Operator(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cS__Registered__Operator.log();
if (single_value->field_cS__Registered__Operator.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", alignment_octets := ");
if (match_value.alignment__octets().ispresent()) {
single_value->field_alignment__octets.log_match(match_value.alignment__octets(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_alignment__octets.log();
if (single_value->field_alignment__octets.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lLC_PDU := ");
single_value->field_lLC__PDU.log_match(match_value.lLC__PDU(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__UL__UNITDATA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_qoS__Profile.encode_text(text_buf);
single_value->field_cell__Identifier.encode_text(text_buf);
single_value->field_pFI.encode_text(text_buf);
single_value->field_lSA__Identifier__List.encode_text(text_buf);
single_value->field_redirect__Attempt__Flag.encode_text(text_buf);
single_value->field_iMSI__BSSGP.encode_text(text_buf);
single_value->field_unconfirmed__Send__State__Variable.encode_text(text_buf);
single_value->field_selected__PLMN__ID.encode_text(text_buf);
single_value->field_selected__Operator.encode_text(text_buf);
single_value->field_cS__Registered__Operator.encode_text(text_buf);
single_value->field_alignment__octets.encode_text(text_buf);
single_value->field_lLC__PDU.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 @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
}
}

void PDU__BSSGP__UL__UNITDATA_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_qoS__Profile.decode_text(text_buf);
single_value->field_cell__Identifier.decode_text(text_buf);
single_value->field_pFI.decode_text(text_buf);
single_value->field_lSA__Identifier__List.decode_text(text_buf);
single_value->field_redirect__Attempt__Flag.decode_text(text_buf);
single_value->field_iMSI__BSSGP.decode_text(text_buf);
single_value->field_unconfirmed__Send__State__Variable.decode_text(text_buf);
single_value->field_selected__PLMN__ID.decode_text(text_buf);
single_value->field_selected__Operator.decode_text(text_buf);
single_value->field_cS__Registered__Operator.decode_text(text_buf);
single_value->field_alignment__octets.decode_text(text_buf);
single_value->field_lLC__PDU.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__UL__UNITDATA_template[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 @BSSGP_Types.PDU_BSSGP_UL_UNITDATA.");
}
}

void PDU__BSSGP__UL__UNITDATA_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__UL__UNITDATA_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (14<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA has 14 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) qoS__Profile().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cell__Identifier().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lSA__Identifier__List().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) redirect__Attempt__Flag().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) iMSI__BSSGP().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) unconfirmed__Send__State__Variable().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) selected__PLMN__ID().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) selected__Operator().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) cS__Registered__Operator().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) alignment__octets().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) lLC__PDU().set_param(*param.get_elem(13));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "qoS_Profile")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          qoS__Profile().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lSA_Identifier_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lSA__Identifier__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "redirect_Attempt_Flag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          redirect__Attempt__Flag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI_BSSGP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI__BSSGP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "unconfirmed_Send_State_Variable")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          unconfirmed__Send__State__Variable().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "selected_PLMN_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          selected__PLMN__ID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "selected_Operator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          selected__Operator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cS_Registered_Operator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__Registered__Operator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alignment_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alignment__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_UL_UNITDATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__UL__UNITDATA_template* precondition = new PDU__BSSGP__UL__UNITDATA_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__UL__UNITDATA_template* implied_template = new PDU__BSSGP__UL__UNITDATA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__UL__UNITDATA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__UL__UNITDATA_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_qoS__Profile.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_cell__Identifier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_pFI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_lSA__Identifier__List.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_redirect__Attempt__Flag.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_iMSI__BSSGP.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_unconfirmed__Send__State__Variable.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_selected__PLMN__ID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_selected__Operator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_cS__Registered__Operator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_alignment__octets.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
single_value->field_lLC__PDU.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
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 : "@BSSGP_Types.PDU_BSSGP_UL_UNITDATA");
}

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

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

PDU__BSSGP__RA__CAPABILITY::PDU__BSSGP__RA__CAPABILITY()
{
}

PDU__BSSGP__RA__CAPABILITY::PDU__BSSGP__RA__CAPABILITY(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const MS__Radio__Access__Capability& par_mS__Radio__Access__Capability)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_mS__Radio__Access__Capability(par_mS__Radio__Access__Capability)
{
}

PDU__BSSGP__RA__CAPABILITY::PDU__BSSGP__RA__CAPABILITY(const PDU__BSSGP__RA__CAPABILITY& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.mS__Radio__Access__Capability().is_bound()) field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
else field_mS__Radio__Access__Capability.clean_up();
}

void PDU__BSSGP__RA__CAPABILITY::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_mS__Radio__Access__Capability.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__RA__CAPABILITY::get_descriptor() const { return &PDU__BSSGP__RA__CAPABILITY_descr_; }
PDU__BSSGP__RA__CAPABILITY& PDU__BSSGP__RA__CAPABILITY::operator=(const PDU__BSSGP__RA__CAPABILITY& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.mS__Radio__Access__Capability().is_bound()) field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
  else field_mS__Radio__Access__Capability.clean_up();
}
return *this;
}

boolean PDU__BSSGP__RA__CAPABILITY::operator==(const PDU__BSSGP__RA__CAPABILITY& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_mS__Radio__Access__Capability==other_value.field_mS__Radio__Access__Capability;
}

boolean PDU__BSSGP__RA__CAPABILITY::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_mS__Radio__Access__Capability.is_bound());
}
boolean PDU__BSSGP__RA__CAPABILITY::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_mS__Radio__Access__Capability.is_value();
}
void PDU__BSSGP__RA__CAPABILITY::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__RA__CAPABILITY::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (mS__Radio__Access__Capability().is_bound()) mS__Radio__Access__Capability().set_implicit_omit();
}

void PDU__BSSGP__RA__CAPABILITY::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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mS__Radio__Access__Capability().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Radio_Access_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Radio__Access__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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY");
  }
}

void PDU__BSSGP__RA__CAPABILITY::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_mS__Radio__Access__Capability.encode_text(text_buf);
}

void PDU__BSSGP__RA__CAPABILITY::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_mS__Radio__Access__Capability.decode_text(text_buf);
}

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

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

int PDU__BSSGP__RA__CAPABILITY::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_bssgpPduType.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, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_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, MS__Radio__Access__Capability_descr_.raw->forceomit);
  decoded_field_length = field_mS__Radio__Access__Capability.RAW_decode(MS__Radio__Access__Capability_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 (field_bssgpPduType !=  os_27) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__RA__CAPABILITY::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MS__Radio__Access__Capability_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mS__Radio__Access__Capability.RAW_encode(MS__Radio__Access__Capability_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_27) {
  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_27.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__RA__CAPABILITY_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
MS__Radio__Access__Capability_template field_mS__Radio__Access__Capability;
};

void PDU__BSSGP__RA__CAPABILITY_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_mS__Radio__Access__Capability = ANY_VALUE;
}
}
}

void PDU__BSSGP__RA__CAPABILITY_template::copy_value(const PDU__BSSGP__RA__CAPABILITY& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.mS__Radio__Access__Capability().is_bound()) {
  single_value->field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
} else {
  single_value->field_mS__Radio__Access__Capability.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__RA__CAPABILITY_template::copy_template(const PDU__BSSGP__RA__CAPABILITY_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__Radio__Access__Capability().get_selection()) {
single_value->field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
} else {
single_value->field_mS__Radio__Access__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 PDU__BSSGP__RA__CAPABILITY_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__RA__CAPABILITY_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__RA__CAPABILITY_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__RA__CAPABILITY_template::PDU__BSSGP__RA__CAPABILITY_template()
{
}

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

PDU__BSSGP__RA__CAPABILITY_template::PDU__BSSGP__RA__CAPABILITY_template(const PDU__BSSGP__RA__CAPABILITY& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__BSSGP__RA__CAPABILITY_template& PDU__BSSGP__RA__CAPABILITY_template::operator=(const OPTIONAL<PDU__BSSGP__RA__CAPABILITY>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RA__CAPABILITY&)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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
}
return *this;
}

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

boolean PDU__BSSGP__RA__CAPABILITY_template::match(const PDU__BSSGP__RA__CAPABILITY& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.mS__Radio__Access__Capability().is_bound()) return FALSE;
if(!single_value->field_mS__Radio__Access__Capability.match(other_value.mS__Radio__Access__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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
}
return FALSE;
}

boolean PDU__BSSGP__RA__CAPABILITY_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_mS__Radio__Access__Capability.is_bound();
}

boolean PDU__BSSGP__RA__CAPABILITY_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_mS__Radio__Access__Capability.is_value();
}

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

PDU__BSSGP__RA__CAPABILITY PDU__BSSGP__RA__CAPABILITY_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
PDU__BSSGP__RA__CAPABILITY ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_mS__Radio__Access__Capability.is_bound()) {
ret_val.mS__Radio__Access__Capability() = single_value->field_mS__Radio__Access__Capability.valueof();
}
return ret_val;
}

void PDU__BSSGP__RA__CAPABILITY_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__RA__CAPABILITY_template[list_length];
}

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

OCTETSTRING_template& PDU__BSSGP__RA__CAPABILITY_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__RA__CAPABILITY_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__RA__CAPABILITY_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__RA__CAPABILITY_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
return single_value->field_tLLI;
}

MS__Radio__Access__Capability_template& PDU__BSSGP__RA__CAPABILITY_template::mS__Radio__Access__Capability()
{
set_specific();
return single_value->field_mS__Radio__Access__Capability;
}

const MS__Radio__Access__Capability_template& PDU__BSSGP__RA__CAPABILITY_template::mS__Radio__Access__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_Radio_Access_Capability of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
return single_value->field_mS__Radio__Access__Capability;
}

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

void PDU__BSSGP__RA__CAPABILITY_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
single_value->field_mS__Radio__Access__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 PDU__BSSGP__RA__CAPABILITY_template::log_match(const PDU__BSSGP__RA__CAPABILITY& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mS__Radio__Access__Capability.match(match_value.mS__Radio__Access__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_Radio_Access_Capability");
single_value->field_mS__Radio__Access__Capability.log_match(match_value.mS__Radio__Access__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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
single_value->field_mS__Radio__Access__Capability.log_match(match_value.mS__Radio__Access__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 PDU__BSSGP__RA__CAPABILITY_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_mS__Radio__Access__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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
}
}

void PDU__BSSGP__RA__CAPABILITY_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_mS__Radio__Access__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 PDU__BSSGP__RA__CAPABILITY_template[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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY.");
}
}

void PDU__BSSGP__RA__CAPABILITY_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__RA__CAPABILITY_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mS__Radio__Access__Capability().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Radio_Access_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Radio__Access__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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__RA__CAPABILITY_template* precondition = new PDU__BSSGP__RA__CAPABILITY_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__RA__CAPABILITY_template* implied_template = new PDU__BSSGP__RA__CAPABILITY_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__RA__CAPABILITY_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__RA__CAPABILITY_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY");
single_value->field_mS__Radio__Access__Capability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY");
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 : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY");
}

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

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

PDU__BSSGP__DL__MBMS__UNITDATA::PDU__BSSGP__DL__MBMS__UNITDATA()
{
}

PDU__BSSGP__DL__MBMS__UNITDATA::PDU__BSSGP__DL__MBMS__UNITDATA(const OCTETSTRING& par_bssgpPduType,
    const PDU__Lifetime& par_pDU__Lifetime,
    const TMGI__BSSGP& par_tMGI,
    const OPTIONAL< MBMS__Session__Identity >& par_mBMS__Session__Identity,
    const OPTIONAL< Alignment__octets >& par_alignment__octets,
    const LLC__PDU& par_lLC__PDU)
  :   field_bssgpPduType(par_bssgpPduType),
  field_pDU__Lifetime(par_pDU__Lifetime),
  field_tMGI(par_tMGI),
  field_mBMS__Session__Identity(par_mBMS__Session__Identity),
  field_alignment__octets(par_alignment__octets),
  field_lLC__PDU(par_lLC__PDU)
{
}

PDU__BSSGP__DL__MBMS__UNITDATA::PDU__BSSGP__DL__MBMS__UNITDATA(const PDU__BSSGP__DL__MBMS__UNITDATA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.pDU__Lifetime().is_bound()) field_pDU__Lifetime = other_value.pDU__Lifetime();
else field_pDU__Lifetime.clean_up();
if (other_value.tMGI().is_bound()) field_tMGI = other_value.tMGI();
else field_tMGI.clean_up();
if (other_value.mBMS__Session__Identity().is_bound()) field_mBMS__Session__Identity = other_value.mBMS__Session__Identity();
else field_mBMS__Session__Identity.clean_up();
if (other_value.alignment__octets().is_bound()) field_alignment__octets = other_value.alignment__octets();
else field_alignment__octets.clean_up();
if (other_value.lLC__PDU().is_bound()) field_lLC__PDU = other_value.lLC__PDU();
else field_lLC__PDU.clean_up();
}

void PDU__BSSGP__DL__MBMS__UNITDATA::clean_up()
{
field_bssgpPduType.clean_up();
field_pDU__Lifetime.clean_up();
field_tMGI.clean_up();
field_mBMS__Session__Identity.clean_up();
field_alignment__octets.clean_up();
field_lLC__PDU.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__DL__MBMS__UNITDATA::get_descriptor() const { return &PDU__BSSGP__DL__MBMS__UNITDATA_descr_; }
PDU__BSSGP__DL__MBMS__UNITDATA& PDU__BSSGP__DL__MBMS__UNITDATA::operator=(const PDU__BSSGP__DL__MBMS__UNITDATA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.pDU__Lifetime().is_bound()) field_pDU__Lifetime = other_value.pDU__Lifetime();
  else field_pDU__Lifetime.clean_up();
  if (other_value.tMGI().is_bound()) field_tMGI = other_value.tMGI();
  else field_tMGI.clean_up();
  if (other_value.mBMS__Session__Identity().is_bound()) field_mBMS__Session__Identity = other_value.mBMS__Session__Identity();
  else field_mBMS__Session__Identity.clean_up();
  if (other_value.alignment__octets().is_bound()) field_alignment__octets = other_value.alignment__octets();
  else field_alignment__octets.clean_up();
  if (other_value.lLC__PDU().is_bound()) field_lLC__PDU = other_value.lLC__PDU();
  else field_lLC__PDU.clean_up();
}
return *this;
}

boolean PDU__BSSGP__DL__MBMS__UNITDATA::operator==(const PDU__BSSGP__DL__MBMS__UNITDATA& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_pDU__Lifetime==other_value.field_pDU__Lifetime
  && field_tMGI==other_value.field_tMGI
  && field_mBMS__Session__Identity==other_value.field_mBMS__Session__Identity
  && field_alignment__octets==other_value.field_alignment__octets
  && field_lLC__PDU==other_value.field_lLC__PDU;
}

boolean PDU__BSSGP__DL__MBMS__UNITDATA::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_pDU__Lifetime.is_bound())
  || (field_tMGI.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__Session__Identity.get_selection() || field_mBMS__Session__Identity.is_bound())
  || (OPTIONAL_OMIT == field_alignment__octets.get_selection() || field_alignment__octets.is_bound())
  || (field_lLC__PDU.is_bound());
}
boolean PDU__BSSGP__DL__MBMS__UNITDATA::is_value() const
{
return field_bssgpPduType.is_value()
  && field_pDU__Lifetime.is_value()
  && field_tMGI.is_value()
  && (OPTIONAL_OMIT == field_mBMS__Session__Identity.get_selection() || field_mBMS__Session__Identity.is_value())
  && (OPTIONAL_OMIT == field_alignment__octets.get_selection() || field_alignment__octets.is_value())
  && field_lLC__PDU.is_value();
}
int PDU__BSSGP__DL__MBMS__UNITDATA::size_of() const
{
  int ret_val = 4;
  if (field_mBMS__Session__Identity.ispresent()) ret_val++;
  if (field_alignment__octets.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__DL__MBMS__UNITDATA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", pDU_Lifetime := ");
field_pDU__Lifetime.log();
TTCN_Logger::log_event_str(", tMGI := ");
field_tMGI.log();
TTCN_Logger::log_event_str(", mBMS_Session_Identity := ");
field_mBMS__Session__Identity.log();
TTCN_Logger::log_event_str(", alignment_octets := ");
field_alignment__octets.log();
TTCN_Logger::log_event_str(", lLC_PDU := ");
field_lLC__PDU.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__DL__MBMS__UNITDATA::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (pDU__Lifetime().is_bound()) pDU__Lifetime().set_implicit_omit();
if (tMGI().is_bound()) tMGI().set_implicit_omit();
if (!mBMS__Session__Identity().is_bound()) mBMS__Session__Identity() = OMIT_VALUE;
else mBMS__Session__Identity().set_implicit_omit();
if (!alignment__octets().is_bound()) alignment__octets() = OMIT_VALUE;
else alignment__octets().set_implicit_omit();
if (lLC__PDU().is_bound()) lLC__PDU().set_implicit_omit();
}

void PDU__BSSGP__DL__MBMS__UNITDATA::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 @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pDU__Lifetime().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tMGI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mBMS__Session__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) alignment__octets().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lLC__PDU().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pDU_Lifetime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pDU__Lifetime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMGI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMGI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_Session_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Session__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alignment_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alignment__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA");
  }
}

void PDU__BSSGP__DL__MBMS__UNITDATA::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_pDU__Lifetime.encode_text(text_buf);
field_tMGI.encode_text(text_buf);
field_mBMS__Session__Identity.encode_text(text_buf);
field_alignment__octets.encode_text(text_buf);
field_lLC__PDU.encode_text(text_buf);
}

void PDU__BSSGP__DL__MBMS__UNITDATA::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_pDU__Lifetime.decode_text(text_buf);
field_tMGI.decode_text(text_buf);
field_mBMS__Session__Identity.decode_text(text_buf);
field_alignment__octets.decode_text(text_buf);
field_lLC__PDU.decode_text(text_buf);
}

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

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

int PDU__BSSGP__DL__MBMS__UNITDATA::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_bssgpPduType.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, PDU__Lifetime_descr_.raw->forceomit);
  decoded_field_length = field_pDU__Lifetime.RAW_decode(PDU__Lifetime_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, TMGI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tMGI.RAW_decode(TMGI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_mBMS__Session__Identity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MBMS__Session__Identity_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__Session__Identity().RAW_decode(MBMS__Session__Identity_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__Session__Identity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_mBMS__Session__Identity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_alignment__octets = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Alignment__octets_descr_.raw->forceomit);
  decoded_field_length = field_alignment__octets().RAW_decode(Alignment__octets_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_alignment__octets = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_alignment__octets=OMIT_VALUE;
  RAW_Force_Omit field_5_force_omit(5, force_omit, LLC__PDU_descr_.raw->forceomit);
  decoded_field_length = field_lLC__PDU.RAW_decode(LLC__PDU_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());
  if (field_bssgpPduType !=  os_30) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__DL__MBMS__UNITDATA::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__Lifetime_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, TMGI__BSSGP_descr_.raw);
  if (field_mBMS__Session__Identity.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MBMS__Session__Identity_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_alignment__octets.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Alignment__octets_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, LLC__PDU_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pDU__Lifetime.RAW_encode(PDU__Lifetime_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tMGI.RAW_encode(TMGI__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  if (field_mBMS__Session__Identity.ispresent()) {
  encoded_length += field_mBMS__Session__Identity().RAW_encode(MBMS__Session__Identity_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_alignment__octets.ispresent()) {
  encoded_length += field_alignment__octets().RAW_encode(Alignment__octets_descr_, *myleaf.body.node.nodes[4]);
  }
  encoded_length += field_lLC__PDU.RAW_encode(LLC__PDU_descr_, *myleaf.body.node.nodes[5]);
  if (field_bssgpPduType !=  os_30) {
  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_30.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__DL__MBMS__UNITDATA_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
PDU__Lifetime_template field_pDU__Lifetime;
TMGI__BSSGP_template field_tMGI;
MBMS__Session__Identity_template field_mBMS__Session__Identity;
Alignment__octets_template field_alignment__octets;
LLC__PDU_template field_lLC__PDU;
};

void PDU__BSSGP__DL__MBMS__UNITDATA_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_bssgpPduType = ANY_VALUE;
single_value->field_pDU__Lifetime = ANY_VALUE;
single_value->field_tMGI = ANY_VALUE;
single_value->field_mBMS__Session__Identity = ANY_OR_OMIT;
single_value->field_alignment__octets = ANY_OR_OMIT;
single_value->field_lLC__PDU = ANY_VALUE;
}
}
}

void PDU__BSSGP__DL__MBMS__UNITDATA_template::copy_value(const PDU__BSSGP__DL__MBMS__UNITDATA& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.pDU__Lifetime().is_bound()) {
  single_value->field_pDU__Lifetime = other_value.pDU__Lifetime();
} else {
  single_value->field_pDU__Lifetime.clean_up();
}
if (other_value.tMGI().is_bound()) {
  single_value->field_tMGI = other_value.tMGI();
} else {
  single_value->field_tMGI.clean_up();
}
if (other_value.mBMS__Session__Identity().is_bound()) {
  if (other_value.mBMS__Session__Identity().ispresent()) single_value->field_mBMS__Session__Identity = other_value.mBMS__Session__Identity()();
  else single_value->field_mBMS__Session__Identity = OMIT_VALUE;
} else {
  single_value->field_mBMS__Session__Identity.clean_up();
}
if (other_value.alignment__octets().is_bound()) {
  if (other_value.alignment__octets().ispresent()) single_value->field_alignment__octets = other_value.alignment__octets()();
  else single_value->field_alignment__octets = OMIT_VALUE;
} else {
  single_value->field_alignment__octets.clean_up();
}
if (other_value.lLC__PDU().is_bound()) {
  single_value->field_lLC__PDU = other_value.lLC__PDU();
} else {
  single_value->field_lLC__PDU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__DL__MBMS__UNITDATA_template::copy_template(const PDU__BSSGP__DL__MBMS__UNITDATA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pDU__Lifetime().get_selection()) {
single_value->field_pDU__Lifetime = other_value.pDU__Lifetime();
} else {
single_value->field_pDU__Lifetime.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tMGI().get_selection()) {
single_value->field_tMGI = other_value.tMGI();
} else {
single_value->field_tMGI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__Session__Identity().get_selection()) {
single_value->field_mBMS__Session__Identity = other_value.mBMS__Session__Identity();
} else {
single_value->field_mBMS__Session__Identity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.alignment__octets().get_selection()) {
single_value->field_alignment__octets = other_value.alignment__octets();
} else {
single_value->field_alignment__octets.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lLC__PDU().get_selection()) {
single_value->field_lLC__PDU = other_value.lLC__PDU();
} else {
single_value->field_lLC__PDU.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__DL__MBMS__UNITDATA_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__DL__MBMS__UNITDATA_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__DL__MBMS__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__DL__MBMS__UNITDATA_template::PDU__BSSGP__DL__MBMS__UNITDATA_template()
{
}

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

PDU__BSSGP__DL__MBMS__UNITDATA_template::PDU__BSSGP__DL__MBMS__UNITDATA_template(const PDU__BSSGP__DL__MBMS__UNITDATA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__BSSGP__DL__MBMS__UNITDATA_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::operator=(const OPTIONAL<PDU__BSSGP__DL__MBMS__UNITDATA>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__DL__MBMS__UNITDATA&)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 @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
}
return *this;
}

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

boolean PDU__BSSGP__DL__MBMS__UNITDATA_template::match(const PDU__BSSGP__DL__MBMS__UNITDATA& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.pDU__Lifetime().is_bound()) return FALSE;
if(!single_value->field_pDU__Lifetime.match(other_value.pDU__Lifetime(), legacy))return FALSE;
if(!other_value.tMGI().is_bound()) return FALSE;
if(!single_value->field_tMGI.match(other_value.tMGI(), legacy))return FALSE;
if(!other_value.mBMS__Session__Identity().is_bound()) return FALSE;
if((other_value.mBMS__Session__Identity().ispresent() ? !single_value->field_mBMS__Session__Identity.match((const MBMS__Session__Identity&)other_value.mBMS__Session__Identity(), legacy) : !single_value->field_mBMS__Session__Identity.match_omit(legacy)))return FALSE;
if(!other_value.alignment__octets().is_bound()) return FALSE;
if((other_value.alignment__octets().ispresent() ? !single_value->field_alignment__octets.match((const Alignment__octets&)other_value.alignment__octets(), legacy) : !single_value->field_alignment__octets.match_omit(legacy)))return FALSE;
if(!other_value.lLC__PDU().is_bound()) return FALSE;
if(!single_value->field_lLC__PDU.match(other_value.lLC__PDU(), 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 @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
}
return FALSE;
}

boolean PDU__BSSGP__DL__MBMS__UNITDATA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_pDU__Lifetime.is_bound()
 || single_value->field_tMGI.is_bound()
 || (single_value->field_mBMS__Session__Identity.is_omit() || single_value->field_mBMS__Session__Identity.is_bound())
 || (single_value->field_alignment__octets.is_omit() || single_value->field_alignment__octets.is_bound())
 || single_value->field_lLC__PDU.is_bound();
}

boolean PDU__BSSGP__DL__MBMS__UNITDATA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_pDU__Lifetime.is_value()
 && single_value->field_tMGI.is_value()
 && (single_value->field_mBMS__Session__Identity.is_omit() || single_value->field_mBMS__Session__Identity.is_value())
 && (single_value->field_alignment__octets.is_omit() || single_value->field_alignment__octets.is_value())
 && single_value->field_lLC__PDU.is_value();
}

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

PDU__BSSGP__DL__MBMS__UNITDATA PDU__BSSGP__DL__MBMS__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
PDU__BSSGP__DL__MBMS__UNITDATA ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_pDU__Lifetime.is_bound()) {
ret_val.pDU__Lifetime() = single_value->field_pDU__Lifetime.valueof();
}
if (single_value->field_tMGI.is_bound()) {
ret_val.tMGI() = single_value->field_tMGI.valueof();
}
if (single_value->field_mBMS__Session__Identity.is_omit()) ret_val.mBMS__Session__Identity() = OMIT_VALUE;
else if (single_value->field_mBMS__Session__Identity.is_bound()) {
ret_val.mBMS__Session__Identity() = single_value->field_mBMS__Session__Identity.valueof();
}
if (single_value->field_alignment__octets.is_omit()) ret_val.alignment__octets() = OMIT_VALUE;
else if (single_value->field_alignment__octets.is_bound()) {
ret_val.alignment__octets() = single_value->field_alignment__octets.valueof();
}
if (single_value->field_lLC__PDU.is_bound()) {
ret_val.lLC__PDU() = single_value->field_lLC__PDU.valueof();
}
return ret_val;
}

void PDU__BSSGP__DL__MBMS__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__DL__MBMS__UNITDATA_template[list_length];
}

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

OCTETSTRING_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
return single_value->field_bssgpPduType;
}

PDU__Lifetime_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::pDU__Lifetime()
{
set_specific();
return single_value->field_pDU__Lifetime;
}

const PDU__Lifetime_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::pDU__Lifetime() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pDU_Lifetime of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
return single_value->field_pDU__Lifetime;
}

TMGI__BSSGP_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::tMGI()
{
set_specific();
return single_value->field_tMGI;
}

const TMGI__BSSGP_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::tMGI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tMGI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
return single_value->field_tMGI;
}

MBMS__Session__Identity_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::mBMS__Session__Identity()
{
set_specific();
return single_value->field_mBMS__Session__Identity;
}

const MBMS__Session__Identity_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::mBMS__Session__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Session_Identity of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
return single_value->field_mBMS__Session__Identity;
}

Alignment__octets_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::alignment__octets()
{
set_specific();
return single_value->field_alignment__octets;
}

const Alignment__octets_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::alignment__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field alignment_octets of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
return single_value->field_alignment__octets;
}

LLC__PDU_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::lLC__PDU()
{
set_specific();
return single_value->field_lLC__PDU;
}

const LLC__PDU_template& PDU__BSSGP__DL__MBMS__UNITDATA_template::lLC__PDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lLC_PDU of a non-specific template of type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
return single_value->field_lLC__PDU;
}

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

void PDU__BSSGP__DL__MBMS__UNITDATA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", pDU_Lifetime := ");
single_value->field_pDU__Lifetime.log();
TTCN_Logger::log_event_str(", tMGI := ");
single_value->field_tMGI.log();
TTCN_Logger::log_event_str(", mBMS_Session_Identity := ");
single_value->field_mBMS__Session__Identity.log();
TTCN_Logger::log_event_str(", alignment_octets := ");
single_value->field_alignment__octets.log();
TTCN_Logger::log_event_str(", lLC_PDU := ");
single_value->field_lLC__PDU.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__DL__MBMS__UNITDATA_template::log_match(const PDU__BSSGP__DL__MBMS__UNITDATA& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pDU__Lifetime.match(match_value.pDU__Lifetime(), legacy)){
TTCN_Logger::log_logmatch_info(".pDU_Lifetime");
single_value->field_pDU__Lifetime.log_match(match_value.pDU__Lifetime(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tMGI.match(match_value.tMGI(), legacy)){
TTCN_Logger::log_logmatch_info(".tMGI");
single_value->field_tMGI.log_match(match_value.tMGI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mBMS__Session__Identity().ispresent()){
if(!single_value->field_mBMS__Session__Identity.match(match_value.mBMS__Session__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Session_Identity");
single_value->field_mBMS__Session__Identity.log_match(match_value.mBMS__Session__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__Session__Identity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_Session_Identity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__Session__Identity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.alignment__octets().ispresent()){
if(!single_value->field_alignment__octets.match(match_value.alignment__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".alignment_octets");
single_value->field_alignment__octets.log_match(match_value.alignment__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_alignment__octets.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".alignment_octets := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_alignment__octets.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_lLC__PDU.match(match_value.lLC__PDU(), legacy)){
TTCN_Logger::log_logmatch_info(".lLC_PDU");
single_value->field_lLC__PDU.log_match(match_value.lLC__PDU(), 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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", pDU_Lifetime := ");
single_value->field_pDU__Lifetime.log_match(match_value.pDU__Lifetime(), legacy);
TTCN_Logger::log_event_str(", tMGI := ");
single_value->field_tMGI.log_match(match_value.tMGI(), legacy);
TTCN_Logger::log_event_str(", mBMS_Session_Identity := ");
if (match_value.mBMS__Session__Identity().ispresent()) {
single_value->field_mBMS__Session__Identity.log_match(match_value.mBMS__Session__Identity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__Session__Identity.log();
if (single_value->field_mBMS__Session__Identity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", alignment_octets := ");
if (match_value.alignment__octets().ispresent()) {
single_value->field_alignment__octets.log_match(match_value.alignment__octets(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_alignment__octets.log();
if (single_value->field_alignment__octets.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lLC_PDU := ");
single_value->field_lLC__PDU.log_match(match_value.lLC__PDU(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__DL__MBMS__UNITDATA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_pDU__Lifetime.encode_text(text_buf);
single_value->field_tMGI.encode_text(text_buf);
single_value->field_mBMS__Session__Identity.encode_text(text_buf);
single_value->field_alignment__octets.encode_text(text_buf);
single_value->field_lLC__PDU.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 @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
}
}

void PDU__BSSGP__DL__MBMS__UNITDATA_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_bssgpPduType.decode_text(text_buf);
single_value->field_pDU__Lifetime.decode_text(text_buf);
single_value->field_tMGI.decode_text(text_buf);
single_value->field_mBMS__Session__Identity.decode_text(text_buf);
single_value->field_alignment__octets.decode_text(text_buf);
single_value->field_lLC__PDU.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__DL__MBMS__UNITDATA_template[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 @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA.");
}
}

void PDU__BSSGP__DL__MBMS__UNITDATA_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__DL__MBMS__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pDU__Lifetime().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tMGI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mBMS__Session__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) alignment__octets().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) lLC__PDU().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pDU_Lifetime")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pDU__Lifetime().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMGI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMGI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_Session_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Session__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alignment_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alignment__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__DL__MBMS__UNITDATA_template* precondition = new PDU__BSSGP__DL__MBMS__UNITDATA_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__DL__MBMS__UNITDATA_template* implied_template = new PDU__BSSGP__DL__MBMS__UNITDATA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__DL__MBMS__UNITDATA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__DL__MBMS__UNITDATA_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA");
single_value->field_pDU__Lifetime.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA");
single_value->field_tMGI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA");
single_value->field_mBMS__Session__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA");
single_value->field_alignment__octets.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA");
single_value->field_lLC__PDU.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA");
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 : "@BSSGP_Types.PDU_BSSGP_DL_MBMS_UNITDATA");
}

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

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

PDU__BSSGP__UL__MBMS__UNITDATA::PDU__BSSGP__UL__MBMS__UNITDATA()
{
}

PDU__BSSGP__UL__MBMS__UNITDATA::PDU__BSSGP__UL__MBMS__UNITDATA(const OCTETSTRING& par_bssgpPduType,
    const TMGI__BSSGP& par_tMGI,
    const OPTIONAL< MBMS__Session__Identity >& par_mBMS__Session__Identity,
    const OPTIONAL< Alignment__octets >& par_alignment__octets,
    const LLC__PDU& par_lLC__PDU)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tMGI(par_tMGI),
  field_mBMS__Session__Identity(par_mBMS__Session__Identity),
  field_alignment__octets(par_alignment__octets),
  field_lLC__PDU(par_lLC__PDU)
{
}

PDU__BSSGP__UL__MBMS__UNITDATA::PDU__BSSGP__UL__MBMS__UNITDATA(const PDU__BSSGP__UL__MBMS__UNITDATA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tMGI().is_bound()) field_tMGI = other_value.tMGI();
else field_tMGI.clean_up();
if (other_value.mBMS__Session__Identity().is_bound()) field_mBMS__Session__Identity = other_value.mBMS__Session__Identity();
else field_mBMS__Session__Identity.clean_up();
if (other_value.alignment__octets().is_bound()) field_alignment__octets = other_value.alignment__octets();
else field_alignment__octets.clean_up();
if (other_value.lLC__PDU().is_bound()) field_lLC__PDU = other_value.lLC__PDU();
else field_lLC__PDU.clean_up();
}

void PDU__BSSGP__UL__MBMS__UNITDATA::clean_up()
{
field_bssgpPduType.clean_up();
field_tMGI.clean_up();
field_mBMS__Session__Identity.clean_up();
field_alignment__octets.clean_up();
field_lLC__PDU.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__UL__MBMS__UNITDATA::get_descriptor() const { return &PDU__BSSGP__UL__MBMS__UNITDATA_descr_; }
PDU__BSSGP__UL__MBMS__UNITDATA& PDU__BSSGP__UL__MBMS__UNITDATA::operator=(const PDU__BSSGP__UL__MBMS__UNITDATA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tMGI().is_bound()) field_tMGI = other_value.tMGI();
  else field_tMGI.clean_up();
  if (other_value.mBMS__Session__Identity().is_bound()) field_mBMS__Session__Identity = other_value.mBMS__Session__Identity();
  else field_mBMS__Session__Identity.clean_up();
  if (other_value.alignment__octets().is_bound()) field_alignment__octets = other_value.alignment__octets();
  else field_alignment__octets.clean_up();
  if (other_value.lLC__PDU().is_bound()) field_lLC__PDU = other_value.lLC__PDU();
  else field_lLC__PDU.clean_up();
}
return *this;
}

boolean PDU__BSSGP__UL__MBMS__UNITDATA::operator==(const PDU__BSSGP__UL__MBMS__UNITDATA& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tMGI==other_value.field_tMGI
  && field_mBMS__Session__Identity==other_value.field_mBMS__Session__Identity
  && field_alignment__octets==other_value.field_alignment__octets
  && field_lLC__PDU==other_value.field_lLC__PDU;
}

boolean PDU__BSSGP__UL__MBMS__UNITDATA::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tMGI.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__Session__Identity.get_selection() || field_mBMS__Session__Identity.is_bound())
  || (OPTIONAL_OMIT == field_alignment__octets.get_selection() || field_alignment__octets.is_bound())
  || (field_lLC__PDU.is_bound());
}
boolean PDU__BSSGP__UL__MBMS__UNITDATA::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tMGI.is_value()
  && (OPTIONAL_OMIT == field_mBMS__Session__Identity.get_selection() || field_mBMS__Session__Identity.is_value())
  && (OPTIONAL_OMIT == field_alignment__octets.get_selection() || field_alignment__octets.is_value())
  && field_lLC__PDU.is_value();
}
int PDU__BSSGP__UL__MBMS__UNITDATA::size_of() const
{
  int ret_val = 3;
  if (field_mBMS__Session__Identity.ispresent()) ret_val++;
  if (field_alignment__octets.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__UL__MBMS__UNITDATA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tMGI := ");
field_tMGI.log();
TTCN_Logger::log_event_str(", mBMS_Session_Identity := ");
field_mBMS__Session__Identity.log();
TTCN_Logger::log_event_str(", alignment_octets := ");
field_alignment__octets.log();
TTCN_Logger::log_event_str(", lLC_PDU := ");
field_lLC__PDU.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__UL__MBMS__UNITDATA::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tMGI().is_bound()) tMGI().set_implicit_omit();
if (!mBMS__Session__Identity().is_bound()) mBMS__Session__Identity() = OMIT_VALUE;
else mBMS__Session__Identity().set_implicit_omit();
if (!alignment__octets().is_bound()) alignment__octets() = OMIT_VALUE;
else alignment__octets().set_implicit_omit();
if (lLC__PDU().is_bound()) lLC__PDU().set_implicit_omit();
}

void PDU__BSSGP__UL__MBMS__UNITDATA::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 @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tMGI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS__Session__Identity().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) alignment__octets().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) lLC__PDU().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMGI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMGI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_Session_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Session__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alignment_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alignment__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA");
  }
}

void PDU__BSSGP__UL__MBMS__UNITDATA::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tMGI.encode_text(text_buf);
field_mBMS__Session__Identity.encode_text(text_buf);
field_alignment__octets.encode_text(text_buf);
field_lLC__PDU.encode_text(text_buf);
}

void PDU__BSSGP__UL__MBMS__UNITDATA::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tMGI.decode_text(text_buf);
field_mBMS__Session__Identity.decode_text(text_buf);
field_alignment__octets.decode_text(text_buf);
field_lLC__PDU.decode_text(text_buf);
}

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

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

int PDU__BSSGP__UL__MBMS__UNITDATA::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_bssgpPduType.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, TMGI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tMGI.RAW_decode(TMGI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_mBMS__Session__Identity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MBMS__Session__Identity_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__Session__Identity().RAW_decode(MBMS__Session__Identity_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__Session__Identity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_mBMS__Session__Identity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_alignment__octets = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Alignment__octets_descr_.raw->forceomit);
  decoded_field_length = field_alignment__octets().RAW_decode(Alignment__octets_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_alignment__octets = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_alignment__octets=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, LLC__PDU_descr_.raw->forceomit);
  decoded_field_length = field_lLC__PDU.RAW_decode(LLC__PDU_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 (field_bssgpPduType !=  os_31) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__UL__MBMS__UNITDATA::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TMGI__BSSGP_descr_.raw);
  if (field_mBMS__Session__Identity.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__Session__Identity_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_alignment__octets.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Alignment__octets_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, LLC__PDU_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tMGI.RAW_encode(TMGI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  if (field_mBMS__Session__Identity.ispresent()) {
  encoded_length += field_mBMS__Session__Identity().RAW_encode(MBMS__Session__Identity_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_alignment__octets.ispresent()) {
  encoded_length += field_alignment__octets().RAW_encode(Alignment__octets_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_lLC__PDU.RAW_encode(LLC__PDU_descr_, *myleaf.body.node.nodes[4]);
  if (field_bssgpPduType !=  os_31) {
  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_31.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__UL__MBMS__UNITDATA_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TMGI__BSSGP_template field_tMGI;
MBMS__Session__Identity_template field_mBMS__Session__Identity;
Alignment__octets_template field_alignment__octets;
LLC__PDU_template field_lLC__PDU;
};

void PDU__BSSGP__UL__MBMS__UNITDATA_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_bssgpPduType = ANY_VALUE;
single_value->field_tMGI = ANY_VALUE;
single_value->field_mBMS__Session__Identity = ANY_OR_OMIT;
single_value->field_alignment__octets = ANY_OR_OMIT;
single_value->field_lLC__PDU = ANY_VALUE;
}
}
}

void PDU__BSSGP__UL__MBMS__UNITDATA_template::copy_value(const PDU__BSSGP__UL__MBMS__UNITDATA& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tMGI().is_bound()) {
  single_value->field_tMGI = other_value.tMGI();
} else {
  single_value->field_tMGI.clean_up();
}
if (other_value.mBMS__Session__Identity().is_bound()) {
  if (other_value.mBMS__Session__Identity().ispresent()) single_value->field_mBMS__Session__Identity = other_value.mBMS__Session__Identity()();
  else single_value->field_mBMS__Session__Identity = OMIT_VALUE;
} else {
  single_value->field_mBMS__Session__Identity.clean_up();
}
if (other_value.alignment__octets().is_bound()) {
  if (other_value.alignment__octets().ispresent()) single_value->field_alignment__octets = other_value.alignment__octets()();
  else single_value->field_alignment__octets = OMIT_VALUE;
} else {
  single_value->field_alignment__octets.clean_up();
}
if (other_value.lLC__PDU().is_bound()) {
  single_value->field_lLC__PDU = other_value.lLC__PDU();
} else {
  single_value->field_lLC__PDU.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__UL__MBMS__UNITDATA_template::copy_template(const PDU__BSSGP__UL__MBMS__UNITDATA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tMGI().get_selection()) {
single_value->field_tMGI = other_value.tMGI();
} else {
single_value->field_tMGI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__Session__Identity().get_selection()) {
single_value->field_mBMS__Session__Identity = other_value.mBMS__Session__Identity();
} else {
single_value->field_mBMS__Session__Identity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.alignment__octets().get_selection()) {
single_value->field_alignment__octets = other_value.alignment__octets();
} else {
single_value->field_alignment__octets.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lLC__PDU().get_selection()) {
single_value->field_lLC__PDU = other_value.lLC__PDU();
} else {
single_value->field_lLC__PDU.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__UL__MBMS__UNITDATA_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__UL__MBMS__UNITDATA_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__UL__MBMS__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__UL__MBMS__UNITDATA_template::PDU__BSSGP__UL__MBMS__UNITDATA_template()
{
}

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

PDU__BSSGP__UL__MBMS__UNITDATA_template::PDU__BSSGP__UL__MBMS__UNITDATA_template(const PDU__BSSGP__UL__MBMS__UNITDATA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__BSSGP__UL__MBMS__UNITDATA_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::operator=(const OPTIONAL<PDU__BSSGP__UL__MBMS__UNITDATA>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__UL__MBMS__UNITDATA&)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 @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
}
return *this;
}

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

boolean PDU__BSSGP__UL__MBMS__UNITDATA_template::match(const PDU__BSSGP__UL__MBMS__UNITDATA& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tMGI().is_bound()) return FALSE;
if(!single_value->field_tMGI.match(other_value.tMGI(), legacy))return FALSE;
if(!other_value.mBMS__Session__Identity().is_bound()) return FALSE;
if((other_value.mBMS__Session__Identity().ispresent() ? !single_value->field_mBMS__Session__Identity.match((const MBMS__Session__Identity&)other_value.mBMS__Session__Identity(), legacy) : !single_value->field_mBMS__Session__Identity.match_omit(legacy)))return FALSE;
if(!other_value.alignment__octets().is_bound()) return FALSE;
if((other_value.alignment__octets().ispresent() ? !single_value->field_alignment__octets.match((const Alignment__octets&)other_value.alignment__octets(), legacy) : !single_value->field_alignment__octets.match_omit(legacy)))return FALSE;
if(!other_value.lLC__PDU().is_bound()) return FALSE;
if(!single_value->field_lLC__PDU.match(other_value.lLC__PDU(), 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 @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
}
return FALSE;
}

boolean PDU__BSSGP__UL__MBMS__UNITDATA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tMGI.is_bound()
 || (single_value->field_mBMS__Session__Identity.is_omit() || single_value->field_mBMS__Session__Identity.is_bound())
 || (single_value->field_alignment__octets.is_omit() || single_value->field_alignment__octets.is_bound())
 || single_value->field_lLC__PDU.is_bound();
}

boolean PDU__BSSGP__UL__MBMS__UNITDATA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tMGI.is_value()
 && (single_value->field_mBMS__Session__Identity.is_omit() || single_value->field_mBMS__Session__Identity.is_value())
 && (single_value->field_alignment__octets.is_omit() || single_value->field_alignment__octets.is_value())
 && single_value->field_lLC__PDU.is_value();
}

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

PDU__BSSGP__UL__MBMS__UNITDATA PDU__BSSGP__UL__MBMS__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
PDU__BSSGP__UL__MBMS__UNITDATA ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tMGI.is_bound()) {
ret_val.tMGI() = single_value->field_tMGI.valueof();
}
if (single_value->field_mBMS__Session__Identity.is_omit()) ret_val.mBMS__Session__Identity() = OMIT_VALUE;
else if (single_value->field_mBMS__Session__Identity.is_bound()) {
ret_val.mBMS__Session__Identity() = single_value->field_mBMS__Session__Identity.valueof();
}
if (single_value->field_alignment__octets.is_omit()) ret_val.alignment__octets() = OMIT_VALUE;
else if (single_value->field_alignment__octets.is_bound()) {
ret_val.alignment__octets() = single_value->field_alignment__octets.valueof();
}
if (single_value->field_lLC__PDU.is_bound()) {
ret_val.lLC__PDU() = single_value->field_lLC__PDU.valueof();
}
return ret_val;
}

void PDU__BSSGP__UL__MBMS__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__UL__MBMS__UNITDATA_template[list_length];
}

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

OCTETSTRING_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
return single_value->field_bssgpPduType;
}

TMGI__BSSGP_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::tMGI()
{
set_specific();
return single_value->field_tMGI;
}

const TMGI__BSSGP_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::tMGI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tMGI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
return single_value->field_tMGI;
}

MBMS__Session__Identity_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::mBMS__Session__Identity()
{
set_specific();
return single_value->field_mBMS__Session__Identity;
}

const MBMS__Session__Identity_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::mBMS__Session__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Session_Identity of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
return single_value->field_mBMS__Session__Identity;
}

Alignment__octets_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::alignment__octets()
{
set_specific();
return single_value->field_alignment__octets;
}

const Alignment__octets_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::alignment__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field alignment_octets of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
return single_value->field_alignment__octets;
}

LLC__PDU_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::lLC__PDU()
{
set_specific();
return single_value->field_lLC__PDU;
}

const LLC__PDU_template& PDU__BSSGP__UL__MBMS__UNITDATA_template::lLC__PDU() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lLC_PDU of a non-specific template of type @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
return single_value->field_lLC__PDU;
}

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

void PDU__BSSGP__UL__MBMS__UNITDATA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tMGI := ");
single_value->field_tMGI.log();
TTCN_Logger::log_event_str(", mBMS_Session_Identity := ");
single_value->field_mBMS__Session__Identity.log();
TTCN_Logger::log_event_str(", alignment_octets := ");
single_value->field_alignment__octets.log();
TTCN_Logger::log_event_str(", lLC_PDU := ");
single_value->field_lLC__PDU.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__UL__MBMS__UNITDATA_template::log_match(const PDU__BSSGP__UL__MBMS__UNITDATA& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tMGI.match(match_value.tMGI(), legacy)){
TTCN_Logger::log_logmatch_info(".tMGI");
single_value->field_tMGI.log_match(match_value.tMGI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mBMS__Session__Identity().ispresent()){
if(!single_value->field_mBMS__Session__Identity.match(match_value.mBMS__Session__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Session_Identity");
single_value->field_mBMS__Session__Identity.log_match(match_value.mBMS__Session__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__Session__Identity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_Session_Identity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__Session__Identity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.alignment__octets().ispresent()){
if(!single_value->field_alignment__octets.match(match_value.alignment__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".alignment_octets");
single_value->field_alignment__octets.log_match(match_value.alignment__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_alignment__octets.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".alignment_octets := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_alignment__octets.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_lLC__PDU.match(match_value.lLC__PDU(), legacy)){
TTCN_Logger::log_logmatch_info(".lLC_PDU");
single_value->field_lLC__PDU.log_match(match_value.lLC__PDU(), 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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tMGI := ");
single_value->field_tMGI.log_match(match_value.tMGI(), legacy);
TTCN_Logger::log_event_str(", mBMS_Session_Identity := ");
if (match_value.mBMS__Session__Identity().ispresent()) {
single_value->field_mBMS__Session__Identity.log_match(match_value.mBMS__Session__Identity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__Session__Identity.log();
if (single_value->field_mBMS__Session__Identity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", alignment_octets := ");
if (match_value.alignment__octets().ispresent()) {
single_value->field_alignment__octets.log_match(match_value.alignment__octets(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_alignment__octets.log();
if (single_value->field_alignment__octets.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", lLC_PDU := ");
single_value->field_lLC__PDU.log_match(match_value.lLC__PDU(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__UL__MBMS__UNITDATA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tMGI.encode_text(text_buf);
single_value->field_mBMS__Session__Identity.encode_text(text_buf);
single_value->field_alignment__octets.encode_text(text_buf);
single_value->field_lLC__PDU.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 @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
}
}

void PDU__BSSGP__UL__MBMS__UNITDATA_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_bssgpPduType.decode_text(text_buf);
single_value->field_tMGI.decode_text(text_buf);
single_value->field_mBMS__Session__Identity.decode_text(text_buf);
single_value->field_alignment__octets.decode_text(text_buf);
single_value->field_lLC__PDU.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__UL__MBMS__UNITDATA_template[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 @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA.");
}
}

void PDU__BSSGP__UL__MBMS__UNITDATA_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__UL__MBMS__UNITDATA_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 @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tMGI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mBMS__Session__Identity().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) alignment__octets().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) lLC__PDU().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMGI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMGI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_Session_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Session__Identity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "alignment_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          alignment__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lLC_PDU")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lLC__PDU().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__UL__MBMS__UNITDATA_template* precondition = new PDU__BSSGP__UL__MBMS__UNITDATA_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__UL__MBMS__UNITDATA_template* implied_template = new PDU__BSSGP__UL__MBMS__UNITDATA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__UL__MBMS__UNITDATA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__UL__MBMS__UNITDATA_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA");
single_value->field_tMGI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA");
single_value->field_mBMS__Session__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA");
single_value->field_alignment__octets.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA");
single_value->field_lLC__PDU.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA");
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 : "@BSSGP_Types.PDU_BSSGP_UL_MBMS_UNITDATA");
}

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

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

void Paging__Field4::copy_value(const Paging__Field4& other_value)
{
switch (other_value.union_selection) {
case ALT_bVCI:
field_bVCI = new BVCI(*other_value.field_bVCI);
break;
case ALT_location__Area:
field_location__Area = new Location__Area(*other_value.field_location__Area);
break;
case ALT_routeing__Area:
field_routeing__Area = new Routeing__Area(*other_value.field_routeing__Area);
break;
case ALT_bSS__Area__Indication:
field_bSS__Area__Indication = new BSS__Area__Indication(*other_value.field_bSS__Area__Indication);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.Paging_Field4.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean Paging__Field4::operator==(const Paging__Field4& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.Paging_Field4.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.Paging_Field4.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_bVCI:
return *field_bVCI == *other_value.field_bVCI;
case ALT_location__Area:
return *field_location__Area == *other_value.field_location__Area;
case ALT_routeing__Area:
return *field_routeing__Area == *other_value.field_routeing__Area;
case ALT_bSS__Area__Indication:
return *field_bSS__Area__Indication == *other_value.field_bSS__Area__Indication;
default:
return FALSE;
}
}

BVCI& Paging__Field4::bVCI()
{
if (union_selection != ALT_bVCI) {
clean_up();
field_bVCI = new BVCI;
union_selection = ALT_bVCI;
}
return *field_bVCI;
}

const BVCI& Paging__Field4::bVCI() const
{
if (union_selection != ALT_bVCI) TTCN_error("Using non-selected field bVCI in a value of union type @BSSGP_Types.Paging_Field4.");
return *field_bVCI;
}

Location__Area& Paging__Field4::location__Area()
{
if (union_selection != ALT_location__Area) {
clean_up();
field_location__Area = new Location__Area;
union_selection = ALT_location__Area;
}
return *field_location__Area;
}

const Location__Area& Paging__Field4::location__Area() const
{
if (union_selection != ALT_location__Area) TTCN_error("Using non-selected field location_Area in a value of union type @BSSGP_Types.Paging_Field4.");
return *field_location__Area;
}

Routeing__Area& Paging__Field4::routeing__Area()
{
if (union_selection != ALT_routeing__Area) {
clean_up();
field_routeing__Area = new Routeing__Area;
union_selection = ALT_routeing__Area;
}
return *field_routeing__Area;
}

const Routeing__Area& Paging__Field4::routeing__Area() const
{
if (union_selection != ALT_routeing__Area) TTCN_error("Using non-selected field routeing_Area in a value of union type @BSSGP_Types.Paging_Field4.");
return *field_routeing__Area;
}

BSS__Area__Indication& Paging__Field4::bSS__Area__Indication()
{
if (union_selection != ALT_bSS__Area__Indication) {
clean_up();
field_bSS__Area__Indication = new BSS__Area__Indication;
union_selection = ALT_bSS__Area__Indication;
}
return *field_bSS__Area__Indication;
}

const BSS__Area__Indication& Paging__Field4::bSS__Area__Indication() const
{
if (union_selection != ALT_bSS__Area__Indication) TTCN_error("Using non-selected field bSS_Area_Indication in a value of union type @BSSGP_Types.Paging_Field4.");
return *field_bSS__Area__Indication;
}

boolean Paging__Field4::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 @BSSGP_Types.Paging_Field4.");
return union_selection == checked_selection;
}

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

boolean Paging__Field4::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_bVCI: return field_bVCI->is_value();
case ALT_location__Area: return field_location__Area->is_value();
case ALT_routeing__Area: return field_routeing__Area->is_value();
case ALT_bSS__Area__Indication: return field_bSS__Area__Indication->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void Paging__Field4::clean_up()
{
switch (union_selection) {
case ALT_bVCI:
  delete field_bVCI;
  break;
case ALT_location__Area:
  delete field_location__Area;
  break;
case ALT_routeing__Area:
  delete field_routeing__Area;
  break;
case ALT_bSS__Area__Indication:
  delete field_bSS__Area__Indication;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void Paging__Field4::log() const
{
switch (union_selection) {
case ALT_bVCI:
TTCN_Logger::log_event_str("{ bVCI := ");
field_bVCI->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_location__Area:
TTCN_Logger::log_event_str("{ location_Area := ");
field_location__Area->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_routeing__Area:
TTCN_Logger::log_event_str("{ routeing_Area := ");
field_routeing__Area->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_bSS__Area__Indication:
TTCN_Logger::log_event_str("{ bSS_Area_Indication := ");
field_bSS__Area__Indication->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void Paging__Field4::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, "bVCI")) {
    bVCI().set_param(*mp_last);
    if (!bVCI().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "location_Area")) {
    location__Area().set_param(*mp_last);
    if (!location__Area().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "routeing_Area")) {
    routeing__Area().set_param(*mp_last);
    if (!routeing__Area().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "bSS_Area_Indication")) {
    bSS__Area__Indication().set_param(*mp_last);
    if (!bSS__Area__Indication().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.Paging_Field4.", last_name);
}

void Paging__Field4::set_implicit_omit()
{
switch (union_selection) {
case ALT_bVCI:
field_bVCI->set_implicit_omit(); break;
case ALT_location__Area:
field_location__Area->set_implicit_omit(); break;
case ALT_routeing__Area:
field_routeing__Area->set_implicit_omit(); break;
case ALT_bSS__Area__Indication:
field_bSS__Area__Indication->set_implicit_omit(); break;
default: break;
}
}

void Paging__Field4::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_bVCI:
field_bVCI->encode_text(text_buf);
break;
case ALT_location__Area:
field_location__Area->encode_text(text_buf);
break;
case ALT_routeing__Area:
field_routeing__Area->encode_text(text_buf);
break;
case ALT_bSS__Area__Indication:
field_bSS__Area__Indication->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.Paging_Field4.");
}
}

void Paging__Field4::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_bVCI:
bVCI().decode_text(text_buf);
break;
case ALT_location__Area:
location__Area().decode_text(text_buf);
break;
case ALT_routeing__Area:
routeing__Area().decode_text(text_buf);
break;
case ALT_bSS__Area__Indication:
bSS__Area__Indication().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.Paging_Field4.");
}
}

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

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

int Paging__Field4::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, BVCI_descr_.raw->forceomit);
      decoded_length = bVCI().RAW_decode(BVCI_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, Location__Area_descr_.raw->forceomit);
      decoded_length = location__Area().RAW_decode(Location__Area_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, Routeing__Area_descr_.raw->forceomit);
      decoded_length = routeing__Area().RAW_decode(Routeing__Area_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, BSS__Area__Indication_descr_.raw->forceomit);
      decoded_length = bSS__Area__Indication().RAW_decode(BSS__Area__Indication_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, BVCI_descr_.raw->forceomit);
      decoded_length = bVCI().RAW_decode(BVCI_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, Location__Area_descr_.raw->forceomit);
      decoded_length = location__Area().RAW_decode(Location__Area_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;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, Routeing__Area_descr_.raw->forceomit);
      decoded_length = routeing__Area().RAW_decode(Routeing__Area_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_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_3_force_omit(3, force_omit, BSS__Area__Indication_descr_.raw->forceomit);
      decoded_length = bSS__Area__Indication().RAW_decode(BSS__Area__Indication_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int Paging__Field4::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  memset(myleaf.body.node.nodes, 0, 4 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_bVCI:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, BVCI_descr_.raw);
    encoded_length = field_bVCI->RAW_encode(BVCI_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &BVCI_descr_;
    break;
  case ALT_location__Area:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, Location__Area_descr_.raw);
    encoded_length = field_location__Area->RAW_encode(Location__Area_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &Location__Area_descr_;
    break;
  case ALT_routeing__Area:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, Routeing__Area_descr_.raw);
    encoded_length = field_routeing__Area->RAW_encode(Routeing__Area_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &Routeing__Area_descr_;
    break;
  case ALT_bSS__Area__Indication:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, BSS__Area__Indication_descr_.raw);
    encoded_length = field_bSS__Area__Indication->RAW_encode(BSS__Area__Indication_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &BSS__Area__Indication_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void Paging__Field4_template::copy_value(const Paging__Field4& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case Paging__Field4::ALT_bVCI:
single_value.field_bVCI = new BVCI_template(other_value.bVCI());
break;
case Paging__Field4::ALT_location__Area:
single_value.field_location__Area = new Location__Area_template(other_value.location__Area());
break;
case Paging__Field4::ALT_routeing__Area:
single_value.field_routeing__Area = new Routeing__Area_template(other_value.routeing__Area());
break;
case Paging__Field4::ALT_bSS__Area__Indication:
single_value.field_bSS__Area__Indication = new BSS__Area__Indication_template(other_value.bSS__Area__Indication());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.Paging_Field4.");
}
set_selection(SPECIFIC_VALUE);
}

void Paging__Field4_template::copy_template(const Paging__Field4_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 Paging__Field4::ALT_bVCI:
single_value.field_bVCI = new BVCI_template(*other_value.single_value.field_bVCI);
break;
case Paging__Field4::ALT_location__Area:
single_value.field_location__Area = new Location__Area_template(*other_value.single_value.field_location__Area);
break;
case Paging__Field4::ALT_routeing__Area:
single_value.field_routeing__Area = new Routeing__Area_template(*other_value.single_value.field_routeing__Area);
break;
case Paging__Field4::ALT_bSS__Area__Indication:
single_value.field_bSS__Area__Indication = new BSS__Area__Indication_template(*other_value.single_value.field_bSS__Area__Indication);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.Paging_Field4.");
}
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 Paging__Field4_template[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 Paging__Field4_template(*other_value.implication_.precondition);
implication_.implied_template = new Paging__Field4_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 @BSSGP_Types.Paging_Field4.");
}
set_selection(other_value);
}

Paging__Field4_template::Paging__Field4_template()
{
}

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

Paging__Field4_template::Paging__Field4_template(const Paging__Field4& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void Paging__Field4_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Paging__Field4::ALT_bVCI:
delete single_value.field_bVCI;
break;
case Paging__Field4::ALT_location__Area:
delete single_value.field_location__Area;
break;
case Paging__Field4::ALT_routeing__Area:
delete single_value.field_routeing__Area;
break;
case Paging__Field4::ALT_bSS__Area__Indication:
delete single_value.field_bSS__Area__Indication;
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;
}

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

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

Paging__Field4_template& Paging__Field4_template::operator=(const OPTIONAL<Paging__Field4>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Paging__Field4&)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 @BSSGP_Types.Paging_Field4.");
}
return *this;
}

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

boolean Paging__Field4_template::match(const Paging__Field4& 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:
{
Paging__Field4::union_selection_type value_selection = other_value.get_selection();
if (value_selection == Paging__Field4::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case Paging__Field4::ALT_bVCI:
return single_value.field_bVCI->match(other_value.bVCI(), legacy);
case Paging__Field4::ALT_location__Area:
return single_value.field_location__Area->match(other_value.location__Area(), legacy);
case Paging__Field4::ALT_routeing__Area:
return single_value.field_routeing__Area->match(other_value.routeing__Area(), legacy);
case Paging__Field4::ALT_bSS__Area__Indication:
return single_value.field_bSS__Area__Indication->match(other_value.bSS__Area__Indication(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.Paging_Field4.");
}
}
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 @BSSGP_Types.Paging_Field4.");
}
return FALSE;
}

boolean Paging__Field4_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case Paging__Field4::ALT_bVCI:
return single_value.field_bVCI->is_value();
case Paging__Field4::ALT_location__Area:
return single_value.field_location__Area->is_value();
case Paging__Field4::ALT_routeing__Area:
return single_value.field_routeing__Area->is_value();
case Paging__Field4::ALT_bSS__Area__Indication:
return single_value.field_bSS__Area__Indication->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @BSSGP_Types.Paging_Field4.");
}
}

Paging__Field4 Paging__Field4_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 @BSSGP_Types.Paging_Field4.");
Paging__Field4 ret_val;
switch (single_value.union_selection) {
case Paging__Field4::ALT_bVCI:
ret_val.bVCI() = single_value.field_bVCI->valueof();
break;
case Paging__Field4::ALT_location__Area:
ret_val.location__Area() = single_value.field_location__Area->valueof();
break;
case Paging__Field4::ALT_routeing__Area:
ret_val.routeing__Area() = single_value.field_routeing__Area->valueof();
break;
case Paging__Field4::ALT_bSS__Area__Indication:
ret_val.bSS__Area__Indication() = single_value.field_bSS__Area__Indication->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @BSSGP_Types.Paging_Field4.");
}
return ret_val;
}

Paging__Field4_template& Paging__Field4_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 @BSSGP_Types.Paging_Field4.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.Paging_Field4.");
return value_list.list_value[list_index];
}
void Paging__Field4_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 @BSSGP_Types.Paging_Field4.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Paging__Field4_template[list_length];
}

BVCI_template& Paging__Field4_template::bVCI()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Paging__Field4::ALT_bVCI) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_bVCI = new BVCI_template(ANY_VALUE);
else single_value.field_bVCI = new BVCI_template;
single_value.union_selection = Paging__Field4::ALT_bVCI;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_bVCI;
}

const BVCI_template& Paging__Field4_template::bVCI() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bVCI in a non-specific template of union type @BSSGP_Types.Paging_Field4.");
if (single_value.union_selection != Paging__Field4::ALT_bVCI) TTCN_error("Accessing non-selected field bVCI in a template of union type @BSSGP_Types.Paging_Field4.");
return *single_value.field_bVCI;
}

Location__Area_template& Paging__Field4_template::location__Area()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Paging__Field4::ALT_location__Area) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_location__Area = new Location__Area_template(ANY_VALUE);
else single_value.field_location__Area = new Location__Area_template;
single_value.union_selection = Paging__Field4::ALT_location__Area;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_location__Area;
}

const Location__Area_template& Paging__Field4_template::location__Area() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field location_Area in a non-specific template of union type @BSSGP_Types.Paging_Field4.");
if (single_value.union_selection != Paging__Field4::ALT_location__Area) TTCN_error("Accessing non-selected field location_Area in a template of union type @BSSGP_Types.Paging_Field4.");
return *single_value.field_location__Area;
}

Routeing__Area_template& Paging__Field4_template::routeing__Area()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Paging__Field4::ALT_routeing__Area) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_routeing__Area = new Routeing__Area_template(ANY_VALUE);
else single_value.field_routeing__Area = new Routeing__Area_template;
single_value.union_selection = Paging__Field4::ALT_routeing__Area;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_routeing__Area;
}

const Routeing__Area_template& Paging__Field4_template::routeing__Area() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routeing_Area in a non-specific template of union type @BSSGP_Types.Paging_Field4.");
if (single_value.union_selection != Paging__Field4::ALT_routeing__Area) TTCN_error("Accessing non-selected field routeing_Area in a template of union type @BSSGP_Types.Paging_Field4.");
return *single_value.field_routeing__Area;
}

BSS__Area__Indication_template& Paging__Field4_template::bSS__Area__Indication()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Paging__Field4::ALT_bSS__Area__Indication) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_bSS__Area__Indication = new BSS__Area__Indication_template(ANY_VALUE);
else single_value.field_bSS__Area__Indication = new BSS__Area__Indication_template;
single_value.union_selection = Paging__Field4::ALT_bSS__Area__Indication;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_bSS__Area__Indication;
}

const BSS__Area__Indication_template& Paging__Field4_template::bSS__Area__Indication() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bSS_Area_Indication in a non-specific template of union type @BSSGP_Types.Paging_Field4.");
if (single_value.union_selection != Paging__Field4::ALT_bSS__Area__Indication) TTCN_error("Accessing non-selected field bSS_Area_Indication in a template of union type @BSSGP_Types.Paging_Field4.");
return *single_value.field_bSS__Area__Indication;
}

boolean Paging__Field4_template::ischosen(Paging__Field4::union_selection_type checked_selection) const
{
if (checked_selection == Paging__Field4::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.Paging_Field4.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == Paging__Field4::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.Paging_Field4.");
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 @BSSGP_Types.Paging_Field4 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 Paging__Field4_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Paging__Field4::ALT_bVCI:
TTCN_Logger::log_event_str("{ bVCI := ");
single_value.field_bVCI->log();
TTCN_Logger::log_event_str(" }");
break;
case Paging__Field4::ALT_location__Area:
TTCN_Logger::log_event_str("{ location_Area := ");
single_value.field_location__Area->log();
TTCN_Logger::log_event_str(" }");
break;
case Paging__Field4::ALT_routeing__Area:
TTCN_Logger::log_event_str("{ routeing_Area := ");
single_value.field_routeing__Area->log();
TTCN_Logger::log_event_str(" }");
break;
case Paging__Field4::ALT_bSS__Area__Indication:
TTCN_Logger::log_event_str("{ bSS_Area_Indication := ");
single_value.field_bSS__Area__Indication->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 Paging__Field4_template::log_match(const Paging__Field4& 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 Paging__Field4::ALT_bVCI:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".bVCI");
single_value.field_bVCI->log_match(match_value.bVCI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ bVCI := ");
single_value.field_bVCI->log_match(match_value.bVCI(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Paging__Field4::ALT_location__Area:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".location_Area");
single_value.field_location__Area->log_match(match_value.location__Area(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ location_Area := ");
single_value.field_location__Area->log_match(match_value.location__Area(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Paging__Field4::ALT_routeing__Area:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".routeing_Area");
single_value.field_routeing__Area->log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ routeing_Area := ");
single_value.field_routeing__Area->log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Paging__Field4::ALT_bSS__Area__Indication:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".bSS_Area_Indication");
single_value.field_bSS__Area__Indication->log_match(match_value.bSS__Area__Indication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ bSS_Area_Indication := ");
single_value.field_bSS__Area__Indication->log_match(match_value.bSS__Area__Indication(), 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 Paging__Field4_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 Paging__Field4::ALT_bVCI:
single_value.field_bVCI->encode_text(text_buf);
break;
case Paging__Field4::ALT_location__Area:
single_value.field_location__Area->encode_text(text_buf);
break;
case Paging__Field4::ALT_routeing__Area:
single_value.field_routeing__Area->encode_text(text_buf);
break;
case Paging__Field4::ALT_bSS__Area__Indication:
single_value.field_bSS__Area__Indication->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @BSSGP_Types.Paging_Field4.");
}
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 @BSSGP_Types.Paging_Field4.");
}
}

void Paging__Field4_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = Paging__Field4::UNBOUND_VALUE;
Paging__Field4::union_selection_type new_selection = (Paging__Field4::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case Paging__Field4::ALT_bVCI:
single_value.field_bVCI = new BVCI_template;
single_value.field_bVCI->decode_text(text_buf);
break;
case Paging__Field4::ALT_location__Area:
single_value.field_location__Area = new Location__Area_template;
single_value.field_location__Area->decode_text(text_buf);
break;
case Paging__Field4::ALT_routeing__Area:
single_value.field_routeing__Area = new Routeing__Area_template;
single_value.field_routeing__Area->decode_text(text_buf);
break;
case Paging__Field4::ALT_bSS__Area__Indication:
single_value.field_bSS__Area__Indication = new BSS__Area__Indication_template;
single_value.field_bSS__Area__Indication->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.Paging_Field4.");
}
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 Paging__Field4_template[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 @BSSGP_Types.Paging_Field4.");
}
}

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

boolean Paging__Field4_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 Paging__Field4_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 `@BSSGP_Types.Paging_Field4'");
    }
    if (strcmp("bVCI", param_field) == 0) {
      bVCI().set_param(param);
      return;
    } else if (strcmp("location_Area", param_field) == 0) {
      location__Area().set_param(param);
      return;
    } else if (strcmp("routeing_Area", param_field) == 0) {
      routeing__Area().set_param(param);
      return;
    } else if (strcmp("bSS_Area_Indication", param_field) == 0) {
      bSS__Area__Indication().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.Paging_Field4'", 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: {
    Paging__Field4_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", "@BSSGP_Types.Paging_Field4");
    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, "bVCI")) {
      bVCI().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "location_Area")) {
      location__Area().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "routeing_Area")) {
      routeing__Area().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "bSS_Area_Indication")) {
      bSS__Area__Indication().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.Paging_Field4.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    Paging__Field4_template* precondition = new Paging__Field4_template;
    precondition->set_param(*m_p->get_elem(0));
    Paging__Field4_template* implied_template = new Paging__Field4_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Paging__Field4_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.Paging_Field4");
  }
  is_ifpresent = param.get_ifpresent();
}

void Paging__Field4_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 Paging__Field4::ALT_bVCI:
single_value.field_bVCI->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Paging_Field4");
return;
case Paging__Field4::ALT_location__Area:
single_value.field_location__Area->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Paging_Field4");
return;
case Paging__Field4::ALT_routeing__Area:
single_value.field_routeing__Area->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Paging_Field4");
return;
case Paging__Field4::ALT_bSS__Area__Indication:
single_value.field_bSS__Area__Indication->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Paging_Field4");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @BSSGP_Types.Paging_Field4.");
}
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 : "@BSSGP_Types.Paging_Field4");
}

PDU__BSSGP__PAGING__PS::PDU__BSSGP__PAGING__PS()
{
}

PDU__BSSGP__PAGING__PS::PDU__BSSGP__PAGING__PS(const OCTETSTRING& par_bssgpPduType,
    const IMSI__BSSGP& par_iMSI,
    const OPTIONAL< DRX__Parameters >& par_dRX__Parameters,
    const Paging__Field4& par_paging__Field4,
    const OPTIONAL< PFI >& par_pFI,
    const OPTIONAL< ABQP >& par_aBQP,
    const QoS__Profile& par_qoS__Profile,
    const OPTIONAL< TMSI__BSSGP >& par_pTMSI,
    const OPTIONAL< EDRX__Parameters >& par_eDRX__Paremeters)
  :   field_bssgpPduType(par_bssgpPduType),
  field_iMSI(par_iMSI),
  field_dRX__Parameters(par_dRX__Parameters),
  field_paging__Field4(par_paging__Field4),
  field_pFI(par_pFI),
  field_aBQP(par_aBQP),
  field_qoS__Profile(par_qoS__Profile),
  field_pTMSI(par_pTMSI),
  field_eDRX__Paremeters(par_eDRX__Paremeters)
{
}

PDU__BSSGP__PAGING__PS::PDU__BSSGP__PAGING__PS(const PDU__BSSGP__PAGING__PS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.dRX__Parameters().is_bound()) field_dRX__Parameters = other_value.dRX__Parameters();
else field_dRX__Parameters.clean_up();
if (other_value.paging__Field4().is_bound()) field_paging__Field4 = other_value.paging__Field4();
else field_paging__Field4.clean_up();
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
else field_aBQP.clean_up();
if (other_value.qoS__Profile().is_bound()) field_qoS__Profile = other_value.qoS__Profile();
else field_qoS__Profile.clean_up();
if (other_value.pTMSI().is_bound()) field_pTMSI = other_value.pTMSI();
else field_pTMSI.clean_up();
if (other_value.eDRX__Paremeters().is_bound()) field_eDRX__Paremeters = other_value.eDRX__Paremeters();
else field_eDRX__Paremeters.clean_up();
}

void PDU__BSSGP__PAGING__PS::clean_up()
{
field_bssgpPduType.clean_up();
field_iMSI.clean_up();
field_dRX__Parameters.clean_up();
field_paging__Field4.clean_up();
field_pFI.clean_up();
field_aBQP.clean_up();
field_qoS__Profile.clean_up();
field_pTMSI.clean_up();
field_eDRX__Paremeters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PAGING__PS::get_descriptor() const { return &PDU__BSSGP__PAGING__PS_descr_; }
PDU__BSSGP__PAGING__PS& PDU__BSSGP__PAGING__PS::operator=(const PDU__BSSGP__PAGING__PS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.dRX__Parameters().is_bound()) field_dRX__Parameters = other_value.dRX__Parameters();
  else field_dRX__Parameters.clean_up();
  if (other_value.paging__Field4().is_bound()) field_paging__Field4 = other_value.paging__Field4();
  else field_paging__Field4.clean_up();
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
  else field_aBQP.clean_up();
  if (other_value.qoS__Profile().is_bound()) field_qoS__Profile = other_value.qoS__Profile();
  else field_qoS__Profile.clean_up();
  if (other_value.pTMSI().is_bound()) field_pTMSI = other_value.pTMSI();
  else field_pTMSI.clean_up();
  if (other_value.eDRX__Paremeters().is_bound()) field_eDRX__Paremeters = other_value.eDRX__Paremeters();
  else field_eDRX__Paremeters.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PAGING__PS::operator==(const PDU__BSSGP__PAGING__PS& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_iMSI==other_value.field_iMSI
  && field_dRX__Parameters==other_value.field_dRX__Parameters
  && field_paging__Field4==other_value.field_paging__Field4
  && field_pFI==other_value.field_pFI
  && field_aBQP==other_value.field_aBQP
  && field_qoS__Profile==other_value.field_qoS__Profile
  && field_pTMSI==other_value.field_pTMSI
  && field_eDRX__Paremeters==other_value.field_eDRX__Paremeters;
}

boolean PDU__BSSGP__PAGING__PS::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_iMSI.is_bound())
  || (OPTIONAL_OMIT == field_dRX__Parameters.get_selection() || field_dRX__Parameters.is_bound())
  || (field_paging__Field4.is_bound())
  || (OPTIONAL_OMIT == field_pFI.get_selection() || field_pFI.is_bound())
  || (OPTIONAL_OMIT == field_aBQP.get_selection() || field_aBQP.is_bound())
  || (field_qoS__Profile.is_bound())
  || (OPTIONAL_OMIT == field_pTMSI.get_selection() || field_pTMSI.is_bound())
  || (OPTIONAL_OMIT == field_eDRX__Paremeters.get_selection() || field_eDRX__Paremeters.is_bound());
}
boolean PDU__BSSGP__PAGING__PS::is_value() const
{
return field_bssgpPduType.is_value()
  && field_iMSI.is_value()
  && (OPTIONAL_OMIT == field_dRX__Parameters.get_selection() || field_dRX__Parameters.is_value())
  && field_paging__Field4.is_value()
  && (OPTIONAL_OMIT == field_pFI.get_selection() || field_pFI.is_value())
  && (OPTIONAL_OMIT == field_aBQP.get_selection() || field_aBQP.is_value())
  && field_qoS__Profile.is_value()
  && (OPTIONAL_OMIT == field_pTMSI.get_selection() || field_pTMSI.is_value())
  && (OPTIONAL_OMIT == field_eDRX__Paremeters.get_selection() || field_eDRX__Paremeters.is_value());
}
int PDU__BSSGP__PAGING__PS::size_of() const
{
  int ret_val = 4;
  if (field_dRX__Parameters.ispresent()) ret_val++;
  if (field_pFI.ispresent()) ret_val++;
  if (field_aBQP.ispresent()) ret_val++;
  if (field_pTMSI.ispresent()) ret_val++;
  if (field_eDRX__Paremeters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PAGING__PS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", dRX_Parameters := ");
field_dRX__Parameters.log();
TTCN_Logger::log_event_str(", paging_Field4 := ");
field_paging__Field4.log();
TTCN_Logger::log_event_str(", pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", aBQP := ");
field_aBQP.log();
TTCN_Logger::log_event_str(", qoS_Profile := ");
field_qoS__Profile.log();
TTCN_Logger::log_event_str(", pTMSI := ");
field_pTMSI.log();
TTCN_Logger::log_event_str(", eDRX_Paremeters := ");
field_eDRX__Paremeters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PAGING__PS::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (!dRX__Parameters().is_bound()) dRX__Parameters() = OMIT_VALUE;
else dRX__Parameters().set_implicit_omit();
if (paging__Field4().is_bound()) paging__Field4().set_implicit_omit();
if (!pFI().is_bound()) pFI() = OMIT_VALUE;
else pFI().set_implicit_omit();
if (!aBQP().is_bound()) aBQP() = OMIT_VALUE;
else aBQP().set_implicit_omit();
if (qoS__Profile().is_bound()) qoS__Profile().set_implicit_omit();
if (!pTMSI().is_bound()) pTMSI() = OMIT_VALUE;
else pTMSI().set_implicit_omit();
if (!eDRX__Paremeters().is_bound()) eDRX__Paremeters() = OMIT_VALUE;
else eDRX__Paremeters().set_implicit_omit();
}

void PDU__BSSGP__PAGING__PS::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 @BSSGP_Types.PDU_BSSGP_PAGING_PS 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dRX__Parameters().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) paging__Field4().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) aBQP().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) qoS__Profile().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) pTMSI().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) eDRX__Paremeters().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paging_Field4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paging__Field4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aBQP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aBQP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "qoS_Profile")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          qoS__Profile().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eDRX_Paremeters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eDRX__Paremeters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PAGING_PS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
  }
}

void PDU__BSSGP__PAGING__PS::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_dRX__Parameters.encode_text(text_buf);
field_paging__Field4.encode_text(text_buf);
field_pFI.encode_text(text_buf);
field_aBQP.encode_text(text_buf);
field_qoS__Profile.encode_text(text_buf);
field_pTMSI.encode_text(text_buf);
field_eDRX__Paremeters.encode_text(text_buf);
}

void PDU__BSSGP__PAGING__PS::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_dRX__Parameters.decode_text(text_buf);
field_paging__Field4.decode_text(text_buf);
field_pFI.decode_text(text_buf);
field_aBQP.decode_text(text_buf);
field_qoS__Profile.decode_text(text_buf);
field_pTMSI.decode_text(text_buf);
field_eDRX__Paremeters.decode_text(text_buf);
}

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

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

int PDU__BSSGP__PAGING__PS::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_bssgpPduType.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, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_dRX__Parameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, DRX__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_dRX__Parameters().RAW_decode(DRX__Parameters_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_dRX__Parameters = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dRX__Parameters=OMIT_VALUE;
  RAW_Force_Omit field_3_force_omit(3, force_omit, Paging__Field4_descr_.raw->forceomit);
  decoded_field_length = field_paging__Field4.RAW_decode(Paging__Field4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_pFI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI().RAW_decode(PFI_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_pFI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pFI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_aBQP = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, ABQP_descr_.raw->forceomit);
  decoded_field_length = field_aBQP().RAW_decode(ABQP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_aBQP = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_aBQP=OMIT_VALUE;
  RAW_Force_Omit field_6_force_omit(6, force_omit, QoS__Profile_descr_.raw->forceomit);
  decoded_field_length = field_qoS__Profile.RAW_decode(QoS__Profile_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_pTMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, TMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_pTMSI().RAW_decode(TMSI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_pTMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pTMSI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_eDRX__Paremeters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, EDRX__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_eDRX__Paremeters().RAW_decode(EDRX__Parameters_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_eDRX__Paremeters = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_eDRX__Paremeters=OMIT_VALUE;
  if (field_bssgpPduType !=  os_37) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PAGING__PS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IMSI__BSSGP_descr_.raw);
  if (field_dRX__Parameters.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DRX__Parameters_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Paging__Field4_descr_.raw);
  if (field_pFI.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PFI_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_aBQP.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ABQP_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, QoS__Profile_descr_.raw);
  if (field_pTMSI.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, TMSI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_eDRX__Paremeters.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, EDRX__Parameters_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  if (field_dRX__Parameters.ispresent()) {
  encoded_length += field_dRX__Parameters().RAW_encode(DRX__Parameters_descr_, *myleaf.body.node.nodes[2]);
  }
  encoded_length += field_paging__Field4.RAW_encode(Paging__Field4_descr_, *myleaf.body.node.nodes[3]);
  if (field_pFI.ispresent()) {
  encoded_length += field_pFI().RAW_encode(PFI_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_aBQP.ispresent()) {
  encoded_length += field_aBQP().RAW_encode(ABQP_descr_, *myleaf.body.node.nodes[5]);
  }
  encoded_length += field_qoS__Profile.RAW_encode(QoS__Profile_descr_, *myleaf.body.node.nodes[6]);
  if (field_pTMSI.ispresent()) {
  encoded_length += field_pTMSI().RAW_encode(TMSI__BSSGP_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_eDRX__Paremeters.ispresent()) {
  encoded_length += field_eDRX__Paremeters().RAW_encode(EDRX__Parameters_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_bssgpPduType !=  os_37) {
  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_37.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PAGING__PS_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
IMSI__BSSGP_template field_iMSI;
DRX__Parameters_template field_dRX__Parameters;
Paging__Field4_template field_paging__Field4;
PFI_template field_pFI;
ABQP_template field_aBQP;
QoS__Profile_template field_qoS__Profile;
TMSI__BSSGP_template field_pTMSI;
EDRX__Parameters_template field_eDRX__Paremeters;
};

void PDU__BSSGP__PAGING__PS_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_bssgpPduType = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_dRX__Parameters = ANY_OR_OMIT;
single_value->field_paging__Field4 = ANY_VALUE;
single_value->field_pFI = ANY_OR_OMIT;
single_value->field_aBQP = ANY_OR_OMIT;
single_value->field_qoS__Profile = ANY_VALUE;
single_value->field_pTMSI = ANY_OR_OMIT;
single_value->field_eDRX__Paremeters = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PAGING__PS_template::copy_value(const PDU__BSSGP__PAGING__PS& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.dRX__Parameters().is_bound()) {
  if (other_value.dRX__Parameters().ispresent()) single_value->field_dRX__Parameters = other_value.dRX__Parameters()();
  else single_value->field_dRX__Parameters = OMIT_VALUE;
} else {
  single_value->field_dRX__Parameters.clean_up();
}
if (other_value.paging__Field4().is_bound()) {
  single_value->field_paging__Field4 = other_value.paging__Field4();
} else {
  single_value->field_paging__Field4.clean_up();
}
if (other_value.pFI().is_bound()) {
  if (other_value.pFI().ispresent()) single_value->field_pFI = other_value.pFI()();
  else single_value->field_pFI = OMIT_VALUE;
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.aBQP().is_bound()) {
  if (other_value.aBQP().ispresent()) single_value->field_aBQP = other_value.aBQP()();
  else single_value->field_aBQP = OMIT_VALUE;
} else {
  single_value->field_aBQP.clean_up();
}
if (other_value.qoS__Profile().is_bound()) {
  single_value->field_qoS__Profile = other_value.qoS__Profile();
} else {
  single_value->field_qoS__Profile.clean_up();
}
if (other_value.pTMSI().is_bound()) {
  if (other_value.pTMSI().ispresent()) single_value->field_pTMSI = other_value.pTMSI()();
  else single_value->field_pTMSI = OMIT_VALUE;
} else {
  single_value->field_pTMSI.clean_up();
}
if (other_value.eDRX__Paremeters().is_bound()) {
  if (other_value.eDRX__Paremeters().ispresent()) single_value->field_eDRX__Paremeters = other_value.eDRX__Paremeters()();
  else single_value->field_eDRX__Paremeters = OMIT_VALUE;
} else {
  single_value->field_eDRX__Paremeters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PAGING__PS_template::copy_template(const PDU__BSSGP__PAGING__PS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dRX__Parameters().get_selection()) {
single_value->field_dRX__Parameters = other_value.dRX__Parameters();
} else {
single_value->field_dRX__Parameters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.paging__Field4().get_selection()) {
single_value->field_paging__Field4 = other_value.paging__Field4();
} else {
single_value->field_paging__Field4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFI().get_selection()) {
single_value->field_pFI = other_value.pFI();
} else {
single_value->field_pFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aBQP().get_selection()) {
single_value->field_aBQP = other_value.aBQP();
} else {
single_value->field_aBQP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.qoS__Profile().get_selection()) {
single_value->field_qoS__Profile = other_value.qoS__Profile();
} else {
single_value->field_qoS__Profile.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pTMSI().get_selection()) {
single_value->field_pTMSI = other_value.pTMSI();
} else {
single_value->field_pTMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eDRX__Paremeters().get_selection()) {
single_value->field_eDRX__Paremeters = other_value.eDRX__Paremeters();
} else {
single_value->field_eDRX__Paremeters.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PAGING__PS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PAGING__PS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PAGING__PS_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 @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PAGING__PS_template::PDU__BSSGP__PAGING__PS_template()
{
}

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

PDU__BSSGP__PAGING__PS_template::PDU__BSSGP__PAGING__PS_template(const PDU__BSSGP__PAGING__PS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__BSSGP__PAGING__PS_template& PDU__BSSGP__PAGING__PS_template::operator=(const OPTIONAL<PDU__BSSGP__PAGING__PS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PAGING__PS&)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 @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
}
return *this;
}

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

boolean PDU__BSSGP__PAGING__PS_template::match(const PDU__BSSGP__PAGING__PS& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.dRX__Parameters().is_bound()) return FALSE;
if((other_value.dRX__Parameters().ispresent() ? !single_value->field_dRX__Parameters.match((const DRX__Parameters&)other_value.dRX__Parameters(), legacy) : !single_value->field_dRX__Parameters.match_omit(legacy)))return FALSE;
if(!other_value.paging__Field4().is_bound()) return FALSE;
if(!single_value->field_paging__Field4.match(other_value.paging__Field4(), legacy))return FALSE;
if(!other_value.pFI().is_bound()) return FALSE;
if((other_value.pFI().ispresent() ? !single_value->field_pFI.match((const PFI&)other_value.pFI(), legacy) : !single_value->field_pFI.match_omit(legacy)))return FALSE;
if(!other_value.aBQP().is_bound()) return FALSE;
if((other_value.aBQP().ispresent() ? !single_value->field_aBQP.match((const ABQP&)other_value.aBQP(), legacy) : !single_value->field_aBQP.match_omit(legacy)))return FALSE;
if(!other_value.qoS__Profile().is_bound()) return FALSE;
if(!single_value->field_qoS__Profile.match(other_value.qoS__Profile(), legacy))return FALSE;
if(!other_value.pTMSI().is_bound()) return FALSE;
if((other_value.pTMSI().ispresent() ? !single_value->field_pTMSI.match((const TMSI__BSSGP&)other_value.pTMSI(), legacy) : !single_value->field_pTMSI.match_omit(legacy)))return FALSE;
if(!other_value.eDRX__Paremeters().is_bound()) return FALSE;
if((other_value.eDRX__Paremeters().ispresent() ? !single_value->field_eDRX__Paremeters.match((const EDRX__Parameters&)other_value.eDRX__Paremeters(), legacy) : !single_value->field_eDRX__Paremeters.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 @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
}
return FALSE;
}

boolean PDU__BSSGP__PAGING__PS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_iMSI.is_bound()
 || (single_value->field_dRX__Parameters.is_omit() || single_value->field_dRX__Parameters.is_bound())
 || single_value->field_paging__Field4.is_bound()
 || (single_value->field_pFI.is_omit() || single_value->field_pFI.is_bound())
 || (single_value->field_aBQP.is_omit() || single_value->field_aBQP.is_bound())
 || single_value->field_qoS__Profile.is_bound()
 || (single_value->field_pTMSI.is_omit() || single_value->field_pTMSI.is_bound())
 || (single_value->field_eDRX__Paremeters.is_omit() || single_value->field_eDRX__Paremeters.is_bound());
}

boolean PDU__BSSGP__PAGING__PS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_iMSI.is_value()
 && (single_value->field_dRX__Parameters.is_omit() || single_value->field_dRX__Parameters.is_value())
 && single_value->field_paging__Field4.is_value()
 && (single_value->field_pFI.is_omit() || single_value->field_pFI.is_value())
 && (single_value->field_aBQP.is_omit() || single_value->field_aBQP.is_value())
 && single_value->field_qoS__Profile.is_value()
 && (single_value->field_pTMSI.is_omit() || single_value->field_pTMSI.is_value())
 && (single_value->field_eDRX__Paremeters.is_omit() || single_value->field_eDRX__Paremeters.is_value());
}

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

PDU__BSSGP__PAGING__PS PDU__BSSGP__PAGING__PS_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 @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
PDU__BSSGP__PAGING__PS ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_dRX__Parameters.is_omit()) ret_val.dRX__Parameters() = OMIT_VALUE;
else if (single_value->field_dRX__Parameters.is_bound()) {
ret_val.dRX__Parameters() = single_value->field_dRX__Parameters.valueof();
}
if (single_value->field_paging__Field4.is_bound()) {
ret_val.paging__Field4() = single_value->field_paging__Field4.valueof();
}
if (single_value->field_pFI.is_omit()) ret_val.pFI() = OMIT_VALUE;
else if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_aBQP.is_omit()) ret_val.aBQP() = OMIT_VALUE;
else if (single_value->field_aBQP.is_bound()) {
ret_val.aBQP() = single_value->field_aBQP.valueof();
}
if (single_value->field_qoS__Profile.is_bound()) {
ret_val.qoS__Profile() = single_value->field_qoS__Profile.valueof();
}
if (single_value->field_pTMSI.is_omit()) ret_val.pTMSI() = OMIT_VALUE;
else if (single_value->field_pTMSI.is_bound()) {
ret_val.pTMSI() = single_value->field_pTMSI.valueof();
}
if (single_value->field_eDRX__Paremeters.is_omit()) ret_val.eDRX__Paremeters() = OMIT_VALUE;
else if (single_value->field_eDRX__Paremeters.is_bound()) {
ret_val.eDRX__Paremeters() = single_value->field_eDRX__Paremeters.valueof();
}
return ret_val;
}

void PDU__BSSGP__PAGING__PS_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 @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__PAGING__PS_template[list_length];
}

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

OCTETSTRING_template& PDU__BSSGP__PAGING__PS_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PAGING__PS_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
return single_value->field_bssgpPduType;
}

IMSI__BSSGP_template& PDU__BSSGP__PAGING__PS_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__PAGING__PS_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
return single_value->field_iMSI;
}

DRX__Parameters_template& PDU__BSSGP__PAGING__PS_template::dRX__Parameters()
{
set_specific();
return single_value->field_dRX__Parameters;
}

const DRX__Parameters_template& PDU__BSSGP__PAGING__PS_template::dRX__Parameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dRX_Parameters of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
return single_value->field_dRX__Parameters;
}

Paging__Field4_template& PDU__BSSGP__PAGING__PS_template::paging__Field4()
{
set_specific();
return single_value->field_paging__Field4;
}

const Paging__Field4_template& PDU__BSSGP__PAGING__PS_template::paging__Field4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paging_Field4 of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
return single_value->field_paging__Field4;
}

PFI_template& PDU__BSSGP__PAGING__PS_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& PDU__BSSGP__PAGING__PS_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
return single_value->field_pFI;
}

ABQP_template& PDU__BSSGP__PAGING__PS_template::aBQP()
{
set_specific();
return single_value->field_aBQP;
}

const ABQP_template& PDU__BSSGP__PAGING__PS_template::aBQP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aBQP of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
return single_value->field_aBQP;
}

QoS__Profile_template& PDU__BSSGP__PAGING__PS_template::qoS__Profile()
{
set_specific();
return single_value->field_qoS__Profile;
}

const QoS__Profile_template& PDU__BSSGP__PAGING__PS_template::qoS__Profile() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field qoS_Profile of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
return single_value->field_qoS__Profile;
}

TMSI__BSSGP_template& PDU__BSSGP__PAGING__PS_template::pTMSI()
{
set_specific();
return single_value->field_pTMSI;
}

const TMSI__BSSGP_template& PDU__BSSGP__PAGING__PS_template::pTMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pTMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
return single_value->field_pTMSI;
}

EDRX__Parameters_template& PDU__BSSGP__PAGING__PS_template::eDRX__Paremeters()
{
set_specific();
return single_value->field_eDRX__Paremeters;
}

const EDRX__Parameters_template& PDU__BSSGP__PAGING__PS_template::eDRX__Paremeters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eDRX_Paremeters of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
return single_value->field_eDRX__Paremeters;
}

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

void PDU__BSSGP__PAGING__PS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", dRX_Parameters := ");
single_value->field_dRX__Parameters.log();
TTCN_Logger::log_event_str(", paging_Field4 := ");
single_value->field_paging__Field4.log();
TTCN_Logger::log_event_str(", pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log();
TTCN_Logger::log_event_str(", qoS_Profile := ");
single_value->field_qoS__Profile.log();
TTCN_Logger::log_event_str(", pTMSI := ");
single_value->field_pTMSI.log();
TTCN_Logger::log_event_str(", eDRX_Paremeters := ");
single_value->field_eDRX__Paremeters.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PAGING__PS_template::log_match(const PDU__BSSGP__PAGING__PS& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.dRX__Parameters().ispresent()){
if(!single_value->field_dRX__Parameters.match(match_value.dRX__Parameters(), legacy)){
TTCN_Logger::log_logmatch_info(".dRX_Parameters");
single_value->field_dRX__Parameters.log_match(match_value.dRX__Parameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dRX__Parameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dRX_Parameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dRX__Parameters.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_paging__Field4.match(match_value.paging__Field4(), legacy)){
TTCN_Logger::log_logmatch_info(".paging_Field4");
single_value->field_paging__Field4.log_match(match_value.paging__Field4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pFI().ispresent()){
if(!single_value->field_pFI.match(match_value.pFI(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pFI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pFI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pFI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.aBQP().ispresent()){
if(!single_value->field_aBQP.match(match_value.aBQP(), legacy)){
TTCN_Logger::log_logmatch_info(".aBQP");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_aBQP.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".aBQP := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_aBQP.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_qoS__Profile.match(match_value.qoS__Profile(), legacy)){
TTCN_Logger::log_logmatch_info(".qoS_Profile");
single_value->field_qoS__Profile.log_match(match_value.qoS__Profile(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.pTMSI().ispresent()){
if(!single_value->field_pTMSI.match(match_value.pTMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".pTMSI");
single_value->field_pTMSI.log_match(match_value.pTMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pTMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pTMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pTMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eDRX__Paremeters().ispresent()){
if(!single_value->field_eDRX__Paremeters.match(match_value.eDRX__Paremeters(), legacy)){
TTCN_Logger::log_logmatch_info(".eDRX_Paremeters");
single_value->field_eDRX__Paremeters.log_match(match_value.eDRX__Paremeters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eDRX__Paremeters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eDRX_Paremeters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eDRX__Paremeters.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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", dRX_Parameters := ");
if (match_value.dRX__Parameters().ispresent()) {
single_value->field_dRX__Parameters.log_match(match_value.dRX__Parameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dRX__Parameters.log();
if (single_value->field_dRX__Parameters.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", paging_Field4 := ");
single_value->field_paging__Field4.log_match(match_value.paging__Field4(), legacy);
TTCN_Logger::log_event_str(", pFI := ");
if (match_value.pFI().ispresent()) {
single_value->field_pFI.log_match(match_value.pFI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pFI.log();
if (single_value->field_pFI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", aBQP := ");
if (match_value.aBQP().ispresent()) {
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_aBQP.log();
if (single_value->field_aBQP.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", qoS_Profile := ");
single_value->field_qoS__Profile.log_match(match_value.qoS__Profile(), legacy);
TTCN_Logger::log_event_str(", pTMSI := ");
if (match_value.pTMSI().ispresent()) {
single_value->field_pTMSI.log_match(match_value.pTMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pTMSI.log();
if (single_value->field_pTMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eDRX_Paremeters := ");
if (match_value.eDRX__Paremeters().ispresent()) {
single_value->field_eDRX__Paremeters.log_match(match_value.eDRX__Paremeters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eDRX__Paremeters.log();
if (single_value->field_eDRX__Paremeters.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PAGING__PS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_iMSI.encode_text(text_buf);
single_value->field_dRX__Parameters.encode_text(text_buf);
single_value->field_paging__Field4.encode_text(text_buf);
single_value->field_pFI.encode_text(text_buf);
single_value->field_aBQP.encode_text(text_buf);
single_value->field_qoS__Profile.encode_text(text_buf);
single_value->field_pTMSI.encode_text(text_buf);
single_value->field_eDRX__Paremeters.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 @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
}
}

void PDU__BSSGP__PAGING__PS_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_bssgpPduType.decode_text(text_buf);
single_value->field_iMSI.decode_text(text_buf);
single_value->field_dRX__Parameters.decode_text(text_buf);
single_value->field_paging__Field4.decode_text(text_buf);
single_value->field_pFI.decode_text(text_buf);
single_value->field_aBQP.decode_text(text_buf);
single_value->field_qoS__Profile.decode_text(text_buf);
single_value->field_pTMSI.decode_text(text_buf);
single_value->field_eDRX__Paremeters.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PAGING__PS_template[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 @BSSGP_Types.PDU_BSSGP_PAGING_PS.");
}
}

void PDU__BSSGP__PAGING__PS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PAGING__PS_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 @BSSGP_Types.PDU_BSSGP_PAGING_PS 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dRX__Parameters().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) paging__Field4().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) aBQP().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) qoS__Profile().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) pTMSI().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) eDRX__Paremeters().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paging_Field4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paging__Field4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aBQP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aBQP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "qoS_Profile")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          qoS__Profile().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eDRX_Paremeters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eDRX__Paremeters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PAGING_PS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PAGING__PS_template* precondition = new PDU__BSSGP__PAGING__PS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PAGING__PS_template* implied_template = new PDU__BSSGP__PAGING__PS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PAGING__PS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PAGING__PS_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
single_value->field_iMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
single_value->field_dRX__Parameters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
single_value->field_paging__Field4.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
single_value->field_pFI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
single_value->field_aBQP.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
single_value->field_qoS__Profile.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
single_value->field_pTMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
single_value->field_eDRX__Paremeters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
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 : "@BSSGP_Types.PDU_BSSGP_PAGING_PS");
}

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

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

PDU__BSSGP__PAGING__CS::PDU__BSSGP__PAGING__CS()
{
}

PDU__BSSGP__PAGING__CS::PDU__BSSGP__PAGING__CS(const OCTETSTRING& par_bssgpPduType,
    const IMSI__BSSGP& par_iMSI,
    const DRX__Parameters& par_dRX__Parameters,
    const Paging__Field4& par_paging__Field4,
    const OPTIONAL< TLLI__BSSGP >& par_tLLI,
    const OPTIONAL< Channel__needed >& par_channel__needed,
    const OPTIONAL< EMLPP__Priority__BSSGP >& par_eMLPP__Priority,
    const OPTIONAL< TMSI__BSSGP >& par_tMSI,
    const OPTIONAL< Global__CN__Id__BSSGP >& par_global__CN__Id)
  :   field_bssgpPduType(par_bssgpPduType),
  field_iMSI(par_iMSI),
  field_dRX__Parameters(par_dRX__Parameters),
  field_paging__Field4(par_paging__Field4),
  field_tLLI(par_tLLI),
  field_channel__needed(par_channel__needed),
  field_eMLPP__Priority(par_eMLPP__Priority),
  field_tMSI(par_tMSI),
  field_global__CN__Id(par_global__CN__Id)
{
}

PDU__BSSGP__PAGING__CS::PDU__BSSGP__PAGING__CS(const PDU__BSSGP__PAGING__CS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.dRX__Parameters().is_bound()) field_dRX__Parameters = other_value.dRX__Parameters();
else field_dRX__Parameters.clean_up();
if (other_value.paging__Field4().is_bound()) field_paging__Field4 = other_value.paging__Field4();
else field_paging__Field4.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.channel__needed().is_bound()) field_channel__needed = other_value.channel__needed();
else field_channel__needed.clean_up();
if (other_value.eMLPP__Priority().is_bound()) field_eMLPP__Priority = other_value.eMLPP__Priority();
else field_eMLPP__Priority.clean_up();
if (other_value.tMSI().is_bound()) field_tMSI = other_value.tMSI();
else field_tMSI.clean_up();
if (other_value.global__CN__Id().is_bound()) field_global__CN__Id = other_value.global__CN__Id();
else field_global__CN__Id.clean_up();
}

void PDU__BSSGP__PAGING__CS::clean_up()
{
field_bssgpPduType.clean_up();
field_iMSI.clean_up();
field_dRX__Parameters.clean_up();
field_paging__Field4.clean_up();
field_tLLI.clean_up();
field_channel__needed.clean_up();
field_eMLPP__Priority.clean_up();
field_tMSI.clean_up();
field_global__CN__Id.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__PAGING__CS::get_descriptor() const { return &PDU__BSSGP__PAGING__CS_descr_; }
PDU__BSSGP__PAGING__CS& PDU__BSSGP__PAGING__CS::operator=(const PDU__BSSGP__PAGING__CS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.dRX__Parameters().is_bound()) field_dRX__Parameters = other_value.dRX__Parameters();
  else field_dRX__Parameters.clean_up();
  if (other_value.paging__Field4().is_bound()) field_paging__Field4 = other_value.paging__Field4();
  else field_paging__Field4.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.channel__needed().is_bound()) field_channel__needed = other_value.channel__needed();
  else field_channel__needed.clean_up();
  if (other_value.eMLPP__Priority().is_bound()) field_eMLPP__Priority = other_value.eMLPP__Priority();
  else field_eMLPP__Priority.clean_up();
  if (other_value.tMSI().is_bound()) field_tMSI = other_value.tMSI();
  else field_tMSI.clean_up();
  if (other_value.global__CN__Id().is_bound()) field_global__CN__Id = other_value.global__CN__Id();
  else field_global__CN__Id.clean_up();
}
return *this;
}

boolean PDU__BSSGP__PAGING__CS::operator==(const PDU__BSSGP__PAGING__CS& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_iMSI==other_value.field_iMSI
  && field_dRX__Parameters==other_value.field_dRX__Parameters
  && field_paging__Field4==other_value.field_paging__Field4
  && field_tLLI==other_value.field_tLLI
  && field_channel__needed==other_value.field_channel__needed
  && field_eMLPP__Priority==other_value.field_eMLPP__Priority
  && field_tMSI==other_value.field_tMSI
  && field_global__CN__Id==other_value.field_global__CN__Id;
}

boolean PDU__BSSGP__PAGING__CS::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_iMSI.is_bound())
  || (field_dRX__Parameters.is_bound())
  || (field_paging__Field4.is_bound())
  || (OPTIONAL_OMIT == field_tLLI.get_selection() || field_tLLI.is_bound())
  || (OPTIONAL_OMIT == field_channel__needed.get_selection() || field_channel__needed.is_bound())
  || (OPTIONAL_OMIT == field_eMLPP__Priority.get_selection() || field_eMLPP__Priority.is_bound())
  || (OPTIONAL_OMIT == field_tMSI.get_selection() || field_tMSI.is_bound())
  || (OPTIONAL_OMIT == field_global__CN__Id.get_selection() || field_global__CN__Id.is_bound());
}
boolean PDU__BSSGP__PAGING__CS::is_value() const
{
return field_bssgpPduType.is_value()
  && field_iMSI.is_value()
  && field_dRX__Parameters.is_value()
  && field_paging__Field4.is_value()
  && (OPTIONAL_OMIT == field_tLLI.get_selection() || field_tLLI.is_value())
  && (OPTIONAL_OMIT == field_channel__needed.get_selection() || field_channel__needed.is_value())
  && (OPTIONAL_OMIT == field_eMLPP__Priority.get_selection() || field_eMLPP__Priority.is_value())
  && (OPTIONAL_OMIT == field_tMSI.get_selection() || field_tMSI.is_value())
  && (OPTIONAL_OMIT == field_global__CN__Id.get_selection() || field_global__CN__Id.is_value());
}
int PDU__BSSGP__PAGING__CS::size_of() const
{
  int ret_val = 4;
  if (field_tLLI.ispresent()) ret_val++;
  if (field_channel__needed.ispresent()) ret_val++;
  if (field_eMLPP__Priority.ispresent()) ret_val++;
  if (field_tMSI.ispresent()) ret_val++;
  if (field_global__CN__Id.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__PAGING__CS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", dRX_Parameters := ");
field_dRX__Parameters.log();
TTCN_Logger::log_event_str(", paging_Field4 := ");
field_paging__Field4.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", channel_needed := ");
field_channel__needed.log();
TTCN_Logger::log_event_str(", eMLPP_Priority := ");
field_eMLPP__Priority.log();
TTCN_Logger::log_event_str(", tMSI := ");
field_tMSI.log();
TTCN_Logger::log_event_str(", global_CN_Id := ");
field_global__CN__Id.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__PAGING__CS::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (iMSI().is_bound()) iMSI().set_implicit_omit();
if (dRX__Parameters().is_bound()) dRX__Parameters().set_implicit_omit();
if (paging__Field4().is_bound()) paging__Field4().set_implicit_omit();
if (!tLLI().is_bound()) tLLI() = OMIT_VALUE;
else tLLI().set_implicit_omit();
if (!channel__needed().is_bound()) channel__needed() = OMIT_VALUE;
else channel__needed().set_implicit_omit();
if (!eMLPP__Priority().is_bound()) eMLPP__Priority() = OMIT_VALUE;
else eMLPP__Priority().set_implicit_omit();
if (!tMSI().is_bound()) tMSI() = OMIT_VALUE;
else tMSI().set_implicit_omit();
if (!global__CN__Id().is_bound()) global__CN__Id() = OMIT_VALUE;
else global__CN__Id().set_implicit_omit();
}

void PDU__BSSGP__PAGING__CS::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 @BSSGP_Types.PDU_BSSGP_PAGING_CS 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dRX__Parameters().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) paging__Field4().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) channel__needed().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) eMLPP__Priority().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tMSI().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) global__CN__Id().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paging_Field4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paging__Field4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channel_needed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channel__needed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eMLPP_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMLPP__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "global_CN_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          global__CN__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PAGING_CS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
  }
}

void PDU__BSSGP__PAGING__CS::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_dRX__Parameters.encode_text(text_buf);
field_paging__Field4.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_channel__needed.encode_text(text_buf);
field_eMLPP__Priority.encode_text(text_buf);
field_tMSI.encode_text(text_buf);
field_global__CN__Id.encode_text(text_buf);
}

void PDU__BSSGP__PAGING__CS::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_dRX__Parameters.decode_text(text_buf);
field_paging__Field4.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_channel__needed.decode_text(text_buf);
field_eMLPP__Priority.decode_text(text_buf);
field_tMSI.decode_text(text_buf);
field_global__CN__Id.decode_text(text_buf);
}

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

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

int PDU__BSSGP__PAGING__CS::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_bssgpPduType.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, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI.RAW_decode(IMSI__BSSGP_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, DRX__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_dRX__Parameters.RAW_decode(DRX__Parameters_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, Paging__Field4_descr_.raw->forceomit);
  decoded_field_length = field_paging__Field4.RAW_decode(Paging__Field4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_tLLI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI().RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_tLLI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_tLLI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_channel__needed = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, Channel__needed_descr_.raw->forceomit);
  decoded_field_length = field_channel__needed().RAW_decode(Channel__needed_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_channel__needed = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_channel__needed=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_eMLPP__Priority = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, EMLPP__Priority__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_eMLPP__Priority().RAW_decode(EMLPP__Priority__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_eMLPP__Priority = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_eMLPP__Priority=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_tMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, TMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tMSI().RAW_decode(TMSI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_tMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_tMSI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_global__CN__Id = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, Global__CN__Id__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_global__CN__Id().RAW_decode(Global__CN__Id__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_global__CN__Id = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_global__CN__Id=OMIT_VALUE;
  if (field_bssgpPduType !=  os_41) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__PAGING__CS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IMSI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DRX__Parameters_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Paging__Field4_descr_.raw);
  if (field_tLLI.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, TLLI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_channel__needed.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Channel__needed_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_eMLPP__Priority.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, EMLPP__Priority__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_tMSI.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, TMSI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_global__CN__Id.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, Global__CN__Id__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_iMSI.RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_dRX__Parameters.RAW_encode(DRX__Parameters_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_paging__Field4.RAW_encode(Paging__Field4_descr_, *myleaf.body.node.nodes[3]);
  if (field_tLLI.ispresent()) {
  encoded_length += field_tLLI().RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_channel__needed.ispresent()) {
  encoded_length += field_channel__needed().RAW_encode(Channel__needed_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_eMLPP__Priority.ispresent()) {
  encoded_length += field_eMLPP__Priority().RAW_encode(EMLPP__Priority__BSSGP_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_tMSI.ispresent()) {
  encoded_length += field_tMSI().RAW_encode(TMSI__BSSGP_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_global__CN__Id.ispresent()) {
  encoded_length += field_global__CN__Id().RAW_encode(Global__CN__Id__BSSGP_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_bssgpPduType !=  os_41) {
  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_41.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__PAGING__CS_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
IMSI__BSSGP_template field_iMSI;
DRX__Parameters_template field_dRX__Parameters;
Paging__Field4_template field_paging__Field4;
TLLI__BSSGP_template field_tLLI;
Channel__needed_template field_channel__needed;
EMLPP__Priority__BSSGP_template field_eMLPP__Priority;
TMSI__BSSGP_template field_tMSI;
Global__CN__Id__BSSGP_template field_global__CN__Id;
};

void PDU__BSSGP__PAGING__CS_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_bssgpPduType = ANY_VALUE;
single_value->field_iMSI = ANY_VALUE;
single_value->field_dRX__Parameters = ANY_VALUE;
single_value->field_paging__Field4 = ANY_VALUE;
single_value->field_tLLI = ANY_OR_OMIT;
single_value->field_channel__needed = ANY_OR_OMIT;
single_value->field_eMLPP__Priority = ANY_OR_OMIT;
single_value->field_tMSI = ANY_OR_OMIT;
single_value->field_global__CN__Id = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__PAGING__CS_template::copy_value(const PDU__BSSGP__PAGING__CS& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.iMSI().is_bound()) {
  single_value->field_iMSI = other_value.iMSI();
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.dRX__Parameters().is_bound()) {
  single_value->field_dRX__Parameters = other_value.dRX__Parameters();
} else {
  single_value->field_dRX__Parameters.clean_up();
}
if (other_value.paging__Field4().is_bound()) {
  single_value->field_paging__Field4 = other_value.paging__Field4();
} else {
  single_value->field_paging__Field4.clean_up();
}
if (other_value.tLLI().is_bound()) {
  if (other_value.tLLI().ispresent()) single_value->field_tLLI = other_value.tLLI()();
  else single_value->field_tLLI = OMIT_VALUE;
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.channel__needed().is_bound()) {
  if (other_value.channel__needed().ispresent()) single_value->field_channel__needed = other_value.channel__needed()();
  else single_value->field_channel__needed = OMIT_VALUE;
} else {
  single_value->field_channel__needed.clean_up();
}
if (other_value.eMLPP__Priority().is_bound()) {
  if (other_value.eMLPP__Priority().ispresent()) single_value->field_eMLPP__Priority = other_value.eMLPP__Priority()();
  else single_value->field_eMLPP__Priority = OMIT_VALUE;
} else {
  single_value->field_eMLPP__Priority.clean_up();
}
if (other_value.tMSI().is_bound()) {
  if (other_value.tMSI().ispresent()) single_value->field_tMSI = other_value.tMSI()();
  else single_value->field_tMSI = OMIT_VALUE;
} else {
  single_value->field_tMSI.clean_up();
}
if (other_value.global__CN__Id().is_bound()) {
  if (other_value.global__CN__Id().ispresent()) single_value->field_global__CN__Id = other_value.global__CN__Id()();
  else single_value->field_global__CN__Id = OMIT_VALUE;
} else {
  single_value->field_global__CN__Id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__PAGING__CS_template::copy_template(const PDU__BSSGP__PAGING__CS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dRX__Parameters().get_selection()) {
single_value->field_dRX__Parameters = other_value.dRX__Parameters();
} else {
single_value->field_dRX__Parameters.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.paging__Field4().get_selection()) {
single_value->field_paging__Field4 = other_value.paging__Field4();
} else {
single_value->field_paging__Field4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.channel__needed().get_selection()) {
single_value->field_channel__needed = other_value.channel__needed();
} else {
single_value->field_channel__needed.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eMLPP__Priority().get_selection()) {
single_value->field_eMLPP__Priority = other_value.eMLPP__Priority();
} else {
single_value->field_eMLPP__Priority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tMSI().get_selection()) {
single_value->field_tMSI = other_value.tMSI();
} else {
single_value->field_tMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.global__CN__Id().get_selection()) {
single_value->field_global__CN__Id = other_value.global__CN__Id();
} else {
single_value->field_global__CN__Id.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__PAGING__CS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__PAGING__CS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__PAGING__CS_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 @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__PAGING__CS_template::PDU__BSSGP__PAGING__CS_template()
{
}

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

PDU__BSSGP__PAGING__CS_template::PDU__BSSGP__PAGING__CS_template(const PDU__BSSGP__PAGING__CS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__BSSGP__PAGING__CS_template& PDU__BSSGP__PAGING__CS_template::operator=(const OPTIONAL<PDU__BSSGP__PAGING__CS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__PAGING__CS&)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 @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
}
return *this;
}

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

boolean PDU__BSSGP__PAGING__CS_template::match(const PDU__BSSGP__PAGING__CS& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if(!single_value->field_iMSI.match(other_value.iMSI(), legacy))return FALSE;
if(!other_value.dRX__Parameters().is_bound()) return FALSE;
if(!single_value->field_dRX__Parameters.match(other_value.dRX__Parameters(), legacy))return FALSE;
if(!other_value.paging__Field4().is_bound()) return FALSE;
if(!single_value->field_paging__Field4.match(other_value.paging__Field4(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if((other_value.tLLI().ispresent() ? !single_value->field_tLLI.match((const TLLI__BSSGP&)other_value.tLLI(), legacy) : !single_value->field_tLLI.match_omit(legacy)))return FALSE;
if(!other_value.channel__needed().is_bound()) return FALSE;
if((other_value.channel__needed().ispresent() ? !single_value->field_channel__needed.match((const Channel__needed&)other_value.channel__needed(), legacy) : !single_value->field_channel__needed.match_omit(legacy)))return FALSE;
if(!other_value.eMLPP__Priority().is_bound()) return FALSE;
if((other_value.eMLPP__Priority().ispresent() ? !single_value->field_eMLPP__Priority.match((const EMLPP__Priority__BSSGP&)other_value.eMLPP__Priority(), legacy) : !single_value->field_eMLPP__Priority.match_omit(legacy)))return FALSE;
if(!other_value.tMSI().is_bound()) return FALSE;
if((other_value.tMSI().ispresent() ? !single_value->field_tMSI.match((const TMSI__BSSGP&)other_value.tMSI(), legacy) : !single_value->field_tMSI.match_omit(legacy)))return FALSE;
if(!other_value.global__CN__Id().is_bound()) return FALSE;
if((other_value.global__CN__Id().ispresent() ? !single_value->field_global__CN__Id.match((const Global__CN__Id__BSSGP&)other_value.global__CN__Id(), legacy) : !single_value->field_global__CN__Id.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 @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
}
return FALSE;
}

boolean PDU__BSSGP__PAGING__CS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_iMSI.is_bound()
 || single_value->field_dRX__Parameters.is_bound()
 || single_value->field_paging__Field4.is_bound()
 || (single_value->field_tLLI.is_omit() || single_value->field_tLLI.is_bound())
 || (single_value->field_channel__needed.is_omit() || single_value->field_channel__needed.is_bound())
 || (single_value->field_eMLPP__Priority.is_omit() || single_value->field_eMLPP__Priority.is_bound())
 || (single_value->field_tMSI.is_omit() || single_value->field_tMSI.is_bound())
 || (single_value->field_global__CN__Id.is_omit() || single_value->field_global__CN__Id.is_bound());
}

boolean PDU__BSSGP__PAGING__CS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_iMSI.is_value()
 && single_value->field_dRX__Parameters.is_value()
 && single_value->field_paging__Field4.is_value()
 && (single_value->field_tLLI.is_omit() || single_value->field_tLLI.is_value())
 && (single_value->field_channel__needed.is_omit() || single_value->field_channel__needed.is_value())
 && (single_value->field_eMLPP__Priority.is_omit() || single_value->field_eMLPP__Priority.is_value())
 && (single_value->field_tMSI.is_omit() || single_value->field_tMSI.is_value())
 && (single_value->field_global__CN__Id.is_omit() || single_value->field_global__CN__Id.is_value());
}

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

PDU__BSSGP__PAGING__CS PDU__BSSGP__PAGING__CS_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 @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
PDU__BSSGP__PAGING__CS ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_dRX__Parameters.is_bound()) {
ret_val.dRX__Parameters() = single_value->field_dRX__Parameters.valueof();
}
if (single_value->field_paging__Field4.is_bound()) {
ret_val.paging__Field4() = single_value->field_paging__Field4.valueof();
}
if (single_value->field_tLLI.is_omit()) ret_val.tLLI() = OMIT_VALUE;
else if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_channel__needed.is_omit()) ret_val.channel__needed() = OMIT_VALUE;
else if (single_value->field_channel__needed.is_bound()) {
ret_val.channel__needed() = single_value->field_channel__needed.valueof();
}
if (single_value->field_eMLPP__Priority.is_omit()) ret_val.eMLPP__Priority() = OMIT_VALUE;
else if (single_value->field_eMLPP__Priority.is_bound()) {
ret_val.eMLPP__Priority() = single_value->field_eMLPP__Priority.valueof();
}
if (single_value->field_tMSI.is_omit()) ret_val.tMSI() = OMIT_VALUE;
else if (single_value->field_tMSI.is_bound()) {
ret_val.tMSI() = single_value->field_tMSI.valueof();
}
if (single_value->field_global__CN__Id.is_omit()) ret_val.global__CN__Id() = OMIT_VALUE;
else if (single_value->field_global__CN__Id.is_bound()) {
ret_val.global__CN__Id() = single_value->field_global__CN__Id.valueof();
}
return ret_val;
}

void PDU__BSSGP__PAGING__CS_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 @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__PAGING__CS_template[list_length];
}

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

OCTETSTRING_template& PDU__BSSGP__PAGING__CS_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__PAGING__CS_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
return single_value->field_bssgpPduType;
}

IMSI__BSSGP_template& PDU__BSSGP__PAGING__CS_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__PAGING__CS_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
return single_value->field_iMSI;
}

DRX__Parameters_template& PDU__BSSGP__PAGING__CS_template::dRX__Parameters()
{
set_specific();
return single_value->field_dRX__Parameters;
}

const DRX__Parameters_template& PDU__BSSGP__PAGING__CS_template::dRX__Parameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dRX_Parameters of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
return single_value->field_dRX__Parameters;
}

Paging__Field4_template& PDU__BSSGP__PAGING__CS_template::paging__Field4()
{
set_specific();
return single_value->field_paging__Field4;
}

const Paging__Field4_template& PDU__BSSGP__PAGING__CS_template::paging__Field4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paging_Field4 of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
return single_value->field_paging__Field4;
}

TLLI__BSSGP_template& PDU__BSSGP__PAGING__CS_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__PAGING__CS_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
return single_value->field_tLLI;
}

Channel__needed_template& PDU__BSSGP__PAGING__CS_template::channel__needed()
{
set_specific();
return single_value->field_channel__needed;
}

const Channel__needed_template& PDU__BSSGP__PAGING__CS_template::channel__needed() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field channel_needed of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
return single_value->field_channel__needed;
}

EMLPP__Priority__BSSGP_template& PDU__BSSGP__PAGING__CS_template::eMLPP__Priority()
{
set_specific();
return single_value->field_eMLPP__Priority;
}

const EMLPP__Priority__BSSGP_template& PDU__BSSGP__PAGING__CS_template::eMLPP__Priority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eMLPP_Priority of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
return single_value->field_eMLPP__Priority;
}

TMSI__BSSGP_template& PDU__BSSGP__PAGING__CS_template::tMSI()
{
set_specific();
return single_value->field_tMSI;
}

const TMSI__BSSGP_template& PDU__BSSGP__PAGING__CS_template::tMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
return single_value->field_tMSI;
}

Global__CN__Id__BSSGP_template& PDU__BSSGP__PAGING__CS_template::global__CN__Id()
{
set_specific();
return single_value->field_global__CN__Id;
}

const Global__CN__Id__BSSGP_template& PDU__BSSGP__PAGING__CS_template::global__CN__Id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field global_CN_Id of a non-specific template of type @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
return single_value->field_global__CN__Id;
}

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

void PDU__BSSGP__PAGING__CS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", dRX_Parameters := ");
single_value->field_dRX__Parameters.log();
TTCN_Logger::log_event_str(", paging_Field4 := ");
single_value->field_paging__Field4.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", channel_needed := ");
single_value->field_channel__needed.log();
TTCN_Logger::log_event_str(", eMLPP_Priority := ");
single_value->field_eMLPP__Priority.log();
TTCN_Logger::log_event_str(", tMSI := ");
single_value->field_tMSI.log();
TTCN_Logger::log_event_str(", global_CN_Id := ");
single_value->field_global__CN__Id.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__PAGING__CS_template::log_match(const PDU__BSSGP__PAGING__CS& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dRX__Parameters.match(match_value.dRX__Parameters(), legacy)){
TTCN_Logger::log_logmatch_info(".dRX_Parameters");
single_value->field_dRX__Parameters.log_match(match_value.dRX__Parameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_paging__Field4.match(match_value.paging__Field4(), legacy)){
TTCN_Logger::log_logmatch_info(".paging_Field4");
single_value->field_paging__Field4.log_match(match_value.paging__Field4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tLLI().ispresent()){
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tLLI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tLLI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.channel__needed().ispresent()){
if(!single_value->field_channel__needed.match(match_value.channel__needed(), legacy)){
TTCN_Logger::log_logmatch_info(".channel_needed");
single_value->field_channel__needed.log_match(match_value.channel__needed(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_channel__needed.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".channel_needed := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_channel__needed.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eMLPP__Priority().ispresent()){
if(!single_value->field_eMLPP__Priority.match(match_value.eMLPP__Priority(), legacy)){
TTCN_Logger::log_logmatch_info(".eMLPP_Priority");
single_value->field_eMLPP__Priority.log_match(match_value.eMLPP__Priority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eMLPP__Priority.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eMLPP_Priority := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eMLPP__Priority.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tMSI().ispresent()){
if(!single_value->field_tMSI.match(match_value.tMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".tMSI");
single_value->field_tMSI.log_match(match_value.tMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.global__CN__Id().ispresent()){
if(!single_value->field_global__CN__Id.match(match_value.global__CN__Id(), legacy)){
TTCN_Logger::log_logmatch_info(".global_CN_Id");
single_value->field_global__CN__Id.log_match(match_value.global__CN__Id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_global__CN__Id.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".global_CN_Id := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_global__CN__Id.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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::log_event_str(", dRX_Parameters := ");
single_value->field_dRX__Parameters.log_match(match_value.dRX__Parameters(), legacy);
TTCN_Logger::log_event_str(", paging_Field4 := ");
single_value->field_paging__Field4.log_match(match_value.paging__Field4(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
if (match_value.tLLI().ispresent()) {
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tLLI.log();
if (single_value->field_tLLI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", channel_needed := ");
if (match_value.channel__needed().ispresent()) {
single_value->field_channel__needed.log_match(match_value.channel__needed(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_channel__needed.log();
if (single_value->field_channel__needed.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eMLPP_Priority := ");
if (match_value.eMLPP__Priority().ispresent()) {
single_value->field_eMLPP__Priority.log_match(match_value.eMLPP__Priority(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eMLPP__Priority.log();
if (single_value->field_eMLPP__Priority.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tMSI := ");
if (match_value.tMSI().ispresent()) {
single_value->field_tMSI.log_match(match_value.tMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tMSI.log();
if (single_value->field_tMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", global_CN_Id := ");
if (match_value.global__CN__Id().ispresent()) {
single_value->field_global__CN__Id.log_match(match_value.global__CN__Id(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_global__CN__Id.log();
if (single_value->field_global__CN__Id.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__PAGING__CS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_iMSI.encode_text(text_buf);
single_value->field_dRX__Parameters.encode_text(text_buf);
single_value->field_paging__Field4.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_channel__needed.encode_text(text_buf);
single_value->field_eMLPP__Priority.encode_text(text_buf);
single_value->field_tMSI.encode_text(text_buf);
single_value->field_global__CN__Id.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 @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
}
}

void PDU__BSSGP__PAGING__CS_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_bssgpPduType.decode_text(text_buf);
single_value->field_iMSI.decode_text(text_buf);
single_value->field_dRX__Parameters.decode_text(text_buf);
single_value->field_paging__Field4.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_channel__needed.decode_text(text_buf);
single_value->field_eMLPP__Priority.decode_text(text_buf);
single_value->field_tMSI.decode_text(text_buf);
single_value->field_global__CN__Id.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__PAGING__CS_template[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 @BSSGP_Types.PDU_BSSGP_PAGING_CS.");
}
}

void PDU__BSSGP__PAGING__CS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__PAGING__CS_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 @BSSGP_Types.PDU_BSSGP_PAGING_CS 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dRX__Parameters().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) paging__Field4().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) channel__needed().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) eMLPP__Priority().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) tMSI().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) global__CN__Id().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dRX_Parameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dRX__Parameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paging_Field4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paging__Field4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "channel_needed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          channel__needed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eMLPP_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eMLPP__Priority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "global_CN_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          global__CN__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_PAGING_CS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__PAGING__CS_template* precondition = new PDU__BSSGP__PAGING__CS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__PAGING__CS_template* implied_template = new PDU__BSSGP__PAGING__CS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__PAGING__CS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__PAGING__CS_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
single_value->field_iMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
single_value->field_dRX__Parameters.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
single_value->field_paging__Field4.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
single_value->field_channel__needed.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
single_value->field_eMLPP__Priority.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
single_value->field_tMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
single_value->field_global__CN__Id.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
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 : "@BSSGP_Types.PDU_BSSGP_PAGING_CS");
}

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

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

PDU__BSSGP__RA__CAPABILITY__UPDATE::PDU__BSSGP__RA__CAPABILITY__UPDATE()
{
}

PDU__BSSGP__RA__CAPABILITY__UPDATE::PDU__BSSGP__RA__CAPABILITY__UPDATE(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Tag& par_tag)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_tag(par_tag)
{
}

PDU__BSSGP__RA__CAPABILITY__UPDATE::PDU__BSSGP__RA__CAPABILITY__UPDATE(const PDU__BSSGP__RA__CAPABILITY__UPDATE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_tag.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__RA__CAPABILITY__UPDATE::get_descriptor() const { return &PDU__BSSGP__RA__CAPABILITY__UPDATE_descr_; }
PDU__BSSGP__RA__CAPABILITY__UPDATE& PDU__BSSGP__RA__CAPABILITY__UPDATE::operator=(const PDU__BSSGP__RA__CAPABILITY__UPDATE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
}
return *this;
}

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE::operator==(const PDU__BSSGP__RA__CAPABILITY__UPDATE& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_tag==other_value.field_tag;
}

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_tag.is_bound());
}
boolean PDU__BSSGP__RA__CAPABILITY__UPDATE::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_tag.is_value();
}
void PDU__BSSGP__RA__CAPABILITY__UPDATE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
field_tag.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (tag().is_bound()) tag().set_implicit_omit();
}

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

void PDU__BSSGP__RA__CAPABILITY__UPDATE::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_tag.encode_text(text_buf);
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_tag.decode_text(text_buf);
}

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

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

int PDU__BSSGP__RA__CAPABILITY__UPDATE::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_bssgpPduType.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, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_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, Tag_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(Tag_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 (field_bssgpPduType !=  os_21) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__RA__CAPABILITY__UPDATE::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Tag_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tag.RAW_encode(Tag_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_21) {
  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_21.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__RA__CAPABILITY__UPDATE_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Tag_template field_tag;
};

void PDU__BSSGP__RA__CAPABILITY__UPDATE_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_tag = ANY_VALUE;
}
}
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE_template::copy_value(const PDU__BSSGP__RA__CAPABILITY__UPDATE& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE_template::copy_template(const PDU__BSSGP__RA__CAPABILITY__UPDATE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__RA__CAPABILITY__UPDATE_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__RA__CAPABILITY__UPDATE_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__RA__CAPABILITY__UPDATE_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__RA__CAPABILITY__UPDATE_template::PDU__BSSGP__RA__CAPABILITY__UPDATE_template()
{
}

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

PDU__BSSGP__RA__CAPABILITY__UPDATE_template::PDU__BSSGP__RA__CAPABILITY__UPDATE_template(const PDU__BSSGP__RA__CAPABILITY__UPDATE& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__BSSGP__RA__CAPABILITY__UPDATE_template& PDU__BSSGP__RA__CAPABILITY__UPDATE_template::operator=(const OPTIONAL<PDU__BSSGP__RA__CAPABILITY__UPDATE>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RA__CAPABILITY__UPDATE&)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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
}
return *this;
}

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

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE_template::match(const PDU__BSSGP__RA__CAPABILITY__UPDATE& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), 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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
}
return FALSE;
}

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_tag.is_bound();
}

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_tag.is_value();
}

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

PDU__BSSGP__RA__CAPABILITY__UPDATE PDU__BSSGP__RA__CAPABILITY__UPDATE_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
PDU__BSSGP__RA__CAPABILITY__UPDATE ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
return ret_val;
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__RA__CAPABILITY__UPDATE_template[list_length];
}

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

OCTETSTRING_template& PDU__BSSGP__RA__CAPABILITY__UPDATE_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__RA__CAPABILITY__UPDATE_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__RA__CAPABILITY__UPDATE_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__RA__CAPABILITY__UPDATE_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
return single_value->field_tLLI;
}

Tag_template& PDU__BSSGP__RA__CAPABILITY__UPDATE_template::tag()
{
set_specific();
return single_value->field_tag;
}

const Tag_template& PDU__BSSGP__RA__CAPABILITY__UPDATE_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
return single_value->field_tag;
}

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

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

void PDU__BSSGP__RA__CAPABILITY__UPDATE_template::log_match(const PDU__BSSGP__RA__CAPABILITY__UPDATE& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), 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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_tag.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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
}
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_tag.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__RA__CAPABILITY__UPDATE_template[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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE.");
}
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__RA__CAPABILITY__UPDATE_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tag().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__RA__CAPABILITY__UPDATE_template* precondition = new PDU__BSSGP__RA__CAPABILITY__UPDATE_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__RA__CAPABILITY__UPDATE_template* implied_template = new PDU__BSSGP__RA__CAPABILITY__UPDATE_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__RA__CAPABILITY__UPDATE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE");
single_value->field_tag.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE");
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 : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE");
}

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

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

PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK()
{
}

PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Tag& par_tag,
    const OPTIONAL< IMSI__BSSGP >& par_iMSI,
    const RA__Cap__UPD__CAUSE& par_rA__Cap__UPDATE__CAUSE,
    const OPTIONAL< MS__Radio__Access__Capability >& par_mS__Radio__Access__Capability)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_tag(par_tag),
  field_iMSI(par_iMSI),
  field_rA__Cap__UPDATE__CAUSE(par_rA__Cap__UPDATE__CAUSE),
  field_mS__Radio__Access__Capability(par_mS__Radio__Access__Capability)
{
}

PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK(const PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.rA__Cap__UPDATE__CAUSE().is_bound()) field_rA__Cap__UPDATE__CAUSE = other_value.rA__Cap__UPDATE__CAUSE();
else field_rA__Cap__UPDATE__CAUSE.clean_up();
if (other_value.mS__Radio__Access__Capability().is_bound()) field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
else field_mS__Radio__Access__Capability.clean_up();
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_tag.clean_up();
field_iMSI.clean_up();
field_rA__Cap__UPDATE__CAUSE.clean_up();
field_mS__Radio__Access__Capability.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::get_descriptor() const { return &PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_descr_; }
PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::operator=(const PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.rA__Cap__UPDATE__CAUSE().is_bound()) field_rA__Cap__UPDATE__CAUSE = other_value.rA__Cap__UPDATE__CAUSE();
  else field_rA__Cap__UPDATE__CAUSE.clean_up();
  if (other_value.mS__Radio__Access__Capability().is_bound()) field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
  else field_mS__Radio__Access__Capability.clean_up();
}
return *this;
}

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::operator==(const PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_tag==other_value.field_tag
  && field_iMSI==other_value.field_iMSI
  && field_rA__Cap__UPDATE__CAUSE==other_value.field_rA__Cap__UPDATE__CAUSE
  && field_mS__Radio__Access__Capability==other_value.field_mS__Radio__Access__Capability;
}

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_tag.is_bound())
  || (OPTIONAL_OMIT == field_iMSI.get_selection() || field_iMSI.is_bound())
  || (field_rA__Cap__UPDATE__CAUSE.is_bound())
  || (OPTIONAL_OMIT == field_mS__Radio__Access__Capability.get_selection() || field_mS__Radio__Access__Capability.is_bound());
}
boolean PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_tag.is_value()
  && (OPTIONAL_OMIT == field_iMSI.get_selection() || field_iMSI.is_value())
  && field_rA__Cap__UPDATE__CAUSE.is_value()
  && (OPTIONAL_OMIT == field_mS__Radio__Access__Capability.get_selection() || field_mS__Radio__Access__Capability.is_value());
}
int PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::size_of() const
{
  int ret_val = 4;
  if (field_iMSI.ispresent()) ret_val++;
  if (field_mS__Radio__Access__Capability.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", rA_Cap_UPDATE_CAUSE := ");
field_rA__Cap__UPDATE__CAUSE.log();
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (tag().is_bound()) tag().set_implicit_omit();
if (!iMSI().is_bound()) iMSI() = OMIT_VALUE;
else iMSI().set_implicit_omit();
if (rA__Cap__UPDATE__CAUSE().is_bound()) rA__Cap__UPDATE__CAUSE().set_implicit_omit();
if (!mS__Radio__Access__Capability().is_bound()) mS__Radio__Access__Capability() = OMIT_VALUE;
else mS__Radio__Access__Capability().set_implicit_omit();
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rA__Cap__UPDATE__CAUSE().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mS__Radio__Access__Capability().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rA_Cap_UPDATE_CAUSE")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rA__Cap__UPDATE__CAUSE().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Radio_Access_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Radio__Access__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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK");
  }
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_tag.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_rA__Cap__UPDATE__CAUSE.encode_text(text_buf);
field_mS__Radio__Access__Capability.encode_text(text_buf);
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_tag.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_rA__Cap__UPDATE__CAUSE.decode_text(text_buf);
field_mS__Radio__Access__Capability.decode_text(text_buf);
}

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

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

int PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::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_bssgpPduType.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, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_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, Tag_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(Tag_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_iMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI().RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_iMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iMSI=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, RA__Cap__UPD__CAUSE_descr_.raw->forceomit);
  decoded_field_length = field_rA__Cap__UPDATE__CAUSE.RAW_decode(RA__Cap__UPD__CAUSE_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_mS__Radio__Access__Capability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MS__Radio__Access__Capability_descr_.raw->forceomit);
  decoded_field_length = field_mS__Radio__Access__Capability().RAW_decode(MS__Radio__Access__Capability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_mS__Radio__Access__Capability = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_mS__Radio__Access__Capability=OMIT_VALUE;
  if (field_bssgpPduType !=  os_38) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Tag_descr_.raw);
  if (field_iMSI.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, IMSI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RA__Cap__UPD__CAUSE_descr_.raw);
  if (field_mS__Radio__Access__Capability.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MS__Radio__Access__Capability_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tag.RAW_encode(Tag_descr_, *myleaf.body.node.nodes[2]);
  if (field_iMSI.ispresent()) {
  encoded_length += field_iMSI().RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_rA__Cap__UPDATE__CAUSE.RAW_encode(RA__Cap__UPD__CAUSE_descr_, *myleaf.body.node.nodes[4]);
  if (field_mS__Radio__Access__Capability.ispresent()) {
  encoded_length += field_mS__Radio__Access__Capability().RAW_encode(MS__Radio__Access__Capability_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_bssgpPduType !=  os_38) {
  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_38.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Tag_template field_tag;
IMSI__BSSGP_template field_iMSI;
RA__Cap__UPD__CAUSE_template field_rA__Cap__UPDATE__CAUSE;
MS__Radio__Access__Capability_template field_mS__Radio__Access__Capability;
};

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_tag = ANY_VALUE;
single_value->field_iMSI = ANY_OR_OMIT;
single_value->field_rA__Cap__UPDATE__CAUSE = ANY_VALUE;
single_value->field_mS__Radio__Access__Capability = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::copy_value(const PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.iMSI().is_bound()) {
  if (other_value.iMSI().ispresent()) single_value->field_iMSI = other_value.iMSI()();
  else single_value->field_iMSI = OMIT_VALUE;
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.rA__Cap__UPDATE__CAUSE().is_bound()) {
  single_value->field_rA__Cap__UPDATE__CAUSE = other_value.rA__Cap__UPDATE__CAUSE();
} else {
  single_value->field_rA__Cap__UPDATE__CAUSE.clean_up();
}
if (other_value.mS__Radio__Access__Capability().is_bound()) {
  if (other_value.mS__Radio__Access__Capability().ispresent()) single_value->field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability()();
  else single_value->field_mS__Radio__Access__Capability = OMIT_VALUE;
} else {
  single_value->field_mS__Radio__Access__Capability.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::copy_template(const PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rA__Cap__UPDATE__CAUSE().get_selection()) {
single_value->field_rA__Cap__UPDATE__CAUSE = other_value.rA__Cap__UPDATE__CAUSE();
} else {
single_value->field_rA__Cap__UPDATE__CAUSE.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__Radio__Access__Capability().get_selection()) {
single_value->field_mS__Radio__Access__Capability = other_value.mS__Radio__Access__Capability();
} else {
single_value->field_mS__Radio__Access__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 PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template()
{
}

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

PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template(const PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::operator=(const OPTIONAL<PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK&)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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
}
return *this;
}

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

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::match(const PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if((other_value.iMSI().ispresent() ? !single_value->field_iMSI.match((const IMSI__BSSGP&)other_value.iMSI(), legacy) : !single_value->field_iMSI.match_omit(legacy)))return FALSE;
if(!other_value.rA__Cap__UPDATE__CAUSE().is_bound()) return FALSE;
if(!single_value->field_rA__Cap__UPDATE__CAUSE.match(other_value.rA__Cap__UPDATE__CAUSE(), legacy))return FALSE;
if(!other_value.mS__Radio__Access__Capability().is_bound()) return FALSE;
if((other_value.mS__Radio__Access__Capability().ispresent() ? !single_value->field_mS__Radio__Access__Capability.match((const MS__Radio__Access__Capability&)other_value.mS__Radio__Access__Capability(), legacy) : !single_value->field_mS__Radio__Access__Capability.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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_tag.is_bound()
 || (single_value->field_iMSI.is_omit() || single_value->field_iMSI.is_bound())
 || single_value->field_rA__Cap__UPDATE__CAUSE.is_bound()
 || (single_value->field_mS__Radio__Access__Capability.is_omit() || single_value->field_mS__Radio__Access__Capability.is_bound());
}

boolean PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_tag.is_value()
 && (single_value->field_iMSI.is_omit() || single_value->field_iMSI.is_value())
 && single_value->field_rA__Cap__UPDATE__CAUSE.is_value()
 && (single_value->field_mS__Radio__Access__Capability.is_omit() || single_value->field_mS__Radio__Access__Capability.is_value());
}

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

PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_iMSI.is_omit()) ret_val.iMSI() = OMIT_VALUE;
else if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_rA__Cap__UPDATE__CAUSE.is_bound()) {
ret_val.rA__Cap__UPDATE__CAUSE() = single_value->field_rA__Cap__UPDATE__CAUSE.valueof();
}
if (single_value->field_mS__Radio__Access__Capability.is_omit()) ret_val.mS__Radio__Access__Capability() = OMIT_VALUE;
else if (single_value->field_mS__Radio__Access__Capability.is_bound()) {
ret_val.mS__Radio__Access__Capability() = single_value->field_mS__Radio__Access__Capability.valueof();
}
return ret_val;
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template[list_length];
}

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

OCTETSTRING_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
return single_value->field_tLLI;
}

Tag_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::tag()
{
set_specific();
return single_value->field_tag;
}

const Tag_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
return single_value->field_tag;
}

IMSI__BSSGP_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
return single_value->field_iMSI;
}

RA__Cap__UPD__CAUSE_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::rA__Cap__UPDATE__CAUSE()
{
set_specific();
return single_value->field_rA__Cap__UPDATE__CAUSE;
}

const RA__Cap__UPD__CAUSE_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::rA__Cap__UPDATE__CAUSE() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rA_Cap_UPDATE_CAUSE of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
return single_value->field_rA__Cap__UPDATE__CAUSE;
}

MS__Radio__Access__Capability_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::mS__Radio__Access__Capability()
{
set_specific();
return single_value->field_mS__Radio__Access__Capability;
}

const MS__Radio__Access__Capability_template& PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::mS__Radio__Access__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_Radio_Access_Capability of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
return single_value->field_mS__Radio__Access__Capability;
}

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

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", rA_Cap_UPDATE_CAUSE := ");
single_value->field_rA__Cap__UPDATE__CAUSE.log();
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
single_value->field_mS__Radio__Access__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 PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::log_match(const PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.iMSI().ispresent()){
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_rA__Cap__UPDATE__CAUSE.match(match_value.rA__Cap__UPDATE__CAUSE(), legacy)){
TTCN_Logger::log_logmatch_info(".rA_Cap_UPDATE_CAUSE");
single_value->field_rA__Cap__UPDATE__CAUSE.log_match(match_value.rA__Cap__UPDATE__CAUSE(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mS__Radio__Access__Capability().ispresent()){
if(!single_value->field_mS__Radio__Access__Capability.match(match_value.mS__Radio__Access__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_Radio_Access_Capability");
single_value->field_mS__Radio__Access__Capability.log_match(match_value.mS__Radio__Access__Capability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mS__Radio__Access__Capability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mS_Radio_Access_Capability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mS__Radio__Access__Capability.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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", iMSI := ");
if (match_value.iMSI().ispresent()) {
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iMSI.log();
if (single_value->field_iMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", rA_Cap_UPDATE_CAUSE := ");
single_value->field_rA__Cap__UPDATE__CAUSE.log_match(match_value.rA__Cap__UPDATE__CAUSE(), legacy);
TTCN_Logger::log_event_str(", mS_Radio_Access_Capability := ");
if (match_value.mS__Radio__Access__Capability().ispresent()) {
single_value->field_mS__Radio__Access__Capability.log_match(match_value.mS__Radio__Access__Capability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mS__Radio__Access__Capability.log();
if (single_value->field_mS__Radio__Access__Capability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_tag.encode_text(text_buf);
single_value->field_iMSI.encode_text(text_buf);
single_value->field_rA__Cap__UPDATE__CAUSE.encode_text(text_buf);
single_value->field_mS__Radio__Access__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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
}
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_tag.decode_text(text_buf);
single_value->field_iMSI.decode_text(text_buf);
single_value->field_rA__Cap__UPDATE__CAUSE.decode_text(text_buf);
single_value->field_mS__Radio__Access__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 PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template[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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.");
}
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rA__Cap__UPDATE__CAUSE().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mS__Radio__Access__Capability().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rA_Cap_UPDATE_CAUSE")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rA__Cap__UPDATE__CAUSE().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_Radio_Access_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__Radio__Access__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 @BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template* precondition = new PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template* implied_template = new PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK");
single_value->field_tag.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK");
single_value->field_iMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK");
single_value->field_rA__Cap__UPDATE__CAUSE.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK");
single_value->field_mS__Radio__Access__Capability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK");
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 : "@BSSGP_Types.PDU_BSSGP_RA_CAPABILITY_UPDATE_ACK");
}

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

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

PDU__BSSGP__RADIO__STATUS::PDU__BSSGP__RADIO__STATUS()
{
}

PDU__BSSGP__RADIO__STATUS::PDU__BSSGP__RADIO__STATUS(const OCTETSTRING& par_bssgpPduType,
    const OPTIONAL< TLLI__BSSGP >& par_tLLI,
    const OPTIONAL< TMSI__BSSGP >& par_tMSI,
    const OPTIONAL< IMSI__BSSGP >& par_iMSI,
    const Radio__Cause& par_radio__Cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_tMSI(par_tMSI),
  field_iMSI(par_iMSI),
  field_radio__Cause(par_radio__Cause)
{
}

PDU__BSSGP__RADIO__STATUS::PDU__BSSGP__RADIO__STATUS(const PDU__BSSGP__RADIO__STATUS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.tMSI().is_bound()) field_tMSI = other_value.tMSI();
else field_tMSI.clean_up();
if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
else field_iMSI.clean_up();
if (other_value.radio__Cause().is_bound()) field_radio__Cause = other_value.radio__Cause();
else field_radio__Cause.clean_up();
}

void PDU__BSSGP__RADIO__STATUS::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_tMSI.clean_up();
field_iMSI.clean_up();
field_radio__Cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__RADIO__STATUS::get_descriptor() const { return &PDU__BSSGP__RADIO__STATUS_descr_; }
PDU__BSSGP__RADIO__STATUS& PDU__BSSGP__RADIO__STATUS::operator=(const PDU__BSSGP__RADIO__STATUS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.tMSI().is_bound()) field_tMSI = other_value.tMSI();
  else field_tMSI.clean_up();
  if (other_value.iMSI().is_bound()) field_iMSI = other_value.iMSI();
  else field_iMSI.clean_up();
  if (other_value.radio__Cause().is_bound()) field_radio__Cause = other_value.radio__Cause();
  else field_radio__Cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__RADIO__STATUS::operator==(const PDU__BSSGP__RADIO__STATUS& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_tMSI==other_value.field_tMSI
  && field_iMSI==other_value.field_iMSI
  && field_radio__Cause==other_value.field_radio__Cause;
}

boolean PDU__BSSGP__RADIO__STATUS::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (OPTIONAL_OMIT == field_tLLI.get_selection() || field_tLLI.is_bound())
  || (OPTIONAL_OMIT == field_tMSI.get_selection() || field_tMSI.is_bound())
  || (OPTIONAL_OMIT == field_iMSI.get_selection() || field_iMSI.is_bound())
  || (field_radio__Cause.is_bound());
}
boolean PDU__BSSGP__RADIO__STATUS::is_value() const
{
return field_bssgpPduType.is_value()
  && (OPTIONAL_OMIT == field_tLLI.get_selection() || field_tLLI.is_value())
  && (OPTIONAL_OMIT == field_tMSI.get_selection() || field_tMSI.is_value())
  && (OPTIONAL_OMIT == field_iMSI.get_selection() || field_iMSI.is_value())
  && field_radio__Cause.is_value();
}
int PDU__BSSGP__RADIO__STATUS::size_of() const
{
  int ret_val = 2;
  if (field_tLLI.ispresent()) ret_val++;
  if (field_tMSI.ispresent()) ret_val++;
  if (field_iMSI.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__RADIO__STATUS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", tMSI := ");
field_tMSI.log();
TTCN_Logger::log_event_str(", iMSI := ");
field_iMSI.log();
TTCN_Logger::log_event_str(", radio_Cause := ");
field_radio__Cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__RADIO__STATUS::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (!tLLI().is_bound()) tLLI() = OMIT_VALUE;
else tLLI().set_implicit_omit();
if (!tMSI().is_bound()) tMSI() = OMIT_VALUE;
else tMSI().set_implicit_omit();
if (!iMSI().is_bound()) iMSI() = OMIT_VALUE;
else iMSI().set_implicit_omit();
if (radio__Cause().is_bound()) radio__Cause().set_implicit_omit();
}

void PDU__BSSGP__RADIO__STATUS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) radio__Cause().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radio_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radio__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_RADIO_STATUS");
  }
}

void PDU__BSSGP__RADIO__STATUS::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_tMSI.encode_text(text_buf);
field_iMSI.encode_text(text_buf);
field_radio__Cause.encode_text(text_buf);
}

void PDU__BSSGP__RADIO__STATUS::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_tMSI.decode_text(text_buf);
field_iMSI.decode_text(text_buf);
field_radio__Cause.decode_text(text_buf);
}

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

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

int PDU__BSSGP__RADIO__STATUS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_bssgpPduType.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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_tLLI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI().RAW_decode(TLLI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_tLLI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_tLLI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_tMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, TMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tMSI().RAW_decode(TMSI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_tMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_tMSI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_iMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, IMSI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_iMSI().RAW_decode(IMSI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_iMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iMSI=OMIT_VALUE;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Radio__Cause_descr_.raw->forceomit);
  decoded_field_length = field_radio__Cause.RAW_decode(Radio__Cause_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 (field_bssgpPduType !=  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 PDU__BSSGP__RADIO__STATUS::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  if (field_tLLI.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_tMSI.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, TMSI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_iMSI.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, IMSI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Radio__Cause_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  if (field_tLLI.ispresent()) {
  encoded_length += field_tLLI().RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_tMSI.ispresent()) {
  encoded_length += field_tMSI().RAW_encode(TMSI__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_iMSI.ispresent()) {
  encoded_length += field_iMSI().RAW_encode(IMSI__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  }
  encoded_length += field_radio__Cause.RAW_encode(Radio__Cause_descr_, *myleaf.body.node.nodes[4]);
  if (field_bssgpPduType !=  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 PDU__BSSGP__RADIO__STATUS_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
TMSI__BSSGP_template field_tMSI;
IMSI__BSSGP_template field_iMSI;
Radio__Cause_template field_radio__Cause;
};

void PDU__BSSGP__RADIO__STATUS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_OR_OMIT;
single_value->field_tMSI = ANY_OR_OMIT;
single_value->field_iMSI = ANY_OR_OMIT;
single_value->field_radio__Cause = ANY_VALUE;
}
}
}

void PDU__BSSGP__RADIO__STATUS_template::copy_value(const PDU__BSSGP__RADIO__STATUS& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  if (other_value.tLLI().ispresent()) single_value->field_tLLI = other_value.tLLI()();
  else single_value->field_tLLI = OMIT_VALUE;
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.tMSI().is_bound()) {
  if (other_value.tMSI().ispresent()) single_value->field_tMSI = other_value.tMSI()();
  else single_value->field_tMSI = OMIT_VALUE;
} else {
  single_value->field_tMSI.clean_up();
}
if (other_value.iMSI().is_bound()) {
  if (other_value.iMSI().ispresent()) single_value->field_iMSI = other_value.iMSI()();
  else single_value->field_iMSI = OMIT_VALUE;
} else {
  single_value->field_iMSI.clean_up();
}
if (other_value.radio__Cause().is_bound()) {
  single_value->field_radio__Cause = other_value.radio__Cause();
} else {
  single_value->field_radio__Cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__RADIO__STATUS_template::copy_template(const PDU__BSSGP__RADIO__STATUS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tMSI().get_selection()) {
single_value->field_tMSI = other_value.tMSI();
} else {
single_value->field_tMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iMSI().get_selection()) {
single_value->field_iMSI = other_value.iMSI();
} else {
single_value->field_iMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.radio__Cause().get_selection()) {
single_value->field_radio__Cause = other_value.radio__Cause();
} else {
single_value->field_radio__Cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__RADIO__STATUS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__RADIO__STATUS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__RADIO__STATUS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__RADIO__STATUS_template::PDU__BSSGP__RADIO__STATUS_template()
{
}

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

PDU__BSSGP__RADIO__STATUS_template::PDU__BSSGP__RADIO__STATUS_template(const PDU__BSSGP__RADIO__STATUS& other_value)
{
copy_value(other_value);
}

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

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

PDU__BSSGP__RADIO__STATUS_template::PDU__BSSGP__RADIO__STATUS_template(Dynamic_Match_Interface<PDU__BSSGP__RADIO__STATUS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__RADIO__STATUS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__RADIO__STATUS_template::PDU__BSSGP__RADIO__STATUS_template(const PDU__BSSGP__RADIO__STATUS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__RADIO__STATUS_template::~PDU__BSSGP__RADIO__STATUS_template()
{
clean_up();
}

PDU__BSSGP__RADIO__STATUS_template& PDU__BSSGP__RADIO__STATUS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__RADIO__STATUS_template& PDU__BSSGP__RADIO__STATUS_template::operator=(const PDU__BSSGP__RADIO__STATUS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__RADIO__STATUS_template& PDU__BSSGP__RADIO__STATUS_template::operator=(const OPTIONAL<PDU__BSSGP__RADIO__STATUS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RADIO__STATUS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
}
return *this;
}

PDU__BSSGP__RADIO__STATUS_template& PDU__BSSGP__RADIO__STATUS_template::operator=(const PDU__BSSGP__RADIO__STATUS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__RADIO__STATUS_template::match(const PDU__BSSGP__RADIO__STATUS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if((other_value.tLLI().ispresent() ? !single_value->field_tLLI.match((const TLLI__BSSGP&)other_value.tLLI(), legacy) : !single_value->field_tLLI.match_omit(legacy)))return FALSE;
if(!other_value.tMSI().is_bound()) return FALSE;
if((other_value.tMSI().ispresent() ? !single_value->field_tMSI.match((const TMSI__BSSGP&)other_value.tMSI(), legacy) : !single_value->field_tMSI.match_omit(legacy)))return FALSE;
if(!other_value.iMSI().is_bound()) return FALSE;
if((other_value.iMSI().ispresent() ? !single_value->field_iMSI.match((const IMSI__BSSGP&)other_value.iMSI(), legacy) : !single_value->field_iMSI.match_omit(legacy)))return FALSE;
if(!other_value.radio__Cause().is_bound()) return FALSE;
if(!single_value->field_radio__Cause.match(other_value.radio__Cause(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
}
return FALSE;
}

boolean PDU__BSSGP__RADIO__STATUS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || (single_value->field_tLLI.is_omit() || single_value->field_tLLI.is_bound())
 || (single_value->field_tMSI.is_omit() || single_value->field_tMSI.is_bound())
 || (single_value->field_iMSI.is_omit() || single_value->field_iMSI.is_bound())
 || single_value->field_radio__Cause.is_bound();
}

boolean PDU__BSSGP__RADIO__STATUS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && (single_value->field_tLLI.is_omit() || single_value->field_tLLI.is_value())
 && (single_value->field_tMSI.is_omit() || single_value->field_tMSI.is_value())
 && (single_value->field_iMSI.is_omit() || single_value->field_iMSI.is_value())
 && single_value->field_radio__Cause.is_value();
}

void PDU__BSSGP__RADIO__STATUS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__RADIO__STATUS PDU__BSSGP__RADIO__STATUS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
PDU__BSSGP__RADIO__STATUS ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_omit()) ret_val.tLLI() = OMIT_VALUE;
else if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_tMSI.is_omit()) ret_val.tMSI() = OMIT_VALUE;
else if (single_value->field_tMSI.is_bound()) {
ret_val.tMSI() = single_value->field_tMSI.valueof();
}
if (single_value->field_iMSI.is_omit()) ret_val.iMSI() = OMIT_VALUE;
else if (single_value->field_iMSI.is_bound()) {
ret_val.iMSI() = single_value->field_iMSI.valueof();
}
if (single_value->field_radio__Cause.is_bound()) {
ret_val.radio__Cause() = single_value->field_radio__Cause.valueof();
}
return ret_val;
}

void PDU__BSSGP__RADIO__STATUS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__RADIO__STATUS_template[list_length];
}

PDU__BSSGP__RADIO__STATUS_template& PDU__BSSGP__RADIO__STATUS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__RADIO__STATUS_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__RADIO__STATUS_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__RADIO__STATUS_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__RADIO__STATUS_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
return single_value->field_tLLI;
}

TMSI__BSSGP_template& PDU__BSSGP__RADIO__STATUS_template::tMSI()
{
set_specific();
return single_value->field_tMSI;
}

const TMSI__BSSGP_template& PDU__BSSGP__RADIO__STATUS_template::tMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
return single_value->field_tMSI;
}

IMSI__BSSGP_template& PDU__BSSGP__RADIO__STATUS_template::iMSI()
{
set_specific();
return single_value->field_iMSI;
}

const IMSI__BSSGP_template& PDU__BSSGP__RADIO__STATUS_template::iMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMSI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
return single_value->field_iMSI;
}

Radio__Cause_template& PDU__BSSGP__RADIO__STATUS_template::radio__Cause()
{
set_specific();
return single_value->field_radio__Cause;
}

const Radio__Cause_template& PDU__BSSGP__RADIO__STATUS_template::radio__Cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radio_Cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
return single_value->field_radio__Cause;
}

int PDU__BSSGP__RADIO__STATUS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_tLLI.is_present()) ret_val++;
      if (single_value->field_tMSI.is_present()) ret_val++;
      if (single_value->field_iMSI.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 @BSSGP_Types.PDU_BSSGP_RADIO_STATUS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
  }
  return 0;
}

void PDU__BSSGP__RADIO__STATUS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", tMSI := ");
single_value->field_tMSI.log();
TTCN_Logger::log_event_str(", iMSI := ");
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(", radio_Cause := ");
single_value->field_radio__Cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__RADIO__STATUS_template::log_match(const PDU__BSSGP__RADIO__STATUS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tLLI().ispresent()){
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tLLI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tLLI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tMSI().ispresent()){
if(!single_value->field_tMSI.match(match_value.tMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".tMSI");
single_value->field_tMSI.log_match(match_value.tMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.iMSI().ispresent()){
if(!single_value->field_iMSI.match(match_value.iMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMSI");
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_radio__Cause.match(match_value.radio__Cause(), legacy)){
TTCN_Logger::log_logmatch_info(".radio_Cause");
single_value->field_radio__Cause.log_match(match_value.radio__Cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
if (match_value.tLLI().ispresent()) {
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tLLI.log();
if (single_value->field_tLLI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tMSI := ");
if (match_value.tMSI().ispresent()) {
single_value->field_tMSI.log_match(match_value.tMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tMSI.log();
if (single_value->field_tMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", iMSI := ");
if (match_value.iMSI().ispresent()) {
single_value->field_iMSI.log_match(match_value.iMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iMSI.log();
if (single_value->field_iMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", radio_Cause := ");
single_value->field_radio__Cause.log_match(match_value.radio__Cause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__RADIO__STATUS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_tMSI.encode_text(text_buf);
single_value->field_iMSI.encode_text(text_buf);
single_value->field_radio__Cause.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
}
}

void PDU__BSSGP__RADIO__STATUS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_tMSI.decode_text(text_buf);
single_value->field_iMSI.decode_text(text_buf);
single_value->field_radio__Cause.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__RADIO__STATUS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS.");
}
}

void PDU__BSSGP__RADIO__STATUS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__RADIO__STATUS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tMSI().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iMSI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) radio__Cause().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radio_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radio__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_RADIO_STATUS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__RADIO__STATUS_template* precondition = new PDU__BSSGP__RADIO__STATUS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__RADIO__STATUS_template* implied_template = new PDU__BSSGP__RADIO__STATUS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__RADIO__STATUS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_RADIO_STATUS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__RADIO__STATUS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RADIO_STATUS");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RADIO_STATUS");
single_value->field_tMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RADIO_STATUS");
single_value->field_iMSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RADIO_STATUS");
single_value->field_radio__Cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RADIO_STATUS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RADIO_STATUS");
}

boolean PDU__BSSGP__RADIO__STATUS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__RADIO__STATUS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__SUSPEND::PDU__BSSGP__SUSPEND()
{
}

PDU__BSSGP__SUSPEND::PDU__BSSGP__SUSPEND(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Routeing__Area& par_routeing__Area)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_routeing__Area(par_routeing__Area)
{
}

PDU__BSSGP__SUSPEND::PDU__BSSGP__SUSPEND(const PDU__BSSGP__SUSPEND& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_SUSPEND.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
else field_routeing__Area.clean_up();
}

void PDU__BSSGP__SUSPEND::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_routeing__Area.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__SUSPEND::get_descriptor() const { return &PDU__BSSGP__SUSPEND_descr_; }
PDU__BSSGP__SUSPEND& PDU__BSSGP__SUSPEND::operator=(const PDU__BSSGP__SUSPEND& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_SUSPEND.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
  else field_routeing__Area.clean_up();
}
return *this;
}

boolean PDU__BSSGP__SUSPEND::operator==(const PDU__BSSGP__SUSPEND& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_routeing__Area==other_value.field_routeing__Area;
}

boolean PDU__BSSGP__SUSPEND::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_routeing__Area.is_bound());
}
boolean PDU__BSSGP__SUSPEND::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_routeing__Area.is_value();
}
void PDU__BSSGP__SUSPEND::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
field_routeing__Area.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__SUSPEND::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (routeing__Area().is_bound()) routeing__Area().set_implicit_omit();
}

void PDU__BSSGP__SUSPEND::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 @BSSGP_Types.PDU_BSSGP_SUSPEND 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_SUSPEND: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_SUSPEND");
  }
}

void PDU__BSSGP__SUSPEND::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_routeing__Area.encode_text(text_buf);
}

void PDU__BSSGP__SUSPEND::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_routeing__Area.decode_text(text_buf);
}

void PDU__BSSGP__SUSPEND::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__SUSPEND::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__SUSPEND::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_bssgpPduType.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, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_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, Routeing__Area_descr_.raw->forceomit);
  decoded_field_length = field_routeing__Area.RAW_decode(Routeing__Area_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 (field_bssgpPduType !=  os_39) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__SUSPEND::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Routeing__Area_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routeing__Area.RAW_encode(Routeing__Area_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_39) {
  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_39.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__SUSPEND_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Routeing__Area_template field_routeing__Area;
};

void PDU__BSSGP__SUSPEND_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_routeing__Area = ANY_VALUE;
}
}
}

void PDU__BSSGP__SUSPEND_template::copy_value(const PDU__BSSGP__SUSPEND& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.routeing__Area().is_bound()) {
  single_value->field_routeing__Area = other_value.routeing__Area();
} else {
  single_value->field_routeing__Area.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__SUSPEND_template::copy_template(const PDU__BSSGP__SUSPEND_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routeing__Area().get_selection()) {
single_value->field_routeing__Area = other_value.routeing__Area();
} else {
single_value->field_routeing__Area.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__SUSPEND_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__SUSPEND_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__SUSPEND_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 @BSSGP_Types.PDU_BSSGP_SUSPEND.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__SUSPEND_template::PDU__BSSGP__SUSPEND_template()
{
}

PDU__BSSGP__SUSPEND_template::PDU__BSSGP__SUSPEND_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__SUSPEND_template::PDU__BSSGP__SUSPEND_template(const PDU__BSSGP__SUSPEND& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__SUSPEND_template::PDU__BSSGP__SUSPEND_template(const OPTIONAL<PDU__BSSGP__SUSPEND>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__SUSPEND&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND from an unbound optional field.");
}
}

PDU__BSSGP__SUSPEND_template::PDU__BSSGP__SUSPEND_template(PDU__BSSGP__SUSPEND_template* p_precondition, PDU__BSSGP__SUSPEND_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__SUSPEND_template::PDU__BSSGP__SUSPEND_template(Dynamic_Match_Interface<PDU__BSSGP__SUSPEND>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__SUSPEND>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__SUSPEND_template::PDU__BSSGP__SUSPEND_template(const PDU__BSSGP__SUSPEND_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__SUSPEND_template::~PDU__BSSGP__SUSPEND_template()
{
clean_up();
}

PDU__BSSGP__SUSPEND_template& PDU__BSSGP__SUSPEND_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__SUSPEND_template& PDU__BSSGP__SUSPEND_template::operator=(const PDU__BSSGP__SUSPEND& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__SUSPEND_template& PDU__BSSGP__SUSPEND_template::operator=(const OPTIONAL<PDU__BSSGP__SUSPEND>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__SUSPEND&)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 @BSSGP_Types.PDU_BSSGP_SUSPEND.");
}
return *this;
}

PDU__BSSGP__SUSPEND_template& PDU__BSSGP__SUSPEND_template::operator=(const PDU__BSSGP__SUSPEND_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__SUSPEND_template::match(const PDU__BSSGP__SUSPEND& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.routeing__Area().is_bound()) return FALSE;
if(!single_value->field_routeing__Area.match(other_value.routeing__Area(), 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 @BSSGP_Types.PDU_BSSGP_SUSPEND.");
}
return FALSE;
}

boolean PDU__BSSGP__SUSPEND_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_routeing__Area.is_bound();
}

boolean PDU__BSSGP__SUSPEND_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_routeing__Area.is_value();
}

void PDU__BSSGP__SUSPEND_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__SUSPEND PDU__BSSGP__SUSPEND_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 @BSSGP_Types.PDU_BSSGP_SUSPEND.");
PDU__BSSGP__SUSPEND ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_routeing__Area.is_bound()) {
ret_val.routeing__Area() = single_value->field_routeing__Area.valueof();
}
return ret_val;
}

void PDU__BSSGP__SUSPEND_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 @BSSGP_Types.PDU_BSSGP_SUSPEND.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__SUSPEND_template[list_length];
}

PDU__BSSGP__SUSPEND_template& PDU__BSSGP__SUSPEND_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 @BSSGP_Types.PDU_BSSGP_SUSPEND.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_SUSPEND.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__SUSPEND_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__SUSPEND_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__SUSPEND_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__SUSPEND_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND.");
return single_value->field_tLLI;
}

Routeing__Area_template& PDU__BSSGP__SUSPEND_template::routeing__Area()
{
set_specific();
return single_value->field_routeing__Area;
}

const Routeing__Area_template& PDU__BSSGP__SUSPEND_template::routeing__Area() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routeing_Area of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND.");
return single_value->field_routeing__Area;
}

int PDU__BSSGP__SUSPEND_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND 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 @BSSGP_Types.PDU_BSSGP_SUSPEND 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 @BSSGP_Types.PDU_BSSGP_SUSPEND containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_SUSPEND.");
  }
  return 0;
}

void PDU__BSSGP__SUSPEND_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__SUSPEND_template::log_match(const PDU__BSSGP__SUSPEND& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routeing__Area.match(match_value.routeing__Area(), legacy)){
TTCN_Logger::log_logmatch_info(".routeing_Area");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), 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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__SUSPEND_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_routeing__Area.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 @BSSGP_Types.PDU_BSSGP_SUSPEND.");
}
}

void PDU__BSSGP__SUSPEND_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_routeing__Area.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__SUSPEND_template[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 @BSSGP_Types.PDU_BSSGP_SUSPEND.");
}
}

void PDU__BSSGP__SUSPEND_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__SUSPEND_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 @BSSGP_Types.PDU_BSSGP_SUSPEND 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_SUSPEND: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__SUSPEND_template* precondition = new PDU__BSSGP__SUSPEND_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__SUSPEND_template* implied_template = new PDU__BSSGP__SUSPEND_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__SUSPEND_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_SUSPEND");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__SUSPEND_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND");
single_value->field_routeing__Area.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND");
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 : "@BSSGP_Types.PDU_BSSGP_SUSPEND");
}

boolean PDU__BSSGP__SUSPEND_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__SUSPEND_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__SUSPEND__ACK::PDU__BSSGP__SUSPEND__ACK()
{
}

PDU__BSSGP__SUSPEND__ACK::PDU__BSSGP__SUSPEND__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Routeing__Area& par_routeing__Area,
    const Suspend__Reference__Number& par_suspend__Reference__Number)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_routeing__Area(par_routeing__Area),
  field_suspend__Reference__Number(par_suspend__Reference__Number)
{
}

PDU__BSSGP__SUSPEND__ACK::PDU__BSSGP__SUSPEND__ACK(const PDU__BSSGP__SUSPEND__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
else field_routeing__Area.clean_up();
if (other_value.suspend__Reference__Number().is_bound()) field_suspend__Reference__Number = other_value.suspend__Reference__Number();
else field_suspend__Reference__Number.clean_up();
}

void PDU__BSSGP__SUSPEND__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_routeing__Area.clean_up();
field_suspend__Reference__Number.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__SUSPEND__ACK::get_descriptor() const { return &PDU__BSSGP__SUSPEND__ACK_descr_; }
PDU__BSSGP__SUSPEND__ACK& PDU__BSSGP__SUSPEND__ACK::operator=(const PDU__BSSGP__SUSPEND__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
  else field_routeing__Area.clean_up();
  if (other_value.suspend__Reference__Number().is_bound()) field_suspend__Reference__Number = other_value.suspend__Reference__Number();
  else field_suspend__Reference__Number.clean_up();
}
return *this;
}

boolean PDU__BSSGP__SUSPEND__ACK::operator==(const PDU__BSSGP__SUSPEND__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_routeing__Area==other_value.field_routeing__Area
  && field_suspend__Reference__Number==other_value.field_suspend__Reference__Number;
}

boolean PDU__BSSGP__SUSPEND__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_routeing__Area.is_bound())
  || (field_suspend__Reference__Number.is_bound());
}
boolean PDU__BSSGP__SUSPEND__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_routeing__Area.is_value()
  && field_suspend__Reference__Number.is_value();
}
void PDU__BSSGP__SUSPEND__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
field_routeing__Area.log();
TTCN_Logger::log_event_str(", suspend_Reference_Number := ");
field_suspend__Reference__Number.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__SUSPEND__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (routeing__Area().is_bound()) routeing__Area().set_implicit_omit();
if (suspend__Reference__Number().is_bound()) suspend__Reference__Number().set_implicit_omit();
}

void PDU__BSSGP__SUSPEND__ACK::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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) suspend__Reference__Number().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "suspend_Reference_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          suspend__Reference__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_SUSPEND_ACK");
  }
}

void PDU__BSSGP__SUSPEND__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_routeing__Area.encode_text(text_buf);
field_suspend__Reference__Number.encode_text(text_buf);
}

void PDU__BSSGP__SUSPEND__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_routeing__Area.decode_text(text_buf);
field_suspend__Reference__Number.decode_text(text_buf);
}

void PDU__BSSGP__SUSPEND__ACK::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__SUSPEND__ACK::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__SUSPEND__ACK::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_bssgpPduType.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, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_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, Routeing__Area_descr_.raw->forceomit);
  decoded_field_length = field_routeing__Area.RAW_decode(Routeing__Area_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, Suspend__Reference__Number_descr_.raw->forceomit);
  decoded_field_length = field_suspend__Reference__Number.RAW_decode(Suspend__Reference__Number_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_46) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__SUSPEND__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Routeing__Area_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Suspend__Reference__Number_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routeing__Area.RAW_encode(Routeing__Area_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_suspend__Reference__Number.RAW_encode(Suspend__Reference__Number_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  os_46) {
  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_46.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__SUSPEND__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Routeing__Area_template field_routeing__Area;
Suspend__Reference__Number_template field_suspend__Reference__Number;
};

void PDU__BSSGP__SUSPEND__ACK_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_routeing__Area = ANY_VALUE;
single_value->field_suspend__Reference__Number = ANY_VALUE;
}
}
}

void PDU__BSSGP__SUSPEND__ACK_template::copy_value(const PDU__BSSGP__SUSPEND__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.routeing__Area().is_bound()) {
  single_value->field_routeing__Area = other_value.routeing__Area();
} else {
  single_value->field_routeing__Area.clean_up();
}
if (other_value.suspend__Reference__Number().is_bound()) {
  single_value->field_suspend__Reference__Number = other_value.suspend__Reference__Number();
} else {
  single_value->field_suspend__Reference__Number.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__SUSPEND__ACK_template::copy_template(const PDU__BSSGP__SUSPEND__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routeing__Area().get_selection()) {
single_value->field_routeing__Area = other_value.routeing__Area();
} else {
single_value->field_routeing__Area.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.suspend__Reference__Number().get_selection()) {
single_value->field_suspend__Reference__Number = other_value.suspend__Reference__Number();
} else {
single_value->field_suspend__Reference__Number.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__SUSPEND__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__SUSPEND__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__SUSPEND__ACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__SUSPEND__ACK_template::PDU__BSSGP__SUSPEND__ACK_template()
{
}

PDU__BSSGP__SUSPEND__ACK_template::PDU__BSSGP__SUSPEND__ACK_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__SUSPEND__ACK_template::PDU__BSSGP__SUSPEND__ACK_template(const PDU__BSSGP__SUSPEND__ACK& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__SUSPEND__ACK_template::PDU__BSSGP__SUSPEND__ACK_template(const OPTIONAL<PDU__BSSGP__SUSPEND__ACK>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__SUSPEND__ACK&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK from an unbound optional field.");
}
}

PDU__BSSGP__SUSPEND__ACK_template::PDU__BSSGP__SUSPEND__ACK_template(PDU__BSSGP__SUSPEND__ACK_template* p_precondition, PDU__BSSGP__SUSPEND__ACK_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__SUSPEND__ACK_template::PDU__BSSGP__SUSPEND__ACK_template(Dynamic_Match_Interface<PDU__BSSGP__SUSPEND__ACK>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__SUSPEND__ACK>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__SUSPEND__ACK_template::PDU__BSSGP__SUSPEND__ACK_template(const PDU__BSSGP__SUSPEND__ACK_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__SUSPEND__ACK_template::~PDU__BSSGP__SUSPEND__ACK_template()
{
clean_up();
}

PDU__BSSGP__SUSPEND__ACK_template& PDU__BSSGP__SUSPEND__ACK_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__SUSPEND__ACK_template& PDU__BSSGP__SUSPEND__ACK_template::operator=(const PDU__BSSGP__SUSPEND__ACK& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__SUSPEND__ACK_template& PDU__BSSGP__SUSPEND__ACK_template::operator=(const OPTIONAL<PDU__BSSGP__SUSPEND__ACK>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__SUSPEND__ACK&)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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
}
return *this;
}

PDU__BSSGP__SUSPEND__ACK_template& PDU__BSSGP__SUSPEND__ACK_template::operator=(const PDU__BSSGP__SUSPEND__ACK_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__SUSPEND__ACK_template::match(const PDU__BSSGP__SUSPEND__ACK& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.routeing__Area().is_bound()) return FALSE;
if(!single_value->field_routeing__Area.match(other_value.routeing__Area(), legacy))return FALSE;
if(!other_value.suspend__Reference__Number().is_bound()) return FALSE;
if(!single_value->field_suspend__Reference__Number.match(other_value.suspend__Reference__Number(), 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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__SUSPEND__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_routeing__Area.is_bound()
 || single_value->field_suspend__Reference__Number.is_bound();
}

boolean PDU__BSSGP__SUSPEND__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_routeing__Area.is_value()
 && single_value->field_suspend__Reference__Number.is_value();
}

void PDU__BSSGP__SUSPEND__ACK_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__SUSPEND__ACK PDU__BSSGP__SUSPEND__ACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
PDU__BSSGP__SUSPEND__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_routeing__Area.is_bound()) {
ret_val.routeing__Area() = single_value->field_routeing__Area.valueof();
}
if (single_value->field_suspend__Reference__Number.is_bound()) {
ret_val.suspend__Reference__Number() = single_value->field_suspend__Reference__Number.valueof();
}
return ret_val;
}

void PDU__BSSGP__SUSPEND__ACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__SUSPEND__ACK_template[list_length];
}

PDU__BSSGP__SUSPEND__ACK_template& PDU__BSSGP__SUSPEND__ACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__SUSPEND__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__SUSPEND__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__SUSPEND__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__SUSPEND__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
return single_value->field_tLLI;
}

Routeing__Area_template& PDU__BSSGP__SUSPEND__ACK_template::routeing__Area()
{
set_specific();
return single_value->field_routeing__Area;
}

const Routeing__Area_template& PDU__BSSGP__SUSPEND__ACK_template::routeing__Area() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routeing_Area of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
return single_value->field_routeing__Area;
}

Suspend__Reference__Number_template& PDU__BSSGP__SUSPEND__ACK_template::suspend__Reference__Number()
{
set_specific();
return single_value->field_suspend__Reference__Number;
}

const Suspend__Reference__Number_template& PDU__BSSGP__SUSPEND__ACK_template::suspend__Reference__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field suspend_Reference_Number of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
return single_value->field_suspend__Reference__Number;
}

int PDU__BSSGP__SUSPEND__ACK_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK 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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK 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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
  }
  return 0;
}

void PDU__BSSGP__SUSPEND__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log();
TTCN_Logger::log_event_str(", suspend_Reference_Number := ");
single_value->field_suspend__Reference__Number.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__SUSPEND__ACK_template::log_match(const PDU__BSSGP__SUSPEND__ACK& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routeing__Area.match(match_value.routeing__Area(), legacy)){
TTCN_Logger::log_logmatch_info(".routeing_Area");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_suspend__Reference__Number.match(match_value.suspend__Reference__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".suspend_Reference_Number");
single_value->field_suspend__Reference__Number.log_match(match_value.suspend__Reference__Number(), 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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::log_event_str(", suspend_Reference_Number := ");
single_value->field_suspend__Reference__Number.log_match(match_value.suspend__Reference__Number(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__SUSPEND__ACK_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_routeing__Area.encode_text(text_buf);
single_value->field_suspend__Reference__Number.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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
}
}

void PDU__BSSGP__SUSPEND__ACK_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_routeing__Area.decode_text(text_buf);
single_value->field_suspend__Reference__Number.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__SUSPEND__ACK_template[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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK.");
}
}

void PDU__BSSGP__SUSPEND__ACK_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__SUSPEND__ACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) suspend__Reference__Number().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "suspend_Reference_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          suspend__Reference__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_SUSPEND_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__SUSPEND__ACK_template* precondition = new PDU__BSSGP__SUSPEND__ACK_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__SUSPEND__ACK_template* implied_template = new PDU__BSSGP__SUSPEND__ACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__SUSPEND__ACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_SUSPEND_ACK");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__SUSPEND__ACK_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND_ACK");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND_ACK");
single_value->field_routeing__Area.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND_ACK");
single_value->field_suspend__Reference__Number.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND_ACK");
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 : "@BSSGP_Types.PDU_BSSGP_SUSPEND_ACK");
}

boolean PDU__BSSGP__SUSPEND__ACK_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__SUSPEND__ACK_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__SUSPEND__NACK::PDU__BSSGP__SUSPEND__NACK()
{
}

PDU__BSSGP__SUSPEND__NACK::PDU__BSSGP__SUSPEND__NACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Routeing__Area& par_routeing__Area,
    const OPTIONAL< Cause__BSSGP >& par_cause)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_routeing__Area(par_routeing__Area),
  field_cause(par_cause)
{
}

PDU__BSSGP__SUSPEND__NACK::PDU__BSSGP__SUSPEND__NACK(const PDU__BSSGP__SUSPEND__NACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
else field_routeing__Area.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
}

void PDU__BSSGP__SUSPEND__NACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_routeing__Area.clean_up();
field_cause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__SUSPEND__NACK::get_descriptor() const { return &PDU__BSSGP__SUSPEND__NACK_descr_; }
PDU__BSSGP__SUSPEND__NACK& PDU__BSSGP__SUSPEND__NACK::operator=(const PDU__BSSGP__SUSPEND__NACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
  else field_routeing__Area.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
}
return *this;
}

boolean PDU__BSSGP__SUSPEND__NACK::operator==(const PDU__BSSGP__SUSPEND__NACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_routeing__Area==other_value.field_routeing__Area
  && field_cause==other_value.field_cause;
}

boolean PDU__BSSGP__SUSPEND__NACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_routeing__Area.is_bound())
  || (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_bound());
}
boolean PDU__BSSGP__SUSPEND__NACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_routeing__Area.is_value()
  && (OPTIONAL_OMIT == field_cause.get_selection() || field_cause.is_value());
}
int PDU__BSSGP__SUSPEND__NACK::size_of() const
{
  int ret_val = 3;
  if (field_cause.ispresent()) ret_val++;
  return ret_val;
}

void PDU__BSSGP__SUSPEND__NACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
field_routeing__Area.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__SUSPEND__NACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (routeing__Area().is_bound()) routeing__Area().set_implicit_omit();
if (!cause().is_bound()) cause() = OMIT_VALUE;
else cause().set_implicit_omit();
}

void PDU__BSSGP__SUSPEND__NACK::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 @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_SUSPEND_NACK");
  }
}

void PDU__BSSGP__SUSPEND__NACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_routeing__Area.encode_text(text_buf);
field_cause.encode_text(text_buf);
}

void PDU__BSSGP__SUSPEND__NACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_routeing__Area.decode_text(text_buf);
field_cause.decode_text(text_buf);
}

void PDU__BSSGP__SUSPEND__NACK::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__SUSPEND__NACK::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__SUSPEND__NACK::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_bssgpPduType.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, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_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, Routeing__Area_descr_.raw->forceomit);
  decoded_field_length = field_routeing__Area.RAW_decode(Routeing__Area_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_cause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Cause__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_cause().RAW_decode(Cause__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_cause = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_cause=OMIT_VALUE;
  if (field_bssgpPduType !=  os_4) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__SUSPEND__NACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Routeing__Area_descr_.raw);
  if (field_cause.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Cause__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routeing__Area.RAW_encode(Routeing__Area_descr_, *myleaf.body.node.nodes[2]);
  if (field_cause.ispresent()) {
  encoded_length += field_cause().RAW_encode(Cause__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_bssgpPduType !=  os_4) {
  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_4.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__SUSPEND__NACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Routeing__Area_template field_routeing__Area;
Cause__BSSGP_template field_cause;
};

void PDU__BSSGP__SUSPEND__NACK_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_routeing__Area = ANY_VALUE;
single_value->field_cause = ANY_OR_OMIT;
}
}
}

void PDU__BSSGP__SUSPEND__NACK_template::copy_value(const PDU__BSSGP__SUSPEND__NACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.routeing__Area().is_bound()) {
  single_value->field_routeing__Area = other_value.routeing__Area();
} else {
  single_value->field_routeing__Area.clean_up();
}
if (other_value.cause().is_bound()) {
  if (other_value.cause().ispresent()) single_value->field_cause = other_value.cause()();
  else single_value->field_cause = OMIT_VALUE;
} else {
  single_value->field_cause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__SUSPEND__NACK_template::copy_template(const PDU__BSSGP__SUSPEND__NACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routeing__Area().get_selection()) {
single_value->field_routeing__Area = other_value.routeing__Area();
} else {
single_value->field_routeing__Area.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__SUSPEND__NACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__SUSPEND__NACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__SUSPEND__NACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__SUSPEND__NACK_template::PDU__BSSGP__SUSPEND__NACK_template()
{
}

PDU__BSSGP__SUSPEND__NACK_template::PDU__BSSGP__SUSPEND__NACK_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__SUSPEND__NACK_template::PDU__BSSGP__SUSPEND__NACK_template(const PDU__BSSGP__SUSPEND__NACK& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__SUSPEND__NACK_template::PDU__BSSGP__SUSPEND__NACK_template(const OPTIONAL<PDU__BSSGP__SUSPEND__NACK>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__SUSPEND__NACK&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK from an unbound optional field.");
}
}

PDU__BSSGP__SUSPEND__NACK_template::PDU__BSSGP__SUSPEND__NACK_template(PDU__BSSGP__SUSPEND__NACK_template* p_precondition, PDU__BSSGP__SUSPEND__NACK_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__SUSPEND__NACK_template::PDU__BSSGP__SUSPEND__NACK_template(Dynamic_Match_Interface<PDU__BSSGP__SUSPEND__NACK>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__SUSPEND__NACK>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__SUSPEND__NACK_template::PDU__BSSGP__SUSPEND__NACK_template(const PDU__BSSGP__SUSPEND__NACK_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__SUSPEND__NACK_template::~PDU__BSSGP__SUSPEND__NACK_template()
{
clean_up();
}

PDU__BSSGP__SUSPEND__NACK_template& PDU__BSSGP__SUSPEND__NACK_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__SUSPEND__NACK_template& PDU__BSSGP__SUSPEND__NACK_template::operator=(const PDU__BSSGP__SUSPEND__NACK& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__SUSPEND__NACK_template& PDU__BSSGP__SUSPEND__NACK_template::operator=(const OPTIONAL<PDU__BSSGP__SUSPEND__NACK>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__SUSPEND__NACK&)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 @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
}
return *this;
}

PDU__BSSGP__SUSPEND__NACK_template& PDU__BSSGP__SUSPEND__NACK_template::operator=(const PDU__BSSGP__SUSPEND__NACK_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__SUSPEND__NACK_template::match(const PDU__BSSGP__SUSPEND__NACK& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.routeing__Area().is_bound()) return FALSE;
if(!single_value->field_routeing__Area.match(other_value.routeing__Area(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if((other_value.cause().ispresent() ? !single_value->field_cause.match((const Cause__BSSGP&)other_value.cause(), legacy) : !single_value->field_cause.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
}
return FALSE;
}

boolean PDU__BSSGP__SUSPEND__NACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_routeing__Area.is_bound()
 || (single_value->field_cause.is_omit() || single_value->field_cause.is_bound());
}

boolean PDU__BSSGP__SUSPEND__NACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_routeing__Area.is_value()
 && (single_value->field_cause.is_omit() || single_value->field_cause.is_value());
}

void PDU__BSSGP__SUSPEND__NACK_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__SUSPEND__NACK PDU__BSSGP__SUSPEND__NACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
PDU__BSSGP__SUSPEND__NACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_routeing__Area.is_bound()) {
ret_val.routeing__Area() = single_value->field_routeing__Area.valueof();
}
if (single_value->field_cause.is_omit()) ret_val.cause() = OMIT_VALUE;
else if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
return ret_val;
}

void PDU__BSSGP__SUSPEND__NACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__SUSPEND__NACK_template[list_length];
}

PDU__BSSGP__SUSPEND__NACK_template& PDU__BSSGP__SUSPEND__NACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__SUSPEND__NACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__SUSPEND__NACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__SUSPEND__NACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__SUSPEND__NACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
return single_value->field_tLLI;
}

Routeing__Area_template& PDU__BSSGP__SUSPEND__NACK_template::routeing__Area()
{
set_specific();
return single_value->field_routeing__Area;
}

const Routeing__Area_template& PDU__BSSGP__SUSPEND__NACK_template::routeing__Area() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routeing_Area of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
return single_value->field_routeing__Area;
}

Cause__BSSGP_template& PDU__BSSGP__SUSPEND__NACK_template::cause()
{
set_specific();
return single_value->field_cause;
}

const Cause__BSSGP_template& PDU__BSSGP__SUSPEND__NACK_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
return single_value->field_cause;
}

int PDU__BSSGP__SUSPEND__NACK_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_cause.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK 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 @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
  }
  return 0;
}

void PDU__BSSGP__SUSPEND__NACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__SUSPEND__NACK_template::log_match(const PDU__BSSGP__SUSPEND__NACK& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routeing__Area.match(match_value.routeing__Area(), legacy)){
TTCN_Logger::log_logmatch_info(".routeing_Area");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cause().ispresent()){
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::log_event_str(", cause := ");
if (match_value.cause().ispresent()) {
single_value->field_cause.log_match(match_value.cause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause.log();
if (single_value->field_cause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__SUSPEND__NACK_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_routeing__Area.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
}
}

void PDU__BSSGP__SUSPEND__NACK_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_routeing__Area.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__SUSPEND__NACK_template[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 @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK.");
}
}

void PDU__BSSGP__SUSPEND__NACK_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__SUSPEND__NACK_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 @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_SUSPEND_NACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__SUSPEND__NACK_template* precondition = new PDU__BSSGP__SUSPEND__NACK_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__SUSPEND__NACK_template* implied_template = new PDU__BSSGP__SUSPEND__NACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__SUSPEND__NACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_SUSPEND_NACK");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__SUSPEND__NACK_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND_NACK");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND_NACK");
single_value->field_routeing__Area.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND_NACK");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_SUSPEND_NACK");
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 : "@BSSGP_Types.PDU_BSSGP_SUSPEND_NACK");
}

boolean PDU__BSSGP__SUSPEND__NACK_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__SUSPEND__NACK_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__RESUME::PDU__BSSGP__RESUME()
{
}

PDU__BSSGP__RESUME::PDU__BSSGP__RESUME(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Routeing__Area& par_routeing__Area,
    const Suspend__Reference__Number& par_suspend__Reference__Number)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_routeing__Area(par_routeing__Area),
  field_suspend__Reference__Number(par_suspend__Reference__Number)
{
}

PDU__BSSGP__RESUME::PDU__BSSGP__RESUME(const PDU__BSSGP__RESUME& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_RESUME.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
else field_routeing__Area.clean_up();
if (other_value.suspend__Reference__Number().is_bound()) field_suspend__Reference__Number = other_value.suspend__Reference__Number();
else field_suspend__Reference__Number.clean_up();
}

void PDU__BSSGP__RESUME::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_routeing__Area.clean_up();
field_suspend__Reference__Number.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__RESUME::get_descriptor() const { return &PDU__BSSGP__RESUME_descr_; }
PDU__BSSGP__RESUME& PDU__BSSGP__RESUME::operator=(const PDU__BSSGP__RESUME& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_RESUME.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
  else field_routeing__Area.clean_up();
  if (other_value.suspend__Reference__Number().is_bound()) field_suspend__Reference__Number = other_value.suspend__Reference__Number();
  else field_suspend__Reference__Number.clean_up();
}
return *this;
}

boolean PDU__BSSGP__RESUME::operator==(const PDU__BSSGP__RESUME& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_routeing__Area==other_value.field_routeing__Area
  && field_suspend__Reference__Number==other_value.field_suspend__Reference__Number;
}

boolean PDU__BSSGP__RESUME::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_routeing__Area.is_bound())
  || (field_suspend__Reference__Number.is_bound());
}
boolean PDU__BSSGP__RESUME::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_routeing__Area.is_value()
  && field_suspend__Reference__Number.is_value();
}
void PDU__BSSGP__RESUME::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
field_routeing__Area.log();
TTCN_Logger::log_event_str(", suspend_Reference_Number := ");
field_suspend__Reference__Number.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__RESUME::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (routeing__Area().is_bound()) routeing__Area().set_implicit_omit();
if (suspend__Reference__Number().is_bound()) suspend__Reference__Number().set_implicit_omit();
}

void PDU__BSSGP__RESUME::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 @BSSGP_Types.PDU_BSSGP_RESUME 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) suspend__Reference__Number().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "suspend_Reference_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          suspend__Reference__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_RESUME: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_RESUME");
  }
}

void PDU__BSSGP__RESUME::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_routeing__Area.encode_text(text_buf);
field_suspend__Reference__Number.encode_text(text_buf);
}

void PDU__BSSGP__RESUME::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_routeing__Area.decode_text(text_buf);
field_suspend__Reference__Number.decode_text(text_buf);
}

void PDU__BSSGP__RESUME::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__RESUME::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__RESUME::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_bssgpPduType.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, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_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, Routeing__Area_descr_.raw->forceomit);
  decoded_field_length = field_routeing__Area.RAW_decode(Routeing__Area_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, Suspend__Reference__Number_descr_.raw->forceomit);
  decoded_field_length = field_suspend__Reference__Number.RAW_decode(Suspend__Reference__Number_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_bssgpPduType !=  os_20) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__RESUME::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Routeing__Area_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Suspend__Reference__Number_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routeing__Area.RAW_encode(Routeing__Area_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_suspend__Reference__Number.RAW_encode(Suspend__Reference__Number_descr_, *myleaf.body.node.nodes[3]);
  if (field_bssgpPduType !=  os_20) {
  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_20.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__RESUME_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Routeing__Area_template field_routeing__Area;
Suspend__Reference__Number_template field_suspend__Reference__Number;
};

void PDU__BSSGP__RESUME_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_routeing__Area = ANY_VALUE;
single_value->field_suspend__Reference__Number = ANY_VALUE;
}
}
}

void PDU__BSSGP__RESUME_template::copy_value(const PDU__BSSGP__RESUME& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.routeing__Area().is_bound()) {
  single_value->field_routeing__Area = other_value.routeing__Area();
} else {
  single_value->field_routeing__Area.clean_up();
}
if (other_value.suspend__Reference__Number().is_bound()) {
  single_value->field_suspend__Reference__Number = other_value.suspend__Reference__Number();
} else {
  single_value->field_suspend__Reference__Number.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__RESUME_template::copy_template(const PDU__BSSGP__RESUME_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routeing__Area().get_selection()) {
single_value->field_routeing__Area = other_value.routeing__Area();
} else {
single_value->field_routeing__Area.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.suspend__Reference__Number().get_selection()) {
single_value->field_suspend__Reference__Number = other_value.suspend__Reference__Number();
} else {
single_value->field_suspend__Reference__Number.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__RESUME_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__RESUME_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__RESUME_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 @BSSGP_Types.PDU_BSSGP_RESUME.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__RESUME_template::PDU__BSSGP__RESUME_template()
{
}

PDU__BSSGP__RESUME_template::PDU__BSSGP__RESUME_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__RESUME_template::PDU__BSSGP__RESUME_template(const PDU__BSSGP__RESUME& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__RESUME_template::PDU__BSSGP__RESUME_template(const OPTIONAL<PDU__BSSGP__RESUME>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RESUME&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_RESUME from an unbound optional field.");
}
}

PDU__BSSGP__RESUME_template::PDU__BSSGP__RESUME_template(PDU__BSSGP__RESUME_template* p_precondition, PDU__BSSGP__RESUME_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__RESUME_template::PDU__BSSGP__RESUME_template(Dynamic_Match_Interface<PDU__BSSGP__RESUME>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__RESUME>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__RESUME_template::PDU__BSSGP__RESUME_template(const PDU__BSSGP__RESUME_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__RESUME_template::~PDU__BSSGP__RESUME_template()
{
clean_up();
}

PDU__BSSGP__RESUME_template& PDU__BSSGP__RESUME_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__RESUME_template& PDU__BSSGP__RESUME_template::operator=(const PDU__BSSGP__RESUME& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__RESUME_template& PDU__BSSGP__RESUME_template::operator=(const OPTIONAL<PDU__BSSGP__RESUME>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RESUME&)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 @BSSGP_Types.PDU_BSSGP_RESUME.");
}
return *this;
}

PDU__BSSGP__RESUME_template& PDU__BSSGP__RESUME_template::operator=(const PDU__BSSGP__RESUME_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__RESUME_template::match(const PDU__BSSGP__RESUME& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.routeing__Area().is_bound()) return FALSE;
if(!single_value->field_routeing__Area.match(other_value.routeing__Area(), legacy))return FALSE;
if(!other_value.suspend__Reference__Number().is_bound()) return FALSE;
if(!single_value->field_suspend__Reference__Number.match(other_value.suspend__Reference__Number(), 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 @BSSGP_Types.PDU_BSSGP_RESUME.");
}
return FALSE;
}

boolean PDU__BSSGP__RESUME_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_routeing__Area.is_bound()
 || single_value->field_suspend__Reference__Number.is_bound();
}

boolean PDU__BSSGP__RESUME_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_routeing__Area.is_value()
 && single_value->field_suspend__Reference__Number.is_value();
}

void PDU__BSSGP__RESUME_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__RESUME PDU__BSSGP__RESUME_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 @BSSGP_Types.PDU_BSSGP_RESUME.");
PDU__BSSGP__RESUME ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_routeing__Area.is_bound()) {
ret_val.routeing__Area() = single_value->field_routeing__Area.valueof();
}
if (single_value->field_suspend__Reference__Number.is_bound()) {
ret_val.suspend__Reference__Number() = single_value->field_suspend__Reference__Number.valueof();
}
return ret_val;
}

void PDU__BSSGP__RESUME_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 @BSSGP_Types.PDU_BSSGP_RESUME.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__RESUME_template[list_length];
}

PDU__BSSGP__RESUME_template& PDU__BSSGP__RESUME_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 @BSSGP_Types.PDU_BSSGP_RESUME.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_RESUME.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__RESUME_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__RESUME_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__RESUME_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__RESUME_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME.");
return single_value->field_tLLI;
}

Routeing__Area_template& PDU__BSSGP__RESUME_template::routeing__Area()
{
set_specific();
return single_value->field_routeing__Area;
}

const Routeing__Area_template& PDU__BSSGP__RESUME_template::routeing__Area() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routeing_Area of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME.");
return single_value->field_routeing__Area;
}

Suspend__Reference__Number_template& PDU__BSSGP__RESUME_template::suspend__Reference__Number()
{
set_specific();
return single_value->field_suspend__Reference__Number;
}

const Suspend__Reference__Number_template& PDU__BSSGP__RESUME_template::suspend__Reference__Number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field suspend_Reference_Number of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME.");
return single_value->field_suspend__Reference__Number;
}

int PDU__BSSGP__RESUME_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME 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 @BSSGP_Types.PDU_BSSGP_RESUME 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 @BSSGP_Types.PDU_BSSGP_RESUME containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RESUME.");
  }
  return 0;
}

void PDU__BSSGP__RESUME_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log();
TTCN_Logger::log_event_str(", suspend_Reference_Number := ");
single_value->field_suspend__Reference__Number.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__RESUME_template::log_match(const PDU__BSSGP__RESUME& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routeing__Area.match(match_value.routeing__Area(), legacy)){
TTCN_Logger::log_logmatch_info(".routeing_Area");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_suspend__Reference__Number.match(match_value.suspend__Reference__Number(), legacy)){
TTCN_Logger::log_logmatch_info(".suspend_Reference_Number");
single_value->field_suspend__Reference__Number.log_match(match_value.suspend__Reference__Number(), 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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::log_event_str(", suspend_Reference_Number := ");
single_value->field_suspend__Reference__Number.log_match(match_value.suspend__Reference__Number(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__RESUME_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_routeing__Area.encode_text(text_buf);
single_value->field_suspend__Reference__Number.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 @BSSGP_Types.PDU_BSSGP_RESUME.");
}
}

void PDU__BSSGP__RESUME_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_routeing__Area.decode_text(text_buf);
single_value->field_suspend__Reference__Number.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__RESUME_template[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 @BSSGP_Types.PDU_BSSGP_RESUME.");
}
}

void PDU__BSSGP__RESUME_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__RESUME_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 @BSSGP_Types.PDU_BSSGP_RESUME 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) suspend__Reference__Number().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "suspend_Reference_Number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          suspend__Reference__Number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_RESUME: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__RESUME_template* precondition = new PDU__BSSGP__RESUME_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__RESUME_template* implied_template = new PDU__BSSGP__RESUME_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__RESUME_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_RESUME");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__RESUME_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RESUME");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RESUME");
single_value->field_routeing__Area.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RESUME");
single_value->field_suspend__Reference__Number.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RESUME");
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 : "@BSSGP_Types.PDU_BSSGP_RESUME");
}

boolean PDU__BSSGP__RESUME_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__RESUME_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__BSSGP__RESUME__ACK::PDU__BSSGP__RESUME__ACK()
{
}

PDU__BSSGP__RESUME__ACK::PDU__BSSGP__RESUME__ACK(const OCTETSTRING& par_bssgpPduType,
    const TLLI__BSSGP& par_tLLI,
    const Routeing__Area& par_routeing__Area)
  :   field_bssgpPduType(par_bssgpPduType),
  field_tLLI(par_tLLI),
  field_routeing__Area(par_routeing__Area)
{
}

PDU__BSSGP__RESUME__ACK::PDU__BSSGP__RESUME__ACK(const PDU__BSSGP__RESUME__ACK& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
else field_bssgpPduType.clean_up();
if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
else field_tLLI.clean_up();
if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
else field_routeing__Area.clean_up();
}

void PDU__BSSGP__RESUME__ACK::clean_up()
{
field_bssgpPduType.clean_up();
field_tLLI.clean_up();
field_routeing__Area.clean_up();
}

const TTCN_Typedescriptor_t* PDU__BSSGP__RESUME__ACK::get_descriptor() const { return &PDU__BSSGP__RESUME__ACK_descr_; }
PDU__BSSGP__RESUME__ACK& PDU__BSSGP__RESUME__ACK::operator=(const PDU__BSSGP__RESUME__ACK& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
  if (other_value.bssgpPduType().is_bound()) field_bssgpPduType = other_value.bssgpPduType();
  else field_bssgpPduType.clean_up();
  if (other_value.tLLI().is_bound()) field_tLLI = other_value.tLLI();
  else field_tLLI.clean_up();
  if (other_value.routeing__Area().is_bound()) field_routeing__Area = other_value.routeing__Area();
  else field_routeing__Area.clean_up();
}
return *this;
}

boolean PDU__BSSGP__RESUME__ACK::operator==(const PDU__BSSGP__RESUME__ACK& other_value) const
{
return field_bssgpPduType==other_value.field_bssgpPduType
  && field_tLLI==other_value.field_tLLI
  && field_routeing__Area==other_value.field_routeing__Area;
}

boolean PDU__BSSGP__RESUME__ACK::is_bound() const
{
return (field_bssgpPduType.is_bound())
  || (field_tLLI.is_bound())
  || (field_routeing__Area.is_bound());
}
boolean PDU__BSSGP__RESUME__ACK::is_value() const
{
return field_bssgpPduType.is_value()
  && field_tLLI.is_value()
  && field_routeing__Area.is_value();
}
void PDU__BSSGP__RESUME__ACK::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bssgpPduType := ");
field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
field_routeing__Area.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__BSSGP__RESUME__ACK::set_implicit_omit()
{
if (bssgpPduType().is_bound()) bssgpPduType().set_implicit_omit();
if (tLLI().is_bound()) tLLI().set_implicit_omit();
if (routeing__Area().is_bound()) routeing__Area().set_implicit_omit();
}

void PDU__BSSGP__RESUME__ACK::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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_RESUME_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PDU_BSSGP_RESUME_ACK");
  }
}

void PDU__BSSGP__RESUME__ACK::encode_text(Text_Buf& text_buf) const
{
field_bssgpPduType.encode_text(text_buf);
field_tLLI.encode_text(text_buf);
field_routeing__Area.encode_text(text_buf);
}

void PDU__BSSGP__RESUME__ACK::decode_text(Text_Buf& text_buf)
{
field_bssgpPduType.decode_text(text_buf);
field_tLLI.decode_text(text_buf);
field_routeing__Area.decode_text(text_buf);
}

void PDU__BSSGP__RESUME__ACK::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__BSSGP__RESUME__ACK::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__BSSGP__RESUME__ACK::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_bssgpPduType.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, TLLI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tLLI.RAW_decode(TLLI__BSSGP_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, Routeing__Area_descr_.raw->forceomit);
  decoded_field_length = field_routeing__Area.RAW_decode(Routeing__Area_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 (field_bssgpPduType !=  os_47) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__BSSGP__RESUME__ACK::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TLLI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Routeing__Area_descr_.raw);
  encoded_length += field_bssgpPduType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tLLI.RAW_encode(TLLI__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routeing__Area.RAW_encode(Routeing__Area_descr_, *myleaf.body.node.nodes[2]);
  if (field_bssgpPduType !=  os_47) {
  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_47.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__BSSGP__RESUME__ACK_template::single_value_struct {
OCTETSTRING_template field_bssgpPduType;
TLLI__BSSGP_template field_tLLI;
Routeing__Area_template field_routeing__Area;
};

void PDU__BSSGP__RESUME__ACK_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_bssgpPduType = ANY_VALUE;
single_value->field_tLLI = ANY_VALUE;
single_value->field_routeing__Area = ANY_VALUE;
}
}
}

void PDU__BSSGP__RESUME__ACK_template::copy_value(const PDU__BSSGP__RESUME__ACK& other_value)
{
single_value = new single_value_struct;
if (other_value.bssgpPduType().is_bound()) {
  single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
  single_value->field_bssgpPduType.clean_up();
}
if (other_value.tLLI().is_bound()) {
  single_value->field_tLLI = other_value.tLLI();
} else {
  single_value->field_tLLI.clean_up();
}
if (other_value.routeing__Area().is_bound()) {
  single_value->field_routeing__Area = other_value.routeing__Area();
} else {
  single_value->field_routeing__Area.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__BSSGP__RESUME__ACK_template::copy_template(const PDU__BSSGP__RESUME__ACK_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bssgpPduType().get_selection()) {
single_value->field_bssgpPduType = other_value.bssgpPduType();
} else {
single_value->field_bssgpPduType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tLLI().get_selection()) {
single_value->field_tLLI = other_value.tLLI();
} else {
single_value->field_tLLI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routeing__Area().get_selection()) {
single_value->field_routeing__Area = other_value.routeing__Area();
} else {
single_value->field_routeing__Area.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__BSSGP__RESUME__ACK_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__BSSGP__RESUME__ACK_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__BSSGP__RESUME__ACK_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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
break;
}
set_selection(other_value);
}

PDU__BSSGP__RESUME__ACK_template::PDU__BSSGP__RESUME__ACK_template()
{
}

PDU__BSSGP__RESUME__ACK_template::PDU__BSSGP__RESUME__ACK_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__BSSGP__RESUME__ACK_template::PDU__BSSGP__RESUME__ACK_template(const PDU__BSSGP__RESUME__ACK& other_value)
{
copy_value(other_value);
}

PDU__BSSGP__RESUME__ACK_template::PDU__BSSGP__RESUME__ACK_template(const OPTIONAL<PDU__BSSGP__RESUME__ACK>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RESUME__ACK&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK from an unbound optional field.");
}
}

PDU__BSSGP__RESUME__ACK_template::PDU__BSSGP__RESUME__ACK_template(PDU__BSSGP__RESUME__ACK_template* p_precondition, PDU__BSSGP__RESUME__ACK_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__BSSGP__RESUME__ACK_template::PDU__BSSGP__RESUME__ACK_template(Dynamic_Match_Interface<PDU__BSSGP__RESUME__ACK>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__BSSGP__RESUME__ACK>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__BSSGP__RESUME__ACK_template::PDU__BSSGP__RESUME__ACK_template(const PDU__BSSGP__RESUME__ACK_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__BSSGP__RESUME__ACK_template::~PDU__BSSGP__RESUME__ACK_template()
{
clean_up();
}

PDU__BSSGP__RESUME__ACK_template& PDU__BSSGP__RESUME__ACK_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__BSSGP__RESUME__ACK_template& PDU__BSSGP__RESUME__ACK_template::operator=(const PDU__BSSGP__RESUME__ACK& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__BSSGP__RESUME__ACK_template& PDU__BSSGP__RESUME__ACK_template::operator=(const OPTIONAL<PDU__BSSGP__RESUME__ACK>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__BSSGP__RESUME__ACK&)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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
}
return *this;
}

PDU__BSSGP__RESUME__ACK_template& PDU__BSSGP__RESUME__ACK_template::operator=(const PDU__BSSGP__RESUME__ACK_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__BSSGP__RESUME__ACK_template::match(const PDU__BSSGP__RESUME__ACK& 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.bssgpPduType().is_bound()) return FALSE;
if(!single_value->field_bssgpPduType.match(other_value.bssgpPduType(), legacy))return FALSE;
if(!other_value.tLLI().is_bound()) return FALSE;
if(!single_value->field_tLLI.match(other_value.tLLI(), legacy))return FALSE;
if(!other_value.routeing__Area().is_bound()) return FALSE;
if(!single_value->field_routeing__Area.match(other_value.routeing__Area(), 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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
}
return FALSE;
}

boolean PDU__BSSGP__RESUME__ACK_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bssgpPduType.is_bound()
 || single_value->field_tLLI.is_bound()
 || single_value->field_routeing__Area.is_bound();
}

boolean PDU__BSSGP__RESUME__ACK_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bssgpPduType.is_value()
 && single_value->field_tLLI.is_value()
 && single_value->field_routeing__Area.is_value();
}

void PDU__BSSGP__RESUME__ACK_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__BSSGP__RESUME__ACK PDU__BSSGP__RESUME__ACK_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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
PDU__BSSGP__RESUME__ACK ret_val;
if (single_value->field_bssgpPduType.is_bound()) {
ret_val.bssgpPduType() = single_value->field_bssgpPduType.valueof();
}
if (single_value->field_tLLI.is_bound()) {
ret_val.tLLI() = single_value->field_tLLI.valueof();
}
if (single_value->field_routeing__Area.is_bound()) {
ret_val.routeing__Area() = single_value->field_routeing__Area.valueof();
}
return ret_val;
}

void PDU__BSSGP__RESUME__ACK_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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__BSSGP__RESUME__ACK_template[list_length];
}

PDU__BSSGP__RESUME__ACK_template& PDU__BSSGP__RESUME__ACK_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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PDU__BSSGP__RESUME__ACK_template::bssgpPduType()
{
set_specific();
return single_value->field_bssgpPduType;
}

const OCTETSTRING_template& PDU__BSSGP__RESUME__ACK_template::bssgpPduType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bssgpPduType of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
return single_value->field_bssgpPduType;
}

TLLI__BSSGP_template& PDU__BSSGP__RESUME__ACK_template::tLLI()
{
set_specific();
return single_value->field_tLLI;
}

const TLLI__BSSGP_template& PDU__BSSGP__RESUME__ACK_template::tLLI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tLLI of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
return single_value->field_tLLI;
}

Routeing__Area_template& PDU__BSSGP__RESUME__ACK_template::routeing__Area()
{
set_specific();
return single_value->field_routeing__Area;
}

const Routeing__Area_template& PDU__BSSGP__RESUME__ACK_template::routeing__Area() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routeing_Area of a non-specific template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
return single_value->field_routeing__Area;
}

int PDU__BSSGP__RESUME__ACK_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK 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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK 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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
  }
  return 0;
}

void PDU__BSSGP__RESUME__ACK_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bssgpPduType := ");
single_value->field_bssgpPduType.log();
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log();
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__BSSGP__RESUME__ACK_template::log_match(const PDU__BSSGP__RESUME__ACK& 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_bssgpPduType.match(match_value.bssgpPduType(), legacy)){
TTCN_Logger::log_logmatch_info(".bssgpPduType");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tLLI.match(match_value.tLLI(), legacy)){
TTCN_Logger::log_logmatch_info(".tLLI");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routeing__Area.match(match_value.routeing__Area(), legacy)){
TTCN_Logger::log_logmatch_info(".routeing_Area");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), 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("{ bssgpPduType := ");
single_value->field_bssgpPduType.log_match(match_value.bssgpPduType(), legacy);
TTCN_Logger::log_event_str(", tLLI := ");
single_value->field_tLLI.log_match(match_value.tLLI(), legacy);
TTCN_Logger::log_event_str(", routeing_Area := ");
single_value->field_routeing__Area.log_match(match_value.routeing__Area(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__BSSGP__RESUME__ACK_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bssgpPduType.encode_text(text_buf);
single_value->field_tLLI.encode_text(text_buf);
single_value->field_routeing__Area.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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
}
}

void PDU__BSSGP__RESUME__ACK_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_bssgpPduType.decode_text(text_buf);
single_value->field_tLLI.decode_text(text_buf);
single_value->field_routeing__Area.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__BSSGP__RESUME__ACK_template[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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK.");
}
}

void PDU__BSSGP__RESUME__ACK_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__BSSGP__RESUME__ACK_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 @BSSGP_Types.PDU_BSSGP_RESUME_ACK 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) bssgpPduType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tLLI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routeing__Area().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(), "bssgpPduType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bssgpPduType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tLLI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tLLI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routeing_Area")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routeing__Area().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.PDU_BSSGP_RESUME_ACK: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__BSSGP__RESUME__ACK_template* precondition = new PDU__BSSGP__RESUME__ACK_template;
    precondition->set_param(*param.get_elem(0));
    PDU__BSSGP__RESUME__ACK_template* implied_template = new PDU__BSSGP__RESUME__ACK_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__BSSGP__RESUME__ACK_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PDU_BSSGP_RESUME_ACK");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__BSSGP__RESUME__ACK_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_bssgpPduType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RESUME_ACK");
single_value->field_tLLI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RESUME_ACK");
single_value->field_routeing__Area.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_BSSGP_RESUME_ACK");
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 : "@BSSGP_Types.PDU_BSSGP_RESUME_ACK");
}

boolean PDU__BSSGP__RESUME__ACK_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__BSSGP__RESUME__ACK_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 */
