// 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 */

MBMS__Session__Duration::MBMS__Session__Duration()
{
}

MBMS__Session__Duration::MBMS__Session__Duration(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_mBMS__Session__Duration__Value)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_mBMS__Session__Duration__Value(par_mBMS__Session__Duration__Value)
{
}

MBMS__Session__Duration::MBMS__Session__Duration(const MBMS__Session__Duration& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MBMS_Session_Duration.");
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.mBMS__Session__Duration__Value().is_bound()) field_mBMS__Session__Duration__Value = other_value.mBMS__Session__Duration__Value();
else field_mBMS__Session__Duration__Value.clean_up();
}

void MBMS__Session__Duration::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_mBMS__Session__Duration__Value.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__Session__Duration::get_descriptor() const { return &MBMS__Session__Duration_descr_; }
MBMS__Session__Duration& MBMS__Session__Duration::operator=(const MBMS__Session__Duration& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MBMS_Session_Duration.");
  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.mBMS__Session__Duration__Value().is_bound()) field_mBMS__Session__Duration__Value = other_value.mBMS__Session__Duration__Value();
  else field_mBMS__Session__Duration__Value.clean_up();
}
return *this;
}

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

boolean MBMS__Session__Duration::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mBMS__Session__Duration__Value.is_bound());
}
boolean MBMS__Session__Duration::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_mBMS__Session__Duration__Value.is_value();
}
void MBMS__Session__Duration::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(", mBMS_Session_Duration_Value := ");
field_mBMS__Session__Duration__Value.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__Session__Duration::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 (mBMS__Session__Duration__Value().is_bound()) mBMS__Session__Duration__Value().set_implicit_omit();
}

void MBMS__Session__Duration::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.MBMS_Session_Duration 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) mBMS__Session__Duration__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(), "mBMS_Session_Duration_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Session__Duration__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.MBMS_Session_Duration: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.MBMS_Session_Duration");
  }
}

void MBMS__Session__Duration::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_mBMS__Session__Duration__Value.encode_text(text_buf);
}

void MBMS__Session__Duration::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_mBMS__Session__Duration__Value.decode_text(text_buf);
}

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

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

int MBMS__Session__Duration::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, MBMS__Session__Duration_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(MBMS__Session__Duration_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, MBMS__Session__Duration_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__Session__Duration_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_mBMS__Session__Duration__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_111) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__Session__Duration::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, MBMS__Session__Duration_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__Session__Duration_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(MBMS__Session__Duration_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(MBMS__Session__Duration_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mBMS__Session__Duration__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(MBMS__Session__Duration_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(MBMS__Session__Duration_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_111) {
  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_111.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MBMS__Session__Duration_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_mBMS__Session__Duration__Value;
};

void MBMS__Session__Duration_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_mBMS__Session__Duration__Value = ANY_VALUE;
}
}
}

void MBMS__Session__Duration_template::copy_value(const MBMS__Session__Duration& 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.mBMS__Session__Duration__Value().is_bound()) {
  single_value->field_mBMS__Session__Duration__Value = other_value.mBMS__Session__Duration__Value();
} else {
  single_value->field_mBMS__Session__Duration__Value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMS__Session__Duration_template::copy_template(const MBMS__Session__Duration_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.mBMS__Session__Duration__Value().get_selection()) {
single_value->field_mBMS__Session__Duration__Value = other_value.mBMS__Session__Duration__Value();
} else {
single_value->field_mBMS__Session__Duration__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 MBMS__Session__Duration_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MBMS__Session__Duration_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__Session__Duration_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.MBMS_Session_Duration.");
break;
}
set_selection(other_value);
}

MBMS__Session__Duration_template::MBMS__Session__Duration_template()
{
}

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

MBMS__Session__Duration_template::MBMS__Session__Duration_template(const MBMS__Session__Duration& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMS__Session__Duration_template::match(const MBMS__Session__Duration& 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.mBMS__Session__Duration__Value().is_bound()) return FALSE;
if(!single_value->field_mBMS__Session__Duration__Value.match(other_value.mBMS__Session__Duration__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.MBMS_Session_Duration.");
}
return FALSE;
}

boolean MBMS__Session__Duration_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_mBMS__Session__Duration__Value.is_bound();
}

boolean MBMS__Session__Duration_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_mBMS__Session__Duration__Value.is_value();
}

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

MBMS__Session__Duration MBMS__Session__Duration_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.MBMS_Session_Duration.");
MBMS__Session__Duration 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_mBMS__Session__Duration__Value.is_bound()) {
ret_val.mBMS__Session__Duration__Value() = single_value->field_mBMS__Session__Duration__Value.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

OCTETSTRING_template& MBMS__Session__Duration_template::mBMS__Session__Duration__Value()
{
set_specific();
return single_value->field_mBMS__Session__Duration__Value;
}

const OCTETSTRING_template& MBMS__Session__Duration_template::mBMS__Session__Duration__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Session_Duration_Value of a non-specific template of type @BSSGP_Types.MBMS_Session_Duration.");
return single_value->field_mBMS__Session__Duration__Value;
}

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

void MBMS__Session__Duration_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(", mBMS_Session_Duration_Value := ");
single_value->field_mBMS__Session__Duration__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 MBMS__Session__Duration_template::log_match(const MBMS__Session__Duration& 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_mBMS__Session__Duration__Value.match(match_value.mBMS__Session__Duration__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Session_Duration_Value");
single_value->field_mBMS__Session__Duration__Value.log_match(match_value.mBMS__Session__Duration__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(", mBMS_Session_Duration_Value := ");
single_value->field_mBMS__Session__Duration__Value.log_match(match_value.mBMS__Session__Duration__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 MBMS__Session__Duration_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_mBMS__Session__Duration__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.MBMS_Session_Duration.");
}
}

void MBMS__Session__Duration_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_mBMS__Session__Duration__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 MBMS__Session__Duration_template[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.MBMS_Session_Duration.");
}
}

void MBMS__Session__Duration_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MBMS__Session__Duration_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.MBMS_Session_Duration 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) mBMS__Session__Duration__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(), "mBMS_Session_Duration_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Session__Duration__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.MBMS_Session_Duration: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__Session__Duration_template* precondition = new MBMS__Session__Duration_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__Session__Duration_template* implied_template = new MBMS__Session__Duration_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__Session__Duration_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.MBMS_Session_Duration");
  }
  is_ifpresent = param.get_ifpresent();
}

void MBMS__Session__Duration_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.MBMS_Session_Duration");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Duration");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Duration");
single_value->field_mBMS__Session__Duration__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Duration");
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.MBMS_Session_Duration");
}

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

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

MBMS__Service__Area__Identity__List::MBMS__Service__Area__Identity__List()
{
}

MBMS__Service__Area__Identity__List::MBMS__Service__Area__Identity__List(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_mBMS__Service__Area__Identity__List__Value)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_mBMS__Service__Area__Identity__List__Value(par_mBMS__Service__Area__Identity__List__Value)
{
}

MBMS__Service__Area__Identity__List::MBMS__Service__Area__Identity__List(const MBMS__Service__Area__Identity__List& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MBMS_Service_Area_Identity_List.");
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.mBMS__Service__Area__Identity__List__Value().is_bound()) field_mBMS__Service__Area__Identity__List__Value = other_value.mBMS__Service__Area__Identity__List__Value();
else field_mBMS__Service__Area__Identity__List__Value.clean_up();
}

void MBMS__Service__Area__Identity__List::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_mBMS__Service__Area__Identity__List__Value.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__Service__Area__Identity__List::get_descriptor() const { return &MBMS__Service__Area__Identity__List_descr_; }
MBMS__Service__Area__Identity__List& MBMS__Service__Area__Identity__List::operator=(const MBMS__Service__Area__Identity__List& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MBMS_Service_Area_Identity_List.");
  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.mBMS__Service__Area__Identity__List__Value().is_bound()) field_mBMS__Service__Area__Identity__List__Value = other_value.mBMS__Service__Area__Identity__List__Value();
  else field_mBMS__Service__Area__Identity__List__Value.clean_up();
}
return *this;
}

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

boolean MBMS__Service__Area__Identity__List::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mBMS__Service__Area__Identity__List__Value.is_bound());
}
boolean MBMS__Service__Area__Identity__List::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_mBMS__Service__Area__Identity__List__Value.is_value();
}
void MBMS__Service__Area__Identity__List::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(", mBMS_Service_Area_Identity_List_Value := ");
field_mBMS__Service__Area__Identity__List__Value.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__Service__Area__Identity__List::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 (mBMS__Service__Area__Identity__List__Value().is_bound()) mBMS__Service__Area__Identity__List__Value().set_implicit_omit();
}

void MBMS__Service__Area__Identity__List::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.MBMS_Service_Area_Identity_List 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) mBMS__Service__Area__Identity__List__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(), "mBMS_Service_Area_Identity_List_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Service__Area__Identity__List__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.MBMS_Service_Area_Identity_List: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.MBMS_Service_Area_Identity_List");
  }
}

void MBMS__Service__Area__Identity__List::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_mBMS__Service__Area__Identity__List__Value.encode_text(text_buf);
}

void MBMS__Service__Area__Identity__List::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_mBMS__Service__Area__Identity__List__Value.decode_text(text_buf);
}

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

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

int MBMS__Service__Area__Identity__List::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, MBMS__Service__Area__Identity__List_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(MBMS__Service__Area__Identity__List_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, MBMS__Service__Area__Identity__List_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__Service__Area__Identity__List_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_mBMS__Service__Area__Identity__List__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_141) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__Service__Area__Identity__List::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, MBMS__Service__Area__Identity__List_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__Service__Area__Identity__List_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(MBMS__Service__Area__Identity__List_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(MBMS__Service__Area__Identity__List_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mBMS__Service__Area__Identity__List__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(MBMS__Service__Area__Identity__List_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(MBMS__Service__Area__Identity__List_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_141) {
  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_141.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MBMS__Service__Area__Identity__List_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_mBMS__Service__Area__Identity__List__Value;
};

void MBMS__Service__Area__Identity__List_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_mBMS__Service__Area__Identity__List__Value = ANY_VALUE;
}
}
}

void MBMS__Service__Area__Identity__List_template::copy_value(const MBMS__Service__Area__Identity__List& 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.mBMS__Service__Area__Identity__List__Value().is_bound()) {
  single_value->field_mBMS__Service__Area__Identity__List__Value = other_value.mBMS__Service__Area__Identity__List__Value();
} else {
  single_value->field_mBMS__Service__Area__Identity__List__Value.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMS__Service__Area__Identity__List_template::copy_template(const MBMS__Service__Area__Identity__List_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.mBMS__Service__Area__Identity__List__Value().get_selection()) {
single_value->field_mBMS__Service__Area__Identity__List__Value = other_value.mBMS__Service__Area__Identity__List__Value();
} else {
single_value->field_mBMS__Service__Area__Identity__List__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 MBMS__Service__Area__Identity__List_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MBMS__Service__Area__Identity__List_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__Service__Area__Identity__List_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.MBMS_Service_Area_Identity_List.");
break;
}
set_selection(other_value);
}

MBMS__Service__Area__Identity__List_template::MBMS__Service__Area__Identity__List_template()
{
}

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

MBMS__Service__Area__Identity__List_template::MBMS__Service__Area__Identity__List_template(const MBMS__Service__Area__Identity__List& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMS__Service__Area__Identity__List_template::match(const MBMS__Service__Area__Identity__List& 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.mBMS__Service__Area__Identity__List__Value().is_bound()) return FALSE;
if(!single_value->field_mBMS__Service__Area__Identity__List__Value.match(other_value.mBMS__Service__Area__Identity__List__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.MBMS_Service_Area_Identity_List.");
}
return FALSE;
}

boolean MBMS__Service__Area__Identity__List_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_mBMS__Service__Area__Identity__List__Value.is_bound();
}

boolean MBMS__Service__Area__Identity__List_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_mBMS__Service__Area__Identity__List__Value.is_value();
}

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

MBMS__Service__Area__Identity__List MBMS__Service__Area__Identity__List_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.MBMS_Service_Area_Identity_List.");
MBMS__Service__Area__Identity__List 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_mBMS__Service__Area__Identity__List__Value.is_bound()) {
ret_val.mBMS__Service__Area__Identity__List__Value() = single_value->field_mBMS__Service__Area__Identity__List__Value.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

OCTETSTRING_template& MBMS__Service__Area__Identity__List_template::mBMS__Service__Area__Identity__List__Value()
{
set_specific();
return single_value->field_mBMS__Service__Area__Identity__List__Value;
}

const OCTETSTRING_template& MBMS__Service__Area__Identity__List_template::mBMS__Service__Area__Identity__List__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Service_Area_Identity_List_Value of a non-specific template of type @BSSGP_Types.MBMS_Service_Area_Identity_List.");
return single_value->field_mBMS__Service__Area__Identity__List__Value;
}

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

void MBMS__Service__Area__Identity__List_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(", mBMS_Service_Area_Identity_List_Value := ");
single_value->field_mBMS__Service__Area__Identity__List__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 MBMS__Service__Area__Identity__List_template::log_match(const MBMS__Service__Area__Identity__List& 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_mBMS__Service__Area__Identity__List__Value.match(match_value.mBMS__Service__Area__Identity__List__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Service_Area_Identity_List_Value");
single_value->field_mBMS__Service__Area__Identity__List__Value.log_match(match_value.mBMS__Service__Area__Identity__List__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(", mBMS_Service_Area_Identity_List_Value := ");
single_value->field_mBMS__Service__Area__Identity__List__Value.log_match(match_value.mBMS__Service__Area__Identity__List__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 MBMS__Service__Area__Identity__List_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_mBMS__Service__Area__Identity__List__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.MBMS_Service_Area_Identity_List.");
}
}

void MBMS__Service__Area__Identity__List_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_mBMS__Service__Area__Identity__List__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 MBMS__Service__Area__Identity__List_template[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.MBMS_Service_Area_Identity_List.");
}
}

void MBMS__Service__Area__Identity__List_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MBMS__Service__Area__Identity__List_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.MBMS_Service_Area_Identity_List 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) mBMS__Service__Area__Identity__List__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(), "mBMS_Service_Area_Identity_List_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Service__Area__Identity__List__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.MBMS_Service_Area_Identity_List: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__Service__Area__Identity__List_template* precondition = new MBMS__Service__Area__Identity__List_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__Service__Area__Identity__List_template* implied_template = new MBMS__Service__Area__Identity__List_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__Service__Area__Identity__List_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.MBMS_Service_Area_Identity_List");
  }
  is_ifpresent = param.get_ifpresent();
}

void MBMS__Service__Area__Identity__List_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.MBMS_Service_Area_Identity_List");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Service_Area_Identity_List");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Service_Area_Identity_List");
single_value->field_mBMS__Service__Area__Identity__List__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Service_Area_Identity_List");
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.MBMS_Service_Area_Identity_List");
}

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

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

MBMS__Response::MBMS__Response()
{
}

MBMS__Response::MBMS__Response(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const HEXSTRING& par_causeValue,
    const HEXSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_causeValue(par_causeValue),
  field_spare(par_spare)
{
}

MBMS__Response::MBMS__Response(const MBMS__Response& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MBMS_Response.");
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.causeValue().is_bound()) field_causeValue = other_value.causeValue();
else field_causeValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

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

const TTCN_Typedescriptor_t* MBMS__Response::get_descriptor() const { return &MBMS__Response_descr_; }
MBMS__Response& MBMS__Response::operator=(const MBMS__Response& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MBMS_Response.");
  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.causeValue().is_bound()) field_causeValue = other_value.causeValue();
  else field_causeValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

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

boolean MBMS__Response::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_causeValue.is_bound())
  || (field_spare.is_bound());
}
boolean MBMS__Response::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_causeValue.is_value()
  && field_spare.is_value();
}
void MBMS__Response::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(", causeValue := ");
field_causeValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__Response::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 (causeValue().is_bound()) causeValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void MBMS__Response::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_causeValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void MBMS__Response::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_causeValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int MBMS__Response::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, MBMS__Response_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(MBMS__Response_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, MBMS__Response_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__Response_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_causeValue.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_spare.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;
  if (field_iEI !=  os_121) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__Response::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, MBMS__Response_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__Response_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);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(MBMS__Response_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(MBMS__Response_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_causeValue.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::HEX1_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(MBMS__Response_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(MBMS__Response_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_121) {
  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_121.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MBMS__Response_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
HEXSTRING_template field_causeValue;
HEXSTRING_template field_spare;
};

void MBMS__Response_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_causeValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void MBMS__Response_template::copy_value(const MBMS__Response& 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.causeValue().is_bound()) {
  single_value->field_causeValue = other_value.causeValue();
} else {
  single_value->field_causeValue.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 MBMS__Response_template::copy_template(const MBMS__Response_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.causeValue().get_selection()) {
single_value->field_causeValue = other_value.causeValue();
} else {
single_value->field_causeValue.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 MBMS__Response_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MBMS__Response_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__Response_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.MBMS_Response.");
break;
}
set_selection(other_value);
}

MBMS__Response_template::MBMS__Response_template()
{
}

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

MBMS__Response_template::MBMS__Response_template(const MBMS__Response& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMS__Response_template::match(const MBMS__Response& 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.causeValue().is_bound()) return FALSE;
if(!single_value->field_causeValue.match(other_value.causeValue(), 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.MBMS_Response.");
}
return FALSE;
}

boolean MBMS__Response_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_causeValue.is_bound()
 || single_value->field_spare.is_bound();
}

boolean MBMS__Response_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_causeValue.is_value()
 && single_value->field_spare.is_value();
}

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

MBMS__Response MBMS__Response_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.MBMS_Response.");
MBMS__Response 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_causeValue.is_bound()) {
ret_val.causeValue() = single_value->field_causeValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

HEXSTRING_template& MBMS__Response_template::causeValue()
{
set_specific();
return single_value->field_causeValue;
}

const HEXSTRING_template& MBMS__Response_template::causeValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field causeValue of a non-specific template of type @BSSGP_Types.MBMS_Response.");
return single_value->field_causeValue;
}

HEXSTRING_template& MBMS__Response_template::spare()
{
set_specific();
return single_value->field_spare;
}

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

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

void MBMS__Response_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(", causeValue := ");
single_value->field_causeValue.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 MBMS__Response_template::log_match(const MBMS__Response& 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_causeValue.match(match_value.causeValue(), legacy)){
TTCN_Logger::log_logmatch_info(".causeValue");
single_value->field_causeValue.log_match(match_value.causeValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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(", causeValue := ");
single_value->field_causeValue.log_match(match_value.causeValue(), 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 MBMS__Response_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_causeValue.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.MBMS_Response.");
}
}

void MBMS__Response_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_causeValue.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 MBMS__Response_template[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.MBMS_Response.");
}
}

void MBMS__Response_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MBMS__Response_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.MBMS_Response 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) causeValue().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(), "causeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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.MBMS_Response: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__Response_template* precondition = new MBMS__Response_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__Response_template* implied_template = new MBMS__Response_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__Response_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.MBMS_Response");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

MBMS__Routing__Area__List::MBMS__Routing__Area__List()
{
}

MBMS__Routing__Area__List::MBMS__Routing__Area__List(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const HEXSTRING& par_spare,
    const HEXSTRING& par_number__of__Routing__Area__Identifications,
    const OPTIONAL< OCTETSTRING >& par_routing__Area__Identifications)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_spare(par_spare),
  field_number__of__Routing__Area__Identifications(par_number__of__Routing__Area__Identifications),
  field_routing__Area__Identifications(par_routing__Area__Identifications)
{
}

MBMS__Routing__Area__List::MBMS__Routing__Area__List(const MBMS__Routing__Area__List& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MBMS_Routing_Area_List.");
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.number__of__Routing__Area__Identifications().is_bound()) field_number__of__Routing__Area__Identifications = other_value.number__of__Routing__Area__Identifications();
else field_number__of__Routing__Area__Identifications.clean_up();
if (other_value.routing__Area__Identifications().is_bound()) field_routing__Area__Identifications = other_value.routing__Area__Identifications();
else field_routing__Area__Identifications.clean_up();
}

void MBMS__Routing__Area__List::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_spare.clean_up();
field_number__of__Routing__Area__Identifications.clean_up();
field_routing__Area__Identifications.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__Routing__Area__List::get_descriptor() const { return &MBMS__Routing__Area__List_descr_; }
MBMS__Routing__Area__List& MBMS__Routing__Area__List::operator=(const MBMS__Routing__Area__List& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MBMS_Routing_Area_List.");
  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.number__of__Routing__Area__Identifications().is_bound()) field_number__of__Routing__Area__Identifications = other_value.number__of__Routing__Area__Identifications();
  else field_number__of__Routing__Area__Identifications.clean_up();
  if (other_value.routing__Area__Identifications().is_bound()) field_routing__Area__Identifications = other_value.routing__Area__Identifications();
  else field_routing__Area__Identifications.clean_up();
}
return *this;
}

boolean MBMS__Routing__Area__List::operator==(const MBMS__Routing__Area__List& 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_number__of__Routing__Area__Identifications==other_value.field_number__of__Routing__Area__Identifications
  && field_routing__Area__Identifications==other_value.field_routing__Area__Identifications;
}

boolean MBMS__Routing__Area__List::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_spare.is_bound())
  || (field_number__of__Routing__Area__Identifications.is_bound())
  || (OPTIONAL_OMIT == field_routing__Area__Identifications.get_selection() || field_routing__Area__Identifications.is_bound());
}
boolean MBMS__Routing__Area__List::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_spare.is_value()
  && field_number__of__Routing__Area__Identifications.is_value()
  && (OPTIONAL_OMIT == field_routing__Area__Identifications.get_selection() || field_routing__Area__Identifications.is_value());
}
int MBMS__Routing__Area__List::size_of() const
{
  int ret_val = 5;
  if (field_routing__Area__Identifications.ispresent()) ret_val++;
  return ret_val;
}

void MBMS__Routing__Area__List::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(", number_of_Routing_Area_Identifications := ");
field_number__of__Routing__Area__Identifications.log();
TTCN_Logger::log_event_str(", routing_Area_Identifications := ");
field_routing__Area__Identifications.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__Routing__Area__List::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 (number__of__Routing__Area__Identifications().is_bound()) number__of__Routing__Area__Identifications().set_implicit_omit();
if (!routing__Area__Identifications().is_bound()) routing__Area__Identifications() = OMIT_VALUE;
else routing__Area__Identifications().set_implicit_omit();
}

void MBMS__Routing__Area__List::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.MBMS_Routing_Area_List 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) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) number__of__Routing__Area__Identifications().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) routing__Area__Identifications().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(), "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(), "number_of_Routing_Area_Identifications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__Routing__Area__Identifications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Area_Identifications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Area__Identifications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.MBMS_Routing_Area_List: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.MBMS_Routing_Area_List");
  }
}

void MBMS__Routing__Area__List::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_number__of__Routing__Area__Identifications.encode_text(text_buf);
field_routing__Area__Identifications.encode_text(text_buf);
}

void MBMS__Routing__Area__List::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_number__of__Routing__Area__Identifications.decode_text(text_buf);
field_routing__Area__Identifications.decode_text(text_buf);
}

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

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

int MBMS__Routing__Area__List::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, MBMS__Routing__Area__List_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(MBMS__Routing__Area__List_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, MBMS__Routing__Area__List_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__Routing__Area__List_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_spare.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_number__of__Routing__Area__Identifications.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;
  if (limit > 0 && value_of_length_field2 > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_routing__Area__Identifications = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_routing__Area__Identifications().RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_routing__Area__Identifications = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  }
  }
  }
  else field_routing__Area__Identifications=OMIT_VALUE;
  if (field_iEI !=  os_128) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__Routing__Area__List::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, MBMS__Routing__Area__List_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__Routing__Area__List_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);
  if (field_routing__Area__Identifications.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, OCTETSTRING_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(MBMS__Routing__Area__List_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(MBMS__Routing__Area__List_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_number__of__Routing__Area__Identifications.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  if (field_routing__Area__Identifications.ispresent()) {
  encoded_length += field_routing__Area__Identifications().RAW_encode(OCTETSTRING_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;
  if (field_routing__Area__Identifications.ispresent()) {
  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;
  }else{
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = 0;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = 0;
  }
  }
  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(MBMS__Routing__Area__List_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(MBMS__Routing__Area__List_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_128) {
  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_128.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MBMS__Routing__Area__List_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
HEXSTRING_template field_spare;
HEXSTRING_template field_number__of__Routing__Area__Identifications;
OCTETSTRING_template field_routing__Area__Identifications;
};

void MBMS__Routing__Area__List_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_number__of__Routing__Area__Identifications = ANY_VALUE;
single_value->field_routing__Area__Identifications = ANY_OR_OMIT;
}
}
}

void MBMS__Routing__Area__List_template::copy_value(const MBMS__Routing__Area__List& 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.number__of__Routing__Area__Identifications().is_bound()) {
  single_value->field_number__of__Routing__Area__Identifications = other_value.number__of__Routing__Area__Identifications();
} else {
  single_value->field_number__of__Routing__Area__Identifications.clean_up();
}
if (other_value.routing__Area__Identifications().is_bound()) {
  if (other_value.routing__Area__Identifications().ispresent()) single_value->field_routing__Area__Identifications = other_value.routing__Area__Identifications()();
  else single_value->field_routing__Area__Identifications = OMIT_VALUE;
} else {
  single_value->field_routing__Area__Identifications.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMS__Routing__Area__List_template::copy_template(const MBMS__Routing__Area__List_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.number__of__Routing__Area__Identifications().get_selection()) {
single_value->field_number__of__Routing__Area__Identifications = other_value.number__of__Routing__Area__Identifications();
} else {
single_value->field_number__of__Routing__Area__Identifications.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Area__Identifications().get_selection()) {
single_value->field_routing__Area__Identifications = other_value.routing__Area__Identifications();
} else {
single_value->field_routing__Area__Identifications.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new MBMS__Routing__Area__List_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MBMS__Routing__Area__List_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__Routing__Area__List_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.MBMS_Routing_Area_List.");
break;
}
set_selection(other_value);
}

MBMS__Routing__Area__List_template::MBMS__Routing__Area__List_template()
{
}

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

MBMS__Routing__Area__List_template::MBMS__Routing__Area__List_template(const MBMS__Routing__Area__List& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMS__Routing__Area__List_template::match(const MBMS__Routing__Area__List& 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.number__of__Routing__Area__Identifications().is_bound()) return FALSE;
if(!single_value->field_number__of__Routing__Area__Identifications.match(other_value.number__of__Routing__Area__Identifications(), legacy))return FALSE;
if(!other_value.routing__Area__Identifications().is_bound()) return FALSE;
if((other_value.routing__Area__Identifications().ispresent() ? !single_value->field_routing__Area__Identifications.match((const OCTETSTRING&)other_value.routing__Area__Identifications(), legacy) : !single_value->field_routing__Area__Identifications.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.MBMS_Routing_Area_List.");
}
return FALSE;
}

boolean MBMS__Routing__Area__List_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_number__of__Routing__Area__Identifications.is_bound()
 || (single_value->field_routing__Area__Identifications.is_omit() || single_value->field_routing__Area__Identifications.is_bound());
}

boolean MBMS__Routing__Area__List_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_number__of__Routing__Area__Identifications.is_value()
 && (single_value->field_routing__Area__Identifications.is_omit() || single_value->field_routing__Area__Identifications.is_value());
}

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

MBMS__Routing__Area__List MBMS__Routing__Area__List_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.MBMS_Routing_Area_List.");
MBMS__Routing__Area__List 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_number__of__Routing__Area__Identifications.is_bound()) {
ret_val.number__of__Routing__Area__Identifications() = single_value->field_number__of__Routing__Area__Identifications.valueof();
}
if (single_value->field_routing__Area__Identifications.is_omit()) ret_val.routing__Area__Identifications() = OMIT_VALUE;
else if (single_value->field_routing__Area__Identifications.is_bound()) {
ret_val.routing__Area__Identifications() = single_value->field_routing__Area__Identifications.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

HEXSTRING_template& MBMS__Routing__Area__List_template::spare()
{
set_specific();
return single_value->field_spare;
}

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

HEXSTRING_template& MBMS__Routing__Area__List_template::number__of__Routing__Area__Identifications()
{
set_specific();
return single_value->field_number__of__Routing__Area__Identifications;
}

const HEXSTRING_template& MBMS__Routing__Area__List_template::number__of__Routing__Area__Identifications() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_Routing_Area_Identifications of a non-specific template of type @BSSGP_Types.MBMS_Routing_Area_List.");
return single_value->field_number__of__Routing__Area__Identifications;
}

OCTETSTRING_template& MBMS__Routing__Area__List_template::routing__Area__Identifications()
{
set_specific();
return single_value->field_routing__Area__Identifications;
}

const OCTETSTRING_template& MBMS__Routing__Area__List_template::routing__Area__Identifications() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Area_Identifications of a non-specific template of type @BSSGP_Types.MBMS_Routing_Area_List.");
return single_value->field_routing__Area__Identifications;
}

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

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

void MBMS__Routing__Area__List_template::log_match(const MBMS__Routing__Area__List& 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_number__of__Routing__Area__Identifications.match(match_value.number__of__Routing__Area__Identifications(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_Routing_Area_Identifications");
single_value->field_number__of__Routing__Area__Identifications.log_match(match_value.number__of__Routing__Area__Identifications(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.routing__Area__Identifications().ispresent()){
if(!single_value->field_routing__Area__Identifications.match(match_value.routing__Area__Identifications(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Area_Identifications");
single_value->field_routing__Area__Identifications.log_match(match_value.routing__Area__Identifications(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Area__Identifications.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Area_Identifications := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Area__Identifications.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("{ 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(", number_of_Routing_Area_Identifications := ");
single_value->field_number__of__Routing__Area__Identifications.log_match(match_value.number__of__Routing__Area__Identifications(), legacy);
TTCN_Logger::log_event_str(", routing_Area_Identifications := ");
if (match_value.routing__Area__Identifications().ispresent()) {
single_value->field_routing__Area__Identifications.log_match(match_value.routing__Area__Identifications(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Area__Identifications.log();
if (single_value->field_routing__Area__Identifications.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void MBMS__Routing__Area__List_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_number__of__Routing__Area__Identifications.encode_text(text_buf);
single_value->field_routing__Area__Identifications.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.MBMS_Routing_Area_List.");
}
}

void MBMS__Routing__Area__List_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_number__of__Routing__Area__Identifications.decode_text(text_buf);
single_value->field_routing__Area__Identifications.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MBMS__Routing__Area__List_template[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.MBMS_Routing_Area_List.");
}
}

void MBMS__Routing__Area__List_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MBMS__Routing__Area__List_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.MBMS_Routing_Area_List 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) spare().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) number__of__Routing__Area__Identifications().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) routing__Area__Identifications().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(), "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(), "number_of_Routing_Area_Identifications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__Routing__Area__Identifications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Area_Identifications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Area__Identifications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.MBMS_Routing_Area_List: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__Routing__Area__List_template* precondition = new MBMS__Routing__Area__List_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__Routing__Area__List_template* implied_template = new MBMS__Routing__Area__List_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__Routing__Area__List_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.MBMS_Routing_Area_List");
  }
  is_ifpresent = param.get_ifpresent();
}

void MBMS__Routing__Area__List_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.MBMS_Routing_Area_List");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Routing_Area_List");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Routing_Area_List");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Routing_Area_List");
single_value->field_number__of__Routing__Area__Identifications.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Routing_Area_List");
single_value->field_routing__Area__Identifications.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Routing_Area_List");
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.MBMS_Routing_Area_List");
}

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

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

MBMS__Session__Information::MBMS__Session__Information()
{
}

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

MBMS__Session__Information::MBMS__Session__Information(const MBMS__Session__Information& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MBMS_Session_Information.");
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.bCMC().is_bound()) field_bCMC = other_value.bCMC();
else field_bCMC.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

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

const TTCN_Typedescriptor_t* MBMS__Session__Information::get_descriptor() const { return &MBMS__Session__Information_descr_; }
MBMS__Session__Information& MBMS__Session__Information::operator=(const MBMS__Session__Information& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MBMS_Session_Information.");
  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.bCMC().is_bound()) field_bCMC = other_value.bCMC();
  else field_bCMC.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

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

boolean MBMS__Session__Information::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_bCMC.is_bound())
  || (field_spare.is_bound());
}
boolean MBMS__Session__Information::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_bCMC.is_value()
  && field_spare.is_value();
}
void MBMS__Session__Information::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(", bCMC := ");
field_bCMC.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__Session__Information::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 (bCMC().is_bound()) bCMC().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void MBMS__Session__Information::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.MBMS_Session_Information 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) bCMC().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(), "bCMC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bCMC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.MBMS_Session_Information: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.MBMS_Session_Information");
  }
}

void MBMS__Session__Information::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_bCMC.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void MBMS__Session__Information::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_bCMC.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int MBMS__Session__Information::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, MBMS__Session__Information_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(MBMS__Session__Information_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, MBMS__Session__Information_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__Session__Information_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_bCMC.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_129) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__Session__Information::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, MBMS__Session__Information_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__Session__Information_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(MBMS__Session__Information_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(MBMS__Session__Information_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_bCMC.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(MBMS__Session__Information_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(MBMS__Session__Information_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_129) {
  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_129.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

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

void MBMS__Session__Information_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_bCMC = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void MBMS__Session__Information_template::copy_value(const MBMS__Session__Information& 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.bCMC().is_bound()) {
  single_value->field_bCMC = other_value.bCMC();
} else {
  single_value->field_bCMC.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 MBMS__Session__Information_template::copy_template(const MBMS__Session__Information_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.bCMC().get_selection()) {
single_value->field_bCMC = other_value.bCMC();
} else {
single_value->field_bCMC.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 MBMS__Session__Information_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MBMS__Session__Information_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__Session__Information_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.MBMS_Session_Information.");
break;
}
set_selection(other_value);
}

MBMS__Session__Information_template::MBMS__Session__Information_template()
{
}

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

MBMS__Session__Information_template::MBMS__Session__Information_template(const MBMS__Session__Information& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMS__Session__Information_template::match(const MBMS__Session__Information& 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.bCMC().is_bound()) return FALSE;
if(!single_value->field_bCMC.match(other_value.bCMC(), 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.MBMS_Session_Information.");
}
return FALSE;
}

boolean MBMS__Session__Information_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_bCMC.is_bound()
 || single_value->field_spare.is_bound();
}

boolean MBMS__Session__Information_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_bCMC.is_value()
 && single_value->field_spare.is_value();
}

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

MBMS__Session__Information MBMS__Session__Information_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.MBMS_Session_Information.");
MBMS__Session__Information 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_bCMC.is_bound()) {
ret_val.bCMC() = single_value->field_bCMC.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

BITSTRING_template& MBMS__Session__Information_template::bCMC()
{
set_specific();
return single_value->field_bCMC;
}

const BITSTRING_template& MBMS__Session__Information_template::bCMC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bCMC of a non-specific template of type @BSSGP_Types.MBMS_Session_Information.");
return single_value->field_bCMC;
}

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

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

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

void MBMS__Session__Information_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(", bCMC := ");
single_value->field_bCMC.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 MBMS__Session__Information_template::log_match(const MBMS__Session__Information& 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_bCMC.match(match_value.bCMC(), legacy)){
TTCN_Logger::log_logmatch_info(".bCMC");
single_value->field_bCMC.log_match(match_value.bCMC(), 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(", bCMC := ");
single_value->field_bCMC.log_match(match_value.bCMC(), 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 MBMS__Session__Information_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_bCMC.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.MBMS_Session_Information.");
}
}

void MBMS__Session__Information_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_bCMC.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 MBMS__Session__Information_template[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.MBMS_Session_Information.");
}
}

void MBMS__Session__Information_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MBMS__Session__Information_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.MBMS_Session_Information 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) bCMC().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(), "bCMC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bCMC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.MBMS_Session_Information: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__Session__Information_template* precondition = new MBMS__Session__Information_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__Session__Information_template* implied_template = new MBMS__Session__Information_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__Session__Information_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.MBMS_Session_Information");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

TMGI__BSSGP::TMGI__BSSGP()
{
}

TMGI__BSSGP::TMGI__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_mBMS__Service__ID,
    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_mBMS__Service__ID(par_mBMS__Service__ID),
  field_mccDigit1(par_mccDigit1),
  field_mccDigit2(par_mccDigit2),
  field_mccDigit3(par_mccDigit3),
  field_mncDigit3(par_mncDigit3),
  field_mncDigit1(par_mncDigit1),
  field_mncDigit2(par_mncDigit2)
{
}

TMGI__BSSGP::TMGI__BSSGP(const TMGI__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.TMGI_BSSGP.");
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.mBMS__Service__ID().is_bound()) field_mBMS__Service__ID = other_value.mBMS__Service__ID();
else field_mBMS__Service__ID.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 TMGI__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_mBMS__Service__ID.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* TMGI__BSSGP::get_descriptor() const { return &TMGI__BSSGP_descr_; }
TMGI__BSSGP& TMGI__BSSGP::operator=(const TMGI__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.TMGI_BSSGP.");
  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.mBMS__Service__ID().is_bound()) field_mBMS__Service__ID = other_value.mBMS__Service__ID();
  else field_mBMS__Service__ID.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 TMGI__BSSGP::operator==(const TMGI__BSSGP& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_mBMS__Service__ID==other_value.field_mBMS__Service__ID
  && 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 TMGI__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mBMS__Service__ID.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 TMGI__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_mBMS__Service__ID.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 TMGI__BSSGP::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(", mBMS_Service_ID := ");
field_mBMS__Service__ID.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 TMGI__BSSGP::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 (mBMS__Service__ID().is_bound()) mBMS__Service__ID().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 TMGI__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 (10<param.get_size()) {
      param.error("record value of type @BSSGP_Types.TMGI_BSSGP has 10 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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) mBMS__Service__ID().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(9));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "mBMS_Service_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Service__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(), "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.TMGI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.TMGI_BSSGP");
  }
}

void TMGI__BSSGP::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_mBMS__Service__ID.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 TMGI__BSSGP::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_mBMS__Service__ID.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 TMGI__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 TMGI__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 TMGI__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;
  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, TMGI__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(TMGI__BSSGP_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, TMGI__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(TMGI__BSSGP_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_mBMS__Service__ID.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;
  RAW_Force_Omit field_4_force_omit(4, 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_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_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_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_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_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_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_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_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_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::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_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;
  if (field_iEI !=  os_28) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TMGI__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 = 10;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(10);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, TMGI__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, TMGI__BSSGP_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT3_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::HEX1_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(TMGI__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(TMGI__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mBMS__Service__ID.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[9]);
  {
  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 = 7;
  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(7);
  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;
  }
  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(TMGI__BSSGP_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(TMGI__BSSGP_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_28) {
  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_28.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct TMGI__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_mBMS__Service__ID;
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 TMGI__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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_mBMS__Service__ID = 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 TMGI__BSSGP_template::copy_value(const TMGI__BSSGP& 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.mBMS__Service__ID().is_bound()) {
  single_value->field_mBMS__Service__ID = other_value.mBMS__Service__ID();
} else {
  single_value->field_mBMS__Service__ID.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 TMGI__BSSGP_template::copy_template(const TMGI__BSSGP_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.mBMS__Service__ID().get_selection()) {
single_value->field_mBMS__Service__ID = other_value.mBMS__Service__ID();
} else {
single_value->field_mBMS__Service__ID.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 TMGI__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 TMGI__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new TMGI__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.TMGI_BSSGP.");
break;
}
set_selection(other_value);
}

TMGI__BSSGP_template::TMGI__BSSGP_template()
{
}

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

TMGI__BSSGP_template::TMGI__BSSGP_template(const TMGI__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TMGI__BSSGP_template::match(const TMGI__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.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.mBMS__Service__ID().is_bound()) return FALSE;
if(!single_value->field_mBMS__Service__ID.match(other_value.mBMS__Service__ID(), 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.TMGI_BSSGP.");
}
return FALSE;
}

boolean TMGI__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_mBMS__Service__ID.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 TMGI__BSSGP_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_mBMS__Service__ID.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 TMGI__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;
}

TMGI__BSSGP TMGI__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.TMGI_BSSGP.");
TMGI__BSSGP 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_mBMS__Service__ID.is_bound()) {
ret_val.mBMS__Service__ID() = single_value->field_mBMS__Service__ID.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 TMGI__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.TMGI_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TMGI__BSSGP_template[list_length];
}

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

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

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

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

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

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

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

OCTETSTRING_template& TMGI__BSSGP_template::mBMS__Service__ID()
{
set_specific();
return single_value->field_mBMS__Service__ID;
}

const OCTETSTRING_template& TMGI__BSSGP_template::mBMS__Service__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_Service_ID of a non-specific template of type @BSSGP_Types.TMGI_BSSGP.");
return single_value->field_mBMS__Service__ID;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

void TMGI__BSSGP_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(", mBMS_Service_ID := ");
single_value->field_mBMS__Service__ID.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 TMGI__BSSGP_template::log_match(const TMGI__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_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_mBMS__Service__ID.match(match_value.mBMS__Service__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_Service_ID");
single_value->field_mBMS__Service__ID.log_match(match_value.mBMS__Service__ID(), 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(", mBMS_Service_ID := ");
single_value->field_mBMS__Service__ID.log_match(match_value.mBMS__Service__ID(), 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 TMGI__BSSGP_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_mBMS__Service__ID.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.TMGI_BSSGP.");
}
}

void TMGI__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_mBMS__Service__ID.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 TMGI__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.TMGI_BSSGP.");
}
}

void TMGI__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: {
    TMGI__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 (10<param.get_size()) {
      param.error("record template of type @BSSGP_Types.TMGI_BSSGP has 10 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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) mBMS__Service__ID().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(9));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "mBMS_Service_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__Service__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(), "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.TMGI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TMGI__BSSGP_template* precondition = new TMGI__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    TMGI__BSSGP_template* implied_template = new TMGI__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TMGI__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.TMGI_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

MBMS__Stop__Cause::MBMS__Stop__Cause()
{
}

MBMS__Stop__Cause::MBMS__Stop__Cause(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const HEXSTRING& par_causeValue,
    const HEXSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_causeValue(par_causeValue),
  field_spare(par_spare)
{
}

MBMS__Stop__Cause::MBMS__Stop__Cause(const MBMS__Stop__Cause& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MBMS_Stop_Cause.");
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.causeValue().is_bound()) field_causeValue = other_value.causeValue();
else field_causeValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

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

const TTCN_Typedescriptor_t* MBMS__Stop__Cause::get_descriptor() const { return &MBMS__Stop__Cause_descr_; }
MBMS__Stop__Cause& MBMS__Stop__Cause::operator=(const MBMS__Stop__Cause& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MBMS_Stop_Cause.");
  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.causeValue().is_bound()) field_causeValue = other_value.causeValue();
  else field_causeValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

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

boolean MBMS__Stop__Cause::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_causeValue.is_bound())
  || (field_spare.is_bound());
}
boolean MBMS__Stop__Cause::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_causeValue.is_value()
  && field_spare.is_value();
}
void MBMS__Stop__Cause::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(", causeValue := ");
field_causeValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__Stop__Cause::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 (causeValue().is_bound()) causeValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

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

void MBMS__Stop__Cause::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_causeValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void MBMS__Stop__Cause::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_causeValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

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

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

int MBMS__Stop__Cause::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, MBMS__Stop__Cause_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(MBMS__Stop__Cause_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, MBMS__Stop__Cause_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__Stop__Cause_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_causeValue.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_spare.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;
  if (field_iEI !=  os_132) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__Stop__Cause::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, MBMS__Stop__Cause_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__Stop__Cause_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);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(MBMS__Stop__Cause_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(MBMS__Stop__Cause_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_causeValue.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::HEX1_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(MBMS__Stop__Cause_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(MBMS__Stop__Cause_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_132) {
  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_132.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MBMS__Stop__Cause_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
HEXSTRING_template field_causeValue;
HEXSTRING_template field_spare;
};

void MBMS__Stop__Cause_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_causeValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void MBMS__Stop__Cause_template::copy_value(const MBMS__Stop__Cause& 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.causeValue().is_bound()) {
  single_value->field_causeValue = other_value.causeValue();
} else {
  single_value->field_causeValue.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 MBMS__Stop__Cause_template::copy_template(const MBMS__Stop__Cause_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.causeValue().get_selection()) {
single_value->field_causeValue = other_value.causeValue();
} else {
single_value->field_causeValue.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 MBMS__Stop__Cause_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MBMS__Stop__Cause_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__Stop__Cause_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.MBMS_Stop_Cause.");
break;
}
set_selection(other_value);
}

MBMS__Stop__Cause_template::MBMS__Stop__Cause_template()
{
}

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

MBMS__Stop__Cause_template::MBMS__Stop__Cause_template(const MBMS__Stop__Cause& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MBMS__Stop__Cause_template::match(const MBMS__Stop__Cause& 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.causeValue().is_bound()) return FALSE;
if(!single_value->field_causeValue.match(other_value.causeValue(), 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.MBMS_Stop_Cause.");
}
return FALSE;
}

boolean MBMS__Stop__Cause_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_causeValue.is_bound()
 || single_value->field_spare.is_bound();
}

boolean MBMS__Stop__Cause_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_causeValue.is_value()
 && single_value->field_spare.is_value();
}

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

MBMS__Stop__Cause MBMS__Stop__Cause_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.MBMS_Stop_Cause.");
MBMS__Stop__Cause 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_causeValue.is_bound()) {
ret_val.causeValue() = single_value->field_causeValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

HEXSTRING_template& MBMS__Stop__Cause_template::causeValue()
{
set_specific();
return single_value->field_causeValue;
}

const HEXSTRING_template& MBMS__Stop__Cause_template::causeValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field causeValue of a non-specific template of type @BSSGP_Types.MBMS_Stop_Cause.");
return single_value->field_causeValue;
}

HEXSTRING_template& MBMS__Stop__Cause_template::spare()
{
set_specific();
return single_value->field_spare;
}

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

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

void MBMS__Stop__Cause_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(", causeValue := ");
single_value->field_causeValue.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 MBMS__Stop__Cause_template::log_match(const MBMS__Stop__Cause& 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_causeValue.match(match_value.causeValue(), legacy)){
TTCN_Logger::log_logmatch_info(".causeValue");
single_value->field_causeValue.log_match(match_value.causeValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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(", causeValue := ");
single_value->field_causeValue.log_match(match_value.causeValue(), 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 MBMS__Stop__Cause_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_causeValue.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.MBMS_Stop_Cause.");
}
}

void MBMS__Stop__Cause_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_causeValue.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 MBMS__Stop__Cause_template[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.MBMS_Stop_Cause.");
}
}

void MBMS__Stop__Cause_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MBMS__Stop__Cause_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.MBMS_Stop_Cause 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) causeValue().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(), "causeValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          causeValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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.MBMS_Stop_Cause: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__Stop__Cause_template* precondition = new MBMS__Stop__Cause_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__Stop__Cause_template* implied_template = new MBMS__Stop__Cause_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__Stop__Cause_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.MBMS_Stop_Cause");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

Source__BSS__to__Target__BSS__Transparent__Container__Contents::Source__BSS__to__Target__BSS__Transparent__Container__Contents()
{
}

Source__BSS__to__Target__BSS__Transparent__Container__Contents::Source__BSS__to__Target__BSS__Transparent__Container__Contents(const MS__Radio__Access__Capability& par_mS__Radio__Access__Capability,
    const OPTIONAL< Inter__RAT__Handover__Info__BSSGP >& par_inter__RAT__Handover__Info,
    const OPTIONAL< Page__Mode__BSSGP >& par_page__Mode__BSSGP,
    const OPTIONAL< Container__ID__BSSGP >& par_container__ID,
    const OPTIONAL< Global__TFI__BSSGP >& par_global__TFI,
    const OPTIONAL< PS__HandoverIndications >& par_pS__HandoverIndications,
    const OPTIONAL< CS__Indication >& par_cS__Indication,
    const OPTIONAL< E__UTRAN__Inter__RAT__Handover__Info >& par_e__UTRAN__Inter__RAT__Handover__Info,
    const OPTIONAL< IRAT__Measurement__Configuration >& par_iRAT__Measurement__Configuration,
    const OPTIONAL< Source__Cell__ID >& par_source__Cell__ID,
    const OPTIONAL< IRAT__Measurement__Configuration__Extended__eARFCNs >& par_iRAT__Measurement__Configuration__Extended__eARFCNs)
  :   field_mS__Radio__Access__Capability(par_mS__Radio__Access__Capability),
  field_inter__RAT__Handover__Info(par_inter__RAT__Handover__Info),
  field_page__Mode__BSSGP(par_page__Mode__BSSGP),
  field_container__ID(par_container__ID),
  field_global__TFI(par_global__TFI),
  field_pS__HandoverIndications(par_pS__HandoverIndications),
  field_cS__Indication(par_cS__Indication),
  field_e__UTRAN__Inter__RAT__Handover__Info(par_e__UTRAN__Inter__RAT__Handover__Info),
  field_iRAT__Measurement__Configuration(par_iRAT__Measurement__Configuration),
  field_source__Cell__ID(par_source__Cell__ID),
  field_iRAT__Measurement__Configuration__Extended__eARFCNs(par_iRAT__Measurement__Configuration__Extended__eARFCNs)
{
}

Source__BSS__to__Target__BSS__Transparent__Container__Contents::Source__BSS__to__Target__BSS__Transparent__Container__Contents(const Source__BSS__to__Target__BSS__Transparent__Container__Contents& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
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.inter__RAT__Handover__Info().is_bound()) field_inter__RAT__Handover__Info = other_value.inter__RAT__Handover__Info();
else field_inter__RAT__Handover__Info.clean_up();
if (other_value.page__Mode__BSSGP().is_bound()) field_page__Mode__BSSGP = other_value.page__Mode__BSSGP();
else field_page__Mode__BSSGP.clean_up();
if (other_value.container__ID().is_bound()) field_container__ID = other_value.container__ID();
else field_container__ID.clean_up();
if (other_value.global__TFI().is_bound()) field_global__TFI = other_value.global__TFI();
else field_global__TFI.clean_up();
if (other_value.pS__HandoverIndications().is_bound()) field_pS__HandoverIndications = other_value.pS__HandoverIndications();
else field_pS__HandoverIndications.clean_up();
if (other_value.cS__Indication().is_bound()) field_cS__Indication = other_value.cS__Indication();
else field_cS__Indication.clean_up();
if (other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info();
else field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
if (other_value.iRAT__Measurement__Configuration().is_bound()) field_iRAT__Measurement__Configuration = other_value.iRAT__Measurement__Configuration();
else field_iRAT__Measurement__Configuration.clean_up();
if (other_value.source__Cell__ID().is_bound()) field_source__Cell__ID = other_value.source__Cell__ID();
else field_source__Cell__ID.clean_up();
if (other_value.iRAT__Measurement__Configuration__Extended__eARFCNs().is_bound()) field_iRAT__Measurement__Configuration__Extended__eARFCNs = other_value.iRAT__Measurement__Configuration__Extended__eARFCNs();
else field_iRAT__Measurement__Configuration__Extended__eARFCNs.clean_up();
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents::clean_up()
{
field_mS__Radio__Access__Capability.clean_up();
field_inter__RAT__Handover__Info.clean_up();
field_page__Mode__BSSGP.clean_up();
field_container__ID.clean_up();
field_global__TFI.clean_up();
field_pS__HandoverIndications.clean_up();
field_cS__Indication.clean_up();
field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
field_iRAT__Measurement__Configuration.clean_up();
field_source__Cell__ID.clean_up();
field_iRAT__Measurement__Configuration__Extended__eARFCNs.clean_up();
}

const TTCN_Typedescriptor_t* Source__BSS__to__Target__BSS__Transparent__Container__Contents::get_descriptor() const { return &Source__BSS__to__Target__BSS__Transparent__Container__Contents_descr_; }
Source__BSS__to__Target__BSS__Transparent__Container__Contents& Source__BSS__to__Target__BSS__Transparent__Container__Contents::operator=(const Source__BSS__to__Target__BSS__Transparent__Container__Contents& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
  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.inter__RAT__Handover__Info().is_bound()) field_inter__RAT__Handover__Info = other_value.inter__RAT__Handover__Info();
  else field_inter__RAT__Handover__Info.clean_up();
  if (other_value.page__Mode__BSSGP().is_bound()) field_page__Mode__BSSGP = other_value.page__Mode__BSSGP();
  else field_page__Mode__BSSGP.clean_up();
  if (other_value.container__ID().is_bound()) field_container__ID = other_value.container__ID();
  else field_container__ID.clean_up();
  if (other_value.global__TFI().is_bound()) field_global__TFI = other_value.global__TFI();
  else field_global__TFI.clean_up();
  if (other_value.pS__HandoverIndications().is_bound()) field_pS__HandoverIndications = other_value.pS__HandoverIndications();
  else field_pS__HandoverIndications.clean_up();
  if (other_value.cS__Indication().is_bound()) field_cS__Indication = other_value.cS__Indication();
  else field_cS__Indication.clean_up();
  if (other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info();
  else field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
  if (other_value.iRAT__Measurement__Configuration().is_bound()) field_iRAT__Measurement__Configuration = other_value.iRAT__Measurement__Configuration();
  else field_iRAT__Measurement__Configuration.clean_up();
  if (other_value.source__Cell__ID().is_bound()) field_source__Cell__ID = other_value.source__Cell__ID();
  else field_source__Cell__ID.clean_up();
  if (other_value.iRAT__Measurement__Configuration__Extended__eARFCNs().is_bound()) field_iRAT__Measurement__Configuration__Extended__eARFCNs = other_value.iRAT__Measurement__Configuration__Extended__eARFCNs();
  else field_iRAT__Measurement__Configuration__Extended__eARFCNs.clean_up();
}
return *this;
}

boolean Source__BSS__to__Target__BSS__Transparent__Container__Contents::operator==(const Source__BSS__to__Target__BSS__Transparent__Container__Contents& other_value) const
{
return field_mS__Radio__Access__Capability==other_value.field_mS__Radio__Access__Capability
  && field_inter__RAT__Handover__Info==other_value.field_inter__RAT__Handover__Info
  && field_page__Mode__BSSGP==other_value.field_page__Mode__BSSGP
  && field_container__ID==other_value.field_container__ID
  && field_global__TFI==other_value.field_global__TFI
  && field_pS__HandoverIndications==other_value.field_pS__HandoverIndications
  && field_cS__Indication==other_value.field_cS__Indication
  && field_e__UTRAN__Inter__RAT__Handover__Info==other_value.field_e__UTRAN__Inter__RAT__Handover__Info
  && field_iRAT__Measurement__Configuration==other_value.field_iRAT__Measurement__Configuration
  && field_source__Cell__ID==other_value.field_source__Cell__ID
  && field_iRAT__Measurement__Configuration__Extended__eARFCNs==other_value.field_iRAT__Measurement__Configuration__Extended__eARFCNs;
}

boolean Source__BSS__to__Target__BSS__Transparent__Container__Contents::is_bound() const
{
return (field_mS__Radio__Access__Capability.is_bound())
  || (OPTIONAL_OMIT == field_inter__RAT__Handover__Info.get_selection() || field_inter__RAT__Handover__Info.is_bound())
  || (OPTIONAL_OMIT == field_page__Mode__BSSGP.get_selection() || field_page__Mode__BSSGP.is_bound())
  || (OPTIONAL_OMIT == field_container__ID.get_selection() || field_container__ID.is_bound())
  || (OPTIONAL_OMIT == field_global__TFI.get_selection() || field_global__TFI.is_bound())
  || (OPTIONAL_OMIT == field_pS__HandoverIndications.get_selection() || field_pS__HandoverIndications.is_bound())
  || (OPTIONAL_OMIT == field_cS__Indication.get_selection() || field_cS__Indication.is_bound())
  || (OPTIONAL_OMIT == field_e__UTRAN__Inter__RAT__Handover__Info.get_selection() || field_e__UTRAN__Inter__RAT__Handover__Info.is_bound())
  || (OPTIONAL_OMIT == field_iRAT__Measurement__Configuration.get_selection() || field_iRAT__Measurement__Configuration.is_bound())
  || (OPTIONAL_OMIT == field_source__Cell__ID.get_selection() || field_source__Cell__ID.is_bound())
  || (OPTIONAL_OMIT == field_iRAT__Measurement__Configuration__Extended__eARFCNs.get_selection() || field_iRAT__Measurement__Configuration__Extended__eARFCNs.is_bound());
}
boolean Source__BSS__to__Target__BSS__Transparent__Container__Contents::is_value() const
{
return field_mS__Radio__Access__Capability.is_value()
  && (OPTIONAL_OMIT == field_inter__RAT__Handover__Info.get_selection() || field_inter__RAT__Handover__Info.is_value())
  && (OPTIONAL_OMIT == field_page__Mode__BSSGP.get_selection() || field_page__Mode__BSSGP.is_value())
  && (OPTIONAL_OMIT == field_container__ID.get_selection() || field_container__ID.is_value())
  && (OPTIONAL_OMIT == field_global__TFI.get_selection() || field_global__TFI.is_value())
  && (OPTIONAL_OMIT == field_pS__HandoverIndications.get_selection() || field_pS__HandoverIndications.is_value())
  && (OPTIONAL_OMIT == field_cS__Indication.get_selection() || field_cS__Indication.is_value())
  && (OPTIONAL_OMIT == field_e__UTRAN__Inter__RAT__Handover__Info.get_selection() || field_e__UTRAN__Inter__RAT__Handover__Info.is_value())
  && (OPTIONAL_OMIT == field_iRAT__Measurement__Configuration.get_selection() || field_iRAT__Measurement__Configuration.is_value())
  && (OPTIONAL_OMIT == field_source__Cell__ID.get_selection() || field_source__Cell__ID.is_value())
  && (OPTIONAL_OMIT == field_iRAT__Measurement__Configuration__Extended__eARFCNs.get_selection() || field_iRAT__Measurement__Configuration__Extended__eARFCNs.is_value());
}
int Source__BSS__to__Target__BSS__Transparent__Container__Contents::size_of() const
{
  int ret_val = 1;
  if (field_inter__RAT__Handover__Info.ispresent()) ret_val++;
  if (field_page__Mode__BSSGP.ispresent()) ret_val++;
  if (field_container__ID.ispresent()) ret_val++;
  if (field_global__TFI.ispresent()) ret_val++;
  if (field_pS__HandoverIndications.ispresent()) ret_val++;
  if (field_cS__Indication.ispresent()) ret_val++;
  if (field_e__UTRAN__Inter__RAT__Handover__Info.ispresent()) ret_val++;
  if (field_iRAT__Measurement__Configuration.ispresent()) ret_val++;
  if (field_source__Cell__ID.ispresent()) ret_val++;
  if (field_iRAT__Measurement__Configuration__Extended__eARFCNs.ispresent()) ret_val++;
  return ret_val;
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ mS_Radio_Access_Capability := ");
field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(", inter_RAT_Handover_Info := ");
field_inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", page_Mode_BSSGP := ");
field_page__Mode__BSSGP.log();
TTCN_Logger::log_event_str(", container_ID := ");
field_container__ID.log();
TTCN_Logger::log_event_str(", global_TFI := ");
field_global__TFI.log();
TTCN_Logger::log_event_str(", pS_HandoverIndications := ");
field_pS__HandoverIndications.log();
TTCN_Logger::log_event_str(", cS_Indication := ");
field_cS__Indication.log();
TTCN_Logger::log_event_str(", e_UTRAN_Inter_RAT_Handover_Info := ");
field_e__UTRAN__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", iRAT_Measurement_Configuration := ");
field_iRAT__Measurement__Configuration.log();
TTCN_Logger::log_event_str(", source_Cell_ID := ");
field_source__Cell__ID.log();
TTCN_Logger::log_event_str(", iRAT_Measurement_Configuration_Extended_eARFCNs := ");
field_iRAT__Measurement__Configuration__Extended__eARFCNs.log();
TTCN_Logger::log_event_str(" }");
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents::set_implicit_omit()
{
if (mS__Radio__Access__Capability().is_bound()) mS__Radio__Access__Capability().set_implicit_omit();
if (!inter__RAT__Handover__Info().is_bound()) inter__RAT__Handover__Info() = OMIT_VALUE;
else inter__RAT__Handover__Info().set_implicit_omit();
if (!page__Mode__BSSGP().is_bound()) page__Mode__BSSGP() = OMIT_VALUE;
else page__Mode__BSSGP().set_implicit_omit();
if (!container__ID().is_bound()) container__ID() = OMIT_VALUE;
else container__ID().set_implicit_omit();
if (!global__TFI().is_bound()) global__TFI() = OMIT_VALUE;
else global__TFI().set_implicit_omit();
if (!pS__HandoverIndications().is_bound()) pS__HandoverIndications() = OMIT_VALUE;
else pS__HandoverIndications().set_implicit_omit();
if (!cS__Indication().is_bound()) cS__Indication() = OMIT_VALUE;
else cS__Indication().set_implicit_omit();
if (!e__UTRAN__Inter__RAT__Handover__Info().is_bound()) e__UTRAN__Inter__RAT__Handover__Info() = OMIT_VALUE;
else e__UTRAN__Inter__RAT__Handover__Info().set_implicit_omit();
if (!iRAT__Measurement__Configuration().is_bound()) iRAT__Measurement__Configuration() = OMIT_VALUE;
else iRAT__Measurement__Configuration().set_implicit_omit();
if (!source__Cell__ID().is_bound()) source__Cell__ID() = OMIT_VALUE;
else source__Cell__ID().set_implicit_omit();
if (!iRAT__Measurement__Configuration__Extended__eARFCNs().is_bound()) iRAT__Measurement__Configuration__Extended__eARFCNs() = OMIT_VALUE;
else iRAT__Measurement__Configuration__Extended__eARFCNs().set_implicit_omit();
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents::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.Source_BSS_to_Target_BSS_Transparent_Container_Contents 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) mS__Radio__Access__Capability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) inter__RAT__Handover__Info().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) page__Mode__BSSGP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) container__ID().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) global__TFI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) pS__HandoverIndications().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cS__Indication().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) e__UTRAN__Inter__RAT__Handover__Info().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) iRAT__Measurement__Configuration().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) source__Cell__ID().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) iRAT__Measurement__Configuration__Extended__eARFCNs().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(), "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(), "inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "page_Mode_BSSGP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          page__Mode__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(), "container_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          container__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(), "global_TFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          global__TFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pS_HandoverIndications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__HandoverIndications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_Indication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__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(), "e_UTRAN_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__UTRAN__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iRAT_Measurement_Configuration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iRAT__Measurement__Configuration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__Cell__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(), "iRAT_Measurement_Configuration_Extended_eARFCNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iRAT__Measurement__Configuration__Extended__eARFCNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Source_BSS_to_Target_BSS_Transparent_Container_Contents: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
  }
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents::encode_text(Text_Buf& text_buf) const
{
field_mS__Radio__Access__Capability.encode_text(text_buf);
field_inter__RAT__Handover__Info.encode_text(text_buf);
field_page__Mode__BSSGP.encode_text(text_buf);
field_container__ID.encode_text(text_buf);
field_global__TFI.encode_text(text_buf);
field_pS__HandoverIndications.encode_text(text_buf);
field_cS__Indication.encode_text(text_buf);
field_e__UTRAN__Inter__RAT__Handover__Info.encode_text(text_buf);
field_iRAT__Measurement__Configuration.encode_text(text_buf);
field_source__Cell__ID.encode_text(text_buf);
field_iRAT__Measurement__Configuration__Extended__eARFCNs.encode_text(text_buf);
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents::decode_text(Text_Buf& text_buf)
{
field_mS__Radio__Access__Capability.decode_text(text_buf);
field_inter__RAT__Handover__Info.decode_text(text_buf);
field_page__Mode__BSSGP.decode_text(text_buf);
field_container__ID.decode_text(text_buf);
field_global__TFI.decode_text(text_buf);
field_pS__HandoverIndications.decode_text(text_buf);
field_cS__Indication.decode_text(text_buf);
field_e__UTRAN__Inter__RAT__Handover__Info.decode_text(text_buf);
field_iRAT__Measurement__Configuration.decode_text(text_buf);
field_source__Cell__ID.decode_text(text_buf);
field_iRAT__Measurement__Configuration__Extended__eARFCNs.decode_text(text_buf);
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents::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 Source__BSS__to__Target__BSS__Transparent__Container__Contents::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 Source__BSS__to__Target__BSS__Transparent__Container__Contents::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, 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_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_inter__RAT__Handover__Info = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, Inter__RAT__Handover__Info__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_inter__RAT__Handover__Info().RAW_decode(Inter__RAT__Handover__Info__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_inter__RAT__Handover__Info = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_inter__RAT__Handover__Info=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_page__Mode__BSSGP = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, Page__Mode__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_page__Mode__BSSGP().RAW_decode(Page__Mode__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_page__Mode__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_page__Mode__BSSGP=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_container__ID = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Container__ID__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_container__ID().RAW_decode(Container__ID__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_container__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_container__ID=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_global__TFI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, Global__TFI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_global__TFI().RAW_decode(Global__TFI__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_global__TFI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } 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__TFI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_pS__HandoverIndications = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, PS__HandoverIndications_descr_.raw->forceomit);
  decoded_field_length = field_pS__HandoverIndications().RAW_decode(PS__HandoverIndications_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_pS__HandoverIndications = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pS__HandoverIndications=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_cS__Indication = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, CS__Indication_descr_.raw->forceomit);
  decoded_field_length = field_cS__Indication().RAW_decode(CS__Indication_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_cS__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_cS__Indication=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_e__UTRAN__Inter__RAT__Handover__Info = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, E__UTRAN__Inter__RAT__Handover__Info_descr_.raw->forceomit);
  decoded_field_length = field_e__UTRAN__Inter__RAT__Handover__Info().RAW_decode(E__UTRAN__Inter__RAT__Handover__Info_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_e__UTRAN__Inter__RAT__Handover__Info = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_e__UTRAN__Inter__RAT__Handover__Info=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_iRAT__Measurement__Configuration = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, IRAT__Measurement__Configuration_descr_.raw->forceomit);
  decoded_field_length = field_iRAT__Measurement__Configuration().RAW_decode(IRAT__Measurement__Configuration_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_iRAT__Measurement__Configuration = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iRAT__Measurement__Configuration=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_source__Cell__ID = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, Source__Cell__ID_descr_.raw->forceomit);
  decoded_field_length = field_source__Cell__ID().RAW_decode(Source__Cell__ID_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_source__Cell__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_source__Cell__ID=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_iRAT__Measurement__Configuration__Extended__eARFCNs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, IRAT__Measurement__Configuration__Extended__eARFCNs_descr_.raw->forceomit);
  decoded_field_length = field_iRAT__Measurement__Configuration__Extended__eARFCNs().RAW_decode(IRAT__Measurement__Configuration__Extended__eARFCNs_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_iRAT__Measurement__Configuration__Extended__eARFCNs = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_iRAT__Measurement__Configuration__Extended__eARFCNs=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Source__BSS__to__Target__BSS__Transparent__Container__Contents::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, MS__Radio__Access__Capability_descr_.raw);
  if (field_inter__RAT__Handover__Info.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Inter__RAT__Handover__Info__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_page__Mode__BSSGP.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Page__Mode__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_container__ID.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Container__ID__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_global__TFI.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Global__TFI__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_pS__HandoverIndications.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, PS__HandoverIndications_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_cS__Indication.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, CS__Indication_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_e__UTRAN__Inter__RAT__Handover__Info.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, E__UTRAN__Inter__RAT__Handover__Info_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_iRAT__Measurement__Configuration.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, IRAT__Measurement__Configuration_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_source__Cell__ID.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, Source__Cell__ID_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_iRAT__Measurement__Configuration__Extended__eARFCNs.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, IRAT__Measurement__Configuration__Extended__eARFCNs_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  encoded_length += field_mS__Radio__Access__Capability.RAW_encode(MS__Radio__Access__Capability_descr_, *myleaf.body.node.nodes[0]);
  if (field_inter__RAT__Handover__Info.ispresent()) {
  encoded_length += field_inter__RAT__Handover__Info().RAW_encode(Inter__RAT__Handover__Info__BSSGP_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_page__Mode__BSSGP.ispresent()) {
  encoded_length += field_page__Mode__BSSGP().RAW_encode(Page__Mode__BSSGP_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_container__ID.ispresent()) {
  encoded_length += field_container__ID().RAW_encode(Container__ID__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_global__TFI.ispresent()) {
  encoded_length += field_global__TFI().RAW_encode(Global__TFI__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_pS__HandoverIndications.ispresent()) {
  encoded_length += field_pS__HandoverIndications().RAW_encode(PS__HandoverIndications_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_cS__Indication.ispresent()) {
  encoded_length += field_cS__Indication().RAW_encode(CS__Indication_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_e__UTRAN__Inter__RAT__Handover__Info.ispresent()) {
  encoded_length += field_e__UTRAN__Inter__RAT__Handover__Info().RAW_encode(E__UTRAN__Inter__RAT__Handover__Info_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_iRAT__Measurement__Configuration.ispresent()) {
  encoded_length += field_iRAT__Measurement__Configuration().RAW_encode(IRAT__Measurement__Configuration_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_source__Cell__ID.ispresent()) {
  encoded_length += field_source__Cell__ID().RAW_encode(Source__Cell__ID_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_iRAT__Measurement__Configuration__Extended__eARFCNs.ispresent()) {
  encoded_length += field_iRAT__Measurement__Configuration__Extended__eARFCNs().RAW_encode(IRAT__Measurement__Configuration__Extended__eARFCNs_descr_, *myleaf.body.node.nodes[10]);
  }
  return myleaf.length = encoded_length;
}

struct Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::single_value_struct {
MS__Radio__Access__Capability_template field_mS__Radio__Access__Capability;
Inter__RAT__Handover__Info__BSSGP_template field_inter__RAT__Handover__Info;
Page__Mode__BSSGP_template field_page__Mode__BSSGP;
Container__ID__BSSGP_template field_container__ID;
Global__TFI__BSSGP_template field_global__TFI;
PS__HandoverIndications_template field_pS__HandoverIndications;
CS__Indication_template field_cS__Indication;
E__UTRAN__Inter__RAT__Handover__Info_template field_e__UTRAN__Inter__RAT__Handover__Info;
IRAT__Measurement__Configuration_template field_iRAT__Measurement__Configuration;
Source__Cell__ID_template field_source__Cell__ID;
IRAT__Measurement__Configuration__Extended__eARFCNs_template field_iRAT__Measurement__Configuration__Extended__eARFCNs;
};

void Source__BSS__to__Target__BSS__Transparent__Container__Contents_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_mS__Radio__Access__Capability = ANY_VALUE;
single_value->field_inter__RAT__Handover__Info = ANY_OR_OMIT;
single_value->field_page__Mode__BSSGP = ANY_OR_OMIT;
single_value->field_container__ID = ANY_OR_OMIT;
single_value->field_global__TFI = ANY_OR_OMIT;
single_value->field_pS__HandoverIndications = ANY_OR_OMIT;
single_value->field_cS__Indication = ANY_OR_OMIT;
single_value->field_e__UTRAN__Inter__RAT__Handover__Info = ANY_OR_OMIT;
single_value->field_iRAT__Measurement__Configuration = ANY_OR_OMIT;
single_value->field_source__Cell__ID = ANY_OR_OMIT;
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs = ANY_OR_OMIT;
}
}
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::copy_value(const Source__BSS__to__Target__BSS__Transparent__Container__Contents& other_value)
{
single_value = new single_value_struct;
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();
}
if (other_value.inter__RAT__Handover__Info().is_bound()) {
  if (other_value.inter__RAT__Handover__Info().ispresent()) single_value->field_inter__RAT__Handover__Info = other_value.inter__RAT__Handover__Info()();
  else single_value->field_inter__RAT__Handover__Info = OMIT_VALUE;
} else {
  single_value->field_inter__RAT__Handover__Info.clean_up();
}
if (other_value.page__Mode__BSSGP().is_bound()) {
  if (other_value.page__Mode__BSSGP().ispresent()) single_value->field_page__Mode__BSSGP = other_value.page__Mode__BSSGP()();
  else single_value->field_page__Mode__BSSGP = OMIT_VALUE;
} else {
  single_value->field_page__Mode__BSSGP.clean_up();
}
if (other_value.container__ID().is_bound()) {
  if (other_value.container__ID().ispresent()) single_value->field_container__ID = other_value.container__ID()();
  else single_value->field_container__ID = OMIT_VALUE;
} else {
  single_value->field_container__ID.clean_up();
}
if (other_value.global__TFI().is_bound()) {
  if (other_value.global__TFI().ispresent()) single_value->field_global__TFI = other_value.global__TFI()();
  else single_value->field_global__TFI = OMIT_VALUE;
} else {
  single_value->field_global__TFI.clean_up();
}
if (other_value.pS__HandoverIndications().is_bound()) {
  if (other_value.pS__HandoverIndications().ispresent()) single_value->field_pS__HandoverIndications = other_value.pS__HandoverIndications()();
  else single_value->field_pS__HandoverIndications = OMIT_VALUE;
} else {
  single_value->field_pS__HandoverIndications.clean_up();
}
if (other_value.cS__Indication().is_bound()) {
  if (other_value.cS__Indication().ispresent()) single_value->field_cS__Indication = other_value.cS__Indication()();
  else single_value->field_cS__Indication = OMIT_VALUE;
} else {
  single_value->field_cS__Indication.clean_up();
}
if (other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) {
  if (other_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent()) single_value->field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info()();
  else single_value->field_e__UTRAN__Inter__RAT__Handover__Info = OMIT_VALUE;
} else {
  single_value->field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
}
if (other_value.iRAT__Measurement__Configuration().is_bound()) {
  if (other_value.iRAT__Measurement__Configuration().ispresent()) single_value->field_iRAT__Measurement__Configuration = other_value.iRAT__Measurement__Configuration()();
  else single_value->field_iRAT__Measurement__Configuration = OMIT_VALUE;
} else {
  single_value->field_iRAT__Measurement__Configuration.clean_up();
}
if (other_value.source__Cell__ID().is_bound()) {
  if (other_value.source__Cell__ID().ispresent()) single_value->field_source__Cell__ID = other_value.source__Cell__ID()();
  else single_value->field_source__Cell__ID = OMIT_VALUE;
} else {
  single_value->field_source__Cell__ID.clean_up();
}
if (other_value.iRAT__Measurement__Configuration__Extended__eARFCNs().is_bound()) {
  if (other_value.iRAT__Measurement__Configuration__Extended__eARFCNs().ispresent()) single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs = other_value.iRAT__Measurement__Configuration__Extended__eARFCNs()();
  else single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs = OMIT_VALUE;
} else {
  single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::copy_template(const Source__BSS__to__Target__BSS__Transparent__Container__Contents_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
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.inter__RAT__Handover__Info().get_selection()) {
single_value->field_inter__RAT__Handover__Info = other_value.inter__RAT__Handover__Info();
} else {
single_value->field_inter__RAT__Handover__Info.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.page__Mode__BSSGP().get_selection()) {
single_value->field_page__Mode__BSSGP = other_value.page__Mode__BSSGP();
} else {
single_value->field_page__Mode__BSSGP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.container__ID().get_selection()) {
single_value->field_container__ID = other_value.container__ID();
} else {
single_value->field_container__ID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.global__TFI().get_selection()) {
single_value->field_global__TFI = other_value.global__TFI();
} else {
single_value->field_global__TFI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pS__HandoverIndications().get_selection()) {
single_value->field_pS__HandoverIndications = other_value.pS__HandoverIndications();
} else {
single_value->field_pS__HandoverIndications.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cS__Indication().get_selection()) {
single_value->field_cS__Indication = other_value.cS__Indication();
} else {
single_value->field_cS__Indication.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.e__UTRAN__Inter__RAT__Handover__Info().get_selection()) {
single_value->field_e__UTRAN__Inter__RAT__Handover__Info = other_value.e__UTRAN__Inter__RAT__Handover__Info();
} else {
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iRAT__Measurement__Configuration().get_selection()) {
single_value->field_iRAT__Measurement__Configuration = other_value.iRAT__Measurement__Configuration();
} else {
single_value->field_iRAT__Measurement__Configuration.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.source__Cell__ID().get_selection()) {
single_value->field_source__Cell__ID = other_value.source__Cell__ID();
} else {
single_value->field_source__Cell__ID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iRAT__Measurement__Configuration__Extended__eARFCNs().get_selection()) {
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs = other_value.iRAT__Measurement__Configuration__Extended__eARFCNs();
} else {
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.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 Source__BSS__to__Target__BSS__Transparent__Container__Contents_template[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 Source__BSS__to__Target__BSS__Transparent__Container__Contents_template(*other_value.implication_.precondition);
implication_.implied_template = new Source__BSS__to__Target__BSS__Transparent__Container__Contents_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.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
break;
}
set_selection(other_value);
}

Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::Source__BSS__to__Target__BSS__Transparent__Container__Contents_template()
{
}

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

Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::Source__BSS__to__Target__BSS__Transparent__Container__Contents_template(const Source__BSS__to__Target__BSS__Transparent__Container__Contents& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::match(const Source__BSS__to__Target__BSS__Transparent__Container__Contents& 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.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;
if(!other_value.inter__RAT__Handover__Info().is_bound()) return FALSE;
if((other_value.inter__RAT__Handover__Info().ispresent() ? !single_value->field_inter__RAT__Handover__Info.match((const Inter__RAT__Handover__Info__BSSGP&)other_value.inter__RAT__Handover__Info(), legacy) : !single_value->field_inter__RAT__Handover__Info.match_omit(legacy)))return FALSE;
if(!other_value.page__Mode__BSSGP().is_bound()) return FALSE;
if((other_value.page__Mode__BSSGP().ispresent() ? !single_value->field_page__Mode__BSSGP.match((const Page__Mode__BSSGP&)other_value.page__Mode__BSSGP(), legacy) : !single_value->field_page__Mode__BSSGP.match_omit(legacy)))return FALSE;
if(!other_value.container__ID().is_bound()) return FALSE;
if((other_value.container__ID().ispresent() ? !single_value->field_container__ID.match((const Container__ID__BSSGP&)other_value.container__ID(), legacy) : !single_value->field_container__ID.match_omit(legacy)))return FALSE;
if(!other_value.global__TFI().is_bound()) return FALSE;
if((other_value.global__TFI().ispresent() ? !single_value->field_global__TFI.match((const Global__TFI__BSSGP&)other_value.global__TFI(), legacy) : !single_value->field_global__TFI.match_omit(legacy)))return FALSE;
if(!other_value.pS__HandoverIndications().is_bound()) return FALSE;
if((other_value.pS__HandoverIndications().ispresent() ? !single_value->field_pS__HandoverIndications.match((const PS__HandoverIndications&)other_value.pS__HandoverIndications(), legacy) : !single_value->field_pS__HandoverIndications.match_omit(legacy)))return FALSE;
if(!other_value.cS__Indication().is_bound()) return FALSE;
if((other_value.cS__Indication().ispresent() ? !single_value->field_cS__Indication.match((const CS__Indication&)other_value.cS__Indication(), legacy) : !single_value->field_cS__Indication.match_omit(legacy)))return FALSE;
if(!other_value.e__UTRAN__Inter__RAT__Handover__Info().is_bound()) return FALSE;
if((other_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent() ? !single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match((const E__UTRAN__Inter__RAT__Handover__Info&)other_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy) : !single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match_omit(legacy)))return FALSE;
if(!other_value.iRAT__Measurement__Configuration().is_bound()) return FALSE;
if((other_value.iRAT__Measurement__Configuration().ispresent() ? !single_value->field_iRAT__Measurement__Configuration.match((const IRAT__Measurement__Configuration&)other_value.iRAT__Measurement__Configuration(), legacy) : !single_value->field_iRAT__Measurement__Configuration.match_omit(legacy)))return FALSE;
if(!other_value.source__Cell__ID().is_bound()) return FALSE;
if((other_value.source__Cell__ID().ispresent() ? !single_value->field_source__Cell__ID.match((const Source__Cell__ID&)other_value.source__Cell__ID(), legacy) : !single_value->field_source__Cell__ID.match_omit(legacy)))return FALSE;
if(!other_value.iRAT__Measurement__Configuration__Extended__eARFCNs().is_bound()) return FALSE;
if((other_value.iRAT__Measurement__Configuration__Extended__eARFCNs().ispresent() ? !single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.match((const IRAT__Measurement__Configuration__Extended__eARFCNs&)other_value.iRAT__Measurement__Configuration__Extended__eARFCNs(), legacy) : !single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.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.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
}
return FALSE;
}

boolean Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_mS__Radio__Access__Capability.is_bound()
 || (single_value->field_inter__RAT__Handover__Info.is_omit() || single_value->field_inter__RAT__Handover__Info.is_bound())
 || (single_value->field_page__Mode__BSSGP.is_omit() || single_value->field_page__Mode__BSSGP.is_bound())
 || (single_value->field_container__ID.is_omit() || single_value->field_container__ID.is_bound())
 || (single_value->field_global__TFI.is_omit() || single_value->field_global__TFI.is_bound())
 || (single_value->field_pS__HandoverIndications.is_omit() || single_value->field_pS__HandoverIndications.is_bound())
 || (single_value->field_cS__Indication.is_omit() || single_value->field_cS__Indication.is_bound())
 || (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_omit() || single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_bound())
 || (single_value->field_iRAT__Measurement__Configuration.is_omit() || single_value->field_iRAT__Measurement__Configuration.is_bound())
 || (single_value->field_source__Cell__ID.is_omit() || single_value->field_source__Cell__ID.is_bound())
 || (single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.is_omit() || single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.is_bound());
}

boolean Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_mS__Radio__Access__Capability.is_value()
 && (single_value->field_inter__RAT__Handover__Info.is_omit() || single_value->field_inter__RAT__Handover__Info.is_value())
 && (single_value->field_page__Mode__BSSGP.is_omit() || single_value->field_page__Mode__BSSGP.is_value())
 && (single_value->field_container__ID.is_omit() || single_value->field_container__ID.is_value())
 && (single_value->field_global__TFI.is_omit() || single_value->field_global__TFI.is_value())
 && (single_value->field_pS__HandoverIndications.is_omit() || single_value->field_pS__HandoverIndications.is_value())
 && (single_value->field_cS__Indication.is_omit() || single_value->field_cS__Indication.is_value())
 && (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_omit() || single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_value())
 && (single_value->field_iRAT__Measurement__Configuration.is_omit() || single_value->field_iRAT__Measurement__Configuration.is_value())
 && (single_value->field_source__Cell__ID.is_omit() || single_value->field_source__Cell__ID.is_value())
 && (single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.is_omit() || single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.is_value());
}

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

Source__BSS__to__Target__BSS__Transparent__Container__Contents Source__BSS__to__Target__BSS__Transparent__Container__Contents_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.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
Source__BSS__to__Target__BSS__Transparent__Container__Contents ret_val;
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_inter__RAT__Handover__Info.is_omit()) ret_val.inter__RAT__Handover__Info() = OMIT_VALUE;
else if (single_value->field_inter__RAT__Handover__Info.is_bound()) {
ret_val.inter__RAT__Handover__Info() = single_value->field_inter__RAT__Handover__Info.valueof();
}
if (single_value->field_page__Mode__BSSGP.is_omit()) ret_val.page__Mode__BSSGP() = OMIT_VALUE;
else if (single_value->field_page__Mode__BSSGP.is_bound()) {
ret_val.page__Mode__BSSGP() = single_value->field_page__Mode__BSSGP.valueof();
}
if (single_value->field_container__ID.is_omit()) ret_val.container__ID() = OMIT_VALUE;
else if (single_value->field_container__ID.is_bound()) {
ret_val.container__ID() = single_value->field_container__ID.valueof();
}
if (single_value->field_global__TFI.is_omit()) ret_val.global__TFI() = OMIT_VALUE;
else if (single_value->field_global__TFI.is_bound()) {
ret_val.global__TFI() = single_value->field_global__TFI.valueof();
}
if (single_value->field_pS__HandoverIndications.is_omit()) ret_val.pS__HandoverIndications() = OMIT_VALUE;
else if (single_value->field_pS__HandoverIndications.is_bound()) {
ret_val.pS__HandoverIndications() = single_value->field_pS__HandoverIndications.valueof();
}
if (single_value->field_cS__Indication.is_omit()) ret_val.cS__Indication() = OMIT_VALUE;
else if (single_value->field_cS__Indication.is_bound()) {
ret_val.cS__Indication() = single_value->field_cS__Indication.valueof();
}
if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_omit()) ret_val.e__UTRAN__Inter__RAT__Handover__Info() = OMIT_VALUE;
else if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_bound()) {
ret_val.e__UTRAN__Inter__RAT__Handover__Info() = single_value->field_e__UTRAN__Inter__RAT__Handover__Info.valueof();
}
if (single_value->field_iRAT__Measurement__Configuration.is_omit()) ret_val.iRAT__Measurement__Configuration() = OMIT_VALUE;
else if (single_value->field_iRAT__Measurement__Configuration.is_bound()) {
ret_val.iRAT__Measurement__Configuration() = single_value->field_iRAT__Measurement__Configuration.valueof();
}
if (single_value->field_source__Cell__ID.is_omit()) ret_val.source__Cell__ID() = OMIT_VALUE;
else if (single_value->field_source__Cell__ID.is_bound()) {
ret_val.source__Cell__ID() = single_value->field_source__Cell__ID.valueof();
}
if (single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.is_omit()) ret_val.iRAT__Measurement__Configuration__Extended__eARFCNs() = OMIT_VALUE;
else if (single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.is_bound()) {
ret_val.iRAT__Measurement__Configuration__Extended__eARFCNs() = single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.valueof();
}
return ret_val;
}

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

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

MS__Radio__Access__Capability_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::mS__Radio__Access__Capability()
{
set_specific();
return single_value->field_mS__Radio__Access__Capability;
}

const MS__Radio__Access__Capability_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_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.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_mS__Radio__Access__Capability;
}

Inter__RAT__Handover__Info__BSSGP_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::inter__RAT__Handover__Info()
{
set_specific();
return single_value->field_inter__RAT__Handover__Info;
}

const Inter__RAT__Handover__Info__BSSGP_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::inter__RAT__Handover__Info() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field inter_RAT_Handover_Info of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_inter__RAT__Handover__Info;
}

Page__Mode__BSSGP_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::page__Mode__BSSGP()
{
set_specific();
return single_value->field_page__Mode__BSSGP;
}

const Page__Mode__BSSGP_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::page__Mode__BSSGP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field page_Mode_BSSGP of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_page__Mode__BSSGP;
}

Container__ID__BSSGP_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::container__ID()
{
set_specific();
return single_value->field_container__ID;
}

const Container__ID__BSSGP_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::container__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field container_ID of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_container__ID;
}

Global__TFI__BSSGP_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::global__TFI()
{
set_specific();
return single_value->field_global__TFI;
}

const Global__TFI__BSSGP_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::global__TFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field global_TFI of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_global__TFI;
}

PS__HandoverIndications_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::pS__HandoverIndications()
{
set_specific();
return single_value->field_pS__HandoverIndications;
}

const PS__HandoverIndications_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::pS__HandoverIndications() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pS_HandoverIndications of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_pS__HandoverIndications;
}

CS__Indication_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::cS__Indication()
{
set_specific();
return single_value->field_cS__Indication;
}

const CS__Indication_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::cS__Indication() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cS_Indication of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_cS__Indication;
}

E__UTRAN__Inter__RAT__Handover__Info_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::e__UTRAN__Inter__RAT__Handover__Info()
{
set_specific();
return single_value->field_e__UTRAN__Inter__RAT__Handover__Info;
}

const E__UTRAN__Inter__RAT__Handover__Info_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::e__UTRAN__Inter__RAT__Handover__Info() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field e_UTRAN_Inter_RAT_Handover_Info of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_e__UTRAN__Inter__RAT__Handover__Info;
}

IRAT__Measurement__Configuration_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::iRAT__Measurement__Configuration()
{
set_specific();
return single_value->field_iRAT__Measurement__Configuration;
}

const IRAT__Measurement__Configuration_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::iRAT__Measurement__Configuration() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iRAT_Measurement_Configuration of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_iRAT__Measurement__Configuration;
}

Source__Cell__ID_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::source__Cell__ID()
{
set_specific();
return single_value->field_source__Cell__ID;
}

const Source__Cell__ID_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::source__Cell__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_Cell_ID of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_source__Cell__ID;
}

IRAT__Measurement__Configuration__Extended__eARFCNs_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::iRAT__Measurement__Configuration__Extended__eARFCNs()
{
set_specific();
return single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs;
}

const IRAT__Measurement__Configuration__Extended__eARFCNs_template& Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::iRAT__Measurement__Configuration__Extended__eARFCNs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iRAT_Measurement_Configuration_Extended_eARFCNs of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
return single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs;
}

int Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_inter__RAT__Handover__Info.is_present()) ret_val++;
      if (single_value->field_page__Mode__BSSGP.is_present()) ret_val++;
      if (single_value->field_container__ID.is_present()) ret_val++;
      if (single_value->field_global__TFI.is_present()) ret_val++;
      if (single_value->field_pS__HandoverIndications.is_present()) ret_val++;
      if (single_value->field_cS__Indication.is_present()) ret_val++;
      if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.is_present()) ret_val++;
      if (single_value->field_iRAT__Measurement__Configuration.is_present()) ret_val++;
      if (single_value->field_source__Cell__ID.is_present()) ret_val++;
      if (single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.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.Source_BSS_to_Target_BSS_Transparent_Container_Contents 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.Source_BSS_to_Target_BSS_Transparent_Container_Contents 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.Source_BSS_to_Target_BSS_Transparent_Container_Contents containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
  }
  return 0;
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ mS_Radio_Access_Capability := ");
single_value->field_mS__Radio__Access__Capability.log();
TTCN_Logger::log_event_str(", inter_RAT_Handover_Info := ");
single_value->field_inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", page_Mode_BSSGP := ");
single_value->field_page__Mode__BSSGP.log();
TTCN_Logger::log_event_str(", container_ID := ");
single_value->field_container__ID.log();
TTCN_Logger::log_event_str(", global_TFI := ");
single_value->field_global__TFI.log();
TTCN_Logger::log_event_str(", pS_HandoverIndications := ");
single_value->field_pS__HandoverIndications.log();
TTCN_Logger::log_event_str(", cS_Indication := ");
single_value->field_cS__Indication.log();
TTCN_Logger::log_event_str(", e_UTRAN_Inter_RAT_Handover_Info := ");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(", iRAT_Measurement_Configuration := ");
single_value->field_iRAT__Measurement__Configuration.log();
TTCN_Logger::log_event_str(", source_Cell_ID := ");
single_value->field_source__Cell__ID.log();
TTCN_Logger::log_event_str(", iRAT_Measurement_Configuration_Extended_eARFCNs := ");
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.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 Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::log_match(const Source__BSS__to__Target__BSS__Transparent__Container__Contents& 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_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);
}
if (match_value.inter__RAT__Handover__Info().ispresent()){
if(!single_value->field_inter__RAT__Handover__Info.match(match_value.inter__RAT__Handover__Info(), legacy)){
TTCN_Logger::log_logmatch_info(".inter_RAT_Handover_Info");
single_value->field_inter__RAT__Handover__Info.log_match(match_value.inter__RAT__Handover__Info(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_inter__RAT__Handover__Info.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".inter_RAT_Handover_Info := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.page__Mode__BSSGP().ispresent()){
if(!single_value->field_page__Mode__BSSGP.match(match_value.page__Mode__BSSGP(), legacy)){
TTCN_Logger::log_logmatch_info(".page_Mode_BSSGP");
single_value->field_page__Mode__BSSGP.log_match(match_value.page__Mode__BSSGP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_page__Mode__BSSGP.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".page_Mode_BSSGP := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_page__Mode__BSSGP.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.container__ID().ispresent()){
if(!single_value->field_container__ID.match(match_value.container__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".container_ID");
single_value->field_container__ID.log_match(match_value.container__ID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_container__ID.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".container_ID := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_container__ID.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.global__TFI().ispresent()){
if(!single_value->field_global__TFI.match(match_value.global__TFI(), legacy)){
TTCN_Logger::log_logmatch_info(".global_TFI");
single_value->field_global__TFI.log_match(match_value.global__TFI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_global__TFI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".global_TFI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_global__TFI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pS__HandoverIndications().ispresent()){
if(!single_value->field_pS__HandoverIndications.match(match_value.pS__HandoverIndications(), legacy)){
TTCN_Logger::log_logmatch_info(".pS_HandoverIndications");
single_value->field_pS__HandoverIndications.log_match(match_value.pS__HandoverIndications(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pS__HandoverIndications.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pS_HandoverIndications := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pS__HandoverIndications.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cS__Indication().ispresent()){
if(!single_value->field_cS__Indication.match(match_value.cS__Indication(), legacy)){
TTCN_Logger::log_logmatch_info(".cS_Indication");
single_value->field_cS__Indication.log_match(match_value.cS__Indication(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cS__Indication.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cS_Indication := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cS__Indication.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent()){
if(!single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match(match_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy)){
TTCN_Logger::log_logmatch_info(".e_UTRAN_Inter_RAT_Handover_Info");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log_match(match_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".e_UTRAN_Inter_RAT_Handover_Info := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.iRAT__Measurement__Configuration().ispresent()){
if(!single_value->field_iRAT__Measurement__Configuration.match(match_value.iRAT__Measurement__Configuration(), legacy)){
TTCN_Logger::log_logmatch_info(".iRAT_Measurement_Configuration");
single_value->field_iRAT__Measurement__Configuration.log_match(match_value.iRAT__Measurement__Configuration(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iRAT__Measurement__Configuration.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iRAT_Measurement_Configuration := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iRAT__Measurement__Configuration.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.source__Cell__ID().ispresent()){
if(!single_value->field_source__Cell__ID.match(match_value.source__Cell__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".source_Cell_ID");
single_value->field_source__Cell__ID.log_match(match_value.source__Cell__ID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_source__Cell__ID.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".source_Cell_ID := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_source__Cell__ID.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.iRAT__Measurement__Configuration__Extended__eARFCNs().ispresent()){
if(!single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.match(match_value.iRAT__Measurement__Configuration__Extended__eARFCNs(), legacy)){
TTCN_Logger::log_logmatch_info(".iRAT_Measurement_Configuration_Extended_eARFCNs");
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.log_match(match_value.iRAT__Measurement__Configuration__Extended__eARFCNs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".iRAT_Measurement_Configuration_Extended_eARFCNs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.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("{ 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(", inter_RAT_Handover_Info := ");
if (match_value.inter__RAT__Handover__Info().ispresent()) {
single_value->field_inter__RAT__Handover__Info.log_match(match_value.inter__RAT__Handover__Info(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_inter__RAT__Handover__Info.log();
if (single_value->field_inter__RAT__Handover__Info.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", page_Mode_BSSGP := ");
if (match_value.page__Mode__BSSGP().ispresent()) {
single_value->field_page__Mode__BSSGP.log_match(match_value.page__Mode__BSSGP(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_page__Mode__BSSGP.log();
if (single_value->field_page__Mode__BSSGP.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", container_ID := ");
if (match_value.container__ID().ispresent()) {
single_value->field_container__ID.log_match(match_value.container__ID(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_container__ID.log();
if (single_value->field_container__ID.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", global_TFI := ");
if (match_value.global__TFI().ispresent()) {
single_value->field_global__TFI.log_match(match_value.global__TFI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_global__TFI.log();
if (single_value->field_global__TFI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pS_HandoverIndications := ");
if (match_value.pS__HandoverIndications().ispresent()) {
single_value->field_pS__HandoverIndications.log_match(match_value.pS__HandoverIndications(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pS__HandoverIndications.log();
if (single_value->field_pS__HandoverIndications.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cS_Indication := ");
if (match_value.cS__Indication().ispresent()) {
single_value->field_cS__Indication.log_match(match_value.cS__Indication(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cS__Indication.log();
if (single_value->field_cS__Indication.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", e_UTRAN_Inter_RAT_Handover_Info := ");
if (match_value.e__UTRAN__Inter__RAT__Handover__Info().ispresent()) {
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log_match(match_value.e__UTRAN__Inter__RAT__Handover__Info(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.log();
if (single_value->field_e__UTRAN__Inter__RAT__Handover__Info.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", iRAT_Measurement_Configuration := ");
if (match_value.iRAT__Measurement__Configuration().ispresent()) {
single_value->field_iRAT__Measurement__Configuration.log_match(match_value.iRAT__Measurement__Configuration(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iRAT__Measurement__Configuration.log();
if (single_value->field_iRAT__Measurement__Configuration.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", source_Cell_ID := ");
if (match_value.source__Cell__ID().ispresent()) {
single_value->field_source__Cell__ID.log_match(match_value.source__Cell__ID(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_source__Cell__ID.log();
if (single_value->field_source__Cell__ID.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", iRAT_Measurement_Configuration_Extended_eARFCNs := ");
if (match_value.iRAT__Measurement__Configuration__Extended__eARFCNs().ispresent()) {
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.log_match(match_value.iRAT__Measurement__Configuration__Extended__eARFCNs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.log();
if (single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.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 Source__BSS__to__Target__BSS__Transparent__Container__Contents_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_mS__Radio__Access__Capability.encode_text(text_buf);
single_value->field_inter__RAT__Handover__Info.encode_text(text_buf);
single_value->field_page__Mode__BSSGP.encode_text(text_buf);
single_value->field_container__ID.encode_text(text_buf);
single_value->field_global__TFI.encode_text(text_buf);
single_value->field_pS__HandoverIndications.encode_text(text_buf);
single_value->field_cS__Indication.encode_text(text_buf);
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.encode_text(text_buf);
single_value->field_iRAT__Measurement__Configuration.encode_text(text_buf);
single_value->field_source__Cell__ID.encode_text(text_buf);
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.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.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
}
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents_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_mS__Radio__Access__Capability.decode_text(text_buf);
single_value->field_inter__RAT__Handover__Info.decode_text(text_buf);
single_value->field_page__Mode__BSSGP.decode_text(text_buf);
single_value->field_container__ID.decode_text(text_buf);
single_value->field_global__TFI.decode_text(text_buf);
single_value->field_pS__HandoverIndications.decode_text(text_buf);
single_value->field_cS__Indication.decode_text(text_buf);
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.decode_text(text_buf);
single_value->field_iRAT__Measurement__Configuration.decode_text(text_buf);
single_value->field_source__Cell__ID.decode_text(text_buf);
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.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 Source__BSS__to__Target__BSS__Transparent__Container__Contents_template[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.Source_BSS_to_Target_BSS_Transparent_Container_Contents.");
}
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents_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: {
    Source__BSS__to__Target__BSS__Transparent__Container__Contents_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.Source_BSS_to_Target_BSS_Transparent_Container_Contents 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) mS__Radio__Access__Capability().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) inter__RAT__Handover__Info().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) page__Mode__BSSGP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) container__ID().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) global__TFI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) pS__HandoverIndications().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cS__Indication().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) e__UTRAN__Inter__RAT__Handover__Info().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) iRAT__Measurement__Configuration().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) source__Cell__ID().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) iRAT__Measurement__Configuration__Extended__eARFCNs().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(), "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(), "inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "page_Mode_BSSGP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          page__Mode__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(), "container_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          container__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(), "global_TFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          global__TFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pS_HandoverIndications")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__HandoverIndications().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_Indication")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__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(), "e_UTRAN_Inter_RAT_Handover_Info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__UTRAN__Inter__RAT__Handover__Info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iRAT_Measurement_Configuration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iRAT__Measurement__Configuration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "source_Cell_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__Cell__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(), "iRAT_Measurement_Configuration_Extended_eARFCNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iRAT__Measurement__Configuration__Extended__eARFCNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Source_BSS_to_Target_BSS_Transparent_Container_Contents: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Source__BSS__to__Target__BSS__Transparent__Container__Contents_template* precondition = new Source__BSS__to__Target__BSS__Transparent__Container__Contents_template;
    precondition->set_param(*param.get_elem(0));
    Source__BSS__to__Target__BSS__Transparent__Container__Contents_template* implied_template = new Source__BSS__to__Target__BSS__Transparent__Container__Contents_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Source__BSS__to__Target__BSS__Transparent__Container__Contents_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
  }
  is_ifpresent = param.get_ifpresent();
}

void Source__BSS__to__Target__BSS__Transparent__Container__Contents_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_mS__Radio__Access__Capability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_inter__RAT__Handover__Info.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_page__Mode__BSSGP.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_container__ID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_global__TFI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_pS__HandoverIndications.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_cS__Indication.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_e__UTRAN__Inter__RAT__Handover__Info.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_iRAT__Measurement__Configuration.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_source__Cell__ID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_iRAT__Measurement__Configuration__Extended__eARFCNs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
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.Source_BSS_to_Target_BSS_Transparent_Container_Contents");
}

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

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

Inter__RAT__Handover__Info__BSSGP::Inter__RAT__Handover__Info__BSSGP()
{
}

Inter__RAT__Handover__Info__BSSGP::Inter__RAT__Handover__Info__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_inter__RAT__Handover__Information)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_inter__RAT__Handover__Information(par_inter__RAT__Handover__Information)
{
}

Inter__RAT__Handover__Info__BSSGP::Inter__RAT__Handover__Info__BSSGP(const Inter__RAT__Handover__Info__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Inter_RAT_Handover_Info_BSSGP.");
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.inter__RAT__Handover__Information().is_bound()) field_inter__RAT__Handover__Information = other_value.inter__RAT__Handover__Information();
else field_inter__RAT__Handover__Information.clean_up();
}

void Inter__RAT__Handover__Info__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_inter__RAT__Handover__Information.clean_up();
}

const TTCN_Typedescriptor_t* Inter__RAT__Handover__Info__BSSGP::get_descriptor() const { return &Inter__RAT__Handover__Info__BSSGP_descr_; }
Inter__RAT__Handover__Info__BSSGP& Inter__RAT__Handover__Info__BSSGP::operator=(const Inter__RAT__Handover__Info__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Inter_RAT_Handover_Info_BSSGP.");
  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.inter__RAT__Handover__Information().is_bound()) field_inter__RAT__Handover__Information = other_value.inter__RAT__Handover__Information();
  else field_inter__RAT__Handover__Information.clean_up();
}
return *this;
}

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

boolean Inter__RAT__Handover__Info__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_inter__RAT__Handover__Information.is_bound());
}
boolean Inter__RAT__Handover__Info__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_inter__RAT__Handover__Information.is_value();
}
void Inter__RAT__Handover__Info__BSSGP::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(", inter_RAT_Handover_Information := ");
field_inter__RAT__Handover__Information.log();
TTCN_Logger::log_event_str(" }");
}

void Inter__RAT__Handover__Info__BSSGP::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 (inter__RAT__Handover__Information().is_bound()) inter__RAT__Handover__Information().set_implicit_omit();
}

void Inter__RAT__Handover__Info__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 (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Inter_RAT_Handover_Info_BSSGP 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) inter__RAT__Handover__Information().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(), "inter_RAT_Handover_Information")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          inter__RAT__Handover__Information().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Inter_RAT_Handover_Info_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Inter_RAT_Handover_Info_BSSGP");
  }
}

void Inter__RAT__Handover__Info__BSSGP::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_inter__RAT__Handover__Information.encode_text(text_buf);
}

void Inter__RAT__Handover__Info__BSSGP::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_inter__RAT__Handover__Information.decode_text(text_buf);
}

void Inter__RAT__Handover__Info__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 Inter__RAT__Handover__Info__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 Inter__RAT__Handover__Info__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;
  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, Inter__RAT__Handover__Info__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Inter__RAT__Handover__Info__BSSGP_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, Inter__RAT__Handover__Info__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Inter__RAT__Handover__Info__BSSGP_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_inter__RAT__Handover__Information.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_76) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Inter__RAT__Handover__Info__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 = 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, Inter__RAT__Handover__Info__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Inter__RAT__Handover__Info__BSSGP_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(Inter__RAT__Handover__Info__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Inter__RAT__Handover__Info__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_inter__RAT__Handover__Information.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(Inter__RAT__Handover__Info__BSSGP_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(Inter__RAT__Handover__Info__BSSGP_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_76) {
  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_76.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 Inter__RAT__Handover__Info__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_inter__RAT__Handover__Information;
};

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

void Inter__RAT__Handover__Info__BSSGP_template::copy_value(const Inter__RAT__Handover__Info__BSSGP& 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.inter__RAT__Handover__Information().is_bound()) {
  single_value->field_inter__RAT__Handover__Information = other_value.inter__RAT__Handover__Information();
} else {
  single_value->field_inter__RAT__Handover__Information.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Inter__RAT__Handover__Info__BSSGP_template::copy_template(const Inter__RAT__Handover__Info__BSSGP_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.inter__RAT__Handover__Information().get_selection()) {
single_value->field_inter__RAT__Handover__Information = other_value.inter__RAT__Handover__Information();
} else {
single_value->field_inter__RAT__Handover__Information.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 Inter__RAT__Handover__Info__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 Inter__RAT__Handover__Info__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Inter__RAT__Handover__Info__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.Inter_RAT_Handover_Info_BSSGP.");
break;
}
set_selection(other_value);
}

Inter__RAT__Handover__Info__BSSGP_template::Inter__RAT__Handover__Info__BSSGP_template()
{
}

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

Inter__RAT__Handover__Info__BSSGP_template::Inter__RAT__Handover__Info__BSSGP_template(const Inter__RAT__Handover__Info__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Inter__RAT__Handover__Info__BSSGP_template::match(const Inter__RAT__Handover__Info__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.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.inter__RAT__Handover__Information().is_bound()) return FALSE;
if(!single_value->field_inter__RAT__Handover__Information.match(other_value.inter__RAT__Handover__Information(), 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.Inter_RAT_Handover_Info_BSSGP.");
}
return FALSE;
}

boolean Inter__RAT__Handover__Info__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_inter__RAT__Handover__Information.is_bound();
}

boolean Inter__RAT__Handover__Info__BSSGP_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_inter__RAT__Handover__Information.is_value();
}

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

Inter__RAT__Handover__Info__BSSGP Inter__RAT__Handover__Info__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.Inter_RAT_Handover_Info_BSSGP.");
Inter__RAT__Handover__Info__BSSGP 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_inter__RAT__Handover__Information.is_bound()) {
ret_val.inter__RAT__Handover__Information() = single_value->field_inter__RAT__Handover__Information.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

OCTETSTRING_template& Inter__RAT__Handover__Info__BSSGP_template::inter__RAT__Handover__Information()
{
set_specific();
return single_value->field_inter__RAT__Handover__Information;
}

const OCTETSTRING_template& Inter__RAT__Handover__Info__BSSGP_template::inter__RAT__Handover__Information() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field inter_RAT_Handover_Information of a non-specific template of type @BSSGP_Types.Inter_RAT_Handover_Info_BSSGP.");
return single_value->field_inter__RAT__Handover__Information;
}

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

void Inter__RAT__Handover__Info__BSSGP_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(", inter_RAT_Handover_Information := ");
single_value->field_inter__RAT__Handover__Information.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 Inter__RAT__Handover__Info__BSSGP_template::log_match(const Inter__RAT__Handover__Info__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_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_inter__RAT__Handover__Information.match(match_value.inter__RAT__Handover__Information(), legacy)){
TTCN_Logger::log_logmatch_info(".inter_RAT_Handover_Information");
single_value->field_inter__RAT__Handover__Information.log_match(match_value.inter__RAT__Handover__Information(), 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(", inter_RAT_Handover_Information := ");
single_value->field_inter__RAT__Handover__Information.log_match(match_value.inter__RAT__Handover__Information(), 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 Inter__RAT__Handover__Info__BSSGP_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_inter__RAT__Handover__Information.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.Inter_RAT_Handover_Info_BSSGP.");
}
}

void Inter__RAT__Handover__Info__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_inter__RAT__Handover__Information.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 Inter__RAT__Handover__Info__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.Inter_RAT_Handover_Info_BSSGP.");
}
}

void Inter__RAT__Handover__Info__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: {
    Inter__RAT__Handover__Info__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 (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Inter_RAT_Handover_Info_BSSGP 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) inter__RAT__Handover__Information().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(), "inter_RAT_Handover_Information")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          inter__RAT__Handover__Information().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Inter_RAT_Handover_Info_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Inter__RAT__Handover__Info__BSSGP_template* precondition = new Inter__RAT__Handover__Info__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Inter__RAT__Handover__Info__BSSGP_template* implied_template = new Inter__RAT__Handover__Info__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Inter__RAT__Handover__Info__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Inter_RAT_Handover_Info_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void Inter__RAT__Handover__Info__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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Inter_RAT_Handover_Info_BSSGP");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Inter_RAT_Handover_Info_BSSGP");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Inter_RAT_Handover_Info_BSSGP");
single_value->field_inter__RAT__Handover__Information.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Inter_RAT_Handover_Info_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.Inter_RAT_Handover_Info_BSSGP");
}

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

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

Page__Mode__BSSGP::Page__Mode__BSSGP()
{
}

Page__Mode__BSSGP::Page__Mode__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_page__mode,
    const BITSTRING& par_reserved)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_page__mode(par_page__mode),
  field_reserved(par_reserved)
{
}

Page__Mode__BSSGP::Page__Mode__BSSGP(const Page__Mode__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Page_Mode_BSSGP.");
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.page__mode().is_bound()) field_page__mode = other_value.page__mode();
else field_page__mode.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void Page__Mode__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_page__mode.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* Page__Mode__BSSGP::get_descriptor() const { return &Page__Mode__BSSGP_descr_; }
Page__Mode__BSSGP& Page__Mode__BSSGP::operator=(const Page__Mode__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Page_Mode_BSSGP.");
  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.page__mode().is_bound()) field_page__mode = other_value.page__mode();
  else field_page__mode.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

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

boolean Page__Mode__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_page__mode.is_bound())
  || (field_reserved.is_bound());
}
boolean Page__Mode__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_page__mode.is_value()
  && field_reserved.is_value();
}
void Page__Mode__BSSGP::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(", page_mode := ");
field_page__mode.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void Page__Mode__BSSGP::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 (page__mode().is_bound()) page__mode().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void Page__Mode__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 (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Page_Mode_BSSGP 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) page__mode().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(), "page_mode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          page__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(), "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.Page_Mode_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Page_Mode_BSSGP");
  }
}

void Page__Mode__BSSGP::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_page__mode.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void Page__Mode__BSSGP::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_page__mode.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

void Page__Mode__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 Page__Mode__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 Page__Mode__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;
  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, Page__Mode__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Page__Mode__BSSGP_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, Page__Mode__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Page__Mode__BSSGP_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_page__mode.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_84) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Page__Mode__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 = 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, Page__Mode__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Page__Mode__BSSGP_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(Page__Mode__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Page__Mode__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_page__mode.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(Page__Mode__BSSGP_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(Page__Mode__BSSGP_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_84) {
  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_84.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 Page__Mode__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_page__mode;
BITSTRING_template field_reserved;
};

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

void Page__Mode__BSSGP_template::copy_value(const Page__Mode__BSSGP& 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.page__mode().is_bound()) {
  single_value->field_page__mode = other_value.page__mode();
} else {
  single_value->field_page__mode.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 Page__Mode__BSSGP_template::copy_template(const Page__Mode__BSSGP_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.page__mode().get_selection()) {
single_value->field_page__mode = other_value.page__mode();
} else {
single_value->field_page__mode.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 Page__Mode__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 Page__Mode__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Page__Mode__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.Page_Mode_BSSGP.");
break;
}
set_selection(other_value);
}

Page__Mode__BSSGP_template::Page__Mode__BSSGP_template()
{
}

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

Page__Mode__BSSGP_template::Page__Mode__BSSGP_template(const Page__Mode__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Page__Mode__BSSGP_template::match(const Page__Mode__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.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.page__mode().is_bound()) return FALSE;
if(!single_value->field_page__mode.match(other_value.page__mode(), 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.Page_Mode_BSSGP.");
}
return FALSE;
}

boolean Page__Mode__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_page__mode.is_bound()
 || single_value->field_reserved.is_bound();
}

boolean Page__Mode__BSSGP_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_page__mode.is_value()
 && single_value->field_reserved.is_value();
}

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

Page__Mode__BSSGP Page__Mode__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.Page_Mode_BSSGP.");
Page__Mode__BSSGP 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_page__mode.is_bound()) {
ret_val.page__mode() = single_value->field_page__mode.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

BITSTRING_template& Page__Mode__BSSGP_template::page__mode()
{
set_specific();
return single_value->field_page__mode;
}

const BITSTRING_template& Page__Mode__BSSGP_template::page__mode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field page_mode of a non-specific template of type @BSSGP_Types.Page_Mode_BSSGP.");
return single_value->field_page__mode;
}

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

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

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

void Page__Mode__BSSGP_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(", page_mode := ");
single_value->field_page__mode.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 Page__Mode__BSSGP_template::log_match(const Page__Mode__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_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_page__mode.match(match_value.page__mode(), legacy)){
TTCN_Logger::log_logmatch_info(".page_mode");
single_value->field_page__mode.log_match(match_value.page__mode(), 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(", page_mode := ");
single_value->field_page__mode.log_match(match_value.page__mode(), 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 Page__Mode__BSSGP_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_page__mode.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.Page_Mode_BSSGP.");
}
}

void Page__Mode__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_page__mode.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 Page__Mode__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.Page_Mode_BSSGP.");
}
}

void Page__Mode__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: {
    Page__Mode__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 (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Page_Mode_BSSGP 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) page__mode().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(), "page_mode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          page__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(), "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.Page_Mode_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Page__Mode__BSSGP_template* precondition = new Page__Mode__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Page__Mode__BSSGP_template* implied_template = new Page__Mode__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Page__Mode__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Page_Mode_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

Container__ID__BSSGP::Container__ID__BSSGP()
{
}

Container__ID__BSSGP::Container__ID__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_container__ID,
    const BITSTRING& par_reserved)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_container__ID(par_container__ID),
  field_reserved(par_reserved)
{
}

Container__ID__BSSGP::Container__ID__BSSGP(const Container__ID__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Container_ID_BSSGP.");
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.container__ID().is_bound()) field_container__ID = other_value.container__ID();
else field_container__ID.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void Container__ID__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_container__ID.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* Container__ID__BSSGP::get_descriptor() const { return &Container__ID__BSSGP_descr_; }
Container__ID__BSSGP& Container__ID__BSSGP::operator=(const Container__ID__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Container_ID_BSSGP.");
  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.container__ID().is_bound()) field_container__ID = other_value.container__ID();
  else field_container__ID.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

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

boolean Container__ID__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_container__ID.is_bound())
  || (field_reserved.is_bound());
}
boolean Container__ID__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_container__ID.is_value()
  && field_reserved.is_value();
}
void Container__ID__BSSGP::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(", container_ID := ");
field_container__ID.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void Container__ID__BSSGP::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 (container__ID().is_bound()) container__ID().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void Container__ID__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 (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Container_ID_BSSGP 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) container__ID().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(), "container_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          container__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(), "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.Container_ID_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Container_ID_BSSGP");
  }
}

void Container__ID__BSSGP::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_container__ID.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void Container__ID__BSSGP::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_container__ID.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

void Container__ID__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 Container__ID__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 Container__ID__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;
  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, Container__ID__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Container__ID__BSSGP_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, Container__ID__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Container__ID__BSSGP_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_container__ID.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_85) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Container__ID__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 = 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, Container__ID__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Container__ID__BSSGP_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(Container__ID__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Container__ID__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_container__ID.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(Container__ID__BSSGP_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(Container__ID__BSSGP_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_85) {
  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_85.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 Container__ID__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_container__ID;
BITSTRING_template field_reserved;
};

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

void Container__ID__BSSGP_template::copy_value(const Container__ID__BSSGP& 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.container__ID().is_bound()) {
  single_value->field_container__ID = other_value.container__ID();
} else {
  single_value->field_container__ID.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 Container__ID__BSSGP_template::copy_template(const Container__ID__BSSGP_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.container__ID().get_selection()) {
single_value->field_container__ID = other_value.container__ID();
} else {
single_value->field_container__ID.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 Container__ID__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 Container__ID__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Container__ID__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.Container_ID_BSSGP.");
break;
}
set_selection(other_value);
}

Container__ID__BSSGP_template::Container__ID__BSSGP_template()
{
}

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

Container__ID__BSSGP_template::Container__ID__BSSGP_template(const Container__ID__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Container__ID__BSSGP_template::match(const Container__ID__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.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.container__ID().is_bound()) return FALSE;
if(!single_value->field_container__ID.match(other_value.container__ID(), 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.Container_ID_BSSGP.");
}
return FALSE;
}

boolean Container__ID__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_container__ID.is_bound()
 || single_value->field_reserved.is_bound();
}

boolean Container__ID__BSSGP_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_container__ID.is_value()
 && single_value->field_reserved.is_value();
}

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

Container__ID__BSSGP Container__ID__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.Container_ID_BSSGP.");
Container__ID__BSSGP 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_container__ID.is_bound()) {
ret_val.container__ID() = single_value->field_container__ID.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

BITSTRING_template& Container__ID__BSSGP_template::container__ID()
{
set_specific();
return single_value->field_container__ID;
}

const BITSTRING_template& Container__ID__BSSGP_template::container__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field container_ID of a non-specific template of type @BSSGP_Types.Container_ID_BSSGP.");
return single_value->field_container__ID;
}

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

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

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

void Container__ID__BSSGP_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(", container_ID := ");
single_value->field_container__ID.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 Container__ID__BSSGP_template::log_match(const Container__ID__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_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_container__ID.match(match_value.container__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".container_ID");
single_value->field_container__ID.log_match(match_value.container__ID(), 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(", container_ID := ");
single_value->field_container__ID.log_match(match_value.container__ID(), 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 Container__ID__BSSGP_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_container__ID.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.Container_ID_BSSGP.");
}
}

void Container__ID__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_container__ID.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 Container__ID__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.Container_ID_BSSGP.");
}
}

void Container__ID__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: {
    Container__ID__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 (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Container_ID_BSSGP 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) container__ID().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(), "container_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          container__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(), "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.Container_ID_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Container__ID__BSSGP_template* precondition = new Container__ID__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Container__ID__BSSGP_template* implied_template = new Container__ID__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Container__ID__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Container_ID_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

Global__TFI__BSSGP::Global__TFI__BSSGP()
{
}

Global__TFI__BSSGP::Global__TFI__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_global__TFI,
    const BITSTRING& par_reserved)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_global__TFI(par_global__TFI),
  field_reserved(par_reserved)
{
}

Global__TFI__BSSGP::Global__TFI__BSSGP(const Global__TFI__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Global_TFI_BSSGP.");
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.global__TFI().is_bound()) field_global__TFI = other_value.global__TFI();
else field_global__TFI.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void Global__TFI__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_global__TFI.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* Global__TFI__BSSGP::get_descriptor() const { return &Global__TFI__BSSGP_descr_; }
Global__TFI__BSSGP& Global__TFI__BSSGP::operator=(const Global__TFI__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Global_TFI_BSSGP.");
  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.global__TFI().is_bound()) field_global__TFI = other_value.global__TFI();
  else field_global__TFI.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

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

boolean Global__TFI__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_global__TFI.is_bound())
  || (field_reserved.is_bound());
}
boolean Global__TFI__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_global__TFI.is_value()
  && field_reserved.is_value();
}
void Global__TFI__BSSGP::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(", global_TFI := ");
field_global__TFI.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void Global__TFI__BSSGP::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 (global__TFI().is_bound()) global__TFI().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void Global__TFI__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 (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Global_TFI_BSSGP 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) global__TFI().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(), "global_TFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          global__TFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.Global_TFI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Global_TFI_BSSGP");
  }
}

void Global__TFI__BSSGP::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_global__TFI.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void Global__TFI__BSSGP::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_global__TFI.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

void Global__TFI__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 Global__TFI__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 Global__TFI__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;
  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, Global__TFI__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Global__TFI__BSSGP_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, Global__TFI__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Global__TFI__BSSGP_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::BIT6_descr_.raw->forceomit);
  decoded_field_length = field_global__TFI.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_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_reserved.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;
  if (field_iEI !=  os_86) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Global__TFI__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 = 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, Global__TFI__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Global__TFI__BSSGP_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT6_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT2_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Global__TFI__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Global__TFI__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_global__TFI.RAW_encode(General__Types::BIT6_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_reserved.RAW_encode(General__Types::BIT2_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(Global__TFI__BSSGP_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(Global__TFI__BSSGP_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_86) {
  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_86.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 Global__TFI__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_global__TFI;
BITSTRING_template field_reserved;
};

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

void Global__TFI__BSSGP_template::copy_value(const Global__TFI__BSSGP& 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.global__TFI().is_bound()) {
  single_value->field_global__TFI = other_value.global__TFI();
} else {
  single_value->field_global__TFI.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 Global__TFI__BSSGP_template::copy_template(const Global__TFI__BSSGP_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.global__TFI().get_selection()) {
single_value->field_global__TFI = other_value.global__TFI();
} else {
single_value->field_global__TFI.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 Global__TFI__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 Global__TFI__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Global__TFI__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.Global_TFI_BSSGP.");
break;
}
set_selection(other_value);
}

Global__TFI__BSSGP_template::Global__TFI__BSSGP_template()
{
}

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

Global__TFI__BSSGP_template::Global__TFI__BSSGP_template(const Global__TFI__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Global__TFI__BSSGP_template::match(const Global__TFI__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.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.global__TFI().is_bound()) return FALSE;
if(!single_value->field_global__TFI.match(other_value.global__TFI(), 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.Global_TFI_BSSGP.");
}
return FALSE;
}

boolean Global__TFI__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_global__TFI.is_bound()
 || single_value->field_reserved.is_bound();
}

boolean Global__TFI__BSSGP_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_global__TFI.is_value()
 && single_value->field_reserved.is_value();
}

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

Global__TFI__BSSGP Global__TFI__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.Global_TFI_BSSGP.");
Global__TFI__BSSGP 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_global__TFI.is_bound()) {
ret_val.global__TFI() = single_value->field_global__TFI.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

BITSTRING_template& Global__TFI__BSSGP_template::global__TFI()
{
set_specific();
return single_value->field_global__TFI;
}

const BITSTRING_template& Global__TFI__BSSGP_template::global__TFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field global_TFI of a non-specific template of type @BSSGP_Types.Global_TFI_BSSGP.");
return single_value->field_global__TFI;
}

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

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

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

void Global__TFI__BSSGP_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(", global_TFI := ");
single_value->field_global__TFI.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 Global__TFI__BSSGP_template::log_match(const Global__TFI__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_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_global__TFI.match(match_value.global__TFI(), legacy)){
TTCN_Logger::log_logmatch_info(".global_TFI");
single_value->field_global__TFI.log_match(match_value.global__TFI(), 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(", global_TFI := ");
single_value->field_global__TFI.log_match(match_value.global__TFI(), 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 Global__TFI__BSSGP_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_global__TFI.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.Global_TFI_BSSGP.");
}
}

void Global__TFI__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_global__TFI.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 Global__TFI__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.Global_TFI_BSSGP.");
}
}

void Global__TFI__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: {
    Global__TFI__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 (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Global_TFI_BSSGP 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) global__TFI().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(), "global_TFI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          global__TFI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.Global_TFI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Global__TFI__BSSGP_template* precondition = new Global__TFI__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Global__TFI__BSSGP_template* implied_template = new Global__TFI__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Global__TFI__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Global_TFI_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

PS__HandoverIndications::PS__HandoverIndications()
{
}

PS__HandoverIndications::PS__HandoverIndications(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_sI__PSI,
    const BITSTRING& par_dMLC__Carriers,
    const BITSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_sI__PSI(par_sI__PSI),
  field_dMLC__Carriers(par_dMLC__Carriers),
  field_spare(par_spare)
{
}

PS__HandoverIndications::PS__HandoverIndications(const PS__HandoverIndications& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PS_HandoverIndications.");
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.sI__PSI().is_bound()) field_sI__PSI = other_value.sI__PSI();
else field_sI__PSI.clean_up();
if (other_value.dMLC__Carriers().is_bound()) field_dMLC__Carriers = other_value.dMLC__Carriers();
else field_dMLC__Carriers.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void PS__HandoverIndications::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_sI__PSI.clean_up();
field_dMLC__Carriers.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* PS__HandoverIndications::get_descriptor() const { return &PS__HandoverIndications_descr_; }
PS__HandoverIndications& PS__HandoverIndications::operator=(const PS__HandoverIndications& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PS_HandoverIndications.");
  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.sI__PSI().is_bound()) field_sI__PSI = other_value.sI__PSI();
  else field_sI__PSI.clean_up();
  if (other_value.dMLC__Carriers().is_bound()) field_dMLC__Carriers = other_value.dMLC__Carriers();
  else field_dMLC__Carriers.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

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

boolean PS__HandoverIndications::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_sI__PSI.is_bound())
  || (field_dMLC__Carriers.is_bound())
  || (field_spare.is_bound());
}
boolean PS__HandoverIndications::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_sI__PSI.is_value()
  && field_dMLC__Carriers.is_value()
  && field_spare.is_value();
}
void PS__HandoverIndications::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(", sI_PSI := ");
field_sI__PSI.log();
TTCN_Logger::log_event_str(", dMLC_Carriers := ");
field_dMLC__Carriers.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void PS__HandoverIndications::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 (sI__PSI().is_bound()) sI__PSI().set_implicit_omit();
if (dMLC__Carriers().is_bound()) dMLC__Carriers().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void PS__HandoverIndications::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.PS_HandoverIndications 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) sI__PSI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) dMLC__Carriers().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(), "sI_PSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI__PSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dMLC_Carriers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dMLC__Carriers().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.PS_HandoverIndications: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PS_HandoverIndications");
  }
}

void PS__HandoverIndications::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_sI__PSI.encode_text(text_buf);
field_dMLC__Carriers.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void PS__HandoverIndications::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_sI__PSI.decode_text(text_buf);
field_dMLC__Carriers.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void PS__HandoverIndications::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 PS__HandoverIndications::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 PS__HandoverIndications::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, PS__HandoverIndications_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(PS__HandoverIndications_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, PS__HandoverIndications_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PS__HandoverIndications_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_sI__PSI.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::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_dMLC__Carriers.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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT5_descr_, p_buf, min_of_ints(2, limit, value_of_length_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_87) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PS__HandoverIndications::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, PS__HandoverIndications_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PS__HandoverIndications_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::BIT2_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, 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(PS__HandoverIndications_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(PS__HandoverIndications_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_sI__PSI.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_dMLC__Carriers.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT5_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(PS__HandoverIndications_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(PS__HandoverIndications_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_87) {
  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_87.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 PS__HandoverIndications_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_sI__PSI;
BITSTRING_template field_dMLC__Carriers;
BITSTRING_template field_spare;
};

void PS__HandoverIndications_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_sI__PSI = ANY_VALUE;
single_value->field_dMLC__Carriers = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void PS__HandoverIndications_template::copy_value(const PS__HandoverIndications& 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.sI__PSI().is_bound()) {
  single_value->field_sI__PSI = other_value.sI__PSI();
} else {
  single_value->field_sI__PSI.clean_up();
}
if (other_value.dMLC__Carriers().is_bound()) {
  single_value->field_dMLC__Carriers = other_value.dMLC__Carriers();
} else {
  single_value->field_dMLC__Carriers.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 PS__HandoverIndications_template::copy_template(const PS__HandoverIndications_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.sI__PSI().get_selection()) {
single_value->field_sI__PSI = other_value.sI__PSI();
} else {
single_value->field_sI__PSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dMLC__Carriers().get_selection()) {
single_value->field_dMLC__Carriers = other_value.dMLC__Carriers();
} else {
single_value->field_dMLC__Carriers.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 PS__HandoverIndications_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PS__HandoverIndications_template(*other_value.implication_.precondition);
implication_.implied_template = new PS__HandoverIndications_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.PS_HandoverIndications.");
break;
}
set_selection(other_value);
}

PS__HandoverIndications_template::PS__HandoverIndications_template()
{
}

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

PS__HandoverIndications_template::PS__HandoverIndications_template(const PS__HandoverIndications& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PS__HandoverIndications_template::match(const PS__HandoverIndications& 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.sI__PSI().is_bound()) return FALSE;
if(!single_value->field_sI__PSI.match(other_value.sI__PSI(), legacy))return FALSE;
if(!other_value.dMLC__Carriers().is_bound()) return FALSE;
if(!single_value->field_dMLC__Carriers.match(other_value.dMLC__Carriers(), 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.PS_HandoverIndications.");
}
return FALSE;
}

boolean PS__HandoverIndications_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_sI__PSI.is_bound()
 || single_value->field_dMLC__Carriers.is_bound()
 || single_value->field_spare.is_bound();
}

boolean PS__HandoverIndications_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_sI__PSI.is_value()
 && single_value->field_dMLC__Carriers.is_value()
 && single_value->field_spare.is_value();
}

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

PS__HandoverIndications PS__HandoverIndications_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.PS_HandoverIndications.");
PS__HandoverIndications 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_sI__PSI.is_bound()) {
ret_val.sI__PSI() = single_value->field_sI__PSI.valueof();
}
if (single_value->field_dMLC__Carriers.is_bound()) {
ret_val.dMLC__Carriers() = single_value->field_dMLC__Carriers.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

BITSTRING_template& PS__HandoverIndications_template::sI__PSI()
{
set_specific();
return single_value->field_sI__PSI;
}

const BITSTRING_template& PS__HandoverIndications_template::sI__PSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI_PSI of a non-specific template of type @BSSGP_Types.PS_HandoverIndications.");
return single_value->field_sI__PSI;
}

BITSTRING_template& PS__HandoverIndications_template::dMLC__Carriers()
{
set_specific();
return single_value->field_dMLC__Carriers;
}

const BITSTRING_template& PS__HandoverIndications_template::dMLC__Carriers() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dMLC_Carriers of a non-specific template of type @BSSGP_Types.PS_HandoverIndications.");
return single_value->field_dMLC__Carriers;
}

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

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

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

void PS__HandoverIndications_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(", sI_PSI := ");
single_value->field_sI__PSI.log();
TTCN_Logger::log_event_str(", dMLC_Carriers := ");
single_value->field_dMLC__Carriers.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 PS__HandoverIndications_template::log_match(const PS__HandoverIndications& 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_sI__PSI.match(match_value.sI__PSI(), legacy)){
TTCN_Logger::log_logmatch_info(".sI_PSI");
single_value->field_sI__PSI.log_match(match_value.sI__PSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dMLC__Carriers.match(match_value.dMLC__Carriers(), legacy)){
TTCN_Logger::log_logmatch_info(".dMLC_Carriers");
single_value->field_dMLC__Carriers.log_match(match_value.dMLC__Carriers(), 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(", sI_PSI := ");
single_value->field_sI__PSI.log_match(match_value.sI__PSI(), legacy);
TTCN_Logger::log_event_str(", dMLC_Carriers := ");
single_value->field_dMLC__Carriers.log_match(match_value.dMLC__Carriers(), 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 PS__HandoverIndications_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_sI__PSI.encode_text(text_buf);
single_value->field_dMLC__Carriers.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.PS_HandoverIndications.");
}
}

void PS__HandoverIndications_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_sI__PSI.decode_text(text_buf);
single_value->field_dMLC__Carriers.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 PS__HandoverIndications_template[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.PS_HandoverIndications.");
}
}

void PS__HandoverIndications_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PS__HandoverIndications_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.PS_HandoverIndications 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) sI__PSI().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) dMLC__Carriers().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(), "sI_PSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI__PSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dMLC_Carriers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dMLC__Carriers().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.PS_HandoverIndications: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PS__HandoverIndications_template* precondition = new PS__HandoverIndications_template;
    precondition->set_param(*param.get_elem(0));
    PS__HandoverIndications_template* implied_template = new PS__HandoverIndications_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PS__HandoverIndications_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PS_HandoverIndications");
  }
  is_ifpresent = param.get_ifpresent();
}

void PS__HandoverIndications_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.PS_HandoverIndications");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PS_HandoverIndications");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PS_HandoverIndications");
single_value->field_sI__PSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PS_HandoverIndications");
single_value->field_dMLC__Carriers.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PS_HandoverIndications");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PS_HandoverIndications");
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.PS_HandoverIndications");
}

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

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

CS__Indication::CS__Indication()
{
}

CS__Indication::CS__Indication(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_cS__IndicationContents)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_cS__IndicationContents(par_cS__IndicationContents)
{
}

CS__Indication::CS__Indication(const CS__Indication& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.CS_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.cS__IndicationContents().is_bound()) field_cS__IndicationContents = other_value.cS__IndicationContents();
else field_cS__IndicationContents.clean_up();
}

void CS__Indication::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_cS__IndicationContents.clean_up();
}

const TTCN_Typedescriptor_t* CS__Indication::get_descriptor() const { return &CS__Indication_descr_; }
CS__Indication& CS__Indication::operator=(const CS__Indication& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.CS_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.cS__IndicationContents().is_bound()) field_cS__IndicationContents = other_value.cS__IndicationContents();
  else field_cS__IndicationContents.clean_up();
}
return *this;
}

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

boolean CS__Indication::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_cS__IndicationContents.is_bound());
}
boolean CS__Indication::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_cS__IndicationContents.is_value();
}
void CS__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(", cS_IndicationContents := ");
field_cS__IndicationContents.log();
TTCN_Logger::log_event_str(" }");
}

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

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

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

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

void CS__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 CS__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 CS__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, CS__Indication_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(CS__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, CS__Indication_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(CS__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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_cS__IndicationContents.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_88) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CS__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, CS__Indication_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, CS__Indication_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(CS__Indication_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(CS__Indication_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cS__IndicationContents.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(CS__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(CS__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_88) {
  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_88.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 CS__Indication_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_cS__IndicationContents;
};

void CS__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_cS__IndicationContents = ANY_VALUE;
}
}
}

void CS__Indication_template::copy_value(const CS__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.cS__IndicationContents().is_bound()) {
  single_value->field_cS__IndicationContents = other_value.cS__IndicationContents();
} else {
  single_value->field_cS__IndicationContents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CS__Indication_template::copy_template(const CS__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.cS__IndicationContents().get_selection()) {
single_value->field_cS__IndicationContents = other_value.cS__IndicationContents();
} else {
single_value->field_cS__IndicationContents.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 CS__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 CS__Indication_template(*other_value.implication_.precondition);
implication_.implied_template = new CS__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.CS_Indication.");
break;
}
set_selection(other_value);
}

CS__Indication_template::CS__Indication_template()
{
}

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

CS__Indication_template::CS__Indication_template(const CS__Indication& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CS__Indication_template::match(const CS__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.cS__IndicationContents().is_bound()) return FALSE;
if(!single_value->field_cS__IndicationContents.match(other_value.cS__IndicationContents(), 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.CS_Indication.");
}
return FALSE;
}

boolean CS__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_cS__IndicationContents.is_bound();
}

boolean CS__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_cS__IndicationContents.is_value();
}

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

CS__Indication CS__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.CS_Indication.");
CS__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_cS__IndicationContents.is_bound()) {
ret_val.cS__IndicationContents() = single_value->field_cS__IndicationContents.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

OCTETSTRING_template& CS__Indication_template::cS__IndicationContents()
{
set_specific();
return single_value->field_cS__IndicationContents;
}

const OCTETSTRING_template& CS__Indication_template::cS__IndicationContents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cS_IndicationContents of a non-specific template of type @BSSGP_Types.CS_Indication.");
return single_value->field_cS__IndicationContents;
}

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

void CS__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(", cS_IndicationContents := ");
single_value->field_cS__IndicationContents.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 CS__Indication_template::log_match(const CS__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_cS__IndicationContents.match(match_value.cS__IndicationContents(), legacy)){
TTCN_Logger::log_logmatch_info(".cS_IndicationContents");
single_value->field_cS__IndicationContents.log_match(match_value.cS__IndicationContents(), 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(", cS_IndicationContents := ");
single_value->field_cS__IndicationContents.log_match(match_value.cS__IndicationContents(), 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 CS__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_cS__IndicationContents.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.CS_Indication.");
}
}

void CS__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_cS__IndicationContents.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 CS__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.CS_Indication.");
}
}

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

void CS__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.CS_Indication");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CS_Indication");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CS_Indication");
single_value->field_cS__IndicationContents.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.CS_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.CS_Indication");
}

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

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

E__UTRAN__Inter__RAT__Handover__Info::E__UTRAN__Inter__RAT__Handover__Info()
{
}

E__UTRAN__Inter__RAT__Handover__Info::E__UTRAN__Inter__RAT__Handover__Info(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_ue__EUTRA__Capability)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_ue__EUTRA__Capability(par_ue__EUTRA__Capability)
{
}

E__UTRAN__Inter__RAT__Handover__Info::E__UTRAN__Inter__RAT__Handover__Info(const E__UTRAN__Inter__RAT__Handover__Info& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.E_UTRAN_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.ue__EUTRA__Capability().is_bound()) field_ue__EUTRA__Capability = other_value.ue__EUTRA__Capability();
else field_ue__EUTRA__Capability.clean_up();
}

void E__UTRAN__Inter__RAT__Handover__Info::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_ue__EUTRA__Capability.clean_up();
}

const TTCN_Typedescriptor_t* E__UTRAN__Inter__RAT__Handover__Info::get_descriptor() const { return &E__UTRAN__Inter__RAT__Handover__Info_descr_; }
E__UTRAN__Inter__RAT__Handover__Info& E__UTRAN__Inter__RAT__Handover__Info::operator=(const E__UTRAN__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.E_UTRAN_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.ue__EUTRA__Capability().is_bound()) field_ue__EUTRA__Capability = other_value.ue__EUTRA__Capability();
  else field_ue__EUTRA__Capability.clean_up();
}
return *this;
}

boolean E__UTRAN__Inter__RAT__Handover__Info::operator==(const E__UTRAN__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_ue__EUTRA__Capability==other_value.field_ue__EUTRA__Capability;
}

boolean E__UTRAN__Inter__RAT__Handover__Info::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_ue__EUTRA__Capability.is_bound());
}
boolean E__UTRAN__Inter__RAT__Handover__Info::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_ue__EUTRA__Capability.is_value();
}
void E__UTRAN__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(", ue_EUTRA_Capability := ");
field_ue__EUTRA__Capability.log();
TTCN_Logger::log_event_str(" }");
}

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

void E__UTRAN__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 (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.E_UTRAN_Inter_RAT_Handover_Info 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) ue__EUTRA__Capability().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "ue_EUTRA_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ue__EUTRA__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.E_UTRAN_Inter_RAT_Handover_Info: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.E_UTRAN_Inter_RAT_Handover_Info");
  }
}

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

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

void E__UTRAN__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 E__UTRAN__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 E__UTRAN__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, E__UTRAN__Inter__RAT__Handover__Info_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(E__UTRAN__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, E__UTRAN__Inter__RAT__Handover__Info_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(E__UTRAN__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::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_ue__EUTRA__Capability.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_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_77) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int E__UTRAN__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 = 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, E__UTRAN__Inter__RAT__Handover__Info_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, E__UTRAN__Inter__RAT__Handover__Info_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, 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(E__UTRAN__Inter__RAT__Handover__Info_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(E__UTRAN__Inter__RAT__Handover__Info_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_ue__EUTRA__Capability.RAW_encode(General__Types::OCTN_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(E__UTRAN__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(E__UTRAN__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_77) {
  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_77.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 E__UTRAN__Inter__RAT__Handover__Info_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_ue__EUTRA__Capability;
};

void E__UTRAN__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_ue__EUTRA__Capability = ANY_VALUE;
}
}
}

void E__UTRAN__Inter__RAT__Handover__Info_template::copy_value(const E__UTRAN__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.ue__EUTRA__Capability().is_bound()) {
  single_value->field_ue__EUTRA__Capability = other_value.ue__EUTRA__Capability();
} else {
  single_value->field_ue__EUTRA__Capability.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void E__UTRAN__Inter__RAT__Handover__Info_template::copy_template(const E__UTRAN__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.ue__EUTRA__Capability().get_selection()) {
single_value->field_ue__EUTRA__Capability = other_value.ue__EUTRA__Capability();
} else {
single_value->field_ue__EUTRA__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 E__UTRAN__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 E__UTRAN__Inter__RAT__Handover__Info_template(*other_value.implication_.precondition);
implication_.implied_template = new E__UTRAN__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.E_UTRAN_Inter_RAT_Handover_Info.");
break;
}
set_selection(other_value);
}

E__UTRAN__Inter__RAT__Handover__Info_template::E__UTRAN__Inter__RAT__Handover__Info_template()
{
}

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

E__UTRAN__Inter__RAT__Handover__Info_template::E__UTRAN__Inter__RAT__Handover__Info_template(const E__UTRAN__Inter__RAT__Handover__Info& other_value)
{
copy_value(other_value);
}

E__UTRAN__Inter__RAT__Handover__Info_template::E__UTRAN__Inter__RAT__Handover__Info_template(const OPTIONAL<E__UTRAN__Inter__RAT__Handover__Info>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const E__UTRAN__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.E_UTRAN_Inter_RAT_Handover_Info from an unbound optional field.");
}
}

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

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

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

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

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

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

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

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

boolean E__UTRAN__Inter__RAT__Handover__Info_template::match(const E__UTRAN__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.ue__EUTRA__Capability().is_bound()) return FALSE;
if(!single_value->field_ue__EUTRA__Capability.match(other_value.ue__EUTRA__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.E_UTRAN_Inter_RAT_Handover_Info.");
}
return FALSE;
}

boolean E__UTRAN__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_ue__EUTRA__Capability.is_bound();
}

boolean E__UTRAN__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_ue__EUTRA__Capability.is_value();
}

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

E__UTRAN__Inter__RAT__Handover__Info E__UTRAN__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.E_UTRAN_Inter_RAT_Handover_Info.");
E__UTRAN__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_ue__EUTRA__Capability.is_bound()) {
ret_val.ue__EUTRA__Capability() = single_value->field_ue__EUTRA__Capability.valueof();
}
return ret_val;
}

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

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

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

const OCTETSTRING_template& E__UTRAN__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.E_UTRAN_Inter_RAT_Handover_Info.");
return single_value->field_iEI;
}

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

const BITSTRING_template& E__UTRAN__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.E_UTRAN_Inter_RAT_Handover_Info.");
return single_value->field_ext;
}

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

const LIN2__2a_template& E__UTRAN__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.E_UTRAN_Inter_RAT_Handover_Info.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& E__UTRAN__Inter__RAT__Handover__Info_template::ue__EUTRA__Capability()
{
set_specific();
return single_value->field_ue__EUTRA__Capability;
}

const OCTETSTRING_template& E__UTRAN__Inter__RAT__Handover__Info_template::ue__EUTRA__Capability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ue_EUTRA_Capability of a non-specific template of type @BSSGP_Types.E_UTRAN_Inter_RAT_Handover_Info.");
return single_value->field_ue__EUTRA__Capability;
}

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

void E__UTRAN__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(", ue_EUTRA_Capability := ");
single_value->field_ue__EUTRA__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 E__UTRAN__Inter__RAT__Handover__Info_template::log_match(const E__UTRAN__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_ue__EUTRA__Capability.match(match_value.ue__EUTRA__Capability(), legacy)){
TTCN_Logger::log_logmatch_info(".ue_EUTRA_Capability");
single_value->field_ue__EUTRA__Capability.log_match(match_value.ue__EUTRA__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("{ 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(", ue_EUTRA_Capability := ");
single_value->field_ue__EUTRA__Capability.log_match(match_value.ue__EUTRA__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 E__UTRAN__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_ue__EUTRA__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.E_UTRAN_Inter_RAT_Handover_Info.");
}
}

void E__UTRAN__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_ue__EUTRA__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 E__UTRAN__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.E_UTRAN_Inter_RAT_Handover_Info.");
}
}

void E__UTRAN__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: {
    E__UTRAN__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 (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.E_UTRAN_Inter_RAT_Handover_Info 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) ue__EUTRA__Capability().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "ue_EUTRA_Capability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ue__EUTRA__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.E_UTRAN_Inter_RAT_Handover_Info: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    E__UTRAN__Inter__RAT__Handover__Info_template* precondition = new E__UTRAN__Inter__RAT__Handover__Info_template;
    precondition->set_param(*param.get_elem(0));
    E__UTRAN__Inter__RAT__Handover__Info_template* implied_template = new E__UTRAN__Inter__RAT__Handover__Info_template;
    implied_template->set_param(*param.get_elem(1));
    *this = E__UTRAN__Inter__RAT__Handover__Info_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.E_UTRAN_Inter_RAT_Handover_Info");
  }
  is_ifpresent = param.get_ifpresent();
}

void E__UTRAN__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.E_UTRAN_Inter_RAT_Handover_Info");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.E_UTRAN_Inter_RAT_Handover_Info");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.E_UTRAN_Inter_RAT_Handover_Info");
single_value->field_ue__EUTRA__Capability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.E_UTRAN_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.E_UTRAN_Inter_RAT_Handover_Info");
}

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

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


const Measurement Measurement__List::UNBOUND_ELEM;
Measurement__List::Measurement__List()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

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

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

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

const Measurement& Measurement__List::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BSSGP_Types.Measurement_List.");
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.Measurement_List 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.Measurement_List: 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 Measurement& Measurement__List::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.Measurement_List.");
return (*this)[(int)index_value];
}

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

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

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

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

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

Measurement__List Measurement__List::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.Measurement_List.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Types.Measurement_List","element");
Measurement__List 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 Measurement(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

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

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

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

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

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

void Measurement__List::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 Measurement__List::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 Measurement__List::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 Measurement__List::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 Measurement__List_template::copy_value(const Measurement__List& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Types.Measurement_List with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (Measurement_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 Measurement_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new Measurement_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void Measurement__List_template::copy_template(const Measurement__List_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 = (Measurement_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 Measurement_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new Measurement_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 Measurement__List_template[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 Measurement__List_template(*other_value.implication_.precondition);
implication_.implied_template = new Measurement__List_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.Measurement_List.");
break;
}
set_selection(other_value);
}

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

Measurement__List_template::Measurement__List_template()
{
}

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

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

Measurement__List_template::Measurement__List_template(const Measurement__List& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

const Measurement_template& Measurement__List_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.Measurement_List 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.Measurement_List.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Types.Measurement_List: 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 Measurement_template& Measurement__List_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.Measurement_List.");
return (*this)[(int)index_value];
}

void Measurement__List_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.Measurement_List.");
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 = (Measurement_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 Measurement_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 Measurement_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 = (Measurement_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

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

boolean Measurement__List_template::match(const Measurement__List& 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.Measurement_List.");
}
return FALSE;
}

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

Measurement__List Measurement__List_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.Measurement_List.");
Measurement__List 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;
}

Measurement__List Measurement__List_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);
}

Measurement__List Measurement__List_template::replace(int index, int len, const Measurement__List_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());
}

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

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

void Measurement__List_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 Measurement__List_template::log_match(const Measurement__List& 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 Measurement__List_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.Measurement_List.");
}
}

void Measurement__List_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.Measurement_List.");
single_value.value_elements = (Measurement_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 Measurement_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 Measurement__List_template[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.Measurement_List.");
}
}

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

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

void Measurement__List_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.Measurement_List");
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.Measurement_List");
}

boolean Measurement__List_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);
}
}
Measurement::Measurement()
{
}

Measurement::Measurement(const INTEGER& par_e__ARFCN,
    const BITSTRING& par_measurementBandwidth,
    const BITSTRING& par_spare)
  :   field_e__ARFCN(par_e__ARFCN),
  field_measurementBandwidth(par_measurementBandwidth),
  field_spare(par_spare)
{
}

Measurement::Measurement(const Measurement& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Measurement.");
if (other_value.e__ARFCN().is_bound()) field_e__ARFCN = other_value.e__ARFCN();
else field_e__ARFCN.clean_up();
if (other_value.measurementBandwidth().is_bound()) field_measurementBandwidth = other_value.measurementBandwidth();
else field_measurementBandwidth.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void Measurement::clean_up()
{
field_e__ARFCN.clean_up();
field_measurementBandwidth.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* Measurement::get_descriptor() const { return &Measurement_descr_; }
Measurement& Measurement::operator=(const Measurement& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Measurement.");
  if (other_value.e__ARFCN().is_bound()) field_e__ARFCN = other_value.e__ARFCN();
  else field_e__ARFCN.clean_up();
  if (other_value.measurementBandwidth().is_bound()) field_measurementBandwidth = other_value.measurementBandwidth();
  else field_measurementBandwidth.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean Measurement::operator==(const Measurement& other_value) const
{
return field_e__ARFCN==other_value.field_e__ARFCN
  && field_measurementBandwidth==other_value.field_measurementBandwidth
  && field_spare==other_value.field_spare;
}

boolean Measurement::is_bound() const
{
return (field_e__ARFCN.is_bound())
  || (field_measurementBandwidth.is_bound())
  || (field_spare.is_bound());
}
boolean Measurement::is_value() const
{
return field_e__ARFCN.is_value()
  && field_measurementBandwidth.is_value()
  && field_spare.is_value();
}
void Measurement::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ e_ARFCN := ");
field_e__ARFCN.log();
TTCN_Logger::log_event_str(", measurementBandwidth := ");
field_measurementBandwidth.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void Measurement::set_implicit_omit()
{
if (e__ARFCN().is_bound()) e__ARFCN().set_implicit_omit();
if (measurementBandwidth().is_bound()) measurementBandwidth().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void Measurement::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.Measurement 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) e__ARFCN().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) measurementBandwidth().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(), "e_ARFCN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__ARFCN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "measurementBandwidth")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurementBandwidth().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.Measurement: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Measurement");
  }
}

void Measurement::encode_text(Text_Buf& text_buf) const
{
field_e__ARFCN.encode_text(text_buf);
field_measurementBandwidth.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void Measurement::decode_text(Text_Buf& text_buf)
{
field_e__ARFCN.decode_text(text_buf);
field_measurementBandwidth.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void Measurement::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 Measurement::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 Measurement::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::LIN2__BO__LAST_descr_.raw->forceomit);
  decoded_field_length = field_e__ARFCN.RAW_decode(General__Types::LIN2__BO__LAST_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_measurementBandwidth.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 Measurement::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::LIN2__BO__LAST_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_e__ARFCN.RAW_encode(General__Types::LIN2__BO__LAST_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_measurementBandwidth.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 Measurement_template::single_value_struct {
INTEGER_template field_e__ARFCN;
BITSTRING_template field_measurementBandwidth;
BITSTRING_template field_spare;
};

void Measurement_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_e__ARFCN = ANY_VALUE;
single_value->field_measurementBandwidth = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void Measurement_template::copy_value(const Measurement& other_value)
{
single_value = new single_value_struct;
if (other_value.e__ARFCN().is_bound()) {
  single_value->field_e__ARFCN = other_value.e__ARFCN();
} else {
  single_value->field_e__ARFCN.clean_up();
}
if (other_value.measurementBandwidth().is_bound()) {
  single_value->field_measurementBandwidth = other_value.measurementBandwidth();
} else {
  single_value->field_measurementBandwidth.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 Measurement_template::copy_template(const Measurement_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.e__ARFCN().get_selection()) {
single_value->field_e__ARFCN = other_value.e__ARFCN();
} else {
single_value->field_e__ARFCN.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.measurementBandwidth().get_selection()) {
single_value->field_measurementBandwidth = other_value.measurementBandwidth();
} else {
single_value->field_measurementBandwidth.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 Measurement_template[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 Measurement_template(*other_value.implication_.precondition);
implication_.implied_template = new Measurement_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.Measurement.");
break;
}
set_selection(other_value);
}

Measurement_template::Measurement_template()
{
}

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

Measurement_template::Measurement_template(const Measurement& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Measurement_template::match(const Measurement& 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.e__ARFCN().is_bound()) return FALSE;
if(!single_value->field_e__ARFCN.match(other_value.e__ARFCN(), legacy))return FALSE;
if(!other_value.measurementBandwidth().is_bound()) return FALSE;
if(!single_value->field_measurementBandwidth.match(other_value.measurementBandwidth(), 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.Measurement.");
}
return FALSE;
}

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

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

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

Measurement Measurement_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.Measurement.");
Measurement ret_val;
if (single_value->field_e__ARFCN.is_bound()) {
ret_val.e__ARFCN() = single_value->field_e__ARFCN.valueof();
}
if (single_value->field_measurementBandwidth.is_bound()) {
ret_val.measurementBandwidth() = single_value->field_measurementBandwidth.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

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

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

INTEGER_template& Measurement_template::e__ARFCN()
{
set_specific();
return single_value->field_e__ARFCN;
}

const INTEGER_template& Measurement_template::e__ARFCN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field e_ARFCN of a non-specific template of type @BSSGP_Types.Measurement.");
return single_value->field_e__ARFCN;
}

BITSTRING_template& Measurement_template::measurementBandwidth()
{
set_specific();
return single_value->field_measurementBandwidth;
}

const BITSTRING_template& Measurement_template::measurementBandwidth() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field measurementBandwidth of a non-specific template of type @BSSGP_Types.Measurement.");
return single_value->field_measurementBandwidth;
}

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

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

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

void Measurement_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ e_ARFCN := ");
single_value->field_e__ARFCN.log();
TTCN_Logger::log_event_str(", measurementBandwidth := ");
single_value->field_measurementBandwidth.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 Measurement_template::log_match(const Measurement& 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_e__ARFCN.match(match_value.e__ARFCN(), legacy)){
TTCN_Logger::log_logmatch_info(".e_ARFCN");
single_value->field_e__ARFCN.log_match(match_value.e__ARFCN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_measurementBandwidth.match(match_value.measurementBandwidth(), legacy)){
TTCN_Logger::log_logmatch_info(".measurementBandwidth");
single_value->field_measurementBandwidth.log_match(match_value.measurementBandwidth(), 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("{ e_ARFCN := ");
single_value->field_e__ARFCN.log_match(match_value.e__ARFCN(), legacy);
TTCN_Logger::log_event_str(", measurementBandwidth := ");
single_value->field_measurementBandwidth.log_match(match_value.measurementBandwidth(), 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 Measurement_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_e__ARFCN.encode_text(text_buf);
single_value->field_measurementBandwidth.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.Measurement.");
}
}

void Measurement_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_e__ARFCN.decode_text(text_buf);
single_value->field_measurementBandwidth.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 Measurement_template[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.Measurement.");
}
}

void Measurement_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: {
    Measurement_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.Measurement 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) e__ARFCN().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) measurementBandwidth().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(), "e_ARFCN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__ARFCN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "measurementBandwidth")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurementBandwidth().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.Measurement: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Measurement_template* precondition = new Measurement_template;
    precondition->set_param(*param.get_elem(0));
    Measurement_template* implied_template = new Measurement_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Measurement_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Measurement");
  }
  is_ifpresent = param.get_ifpresent();
}

void Measurement_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_e__ARFCN.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Measurement");
single_value->field_measurementBandwidth.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Measurement");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Measurement");
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.Measurement");
}

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

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

IRAT__Measurement__Configuration::IRAT__Measurement__Configuration()
{
}

IRAT__Measurement__Configuration::IRAT__Measurement__Configuration(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const INTEGER& par_reportingThreshold,
    const BITSTRING& par_repQuant,
    const BITSTRING& par_spare,
    const INTEGER& par_measurementDuration,
    const Measurement__List& par_measurement__List)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reportingThreshold(par_reportingThreshold),
  field_repQuant(par_repQuant),
  field_spare(par_spare),
  field_measurementDuration(par_measurementDuration),
  field_measurement__List(par_measurement__List)
{
}

IRAT__Measurement__Configuration::IRAT__Measurement__Configuration(const IRAT__Measurement__Configuration& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.IRAT_Measurement_Configuration.");
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.reportingThreshold().is_bound()) field_reportingThreshold = other_value.reportingThreshold();
else field_reportingThreshold.clean_up();
if (other_value.repQuant().is_bound()) field_repQuant = other_value.repQuant();
else field_repQuant.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.measurementDuration().is_bound()) field_measurementDuration = other_value.measurementDuration();
else field_measurementDuration.clean_up();
if (other_value.measurement__List().is_bound()) field_measurement__List = other_value.measurement__List();
else field_measurement__List.clean_up();
}

void IRAT__Measurement__Configuration::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reportingThreshold.clean_up();
field_repQuant.clean_up();
field_spare.clean_up();
field_measurementDuration.clean_up();
field_measurement__List.clean_up();
}

const TTCN_Typedescriptor_t* IRAT__Measurement__Configuration::get_descriptor() const { return &IRAT__Measurement__Configuration_descr_; }
IRAT__Measurement__Configuration& IRAT__Measurement__Configuration::operator=(const IRAT__Measurement__Configuration& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.IRAT_Measurement_Configuration.");
  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.reportingThreshold().is_bound()) field_reportingThreshold = other_value.reportingThreshold();
  else field_reportingThreshold.clean_up();
  if (other_value.repQuant().is_bound()) field_repQuant = other_value.repQuant();
  else field_repQuant.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.measurementDuration().is_bound()) field_measurementDuration = other_value.measurementDuration();
  else field_measurementDuration.clean_up();
  if (other_value.measurement__List().is_bound()) field_measurement__List = other_value.measurement__List();
  else field_measurement__List.clean_up();
}
return *this;
}

boolean IRAT__Measurement__Configuration::operator==(const IRAT__Measurement__Configuration& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_reportingThreshold==other_value.field_reportingThreshold
  && field_repQuant==other_value.field_repQuant
  && field_spare==other_value.field_spare
  && field_measurementDuration==other_value.field_measurementDuration
  && field_measurement__List==other_value.field_measurement__List;
}

boolean IRAT__Measurement__Configuration::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_reportingThreshold.is_bound())
  || (field_repQuant.is_bound())
  || (field_spare.is_bound())
  || (field_measurementDuration.is_bound())
  || (field_measurement__List.is_bound());
}
boolean IRAT__Measurement__Configuration::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_reportingThreshold.is_value()
  && field_repQuant.is_value()
  && field_spare.is_value()
  && field_measurementDuration.is_value()
  && field_measurement__List.is_value();
}
void IRAT__Measurement__Configuration::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(", reportingThreshold := ");
field_reportingThreshold.log();
TTCN_Logger::log_event_str(", repQuant := ");
field_repQuant.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", measurementDuration := ");
field_measurementDuration.log();
TTCN_Logger::log_event_str(", measurement_List := ");
field_measurement__List.log();
TTCN_Logger::log_event_str(" }");
}

void IRAT__Measurement__Configuration::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 (reportingThreshold().is_bound()) reportingThreshold().set_implicit_omit();
if (repQuant().is_bound()) repQuant().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (measurementDuration().is_bound()) measurementDuration().set_implicit_omit();
if (measurement__List().is_bound()) measurement__List().set_implicit_omit();
}

void IRAT__Measurement__Configuration::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record value of type @BSSGP_Types.IRAT_Measurement_Configuration has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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) reportingThreshold().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) repQuant().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));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) measurementDuration().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) measurement__List().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "reportingThreshold")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reportingThreshold().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "repQuant")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repQuant().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "measurementDuration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurementDuration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "measurement_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurement__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.IRAT_Measurement_Configuration: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.IRAT_Measurement_Configuration");
  }
}

void IRAT__Measurement__Configuration::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_reportingThreshold.encode_text(text_buf);
field_repQuant.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_measurementDuration.encode_text(text_buf);
field_measurement__List.encode_text(text_buf);
}

void IRAT__Measurement__Configuration::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_reportingThreshold.decode_text(text_buf);
field_repQuant.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_measurementDuration.decode_text(text_buf);
field_measurement__List.decode_text(text_buf);
}

void IRAT__Measurement__Configuration::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 IRAT__Measurement__Configuration::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 IRAT__Measurement__Configuration::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, IRAT__Measurement__Configuration_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(IRAT__Measurement__Configuration_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, IRAT__Measurement__Configuration_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(IRAT__Measurement__Configuration_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_reportingThreshold.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_repQuant.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.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_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::INT1_descr_.raw->forceomit);
  decoded_field_length = field_measurementDuration.RAW_decode(General__Types::INT1_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, Measurement__List_descr_.raw->forceomit);
  decoded_field_length = field_measurement__List.RAW_decode(Measurement__List_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;
  if (field_iEI !=  os_89) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int IRAT__Measurement__Configuration::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IRAT__Measurement__Configuration_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IRAT__Measurement__Configuration_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::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::INT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, Measurement__List_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(IRAT__Measurement__Configuration_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(IRAT__Measurement__Configuration_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reportingThreshold.RAW_encode(General__Types::INT6b_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_repQuant.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_measurementDuration.RAW_encode(General__Types::INT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_measurement__List.RAW_encode(Measurement__List_descr_, *myleaf.body.node.nodes[7]);
  {
  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 = 5;
  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(5);
  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;
  }
  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(IRAT__Measurement__Configuration_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(IRAT__Measurement__Configuration_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_89) {
  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_89.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 IRAT__Measurement__Configuration_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
INTEGER_template field_reportingThreshold;
BITSTRING_template field_repQuant;
BITSTRING_template field_spare;
INTEGER_template field_measurementDuration;
Measurement__List_template field_measurement__List;
};

void IRAT__Measurement__Configuration_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_reportingThreshold = ANY_VALUE;
single_value->field_repQuant = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_measurementDuration = ANY_VALUE;
single_value->field_measurement__List = ANY_VALUE;
}
}
}

void IRAT__Measurement__Configuration_template::copy_value(const IRAT__Measurement__Configuration& 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.reportingThreshold().is_bound()) {
  single_value->field_reportingThreshold = other_value.reportingThreshold();
} else {
  single_value->field_reportingThreshold.clean_up();
}
if (other_value.repQuant().is_bound()) {
  single_value->field_repQuant = other_value.repQuant();
} else {
  single_value->field_repQuant.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.measurementDuration().is_bound()) {
  single_value->field_measurementDuration = other_value.measurementDuration();
} else {
  single_value->field_measurementDuration.clean_up();
}
if (other_value.measurement__List().is_bound()) {
  single_value->field_measurement__List = other_value.measurement__List();
} else {
  single_value->field_measurement__List.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void IRAT__Measurement__Configuration_template::copy_template(const IRAT__Measurement__Configuration_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.reportingThreshold().get_selection()) {
single_value->field_reportingThreshold = other_value.reportingThreshold();
} else {
single_value->field_reportingThreshold.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.repQuant().get_selection()) {
single_value->field_repQuant = other_value.repQuant();
} else {
single_value->field_repQuant.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.measurementDuration().get_selection()) {
single_value->field_measurementDuration = other_value.measurementDuration();
} else {
single_value->field_measurementDuration.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.measurement__List().get_selection()) {
single_value->field_measurement__List = other_value.measurement__List();
} else {
single_value->field_measurement__List.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 IRAT__Measurement__Configuration_template[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 IRAT__Measurement__Configuration_template(*other_value.implication_.precondition);
implication_.implied_template = new IRAT__Measurement__Configuration_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.IRAT_Measurement_Configuration.");
break;
}
set_selection(other_value);
}

IRAT__Measurement__Configuration_template::IRAT__Measurement__Configuration_template()
{
}

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

IRAT__Measurement__Configuration_template::IRAT__Measurement__Configuration_template(const IRAT__Measurement__Configuration& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean IRAT__Measurement__Configuration_template::match(const IRAT__Measurement__Configuration& 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.reportingThreshold().is_bound()) return FALSE;
if(!single_value->field_reportingThreshold.match(other_value.reportingThreshold(), legacy))return FALSE;
if(!other_value.repQuant().is_bound()) return FALSE;
if(!single_value->field_repQuant.match(other_value.repQuant(), 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.measurementDuration().is_bound()) return FALSE;
if(!single_value->field_measurementDuration.match(other_value.measurementDuration(), legacy))return FALSE;
if(!other_value.measurement__List().is_bound()) return FALSE;
if(!single_value->field_measurement__List.match(other_value.measurement__List(), 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.IRAT_Measurement_Configuration.");
}
return FALSE;
}

boolean IRAT__Measurement__Configuration_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_reportingThreshold.is_bound()
 || single_value->field_repQuant.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_measurementDuration.is_bound()
 || single_value->field_measurement__List.is_bound();
}

boolean IRAT__Measurement__Configuration_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_reportingThreshold.is_value()
 && single_value->field_repQuant.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_measurementDuration.is_value()
 && single_value->field_measurement__List.is_value();
}

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

IRAT__Measurement__Configuration IRAT__Measurement__Configuration_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.IRAT_Measurement_Configuration.");
IRAT__Measurement__Configuration 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_reportingThreshold.is_bound()) {
ret_val.reportingThreshold() = single_value->field_reportingThreshold.valueof();
}
if (single_value->field_repQuant.is_bound()) {
ret_val.repQuant() = single_value->field_repQuant.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_measurementDuration.is_bound()) {
ret_val.measurementDuration() = single_value->field_measurementDuration.valueof();
}
if (single_value->field_measurement__List.is_bound()) {
ret_val.measurement__List() = single_value->field_measurement__List.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

INTEGER_template& IRAT__Measurement__Configuration_template::reportingThreshold()
{
set_specific();
return single_value->field_reportingThreshold;
}

const INTEGER_template& IRAT__Measurement__Configuration_template::reportingThreshold() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reportingThreshold of a non-specific template of type @BSSGP_Types.IRAT_Measurement_Configuration.");
return single_value->field_reportingThreshold;
}

BITSTRING_template& IRAT__Measurement__Configuration_template::repQuant()
{
set_specific();
return single_value->field_repQuant;
}

const BITSTRING_template& IRAT__Measurement__Configuration_template::repQuant() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field repQuant of a non-specific template of type @BSSGP_Types.IRAT_Measurement_Configuration.");
return single_value->field_repQuant;
}

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

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

INTEGER_template& IRAT__Measurement__Configuration_template::measurementDuration()
{
set_specific();
return single_value->field_measurementDuration;
}

const INTEGER_template& IRAT__Measurement__Configuration_template::measurementDuration() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field measurementDuration of a non-specific template of type @BSSGP_Types.IRAT_Measurement_Configuration.");
return single_value->field_measurementDuration;
}

Measurement__List_template& IRAT__Measurement__Configuration_template::measurement__List()
{
set_specific();
return single_value->field_measurement__List;
}

const Measurement__List_template& IRAT__Measurement__Configuration_template::measurement__List() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field measurement_List of a non-specific template of type @BSSGP_Types.IRAT_Measurement_Configuration.");
return single_value->field_measurement__List;
}

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

void IRAT__Measurement__Configuration_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(", reportingThreshold := ");
single_value->field_reportingThreshold.log();
TTCN_Logger::log_event_str(", repQuant := ");
single_value->field_repQuant.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", measurementDuration := ");
single_value->field_measurementDuration.log();
TTCN_Logger::log_event_str(", measurement_List := ");
single_value->field_measurement__List.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 IRAT__Measurement__Configuration_template::log_match(const IRAT__Measurement__Configuration& 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_reportingThreshold.match(match_value.reportingThreshold(), legacy)){
TTCN_Logger::log_logmatch_info(".reportingThreshold");
single_value->field_reportingThreshold.log_match(match_value.reportingThreshold(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_repQuant.match(match_value.repQuant(), legacy)){
TTCN_Logger::log_logmatch_info(".repQuant");
single_value->field_repQuant.log_match(match_value.repQuant(), 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_measurementDuration.match(match_value.measurementDuration(), legacy)){
TTCN_Logger::log_logmatch_info(".measurementDuration");
single_value->field_measurementDuration.log_match(match_value.measurementDuration(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_measurement__List.match(match_value.measurement__List(), legacy)){
TTCN_Logger::log_logmatch_info(".measurement_List");
single_value->field_measurement__List.log_match(match_value.measurement__List(), 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(", reportingThreshold := ");
single_value->field_reportingThreshold.log_match(match_value.reportingThreshold(), legacy);
TTCN_Logger::log_event_str(", repQuant := ");
single_value->field_repQuant.log_match(match_value.repQuant(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", measurementDuration := ");
single_value->field_measurementDuration.log_match(match_value.measurementDuration(), legacy);
TTCN_Logger::log_event_str(", measurement_List := ");
single_value->field_measurement__List.log_match(match_value.measurement__List(), 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 IRAT__Measurement__Configuration_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_reportingThreshold.encode_text(text_buf);
single_value->field_repQuant.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_measurementDuration.encode_text(text_buf);
single_value->field_measurement__List.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.IRAT_Measurement_Configuration.");
}
}

void IRAT__Measurement__Configuration_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_reportingThreshold.decode_text(text_buf);
single_value->field_repQuant.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_measurementDuration.decode_text(text_buf);
single_value->field_measurement__List.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 IRAT__Measurement__Configuration_template[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.IRAT_Measurement_Configuration.");
}
}

void IRAT__Measurement__Configuration_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: {
    IRAT__Measurement__Configuration_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record template of type @BSSGP_Types.IRAT_Measurement_Configuration has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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) reportingThreshold().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) repQuant().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));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) measurementDuration().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) measurement__List().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "reportingThreshold")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reportingThreshold().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "repQuant")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repQuant().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "measurementDuration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurementDuration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "measurement_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurement__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.IRAT_Measurement_Configuration: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    IRAT__Measurement__Configuration_template* precondition = new IRAT__Measurement__Configuration_template;
    precondition->set_param(*param.get_elem(0));
    IRAT__Measurement__Configuration_template* implied_template = new IRAT__Measurement__Configuration_template;
    implied_template->set_param(*param.get_elem(1));
    *this = IRAT__Measurement__Configuration_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.IRAT_Measurement_Configuration");
  }
  is_ifpresent = param.get_ifpresent();
}

void IRAT__Measurement__Configuration_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.IRAT_Measurement_Configuration");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration");
single_value->field_reportingThreshold.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration");
single_value->field_repQuant.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration");
single_value->field_measurementDuration.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration");
single_value->field_measurement__List.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration");
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.IRAT_Measurement_Configuration");
}

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

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

TrackingAreaIdentity__BSSGP::TrackingAreaIdentity__BSSGP()
{
}

TrackingAreaIdentity__BSSGP::TrackingAreaIdentity__BSSGP(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)
  :   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)
{
}

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

void TrackingAreaIdentity__BSSGP::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();
}

const TTCN_Typedescriptor_t* TrackingAreaIdentity__BSSGP::get_descriptor() const { return &TrackingAreaIdentity__BSSGP_descr_; }
TrackingAreaIdentity__BSSGP& TrackingAreaIdentity__BSSGP::operator=(const TrackingAreaIdentity__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.TrackingAreaIdentity_BSSGP.");
  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();
}
return *this;
}

boolean TrackingAreaIdentity__BSSGP::operator==(const TrackingAreaIdentity__BSSGP& other_value) const
{
return 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;
}

boolean TrackingAreaIdentity__BSSGP::is_bound() const
{
return (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());
}
boolean TrackingAreaIdentity__BSSGP::is_value() const
{
return 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();
}
void TrackingAreaIdentity__BSSGP::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
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(" }");
}

void TrackingAreaIdentity__BSSGP::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();
}

void TrackingAreaIdentity__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 (7<param.get_size()) {
      param.error("record value of type @BSSGP_Types.TrackingAreaIdentity_BSSGP 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) mccDigit1().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tAC().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(), "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++) 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.TrackingAreaIdentity_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.TrackingAreaIdentity_BSSGP");
  }
}

void TrackingAreaIdentity__BSSGP::encode_text(Text_Buf& text_buf) const
{
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);
}

void TrackingAreaIdentity__BSSGP::decode_text(Text_Buf& 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);
}

void TrackingAreaIdentity__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 TrackingAreaIdentity__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 TrackingAreaIdentity__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, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit1.RAW_decode(General__Types::HEX1_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::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit2.RAW_decode(General__Types::HEX1_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::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tAC.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int TrackingAreaIdentity__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 = 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::HEX1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::HEX1_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::OCT2_descr_.raw);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_tAC.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct TrackingAreaIdentity__BSSGP_template::single_value_struct {
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;
};

void TrackingAreaIdentity__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_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;
}
}
}

void TrackingAreaIdentity__BSSGP_template::copy_value(const TrackingAreaIdentity__BSSGP& other_value)
{
single_value = new single_value_struct;
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();
}
set_selection(SPECIFIC_VALUE);
}

void TrackingAreaIdentity__BSSGP_template::copy_template(const TrackingAreaIdentity__BSSGP_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
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();
}
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 TrackingAreaIdentity__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 TrackingAreaIdentity__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new TrackingAreaIdentity__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.TrackingAreaIdentity_BSSGP.");
break;
}
set_selection(other_value);
}

TrackingAreaIdentity__BSSGP_template::TrackingAreaIdentity__BSSGP_template()
{
}

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

TrackingAreaIdentity__BSSGP_template::TrackingAreaIdentity__BSSGP_template(const TrackingAreaIdentity__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean TrackingAreaIdentity__BSSGP_template::match(const TrackingAreaIdentity__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.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;
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.TrackingAreaIdentity_BSSGP.");
}
return FALSE;
}

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

boolean TrackingAreaIdentity__BSSGP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return 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();
}

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

TrackingAreaIdentity__BSSGP TrackingAreaIdentity__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.TrackingAreaIdentity_BSSGP.");
TrackingAreaIdentity__BSSGP ret_val;
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();
}
return ret_val;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

OCTETSTRING_template& TrackingAreaIdentity__BSSGP_template::tAC()
{
set_specific();
return single_value->field_tAC;
}

const OCTETSTRING_template& TrackingAreaIdentity__BSSGP_template::tAC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tAC of a non-specific template of type @BSSGP_Types.TrackingAreaIdentity_BSSGP.");
return single_value->field_tAC;
}

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

void TrackingAreaIdentity__BSSGP_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
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(" }");
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 TrackingAreaIdentity__BSSGP_template::log_match(const TrackingAreaIdentity__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_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);
}
}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("{ 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(" }");
} 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 TrackingAreaIdentity__BSSGP_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
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);
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.TrackingAreaIdentity_BSSGP.");
}
}

void TrackingAreaIdentity__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_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);
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 TrackingAreaIdentity__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.TrackingAreaIdentity_BSSGP.");
}
}

void TrackingAreaIdentity__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: {
    TrackingAreaIdentity__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 (7<param.get_size()) {
      param.error("record template of type @BSSGP_Types.TrackingAreaIdentity_BSSGP 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) mccDigit1().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) tAC().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(), "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++) 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.TrackingAreaIdentity_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrackingAreaIdentity__BSSGP_template* precondition = new TrackingAreaIdentity__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    TrackingAreaIdentity__BSSGP_template* implied_template = new TrackingAreaIdentity__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrackingAreaIdentity__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.TrackingAreaIdentity_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void TrackingAreaIdentity__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_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.TrackingAreaIdentity_BSSGP");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.TrackingAreaIdentity_BSSGP");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.TrackingAreaIdentity_BSSGP");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.TrackingAreaIdentity_BSSGP");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.TrackingAreaIdentity_BSSGP");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.TrackingAreaIdentity_BSSGP");
single_value->field_tAC.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.TrackingAreaIdentity_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.TrackingAreaIdentity_BSSGP");
}

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

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

ECGI__BSSGP::ECGI__BSSGP()
{
}

ECGI__BSSGP::ECGI__BSSGP(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 HEXSTRING& par_spare,
    const INTEGER& par_eCI)
  :   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_spare(par_spare),
  field_eCI(par_eCI)
{
}

ECGI__BSSGP::ECGI__BSSGP(const ECGI__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.ECGI_BSSGP.");
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.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.eCI().is_bound()) field_eCI = other_value.eCI();
else field_eCI.clean_up();
}

void ECGI__BSSGP::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_spare.clean_up();
field_eCI.clean_up();
}

const TTCN_Typedescriptor_t* ECGI__BSSGP::get_descriptor() const { return &ECGI__BSSGP_descr_; }
ECGI__BSSGP& ECGI__BSSGP::operator=(const ECGI__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.ECGI_BSSGP.");
  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.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.eCI().is_bound()) field_eCI = other_value.eCI();
  else field_eCI.clean_up();
}
return *this;
}

boolean ECGI__BSSGP::operator==(const ECGI__BSSGP& other_value) const
{
return 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_spare==other_value.field_spare
  && field_eCI==other_value.field_eCI;
}

boolean ECGI__BSSGP::is_bound() const
{
return (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_spare.is_bound())
  || (field_eCI.is_bound());
}
boolean ECGI__BSSGP::is_value() const
{
return 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_spare.is_value()
  && field_eCI.is_value();
}
void ECGI__BSSGP::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
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(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", eCI := ");
field_eCI.log();
TTCN_Logger::log_event_str(" }");
}

void ECGI__BSSGP::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 (spare().is_bound()) spare().set_implicit_omit();
if (eCI().is_bound()) eCI().set_implicit_omit();
}

void ECGI__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 (8<param.get_size()) {
      param.error("record value of type @BSSGP_Types.ECGI_BSSGP has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) eCI().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "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(), "eCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.ECGI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.ECGI_BSSGP");
  }
}

void ECGI__BSSGP::encode_text(Text_Buf& text_buf) const
{
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_spare.encode_text(text_buf);
field_eCI.encode_text(text_buf);
}

void ECGI__BSSGP::decode_text(Text_Buf& 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_spare.decode_text(text_buf);
field_eCI.decode_text(text_buf);
}

void ECGI__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 ECGI__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 ECGI__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, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit1.RAW_decode(General__Types::HEX1_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::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit2.RAW_decode(General__Types::HEX1_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::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mccDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit3.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit1.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::HEX1_descr_.raw->forceomit);
  decoded_field_length = field_mncDigit2.RAW_decode(General__Types::HEX1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, ECGI__BSSGP_spare_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(ECGI__BSSGP_spare_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, ECGI__BSSGP_eCI_descr_.raw->forceomit);
  decoded_field_length = field_eCI.RAW_decode(ECGI__BSSGP_eCI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ECGI__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 = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::HEX1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::HEX1_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, ECGI__BSSGP_spare_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, ECGI__BSSGP_eCI_descr_.raw);
  encoded_length += field_mccDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mccDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_mccDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_mncDigit3.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_mncDigit1.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mncDigit2.RAW_encode(General__Types::HEX1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_spare.RAW_encode(ECGI__BSSGP_spare_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_eCI.RAW_encode(ECGI__BSSGP_eCI_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct ECGI__BSSGP_template::single_value_struct {
HEXSTRING_template field_mccDigit1;
HEXSTRING_template field_mccDigit2;
HEXSTRING_template field_mccDigit3;
HEXSTRING_template field_mncDigit3;
HEXSTRING_template field_mncDigit1;
HEXSTRING_template field_mncDigit2;
HEXSTRING_template field_spare;
INTEGER_template field_eCI;
};

void ECGI__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_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_spare = ANY_VALUE;
single_value->field_eCI = ANY_VALUE;
}
}
}

void ECGI__BSSGP_template::copy_value(const ECGI__BSSGP& other_value)
{
single_value = new single_value_struct;
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.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.eCI().is_bound()) {
  single_value->field_eCI = other_value.eCI();
} else {
  single_value->field_eCI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ECGI__BSSGP_template::copy_template(const ECGI__BSSGP_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
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.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eCI().get_selection()) {
single_value->field_eCI = other_value.eCI();
} else {
single_value->field_eCI.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 ECGI__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 ECGI__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new ECGI__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.ECGI_BSSGP.");
break;
}
set_selection(other_value);
}

ECGI__BSSGP_template::ECGI__BSSGP_template()
{
}

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

ECGI__BSSGP_template::ECGI__BSSGP_template(const ECGI__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ECGI__BSSGP_template::match(const ECGI__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.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.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.eCI().is_bound()) return FALSE;
if(!single_value->field_eCI.match(other_value.eCI(), 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.ECGI_BSSGP.");
}
return FALSE;
}

boolean ECGI__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_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_spare.is_bound()
 || single_value->field_eCI.is_bound();
}

boolean ECGI__BSSGP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return 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_spare.is_value()
 && single_value->field_eCI.is_value();
}

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

ECGI__BSSGP ECGI__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.ECGI_BSSGP.");
ECGI__BSSGP ret_val;
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_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_eCI.is_bound()) {
ret_val.eCI() = single_value->field_eCI.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

HEXSTRING_template& ECGI__BSSGP_template::spare()
{
set_specific();
return single_value->field_spare;
}

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

INTEGER_template& ECGI__BSSGP_template::eCI()
{
set_specific();
return single_value->field_eCI;
}

const INTEGER_template& ECGI__BSSGP_template::eCI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eCI of a non-specific template of type @BSSGP_Types.ECGI_BSSGP.");
return single_value->field_eCI;
}

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

void ECGI__BSSGP_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
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(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", eCI := ");
single_value->field_eCI.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 ECGI__BSSGP_template::log_match(const ECGI__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_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_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_eCI.match(match_value.eCI(), legacy)){
TTCN_Logger::log_logmatch_info(".eCI");
single_value->field_eCI.log_match(match_value.eCI(), 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("{ 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(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", eCI := ");
single_value->field_eCI.log_match(match_value.eCI(), 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 ECGI__BSSGP_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
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_spare.encode_text(text_buf);
single_value->field_eCI.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.ECGI_BSSGP.");
}
}

void ECGI__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_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_spare.decode_text(text_buf);
single_value->field_eCI.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 ECGI__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.ECGI_BSSGP.");
}
}

void ECGI__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: {
    ECGI__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 (8<param.get_size()) {
      param.error("record template of type @BSSGP_Types.ECGI_BSSGP has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) mccDigit1().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mccDigit2().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) mccDigit3().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mncDigit3().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) mncDigit1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mncDigit2().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) eCI().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "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(), "eCI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eCI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.ECGI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ECGI__BSSGP_template* precondition = new ECGI__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    ECGI__BSSGP_template* implied_template = new ECGI__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ECGI__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.ECGI_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void ECGI__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_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ECGI_BSSGP");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ECGI_BSSGP");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ECGI_BSSGP");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ECGI_BSSGP");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ECGI_BSSGP");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ECGI_BSSGP");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ECGI_BSSGP");
single_value->field_eCI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ECGI_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.ECGI_BSSGP");
}

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

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

Source__Cell__ID::Source__Cell__ID()
{
}

Source__Cell__ID::Source__Cell__ID(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const TrackingAreaIdentity__BSSGP& par_tracking__Area__Identity,
    const ECGI__BSSGP& par_eUTRAN__CGI,
    const OCTETSTRING& par_globaleNBID)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_tracking__Area__Identity(par_tracking__Area__Identity),
  field_eUTRAN__CGI(par_eUTRAN__CGI),
  field_globaleNBID(par_globaleNBID)
{
}

Source__Cell__ID::Source__Cell__ID(const Source__Cell__ID& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Source_Cell_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.tracking__Area__Identity().is_bound()) field_tracking__Area__Identity = other_value.tracking__Area__Identity();
else field_tracking__Area__Identity.clean_up();
if (other_value.eUTRAN__CGI().is_bound()) field_eUTRAN__CGI = other_value.eUTRAN__CGI();
else field_eUTRAN__CGI.clean_up();
if (other_value.globaleNBID().is_bound()) field_globaleNBID = other_value.globaleNBID();
else field_globaleNBID.clean_up();
}

void Source__Cell__ID::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_tracking__Area__Identity.clean_up();
field_eUTRAN__CGI.clean_up();
field_globaleNBID.clean_up();
}

const TTCN_Typedescriptor_t* Source__Cell__ID::get_descriptor() const { return &Source__Cell__ID_descr_; }
Source__Cell__ID& Source__Cell__ID::operator=(const Source__Cell__ID& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Source_Cell_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.tracking__Area__Identity().is_bound()) field_tracking__Area__Identity = other_value.tracking__Area__Identity();
  else field_tracking__Area__Identity.clean_up();
  if (other_value.eUTRAN__CGI().is_bound()) field_eUTRAN__CGI = other_value.eUTRAN__CGI();
  else field_eUTRAN__CGI.clean_up();
  if (other_value.globaleNBID().is_bound()) field_globaleNBID = other_value.globaleNBID();
  else field_globaleNBID.clean_up();
}
return *this;
}

boolean Source__Cell__ID::operator==(const Source__Cell__ID& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_tracking__Area__Identity==other_value.field_tracking__Area__Identity
  && field_eUTRAN__CGI==other_value.field_eUTRAN__CGI
  && field_globaleNBID==other_value.field_globaleNBID;
}

boolean Source__Cell__ID::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_tracking__Area__Identity.is_bound())
  || (field_eUTRAN__CGI.is_bound())
  || (field_globaleNBID.is_bound());
}
boolean Source__Cell__ID::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_tracking__Area__Identity.is_value()
  && field_eUTRAN__CGI.is_value()
  && field_globaleNBID.is_value();
}
void Source__Cell__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(", tracking_Area_Identity := ");
field_tracking__Area__Identity.log();
TTCN_Logger::log_event_str(", eUTRAN_CGI := ");
field_eUTRAN__CGI.log();
TTCN_Logger::log_event_str(", globaleNBID := ");
field_globaleNBID.log();
TTCN_Logger::log_event_str(" }");
}

void Source__Cell__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 (tracking__Area__Identity().is_bound()) tracking__Area__Identity().set_implicit_omit();
if (eUTRAN__CGI().is_bound()) eUTRAN__CGI().set_implicit_omit();
if (globaleNBID().is_bound()) globaleNBID().set_implicit_omit();
}

void Source__Cell__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 (6<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Source_Cell_ID 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) tracking__Area__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) eUTRAN__CGI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) globaleNBID().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(), "tracking_Area_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tracking__Area__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(), "eUTRAN_CGI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRAN__CGI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.Source_Cell_ID: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Source_Cell_ID");
  }
}

void Source__Cell__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_tracking__Area__Identity.encode_text(text_buf);
field_eUTRAN__CGI.encode_text(text_buf);
field_globaleNBID.encode_text(text_buf);
}

void Source__Cell__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_tracking__Area__Identity.decode_text(text_buf);
field_eUTRAN__CGI.decode_text(text_buf);
field_globaleNBID.decode_text(text_buf);
}

void Source__Cell__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 Source__Cell__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 Source__Cell__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, Source__Cell__ID_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Source__Cell__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, Source__Cell__ID_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Source__Cell__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, TrackingAreaIdentity__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_tracking__Area__Identity.RAW_decode(TrackingAreaIdentity__BSSGP_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, ECGI__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_eUTRAN__CGI.RAW_decode(ECGI__BSSGP_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, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_globaleNBID.RAW_decode(OCTETSTRING_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_90) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Source__Cell__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 = 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, Source__Cell__ID_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Source__Cell__ID_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, TrackingAreaIdentity__BSSGP_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ECGI__BSSGP_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, OCTETSTRING_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Source__Cell__ID_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Source__Cell__ID_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_tracking__Area__Identity.RAW_encode(TrackingAreaIdentity__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_eUTRAN__CGI.RAW_encode(ECGI__BSSGP_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_globaleNBID.RAW_encode(OCTETSTRING_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(Source__Cell__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(Source__Cell__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_90) {
  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_90.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 Source__Cell__ID_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
TrackingAreaIdentity__BSSGP_template field_tracking__Area__Identity;
ECGI__BSSGP_template field_eUTRAN__CGI;
OCTETSTRING_template field_globaleNBID;
};

void Source__Cell__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_tracking__Area__Identity = ANY_VALUE;
single_value->field_eUTRAN__CGI = ANY_VALUE;
single_value->field_globaleNBID = ANY_VALUE;
}
}
}

void Source__Cell__ID_template::copy_value(const Source__Cell__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.tracking__Area__Identity().is_bound()) {
  single_value->field_tracking__Area__Identity = other_value.tracking__Area__Identity();
} else {
  single_value->field_tracking__Area__Identity.clean_up();
}
if (other_value.eUTRAN__CGI().is_bound()) {
  single_value->field_eUTRAN__CGI = other_value.eUTRAN__CGI();
} else {
  single_value->field_eUTRAN__CGI.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 Source__Cell__ID_template::copy_template(const Source__Cell__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.tracking__Area__Identity().get_selection()) {
single_value->field_tracking__Area__Identity = other_value.tracking__Area__Identity();
} else {
single_value->field_tracking__Area__Identity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRAN__CGI().get_selection()) {
single_value->field_eUTRAN__CGI = other_value.eUTRAN__CGI();
} else {
single_value->field_eUTRAN__CGI.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 Source__Cell__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 Source__Cell__ID_template(*other_value.implication_.precondition);
implication_.implied_template = new Source__Cell__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.Source_Cell_ID.");
break;
}
set_selection(other_value);
}

Source__Cell__ID_template::Source__Cell__ID_template()
{
}

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

Source__Cell__ID_template::Source__Cell__ID_template(const Source__Cell__ID& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Source__Cell__ID_template::match(const Source__Cell__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.tracking__Area__Identity().is_bound()) return FALSE;
if(!single_value->field_tracking__Area__Identity.match(other_value.tracking__Area__Identity(), legacy))return FALSE;
if(!other_value.eUTRAN__CGI().is_bound()) return FALSE;
if(!single_value->field_eUTRAN__CGI.match(other_value.eUTRAN__CGI(), 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.Source_Cell_ID.");
}
return FALSE;
}

boolean Source__Cell__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_tracking__Area__Identity.is_bound()
 || single_value->field_eUTRAN__CGI.is_bound()
 || single_value->field_globaleNBID.is_bound();
}

boolean Source__Cell__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_tracking__Area__Identity.is_value()
 && single_value->field_eUTRAN__CGI.is_value()
 && single_value->field_globaleNBID.is_value();
}

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

Source__Cell__ID Source__Cell__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.Source_Cell_ID.");
Source__Cell__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_tracking__Area__Identity.is_bound()) {
ret_val.tracking__Area__Identity() = single_value->field_tracking__Area__Identity.valueof();
}
if (single_value->field_eUTRAN__CGI.is_bound()) {
ret_val.eUTRAN__CGI() = single_value->field_eUTRAN__CGI.valueof();
}
if (single_value->field_globaleNBID.is_bound()) {
ret_val.globaleNBID() = single_value->field_globaleNBID.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

TrackingAreaIdentity__BSSGP_template& Source__Cell__ID_template::tracking__Area__Identity()
{
set_specific();
return single_value->field_tracking__Area__Identity;
}

const TrackingAreaIdentity__BSSGP_template& Source__Cell__ID_template::tracking__Area__Identity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tracking_Area_Identity of a non-specific template of type @BSSGP_Types.Source_Cell_ID.");
return single_value->field_tracking__Area__Identity;
}

ECGI__BSSGP_template& Source__Cell__ID_template::eUTRAN__CGI()
{
set_specific();
return single_value->field_eUTRAN__CGI;
}

const ECGI__BSSGP_template& Source__Cell__ID_template::eUTRAN__CGI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRAN_CGI of a non-specific template of type @BSSGP_Types.Source_Cell_ID.");
return single_value->field_eUTRAN__CGI;
}

OCTETSTRING_template& Source__Cell__ID_template::globaleNBID()
{
set_specific();
return single_value->field_globaleNBID;
}

const OCTETSTRING_template& Source__Cell__ID_template::globaleNBID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globaleNBID of a non-specific template of type @BSSGP_Types.Source_Cell_ID.");
return single_value->field_globaleNBID;
}

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

void Source__Cell__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(", tracking_Area_Identity := ");
single_value->field_tracking__Area__Identity.log();
TTCN_Logger::log_event_str(", eUTRAN_CGI := ");
single_value->field_eUTRAN__CGI.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 Source__Cell__ID_template::log_match(const Source__Cell__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_tracking__Area__Identity.match(match_value.tracking__Area__Identity(), legacy)){
TTCN_Logger::log_logmatch_info(".tracking_Area_Identity");
single_value->field_tracking__Area__Identity.log_match(match_value.tracking__Area__Identity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_eUTRAN__CGI.match(match_value.eUTRAN__CGI(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRAN_CGI");
single_value->field_eUTRAN__CGI.log_match(match_value.eUTRAN__CGI(), 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(", tracking_Area_Identity := ");
single_value->field_tracking__Area__Identity.log_match(match_value.tracking__Area__Identity(), legacy);
TTCN_Logger::log_event_str(", eUTRAN_CGI := ");
single_value->field_eUTRAN__CGI.log_match(match_value.eUTRAN__CGI(), 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 Source__Cell__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_tracking__Area__Identity.encode_text(text_buf);
single_value->field_eUTRAN__CGI.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.Source_Cell_ID.");
}
}

void Source__Cell__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_tracking__Area__Identity.decode_text(text_buf);
single_value->field_eUTRAN__CGI.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 Source__Cell__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.Source_Cell_ID.");
}
}

void Source__Cell__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: {
    Source__Cell__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 (6<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Source_Cell_ID 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) tracking__Area__Identity().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) eUTRAN__CGI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) globaleNBID().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(), "tracking_Area_Identity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tracking__Area__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(), "eUTRAN_CGI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRAN__CGI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.Source_Cell_ID: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Source__Cell__ID_template* precondition = new Source__Cell__ID_template;
    precondition->set_param(*param.get_elem(0));
    Source__Cell__ID_template* implied_template = new Source__Cell__ID_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Source__Cell__ID_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Source_Cell_ID");
  }
  is_ifpresent = param.get_ifpresent();
}

void Source__Cell__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.Source_Cell_ID");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_Cell_ID");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_Cell_ID");
single_value->field_tracking__Area__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_Cell_ID");
single_value->field_eUTRAN__CGI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_Cell_ID");
single_value->field_globaleNBID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_Cell_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.Source_Cell_ID");
}

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

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


const Measurement__Extended Measurement__List__Extended::UNBOUND_ELEM;
Measurement__List__Extended::Measurement__List__Extended()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

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

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

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

const Measurement__Extended& Measurement__List__Extended::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BSSGP_Types.Measurement_List_Extended.");
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.Measurement_List_Extended 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.Measurement_List_Extended: 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 Measurement__Extended& Measurement__List__Extended::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.Measurement_List_Extended.");
return (*this)[(int)index_value];
}

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

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

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

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

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

Measurement__List__Extended Measurement__List__Extended::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.Measurement_List_Extended.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Types.Measurement_List_Extended","element");
Measurement__List__Extended 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 Measurement__Extended(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

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

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

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

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

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

void Measurement__List__Extended::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 Measurement__List__Extended::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 Measurement__List__Extended::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 Measurement__List__Extended::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 Measurement__List__Extended_template::copy_value(const Measurement__List__Extended& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Types.Measurement_List_Extended with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (Measurement__Extended_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 Measurement__Extended_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new Measurement__Extended_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void Measurement__List__Extended_template::copy_template(const Measurement__List__Extended_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 = (Measurement__Extended_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 Measurement__Extended_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new Measurement__Extended_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 Measurement__List__Extended_template[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 Measurement__List__Extended_template(*other_value.implication_.precondition);
implication_.implied_template = new Measurement__List__Extended_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.Measurement_List_Extended.");
break;
}
set_selection(other_value);
}

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

Measurement__List__Extended_template::Measurement__List__Extended_template()
{
}

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

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

Measurement__List__Extended_template::Measurement__List__Extended_template(const Measurement__List__Extended& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

const Measurement__Extended_template& Measurement__List__Extended_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.Measurement_List_Extended 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.Measurement_List_Extended.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Types.Measurement_List_Extended: 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 Measurement__Extended_template& Measurement__List__Extended_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.Measurement_List_Extended.");
return (*this)[(int)index_value];
}

void Measurement__List__Extended_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.Measurement_List_Extended.");
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 = (Measurement__Extended_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 Measurement__Extended_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 Measurement__Extended_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 = (Measurement__Extended_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

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

boolean Measurement__List__Extended_template::match(const Measurement__List__Extended& 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.Measurement_List_Extended.");
}
return FALSE;
}

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

Measurement__List__Extended Measurement__List__Extended_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.Measurement_List_Extended.");
Measurement__List__Extended 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;
}

Measurement__List__Extended Measurement__List__Extended_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);
}

Measurement__List__Extended Measurement__List__Extended_template::replace(int index, int len, const Measurement__List__Extended_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());
}

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

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

void Measurement__List__Extended_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 Measurement__List__Extended_template::log_match(const Measurement__List__Extended& 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 Measurement__List__Extended_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.Measurement_List_Extended.");
}
}

void Measurement__List__Extended_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.Measurement_List_Extended.");
single_value.value_elements = (Measurement__Extended_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 Measurement__Extended_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 Measurement__List__Extended_template[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.Measurement_List_Extended.");
}
}

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

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

void Measurement__List__Extended_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.Measurement_List_Extended");
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.Measurement_List_Extended");
}

boolean Measurement__List__Extended_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);
}
}
Measurement__Extended::Measurement__Extended()
{
}

Measurement__Extended::Measurement__Extended(const INTEGER& par_e__ARFCN,
    const BITSTRING& par_spare,
    const BITSTRING& par_measurementBandwidth)
  :   field_e__ARFCN(par_e__ARFCN),
  field_spare(par_spare),
  field_measurementBandwidth(par_measurementBandwidth)
{
}

Measurement__Extended::Measurement__Extended(const Measurement__Extended& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Measurement_Extended.");
if (other_value.e__ARFCN().is_bound()) field_e__ARFCN = other_value.e__ARFCN();
else field_e__ARFCN.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.measurementBandwidth().is_bound()) field_measurementBandwidth = other_value.measurementBandwidth();
else field_measurementBandwidth.clean_up();
}

void Measurement__Extended::clean_up()
{
field_e__ARFCN.clean_up();
field_spare.clean_up();
field_measurementBandwidth.clean_up();
}

const TTCN_Typedescriptor_t* Measurement__Extended::get_descriptor() const { return &Measurement__Extended_descr_; }
Measurement__Extended& Measurement__Extended::operator=(const Measurement__Extended& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Measurement_Extended.");
  if (other_value.e__ARFCN().is_bound()) field_e__ARFCN = other_value.e__ARFCN();
  else field_e__ARFCN.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.measurementBandwidth().is_bound()) field_measurementBandwidth = other_value.measurementBandwidth();
  else field_measurementBandwidth.clean_up();
}
return *this;
}

boolean Measurement__Extended::operator==(const Measurement__Extended& other_value) const
{
return field_e__ARFCN==other_value.field_e__ARFCN
  && field_spare==other_value.field_spare
  && field_measurementBandwidth==other_value.field_measurementBandwidth;
}

boolean Measurement__Extended::is_bound() const
{
return (field_e__ARFCN.is_bound())
  || (field_spare.is_bound())
  || (field_measurementBandwidth.is_bound());
}
boolean Measurement__Extended::is_value() const
{
return field_e__ARFCN.is_value()
  && field_spare.is_value()
  && field_measurementBandwidth.is_value();
}
void Measurement__Extended::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ e_ARFCN := ");
field_e__ARFCN.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", measurementBandwidth := ");
field_measurementBandwidth.log();
TTCN_Logger::log_event_str(" }");
}

void Measurement__Extended::set_implicit_omit()
{
if (e__ARFCN().is_bound()) e__ARFCN().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (measurementBandwidth().is_bound()) measurementBandwidth().set_implicit_omit();
}

void Measurement__Extended::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.Measurement_Extended 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) e__ARFCN().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) measurementBandwidth().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(), "e_ARFCN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__ARFCN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "measurementBandwidth")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurementBandwidth().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Measurement_Extended: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Measurement_Extended");
  }
}

void Measurement__Extended::encode_text(Text_Buf& text_buf) const
{
field_e__ARFCN.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_measurementBandwidth.encode_text(text_buf);
}

void Measurement__Extended::decode_text(Text_Buf& text_buf)
{
field_e__ARFCN.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_measurementBandwidth.decode_text(text_buf);
}

void Measurement__Extended::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 Measurement__Extended::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 Measurement__Extended::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, Measurement__Extended_e__ARFCN_descr_.raw->forceomit);
  decoded_field_length = field_e__ARFCN.RAW_decode(Measurement__Extended_e__ARFCN_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, Measurement__Extended_spare_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(Measurement__Extended_spare_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, Measurement__Extended_measurementBandwidth_descr_.raw->forceomit);
  decoded_field_length = field_measurementBandwidth.RAW_decode(Measurement__Extended_measurementBandwidth_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 Measurement__Extended::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, Measurement__Extended_e__ARFCN_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Measurement__Extended_spare_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Measurement__Extended_measurementBandwidth_descr_.raw);
  encoded_length += field_e__ARFCN.RAW_encode(Measurement__Extended_e__ARFCN_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(Measurement__Extended_spare_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_measurementBandwidth.RAW_encode(Measurement__Extended_measurementBandwidth_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct Measurement__Extended_template::single_value_struct {
INTEGER_template field_e__ARFCN;
BITSTRING_template field_spare;
BITSTRING_template field_measurementBandwidth;
};

void Measurement__Extended_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_e__ARFCN = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_measurementBandwidth = ANY_VALUE;
}
}
}

void Measurement__Extended_template::copy_value(const Measurement__Extended& other_value)
{
single_value = new single_value_struct;
if (other_value.e__ARFCN().is_bound()) {
  single_value->field_e__ARFCN = other_value.e__ARFCN();
} else {
  single_value->field_e__ARFCN.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.measurementBandwidth().is_bound()) {
  single_value->field_measurementBandwidth = other_value.measurementBandwidth();
} else {
  single_value->field_measurementBandwidth.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Measurement__Extended_template::copy_template(const Measurement__Extended_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.e__ARFCN().get_selection()) {
single_value->field_e__ARFCN = other_value.e__ARFCN();
} else {
single_value->field_e__ARFCN.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.measurementBandwidth().get_selection()) {
single_value->field_measurementBandwidth = other_value.measurementBandwidth();
} else {
single_value->field_measurementBandwidth.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 Measurement__Extended_template[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 Measurement__Extended_template(*other_value.implication_.precondition);
implication_.implied_template = new Measurement__Extended_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.Measurement_Extended.");
break;
}
set_selection(other_value);
}

Measurement__Extended_template::Measurement__Extended_template()
{
}

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

Measurement__Extended_template::Measurement__Extended_template(const Measurement__Extended& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Measurement__Extended_template::match(const Measurement__Extended& 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.e__ARFCN().is_bound()) return FALSE;
if(!single_value->field_e__ARFCN.match(other_value.e__ARFCN(), 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.measurementBandwidth().is_bound()) return FALSE;
if(!single_value->field_measurementBandwidth.match(other_value.measurementBandwidth(), 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.Measurement_Extended.");
}
return FALSE;
}

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

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

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

Measurement__Extended Measurement__Extended_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.Measurement_Extended.");
Measurement__Extended ret_val;
if (single_value->field_e__ARFCN.is_bound()) {
ret_val.e__ARFCN() = single_value->field_e__ARFCN.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_measurementBandwidth.is_bound()) {
ret_val.measurementBandwidth() = single_value->field_measurementBandwidth.valueof();
}
return ret_val;
}

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

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

INTEGER_template& Measurement__Extended_template::e__ARFCN()
{
set_specific();
return single_value->field_e__ARFCN;
}

const INTEGER_template& Measurement__Extended_template::e__ARFCN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field e_ARFCN of a non-specific template of type @BSSGP_Types.Measurement_Extended.");
return single_value->field_e__ARFCN;
}

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

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

BITSTRING_template& Measurement__Extended_template::measurementBandwidth()
{
set_specific();
return single_value->field_measurementBandwidth;
}

const BITSTRING_template& Measurement__Extended_template::measurementBandwidth() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field measurementBandwidth of a non-specific template of type @BSSGP_Types.Measurement_Extended.");
return single_value->field_measurementBandwidth;
}

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

void Measurement__Extended_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ e_ARFCN := ");
single_value->field_e__ARFCN.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", measurementBandwidth := ");
single_value->field_measurementBandwidth.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 Measurement__Extended_template::log_match(const Measurement__Extended& 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_e__ARFCN.match(match_value.e__ARFCN(), legacy)){
TTCN_Logger::log_logmatch_info(".e_ARFCN");
single_value->field_e__ARFCN.log_match(match_value.e__ARFCN(), 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_measurementBandwidth.match(match_value.measurementBandwidth(), legacy)){
TTCN_Logger::log_logmatch_info(".measurementBandwidth");
single_value->field_measurementBandwidth.log_match(match_value.measurementBandwidth(), 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("{ e_ARFCN := ");
single_value->field_e__ARFCN.log_match(match_value.e__ARFCN(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", measurementBandwidth := ");
single_value->field_measurementBandwidth.log_match(match_value.measurementBandwidth(), 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 Measurement__Extended_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_e__ARFCN.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_measurementBandwidth.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.Measurement_Extended.");
}
}

void Measurement__Extended_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_e__ARFCN.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_measurementBandwidth.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 Measurement__Extended_template[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.Measurement_Extended.");
}
}

void Measurement__Extended_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: {
    Measurement__Extended_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.Measurement_Extended 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) e__ARFCN().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) measurementBandwidth().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(), "e_ARFCN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e__ARFCN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "measurementBandwidth")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurementBandwidth().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Measurement_Extended: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Measurement__Extended_template* precondition = new Measurement__Extended_template;
    precondition->set_param(*param.get_elem(0));
    Measurement__Extended_template* implied_template = new Measurement__Extended_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Measurement__Extended_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Measurement_Extended");
  }
  is_ifpresent = param.get_ifpresent();
}

void Measurement__Extended_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_e__ARFCN.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Measurement_Extended");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Measurement_Extended");
single_value->field_measurementBandwidth.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Measurement_Extended");
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.Measurement_Extended");
}

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

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

IRAT__Measurement__Configuration__Extended__eARFCNs::IRAT__Measurement__Configuration__Extended__eARFCNs()
{
}

IRAT__Measurement__Configuration__Extended__eARFCNs::IRAT__Measurement__Configuration__Extended__eARFCNs(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const INTEGER& par_reportingThreshold,
    const BITSTRING& par_repQuant,
    const BITSTRING& par_spare,
    const INTEGER& par_measurementDuration,
    const Measurement__List__Extended& par_measurement__List)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_reportingThreshold(par_reportingThreshold),
  field_repQuant(par_repQuant),
  field_spare(par_spare),
  field_measurementDuration(par_measurementDuration),
  field_measurement__List(par_measurement__List)
{
}

IRAT__Measurement__Configuration__Extended__eARFCNs::IRAT__Measurement__Configuration__Extended__eARFCNs(const IRAT__Measurement__Configuration__Extended__eARFCNs& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs.");
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.reportingThreshold().is_bound()) field_reportingThreshold = other_value.reportingThreshold();
else field_reportingThreshold.clean_up();
if (other_value.repQuant().is_bound()) field_repQuant = other_value.repQuant();
else field_repQuant.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.measurementDuration().is_bound()) field_measurementDuration = other_value.measurementDuration();
else field_measurementDuration.clean_up();
if (other_value.measurement__List().is_bound()) field_measurement__List = other_value.measurement__List();
else field_measurement__List.clean_up();
}

void IRAT__Measurement__Configuration__Extended__eARFCNs::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_reportingThreshold.clean_up();
field_repQuant.clean_up();
field_spare.clean_up();
field_measurementDuration.clean_up();
field_measurement__List.clean_up();
}

const TTCN_Typedescriptor_t* IRAT__Measurement__Configuration__Extended__eARFCNs::get_descriptor() const { return &IRAT__Measurement__Configuration__Extended__eARFCNs_descr_; }
IRAT__Measurement__Configuration__Extended__eARFCNs& IRAT__Measurement__Configuration__Extended__eARFCNs::operator=(const IRAT__Measurement__Configuration__Extended__eARFCNs& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs.");
  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.reportingThreshold().is_bound()) field_reportingThreshold = other_value.reportingThreshold();
  else field_reportingThreshold.clean_up();
  if (other_value.repQuant().is_bound()) field_repQuant = other_value.repQuant();
  else field_repQuant.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.measurementDuration().is_bound()) field_measurementDuration = other_value.measurementDuration();
  else field_measurementDuration.clean_up();
  if (other_value.measurement__List().is_bound()) field_measurement__List = other_value.measurement__List();
  else field_measurement__List.clean_up();
}
return *this;
}

boolean IRAT__Measurement__Configuration__Extended__eARFCNs::operator==(const IRAT__Measurement__Configuration__Extended__eARFCNs& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_reportingThreshold==other_value.field_reportingThreshold
  && field_repQuant==other_value.field_repQuant
  && field_spare==other_value.field_spare
  && field_measurementDuration==other_value.field_measurementDuration
  && field_measurement__List==other_value.field_measurement__List;
}

boolean IRAT__Measurement__Configuration__Extended__eARFCNs::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_reportingThreshold.is_bound())
  || (field_repQuant.is_bound())
  || (field_spare.is_bound())
  || (field_measurementDuration.is_bound())
  || (field_measurement__List.is_bound());
}
boolean IRAT__Measurement__Configuration__Extended__eARFCNs::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_reportingThreshold.is_value()
  && field_repQuant.is_value()
  && field_spare.is_value()
  && field_measurementDuration.is_value()
  && field_measurement__List.is_value();
}
void IRAT__Measurement__Configuration__Extended__eARFCNs::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(", reportingThreshold := ");
field_reportingThreshold.log();
TTCN_Logger::log_event_str(", repQuant := ");
field_repQuant.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", measurementDuration := ");
field_measurementDuration.log();
TTCN_Logger::log_event_str(", measurement_List := ");
field_measurement__List.log();
TTCN_Logger::log_event_str(" }");
}

void IRAT__Measurement__Configuration__Extended__eARFCNs::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 (reportingThreshold().is_bound()) reportingThreshold().set_implicit_omit();
if (repQuant().is_bound()) repQuant().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (measurementDuration().is_bound()) measurementDuration().set_implicit_omit();
if (measurement__List().is_bound()) measurement__List().set_implicit_omit();
}

void IRAT__Measurement__Configuration__Extended__eARFCNs::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record value of type @BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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) reportingThreshold().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) repQuant().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));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) measurementDuration().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) measurement__List().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "reportingThreshold")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reportingThreshold().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "repQuant")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repQuant().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "measurementDuration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurementDuration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "measurement_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurement__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.IRAT_Measurement_Configuration_Extended_eARFCNs: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs");
  }
}

void IRAT__Measurement__Configuration__Extended__eARFCNs::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_reportingThreshold.encode_text(text_buf);
field_repQuant.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_measurementDuration.encode_text(text_buf);
field_measurement__List.encode_text(text_buf);
}

void IRAT__Measurement__Configuration__Extended__eARFCNs::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_reportingThreshold.decode_text(text_buf);
field_repQuant.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_measurementDuration.decode_text(text_buf);
field_measurement__List.decode_text(text_buf);
}

void IRAT__Measurement__Configuration__Extended__eARFCNs::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 IRAT__Measurement__Configuration__Extended__eARFCNs::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 IRAT__Measurement__Configuration__Extended__eARFCNs::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, IRAT__Measurement__Configuration__Extended__eARFCNs_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(IRAT__Measurement__Configuration__Extended__eARFCNs_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, IRAT__Measurement__Configuration__Extended__eARFCNs_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(IRAT__Measurement__Configuration__Extended__eARFCNs_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_reportingThreshold.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_repQuant.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.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_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::INT1_descr_.raw->forceomit);
  decoded_field_length = field_measurementDuration.RAW_decode(General__Types::INT1_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, Measurement__List__Extended_descr_.raw->forceomit);
  decoded_field_length = field_measurement__List.RAW_decode(Measurement__List__Extended_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;
  if (field_iEI !=  os_91) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int IRAT__Measurement__Configuration__Extended__eARFCNs::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IRAT__Measurement__Configuration__Extended__eARFCNs_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IRAT__Measurement__Configuration__Extended__eARFCNs_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::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::INT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, Measurement__List__Extended_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(IRAT__Measurement__Configuration__Extended__eARFCNs_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(IRAT__Measurement__Configuration__Extended__eARFCNs_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reportingThreshold.RAW_encode(General__Types::INT6b_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_repQuant.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_measurementDuration.RAW_encode(General__Types::INT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_measurement__List.RAW_encode(Measurement__List__Extended_descr_, *myleaf.body.node.nodes[7]);
  {
  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 = 5;
  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(5);
  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;
  }
  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(IRAT__Measurement__Configuration__Extended__eARFCNs_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(IRAT__Measurement__Configuration__Extended__eARFCNs_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_91) {
  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_91.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 IRAT__Measurement__Configuration__Extended__eARFCNs_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
INTEGER_template field_reportingThreshold;
BITSTRING_template field_repQuant;
BITSTRING_template field_spare;
INTEGER_template field_measurementDuration;
Measurement__List__Extended_template field_measurement__List;
};

void IRAT__Measurement__Configuration__Extended__eARFCNs_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_reportingThreshold = ANY_VALUE;
single_value->field_repQuant = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_measurementDuration = ANY_VALUE;
single_value->field_measurement__List = ANY_VALUE;
}
}
}

void IRAT__Measurement__Configuration__Extended__eARFCNs_template::copy_value(const IRAT__Measurement__Configuration__Extended__eARFCNs& 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.reportingThreshold().is_bound()) {
  single_value->field_reportingThreshold = other_value.reportingThreshold();
} else {
  single_value->field_reportingThreshold.clean_up();
}
if (other_value.repQuant().is_bound()) {
  single_value->field_repQuant = other_value.repQuant();
} else {
  single_value->field_repQuant.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.measurementDuration().is_bound()) {
  single_value->field_measurementDuration = other_value.measurementDuration();
} else {
  single_value->field_measurementDuration.clean_up();
}
if (other_value.measurement__List().is_bound()) {
  single_value->field_measurement__List = other_value.measurement__List();
} else {
  single_value->field_measurement__List.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void IRAT__Measurement__Configuration__Extended__eARFCNs_template::copy_template(const IRAT__Measurement__Configuration__Extended__eARFCNs_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.reportingThreshold().get_selection()) {
single_value->field_reportingThreshold = other_value.reportingThreshold();
} else {
single_value->field_reportingThreshold.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.repQuant().get_selection()) {
single_value->field_repQuant = other_value.repQuant();
} else {
single_value->field_repQuant.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.measurementDuration().get_selection()) {
single_value->field_measurementDuration = other_value.measurementDuration();
} else {
single_value->field_measurementDuration.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.measurement__List().get_selection()) {
single_value->field_measurement__List = other_value.measurement__List();
} else {
single_value->field_measurement__List.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 IRAT__Measurement__Configuration__Extended__eARFCNs_template[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 IRAT__Measurement__Configuration__Extended__eARFCNs_template(*other_value.implication_.precondition);
implication_.implied_template = new IRAT__Measurement__Configuration__Extended__eARFCNs_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.IRAT_Measurement_Configuration_Extended_eARFCNs.");
break;
}
set_selection(other_value);
}

IRAT__Measurement__Configuration__Extended__eARFCNs_template::IRAT__Measurement__Configuration__Extended__eARFCNs_template()
{
}

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

IRAT__Measurement__Configuration__Extended__eARFCNs_template::IRAT__Measurement__Configuration__Extended__eARFCNs_template(const IRAT__Measurement__Configuration__Extended__eARFCNs& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean IRAT__Measurement__Configuration__Extended__eARFCNs_template::match(const IRAT__Measurement__Configuration__Extended__eARFCNs& 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.reportingThreshold().is_bound()) return FALSE;
if(!single_value->field_reportingThreshold.match(other_value.reportingThreshold(), legacy))return FALSE;
if(!other_value.repQuant().is_bound()) return FALSE;
if(!single_value->field_repQuant.match(other_value.repQuant(), 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.measurementDuration().is_bound()) return FALSE;
if(!single_value->field_measurementDuration.match(other_value.measurementDuration(), legacy))return FALSE;
if(!other_value.measurement__List().is_bound()) return FALSE;
if(!single_value->field_measurement__List.match(other_value.measurement__List(), 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.IRAT_Measurement_Configuration_Extended_eARFCNs.");
}
return FALSE;
}

boolean IRAT__Measurement__Configuration__Extended__eARFCNs_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_reportingThreshold.is_bound()
 || single_value->field_repQuant.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_measurementDuration.is_bound()
 || single_value->field_measurement__List.is_bound();
}

boolean IRAT__Measurement__Configuration__Extended__eARFCNs_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_reportingThreshold.is_value()
 && single_value->field_repQuant.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_measurementDuration.is_value()
 && single_value->field_measurement__List.is_value();
}

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

IRAT__Measurement__Configuration__Extended__eARFCNs IRAT__Measurement__Configuration__Extended__eARFCNs_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.IRAT_Measurement_Configuration_Extended_eARFCNs.");
IRAT__Measurement__Configuration__Extended__eARFCNs 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_reportingThreshold.is_bound()) {
ret_val.reportingThreshold() = single_value->field_reportingThreshold.valueof();
}
if (single_value->field_repQuant.is_bound()) {
ret_val.repQuant() = single_value->field_repQuant.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_measurementDuration.is_bound()) {
ret_val.measurementDuration() = single_value->field_measurementDuration.valueof();
}
if (single_value->field_measurement__List.is_bound()) {
ret_val.measurement__List() = single_value->field_measurement__List.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

INTEGER_template& IRAT__Measurement__Configuration__Extended__eARFCNs_template::reportingThreshold()
{
set_specific();
return single_value->field_reportingThreshold;
}

const INTEGER_template& IRAT__Measurement__Configuration__Extended__eARFCNs_template::reportingThreshold() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reportingThreshold of a non-specific template of type @BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs.");
return single_value->field_reportingThreshold;
}

BITSTRING_template& IRAT__Measurement__Configuration__Extended__eARFCNs_template::repQuant()
{
set_specific();
return single_value->field_repQuant;
}

const BITSTRING_template& IRAT__Measurement__Configuration__Extended__eARFCNs_template::repQuant() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field repQuant of a non-specific template of type @BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs.");
return single_value->field_repQuant;
}

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

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

INTEGER_template& IRAT__Measurement__Configuration__Extended__eARFCNs_template::measurementDuration()
{
set_specific();
return single_value->field_measurementDuration;
}

const INTEGER_template& IRAT__Measurement__Configuration__Extended__eARFCNs_template::measurementDuration() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field measurementDuration of a non-specific template of type @BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs.");
return single_value->field_measurementDuration;
}

Measurement__List__Extended_template& IRAT__Measurement__Configuration__Extended__eARFCNs_template::measurement__List()
{
set_specific();
return single_value->field_measurement__List;
}

const Measurement__List__Extended_template& IRAT__Measurement__Configuration__Extended__eARFCNs_template::measurement__List() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field measurement_List of a non-specific template of type @BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs.");
return single_value->field_measurement__List;
}

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

void IRAT__Measurement__Configuration__Extended__eARFCNs_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(", reportingThreshold := ");
single_value->field_reportingThreshold.log();
TTCN_Logger::log_event_str(", repQuant := ");
single_value->field_repQuant.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", measurementDuration := ");
single_value->field_measurementDuration.log();
TTCN_Logger::log_event_str(", measurement_List := ");
single_value->field_measurement__List.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 IRAT__Measurement__Configuration__Extended__eARFCNs_template::log_match(const IRAT__Measurement__Configuration__Extended__eARFCNs& 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_reportingThreshold.match(match_value.reportingThreshold(), legacy)){
TTCN_Logger::log_logmatch_info(".reportingThreshold");
single_value->field_reportingThreshold.log_match(match_value.reportingThreshold(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_repQuant.match(match_value.repQuant(), legacy)){
TTCN_Logger::log_logmatch_info(".repQuant");
single_value->field_repQuant.log_match(match_value.repQuant(), 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_measurementDuration.match(match_value.measurementDuration(), legacy)){
TTCN_Logger::log_logmatch_info(".measurementDuration");
single_value->field_measurementDuration.log_match(match_value.measurementDuration(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_measurement__List.match(match_value.measurement__List(), legacy)){
TTCN_Logger::log_logmatch_info(".measurement_List");
single_value->field_measurement__List.log_match(match_value.measurement__List(), 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(", reportingThreshold := ");
single_value->field_reportingThreshold.log_match(match_value.reportingThreshold(), legacy);
TTCN_Logger::log_event_str(", repQuant := ");
single_value->field_repQuant.log_match(match_value.repQuant(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", measurementDuration := ");
single_value->field_measurementDuration.log_match(match_value.measurementDuration(), legacy);
TTCN_Logger::log_event_str(", measurement_List := ");
single_value->field_measurement__List.log_match(match_value.measurement__List(), 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 IRAT__Measurement__Configuration__Extended__eARFCNs_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_reportingThreshold.encode_text(text_buf);
single_value->field_repQuant.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_measurementDuration.encode_text(text_buf);
single_value->field_measurement__List.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.IRAT_Measurement_Configuration_Extended_eARFCNs.");
}
}

void IRAT__Measurement__Configuration__Extended__eARFCNs_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_reportingThreshold.decode_text(text_buf);
single_value->field_repQuant.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_measurementDuration.decode_text(text_buf);
single_value->field_measurement__List.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 IRAT__Measurement__Configuration__Extended__eARFCNs_template[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.IRAT_Measurement_Configuration_Extended_eARFCNs.");
}
}

void IRAT__Measurement__Configuration__Extended__eARFCNs_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: {
    IRAT__Measurement__Configuration__Extended__eARFCNs_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record template of type @BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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) reportingThreshold().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) repQuant().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));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) measurementDuration().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) measurement__List().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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(), "reportingThreshold")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reportingThreshold().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "repQuant")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repQuant().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "measurementDuration")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurementDuration().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "measurement_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          measurement__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.IRAT_Measurement_Configuration_Extended_eARFCNs: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    IRAT__Measurement__Configuration__Extended__eARFCNs_template* precondition = new IRAT__Measurement__Configuration__Extended__eARFCNs_template;
    precondition->set_param(*param.get_elem(0));
    IRAT__Measurement__Configuration__Extended__eARFCNs_template* implied_template = new IRAT__Measurement__Configuration__Extended__eARFCNs_template;
    implied_template->set_param(*param.get_elem(1));
    *this = IRAT__Measurement__Configuration__Extended__eARFCNs_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs");
  }
  is_ifpresent = param.get_ifpresent();
}

void IRAT__Measurement__Configuration__Extended__eARFCNs_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.IRAT_Measurement_Configuration_Extended_eARFCNs");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs");
single_value->field_reportingThreshold.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs");
single_value->field_repQuant.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs");
single_value->field_measurementDuration.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs");
single_value->field_measurement__List.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IRAT_Measurement_Configuration_Extended_eARFCNs");
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.IRAT_Measurement_Configuration_Extended_eARFCNs");
}

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

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

Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::Source__BSS__to__Target__BSS__Transparent__Container__BSSGP()
{
}

Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::Source__BSS__to__Target__BSS__Transparent__Container__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Source__BSS__to__Target__BSS__Transparent__Container__Contents& par_source__BSS__to__Target__BSS__Transparent__Container__Contents)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_source__BSS__to__Target__BSS__Transparent__Container__Contents(par_source__BSS__to__Target__BSS__Transparent__Container__Contents)
{
}

Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::Source__BSS__to__Target__BSS__Transparent__Container__BSSGP(const Source__BSS__to__Target__BSS__Transparent__Container__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP.");
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.source__BSS__to__Target__BSS__Transparent__Container__Contents().is_bound()) field_source__BSS__to__Target__BSS__Transparent__Container__Contents = other_value.source__BSS__to__Target__BSS__Transparent__Container__Contents();
else field_source__BSS__to__Target__BSS__Transparent__Container__Contents.clean_up();
}

void Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_source__BSS__to__Target__BSS__Transparent__Container__Contents.clean_up();
}

const TTCN_Typedescriptor_t* Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::get_descriptor() const { return &Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_descr_; }
Source__BSS__to__Target__BSS__Transparent__Container__BSSGP& Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::operator=(const Source__BSS__to__Target__BSS__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.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP.");
  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.source__BSS__to__Target__BSS__Transparent__Container__Contents().is_bound()) field_source__BSS__to__Target__BSS__Transparent__Container__Contents = other_value.source__BSS__to__Target__BSS__Transparent__Container__Contents();
  else field_source__BSS__to__Target__BSS__Transparent__Container__Contents.clean_up();
}
return *this;
}

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

boolean Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_source__BSS__to__Target__BSS__Transparent__Container__Contents.is_bound());
}
boolean Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_source__BSS__to__Target__BSS__Transparent__Container__Contents.is_value();
}
void Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::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(", source_BSS_to_Target_BSS_Transparent_Container_Contents := ");
field_source__BSS__to__Target__BSS__Transparent__Container__Contents.log();
TTCN_Logger::log_event_str(" }");
}

void Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::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 (source__BSS__to__Target__BSS__Transparent__Container__Contents().is_bound()) source__BSS__to__Target__BSS__Transparent__Container__Contents().set_implicit_omit();
}

void Source__BSS__to__Target__BSS__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 (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP 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) source__BSS__to__Target__BSS__Transparent__Container__Contents().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(), "source_BSS_to_Target_BSS_Transparent_Container_Contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__BSS__to__Target__BSS__Transparent__Container__Contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP");
  }
}

void Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::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_source__BSS__to__Target__BSS__Transparent__Container__Contents.encode_text(text_buf);
}

void Source__BSS__to__Target__BSS__Transparent__Container__BSSGP::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_source__BSS__to__Target__BSS__Transparent__Container__Contents.decode_text(text_buf);
}

void Source__BSS__to__Target__BSS__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 Source__BSS__to__Target__BSS__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 Source__BSS__to__Target__BSS__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;
  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, Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_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, Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_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, Source__BSS__to__Target__BSS__Transparent__Container__Contents_descr_.raw->forceomit);
  decoded_field_length = field_source__BSS__to__Target__BSS__Transparent__Container__Contents.RAW_decode(Source__BSS__to__Target__BSS__Transparent__Container__Contents_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_92) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Source__BSS__to__Target__BSS__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 = 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, Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Source__BSS__to__Target__BSS__Transparent__Container__Contents_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_source__BSS__to__Target__BSS__Transparent__Container__Contents.RAW_encode(Source__BSS__to__Target__BSS__Transparent__Container__Contents_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(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_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(Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_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_92) {
  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_92.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 Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Source__BSS__to__Target__BSS__Transparent__Container__Contents_template field_source__BSS__to__Target__BSS__Transparent__Container__Contents;
};

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

void Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template::copy_value(const Source__BSS__to__Target__BSS__Transparent__Container__BSSGP& 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.source__BSS__to__Target__BSS__Transparent__Container__Contents().is_bound()) {
  single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents = other_value.source__BSS__to__Target__BSS__Transparent__Container__Contents();
} else {
  single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template::copy_template(const Source__BSS__to__Target__BSS__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.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.source__BSS__to__Target__BSS__Transparent__Container__Contents().get_selection()) {
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents = other_value.source__BSS__to__Target__BSS__Transparent__Container__Contents();
} else {
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.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 Source__BSS__to__Target__BSS__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 Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Source__BSS__to__Target__BSS__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.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP.");
break;
}
set_selection(other_value);
}

Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template::Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template()
{
}

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

Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template::Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template(const Source__BSS__to__Target__BSS__Transparent__Container__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template::match(const Source__BSS__to__Target__BSS__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.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.source__BSS__to__Target__BSS__Transparent__Container__Contents().is_bound()) return FALSE;
if(!single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.match(other_value.source__BSS__to__Target__BSS__Transparent__Container__Contents(), 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.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP.");
}
return FALSE;
}

boolean Source__BSS__to__Target__BSS__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.is_bound();
}

boolean Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_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_source__BSS__to__Target__BSS__Transparent__Container__Contents.is_value();
}

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

Source__BSS__to__Target__BSS__Transparent__Container__BSSGP Source__BSS__to__Target__BSS__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.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP.");
Source__BSS__to__Target__BSS__Transparent__Container__BSSGP 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_source__BSS__to__Target__BSS__Transparent__Container__Contents.is_bound()) {
ret_val.source__BSS__to__Target__BSS__Transparent__Container__Contents() = single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

Source__BSS__to__Target__BSS__Transparent__Container__Contents_template& Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template::source__BSS__to__Target__BSS__Transparent__Container__Contents()
{
set_specific();
return single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents;
}

const Source__BSS__to__Target__BSS__Transparent__Container__Contents_template& Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template::source__BSS__to__Target__BSS__Transparent__Container__Contents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_BSS_to_Target_BSS_Transparent_Container_Contents of a non-specific template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP.");
return single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents;
}

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

void Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_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(", source_BSS_to_Target_BSS_Transparent_Container_Contents := ");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.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 Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template::log_match(const Source__BSS__to__Target__BSS__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_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_source__BSS__to__Target__BSS__Transparent__Container__Contents.match(match_value.source__BSS__to__Target__BSS__Transparent__Container__Contents(), legacy)){
TTCN_Logger::log_logmatch_info(".source_BSS_to_Target_BSS_Transparent_Container_Contents");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.log_match(match_value.source__BSS__to__Target__BSS__Transparent__Container__Contents(), 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(", source_BSS_to_Target_BSS_Transparent_Container_Contents := ");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.log_match(match_value.source__BSS__to__Target__BSS__Transparent__Container__Contents(), 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 Source__BSS__to__Target__BSS__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_iEI.encode_text(text_buf);
single_value->field_ext.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.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.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP.");
}
}

void Source__BSS__to__Target__BSS__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.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 Source__BSS__to__Target__BSS__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.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP.");
}
}

void Source__BSS__to__Target__BSS__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: {
    Source__BSS__to__Target__BSS__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 (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP 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) source__BSS__to__Target__BSS__Transparent__Container__Contents().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(), "source_BSS_to_Target_BSS_Transparent_Container_Contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__BSS__to__Target__BSS__Transparent__Container__Contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template* precondition = new Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template* implied_template = new Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Source__BSS__to__Target__BSS__Transparent__Container__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void Source__BSS__to__Target__BSS__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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP");
single_value->field_source__BSS__to__Target__BSS__Transparent__Container__Contents.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_BSS_to_Target_BSS_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.Source_BSS_to_Target_BSS_Transparent_Container_BSSGP");
}

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

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

Target__BSS__to__Source__BSS__Transparent__Container__Contents::Target__BSS__to__Source__BSS__Transparent__Container__Contents()
{
}

Target__BSS__to__Source__BSS__Transparent__Container__Contents::Target__BSS__to__Source__BSS__Transparent__Container__Contents(const OPTIONAL< PS__Handover__Command__BSSGP >& par_pS__Handover__Command,
    const OPTIONAL< SI__PSI__Container >& par_sI__PSI__Container,
    const OPTIONAL< DTM__Handover__Command >& par_dTM__Handover__Command)
  :   field_pS__Handover__Command(par_pS__Handover__Command),
  field_sI__PSI__Container(par_sI__PSI__Container),
  field_dTM__Handover__Command(par_dTM__Handover__Command)
{
}

Target__BSS__to__Source__BSS__Transparent__Container__Contents::Target__BSS__to__Source__BSS__Transparent__Container__Contents(const Target__BSS__to__Source__BSS__Transparent__Container__Contents& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
if (other_value.pS__Handover__Command().is_bound()) field_pS__Handover__Command = other_value.pS__Handover__Command();
else field_pS__Handover__Command.clean_up();
if (other_value.sI__PSI__Container().is_bound()) field_sI__PSI__Container = other_value.sI__PSI__Container();
else field_sI__PSI__Container.clean_up();
if (other_value.dTM__Handover__Command().is_bound()) field_dTM__Handover__Command = other_value.dTM__Handover__Command();
else field_dTM__Handover__Command.clean_up();
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents::clean_up()
{
field_pS__Handover__Command.clean_up();
field_sI__PSI__Container.clean_up();
field_dTM__Handover__Command.clean_up();
}

const TTCN_Typedescriptor_t* Target__BSS__to__Source__BSS__Transparent__Container__Contents::get_descriptor() const { return &Target__BSS__to__Source__BSS__Transparent__Container__Contents_descr_; }
Target__BSS__to__Source__BSS__Transparent__Container__Contents& Target__BSS__to__Source__BSS__Transparent__Container__Contents::operator=(const Target__BSS__to__Source__BSS__Transparent__Container__Contents& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
  if (other_value.pS__Handover__Command().is_bound()) field_pS__Handover__Command = other_value.pS__Handover__Command();
  else field_pS__Handover__Command.clean_up();
  if (other_value.sI__PSI__Container().is_bound()) field_sI__PSI__Container = other_value.sI__PSI__Container();
  else field_sI__PSI__Container.clean_up();
  if (other_value.dTM__Handover__Command().is_bound()) field_dTM__Handover__Command = other_value.dTM__Handover__Command();
  else field_dTM__Handover__Command.clean_up();
}
return *this;
}

boolean Target__BSS__to__Source__BSS__Transparent__Container__Contents::operator==(const Target__BSS__to__Source__BSS__Transparent__Container__Contents& other_value) const
{
return field_pS__Handover__Command==other_value.field_pS__Handover__Command
  && field_sI__PSI__Container==other_value.field_sI__PSI__Container
  && field_dTM__Handover__Command==other_value.field_dTM__Handover__Command;
}

boolean Target__BSS__to__Source__BSS__Transparent__Container__Contents::is_bound() const
{
return (OPTIONAL_OMIT == field_pS__Handover__Command.get_selection() || field_pS__Handover__Command.is_bound())
  || (OPTIONAL_OMIT == field_sI__PSI__Container.get_selection() || field_sI__PSI__Container.is_bound())
  || (OPTIONAL_OMIT == field_dTM__Handover__Command.get_selection() || field_dTM__Handover__Command.is_bound());
}
boolean Target__BSS__to__Source__BSS__Transparent__Container__Contents::is_value() const
{
return (OPTIONAL_OMIT == field_pS__Handover__Command.get_selection() || field_pS__Handover__Command.is_value())
  && (OPTIONAL_OMIT == field_sI__PSI__Container.get_selection() || field_sI__PSI__Container.is_value())
  && (OPTIONAL_OMIT == field_dTM__Handover__Command.get_selection() || field_dTM__Handover__Command.is_value());
}
int Target__BSS__to__Source__BSS__Transparent__Container__Contents::size_of() const
{
  int ret_val = 0;
  if (field_pS__Handover__Command.ispresent()) ret_val++;
  if (field_sI__PSI__Container.ispresent()) ret_val++;
  if (field_dTM__Handover__Command.ispresent()) ret_val++;
  return ret_val;
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ pS_Handover_Command := ");
field_pS__Handover__Command.log();
TTCN_Logger::log_event_str(", sI_PSI_Container := ");
field_sI__PSI__Container.log();
TTCN_Logger::log_event_str(", dTM_Handover_Command := ");
field_dTM__Handover__Command.log();
TTCN_Logger::log_event_str(" }");
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents::set_implicit_omit()
{
if (!pS__Handover__Command().is_bound()) pS__Handover__Command() = OMIT_VALUE;
else pS__Handover__Command().set_implicit_omit();
if (!sI__PSI__Container().is_bound()) sI__PSI__Container() = OMIT_VALUE;
else sI__PSI__Container().set_implicit_omit();
if (!dTM__Handover__Command().is_bound()) dTM__Handover__Command() = OMIT_VALUE;
else dTM__Handover__Command().set_implicit_omit();
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents::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.Target_BSS_to_Source_BSS_Transparent_Container_Contents 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) pS__Handover__Command().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sI__PSI__Container().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dTM__Handover__Command().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(), "pS_Handover_Command")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__Handover__Command().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI_PSI_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI__PSI__Container().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTM_Handover_Command")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTM__Handover__Command().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Target_BSS_to_Source_BSS_Transparent_Container_Contents: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container_Contents");
  }
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents::encode_text(Text_Buf& text_buf) const
{
field_pS__Handover__Command.encode_text(text_buf);
field_sI__PSI__Container.encode_text(text_buf);
field_dTM__Handover__Command.encode_text(text_buf);
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents::decode_text(Text_Buf& text_buf)
{
field_pS__Handover__Command.decode_text(text_buf);
field_sI__PSI__Container.decode_text(text_buf);
field_dTM__Handover__Command.decode_text(text_buf);
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents::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 Target__BSS__to__Source__BSS__Transparent__Container__Contents::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 Target__BSS__to__Source__BSS__Transparent__Container__Contents::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;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(0)) {
    field_pS__Handover__Command = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_0_force_omit(0, force_omit, PS__Handover__Command__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_pS__Handover__Command().RAW_decode(PS__Handover__Command__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 1) {
  field_pS__Handover__Command = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_pS__Handover__Command=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_sI__PSI__Container = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, SI__PSI__Container_descr_.raw->forceomit);
  decoded_field_length = field_sI__PSI__Container().RAW_decode(SI__PSI__Container_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_sI__PSI__Container = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_sI__PSI__Container=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_dTM__Handover__Command = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, DTM__Handover__Command_descr_.raw->forceomit);
  decoded_field_length = field_dTM__Handover__Command().RAW_decode(DTM__Handover__Command_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_dTM__Handover__Command = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_dTM__Handover__Command=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Target__BSS__to__Source__BSS__Transparent__Container__Contents::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);
  if (field_pS__Handover__Command.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, PS__Handover__Command__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_sI__PSI__Container.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SI__PSI__Container_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_dTM__Handover__Command.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DTM__Handover__Command_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_pS__Handover__Command.ispresent()) {
  encoded_length += field_pS__Handover__Command().RAW_encode(PS__Handover__Command__BSSGP_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_sI__PSI__Container.ispresent()) {
  encoded_length += field_sI__PSI__Container().RAW_encode(SI__PSI__Container_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_dTM__Handover__Command.ispresent()) {
  encoded_length += field_dTM__Handover__Command().RAW_encode(DTM__Handover__Command_descr_, *myleaf.body.node.nodes[2]);
  }
  return myleaf.length = encoded_length;
}

struct Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::single_value_struct {
PS__Handover__Command__BSSGP_template field_pS__Handover__Command;
SI__PSI__Container_template field_sI__PSI__Container;
DTM__Handover__Command_template field_dTM__Handover__Command;
};

void Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_pS__Handover__Command = ANY_OR_OMIT;
single_value->field_sI__PSI__Container = ANY_OR_OMIT;
single_value->field_dTM__Handover__Command = ANY_OR_OMIT;
}
}
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::copy_value(const Target__BSS__to__Source__BSS__Transparent__Container__Contents& other_value)
{
single_value = new single_value_struct;
if (other_value.pS__Handover__Command().is_bound()) {
  if (other_value.pS__Handover__Command().ispresent()) single_value->field_pS__Handover__Command = other_value.pS__Handover__Command()();
  else single_value->field_pS__Handover__Command = OMIT_VALUE;
} else {
  single_value->field_pS__Handover__Command.clean_up();
}
if (other_value.sI__PSI__Container().is_bound()) {
  if (other_value.sI__PSI__Container().ispresent()) single_value->field_sI__PSI__Container = other_value.sI__PSI__Container()();
  else single_value->field_sI__PSI__Container = OMIT_VALUE;
} else {
  single_value->field_sI__PSI__Container.clean_up();
}
if (other_value.dTM__Handover__Command().is_bound()) {
  if (other_value.dTM__Handover__Command().ispresent()) single_value->field_dTM__Handover__Command = other_value.dTM__Handover__Command()();
  else single_value->field_dTM__Handover__Command = OMIT_VALUE;
} else {
  single_value->field_dTM__Handover__Command.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::copy_template(const Target__BSS__to__Source__BSS__Transparent__Container__Contents_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.pS__Handover__Command().get_selection()) {
single_value->field_pS__Handover__Command = other_value.pS__Handover__Command();
} else {
single_value->field_pS__Handover__Command.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sI__PSI__Container().get_selection()) {
single_value->field_sI__PSI__Container = other_value.sI__PSI__Container();
} else {
single_value->field_sI__PSI__Container.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dTM__Handover__Command().get_selection()) {
single_value->field_dTM__Handover__Command = other_value.dTM__Handover__Command();
} else {
single_value->field_dTM__Handover__Command.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 Target__BSS__to__Source__BSS__Transparent__Container__Contents_template[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 Target__BSS__to__Source__BSS__Transparent__Container__Contents_template(*other_value.implication_.precondition);
implication_.implied_template = new Target__BSS__to__Source__BSS__Transparent__Container__Contents_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.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
break;
}
set_selection(other_value);
}

Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::Target__BSS__to__Source__BSS__Transparent__Container__Contents_template()
{
}

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

Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::Target__BSS__to__Source__BSS__Transparent__Container__Contents_template(const Target__BSS__to__Source__BSS__Transparent__Container__Contents& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::match(const Target__BSS__to__Source__BSS__Transparent__Container__Contents& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.pS__Handover__Command().is_bound()) return FALSE;
if((other_value.pS__Handover__Command().ispresent() ? !single_value->field_pS__Handover__Command.match((const PS__Handover__Command__BSSGP&)other_value.pS__Handover__Command(), legacy) : !single_value->field_pS__Handover__Command.match_omit(legacy)))return FALSE;
if(!other_value.sI__PSI__Container().is_bound()) return FALSE;
if((other_value.sI__PSI__Container().ispresent() ? !single_value->field_sI__PSI__Container.match((const SI__PSI__Container&)other_value.sI__PSI__Container(), legacy) : !single_value->field_sI__PSI__Container.match_omit(legacy)))return FALSE;
if(!other_value.dTM__Handover__Command().is_bound()) return FALSE;
if((other_value.dTM__Handover__Command().ispresent() ? !single_value->field_dTM__Handover__Command.match((const DTM__Handover__Command&)other_value.dTM__Handover__Command(), legacy) : !single_value->field_dTM__Handover__Command.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.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
}
return FALSE;
}

boolean Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_pS__Handover__Command.is_omit() || single_value->field_pS__Handover__Command.is_bound())
 || (single_value->field_sI__PSI__Container.is_omit() || single_value->field_sI__PSI__Container.is_bound())
 || (single_value->field_dTM__Handover__Command.is_omit() || single_value->field_dTM__Handover__Command.is_bound());
}

boolean Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_pS__Handover__Command.is_omit() || single_value->field_pS__Handover__Command.is_value())
 && (single_value->field_sI__PSI__Container.is_omit() || single_value->field_sI__PSI__Container.is_value())
 && (single_value->field_dTM__Handover__Command.is_omit() || single_value->field_dTM__Handover__Command.is_value());
}

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

Target__BSS__to__Source__BSS__Transparent__Container__Contents Target__BSS__to__Source__BSS__Transparent__Container__Contents_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.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
Target__BSS__to__Source__BSS__Transparent__Container__Contents ret_val;
if (single_value->field_pS__Handover__Command.is_omit()) ret_val.pS__Handover__Command() = OMIT_VALUE;
else if (single_value->field_pS__Handover__Command.is_bound()) {
ret_val.pS__Handover__Command() = single_value->field_pS__Handover__Command.valueof();
}
if (single_value->field_sI__PSI__Container.is_omit()) ret_val.sI__PSI__Container() = OMIT_VALUE;
else if (single_value->field_sI__PSI__Container.is_bound()) {
ret_val.sI__PSI__Container() = single_value->field_sI__PSI__Container.valueof();
}
if (single_value->field_dTM__Handover__Command.is_omit()) ret_val.dTM__Handover__Command() = OMIT_VALUE;
else if (single_value->field_dTM__Handover__Command.is_bound()) {
ret_val.dTM__Handover__Command() = single_value->field_dTM__Handover__Command.valueof();
}
return ret_val;
}

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

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

PS__Handover__Command__BSSGP_template& Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::pS__Handover__Command()
{
set_specific();
return single_value->field_pS__Handover__Command;
}

const PS__Handover__Command__BSSGP_template& Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::pS__Handover__Command() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pS_Handover_Command of a non-specific template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
return single_value->field_pS__Handover__Command;
}

SI__PSI__Container_template& Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::sI__PSI__Container()
{
set_specific();
return single_value->field_sI__PSI__Container;
}

const SI__PSI__Container_template& Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::sI__PSI__Container() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI_PSI_Container of a non-specific template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
return single_value->field_sI__PSI__Container;
}

DTM__Handover__Command_template& Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::dTM__Handover__Command()
{
set_specific();
return single_value->field_dTM__Handover__Command;
}

const DTM__Handover__Command_template& Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::dTM__Handover__Command() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTM_Handover_Command of a non-specific template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
return single_value->field_dTM__Handover__Command;
}

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

void Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ pS_Handover_Command := ");
single_value->field_pS__Handover__Command.log();
TTCN_Logger::log_event_str(", sI_PSI_Container := ");
single_value->field_sI__PSI__Container.log();
TTCN_Logger::log_event_str(", dTM_Handover_Command := ");
single_value->field_dTM__Handover__Command.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 Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::log_match(const Target__BSS__to__Source__BSS__Transparent__Container__Contents& 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 (match_value.pS__Handover__Command().ispresent()){
if(!single_value->field_pS__Handover__Command.match(match_value.pS__Handover__Command(), legacy)){
TTCN_Logger::log_logmatch_info(".pS_Handover_Command");
single_value->field_pS__Handover__Command.log_match(match_value.pS__Handover__Command(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pS__Handover__Command.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pS_Handover_Command := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pS__Handover__Command.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.sI__PSI__Container().ispresent()){
if(!single_value->field_sI__PSI__Container.match(match_value.sI__PSI__Container(), legacy)){
TTCN_Logger::log_logmatch_info(".sI_PSI_Container");
single_value->field_sI__PSI__Container.log_match(match_value.sI__PSI__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_sI__PSI__Container.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".sI_PSI_Container := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_sI__PSI__Container.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.dTM__Handover__Command().ispresent()){
if(!single_value->field_dTM__Handover__Command.match(match_value.dTM__Handover__Command(), legacy)){
TTCN_Logger::log_logmatch_info(".dTM_Handover_Command");
single_value->field_dTM__Handover__Command.log_match(match_value.dTM__Handover__Command(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_dTM__Handover__Command.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".dTM_Handover_Command := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_dTM__Handover__Command.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("{ pS_Handover_Command := ");
if (match_value.pS__Handover__Command().ispresent()) {
single_value->field_pS__Handover__Command.log_match(match_value.pS__Handover__Command(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pS__Handover__Command.log();
if (single_value->field_pS__Handover__Command.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", sI_PSI_Container := ");
if (match_value.sI__PSI__Container().ispresent()) {
single_value->field_sI__PSI__Container.log_match(match_value.sI__PSI__Container(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_sI__PSI__Container.log();
if (single_value->field_sI__PSI__Container.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", dTM_Handover_Command := ");
if (match_value.dTM__Handover__Command().ispresent()) {
single_value->field_dTM__Handover__Command.log_match(match_value.dTM__Handover__Command(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_dTM__Handover__Command.log();
if (single_value->field_dTM__Handover__Command.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 Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_pS__Handover__Command.encode_text(text_buf);
single_value->field_sI__PSI__Container.encode_text(text_buf);
single_value->field_dTM__Handover__Command.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.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
}
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_pS__Handover__Command.decode_text(text_buf);
single_value->field_sI__PSI__Container.decode_text(text_buf);
single_value->field_dTM__Handover__Command.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 Target__BSS__to__Source__BSS__Transparent__Container__Contents_template[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.Target_BSS_to_Source_BSS_Transparent_Container_Contents.");
}
}

void Target__BSS__to__Source__BSS__Transparent__Container__Contents_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: {
    Target__BSS__to__Source__BSS__Transparent__Container__Contents_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.Target_BSS_to_Source_BSS_Transparent_Container_Contents 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) pS__Handover__Command().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sI__PSI__Container().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dTM__Handover__Command().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(), "pS_Handover_Command")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__Handover__Command().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI_PSI_Container")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI__PSI__Container().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dTM_Handover_Command")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTM__Handover__Command().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Target_BSS_to_Source_BSS_Transparent_Container_Contents: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Target__BSS__to__Source__BSS__Transparent__Container__Contents_template* precondition = new Target__BSS__to__Source__BSS__Transparent__Container__Contents_template;
    precondition->set_param(*param.get_elem(0));
    Target__BSS__to__Source__BSS__Transparent__Container__Contents_template* implied_template = new Target__BSS__to__Source__BSS__Transparent__Container__Contents_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Target__BSS__to__Source__BSS__Transparent__Container__Contents_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container_Contents");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

PS__Handover__Command__BSSGP::PS__Handover__Command__BSSGP()
{
}

PS__Handover__Command__BSSGP::PS__Handover__Command__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_pS__Handover__Command__radio__interface__message)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_pS__Handover__Command__radio__interface__message(par_pS__Handover__Command__radio__interface__message)
{
}

PS__Handover__Command__BSSGP::PS__Handover__Command__BSSGP(const PS__Handover__Command__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PS_Handover_Command_BSSGP.");
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.pS__Handover__Command__radio__interface__message().is_bound()) field_pS__Handover__Command__radio__interface__message = other_value.pS__Handover__Command__radio__interface__message();
else field_pS__Handover__Command__radio__interface__message.clean_up();
}

void PS__Handover__Command__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_pS__Handover__Command__radio__interface__message.clean_up();
}

const TTCN_Typedescriptor_t* PS__Handover__Command__BSSGP::get_descriptor() const { return &PS__Handover__Command__BSSGP_descr_; }
PS__Handover__Command__BSSGP& PS__Handover__Command__BSSGP::operator=(const PS__Handover__Command__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PS_Handover_Command_BSSGP.");
  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.pS__Handover__Command__radio__interface__message().is_bound()) field_pS__Handover__Command__radio__interface__message = other_value.pS__Handover__Command__radio__interface__message();
  else field_pS__Handover__Command__radio__interface__message.clean_up();
}
return *this;
}

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

boolean PS__Handover__Command__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_pS__Handover__Command__radio__interface__message.is_bound());
}
boolean PS__Handover__Command__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_pS__Handover__Command__radio__interface__message.is_value();
}
void PS__Handover__Command__BSSGP::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(", pS_Handover_Command_radio_interface_message := ");
field_pS__Handover__Command__radio__interface__message.log();
TTCN_Logger::log_event_str(" }");
}

void PS__Handover__Command__BSSGP::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 (pS__Handover__Command__radio__interface__message().is_bound()) pS__Handover__Command__radio__interface__message().set_implicit_omit();
}

void PS__Handover__Command__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 (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.PS_Handover_Command_BSSGP 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) pS__Handover__Command__radio__interface__message().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(), "pS_Handover_Command_radio_interface_message")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__Handover__Command__radio__interface__message().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.PS_Handover_Command_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PS_Handover_Command_BSSGP");
  }
}

void PS__Handover__Command__BSSGP::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_pS__Handover__Command__radio__interface__message.encode_text(text_buf);
}

void PS__Handover__Command__BSSGP::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_pS__Handover__Command__radio__interface__message.decode_text(text_buf);
}

void PS__Handover__Command__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 PS__Handover__Command__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 PS__Handover__Command__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;
  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, PS__Handover__Command__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(PS__Handover__Command__BSSGP_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, PS__Handover__Command__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PS__Handover__Command__BSSGP_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_pS__Handover__Command__radio__interface__message.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_102) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PS__Handover__Command__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 = 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, PS__Handover__Command__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PS__Handover__Command__BSSGP_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(PS__Handover__Command__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(PS__Handover__Command__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_pS__Handover__Command__radio__interface__message.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(PS__Handover__Command__BSSGP_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(PS__Handover__Command__BSSGP_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_102) {
  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_102.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 PS__Handover__Command__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_pS__Handover__Command__radio__interface__message;
};

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

void PS__Handover__Command__BSSGP_template::copy_value(const PS__Handover__Command__BSSGP& 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.pS__Handover__Command__radio__interface__message().is_bound()) {
  single_value->field_pS__Handover__Command__radio__interface__message = other_value.pS__Handover__Command__radio__interface__message();
} else {
  single_value->field_pS__Handover__Command__radio__interface__message.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PS__Handover__Command__BSSGP_template::copy_template(const PS__Handover__Command__BSSGP_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.pS__Handover__Command__radio__interface__message().get_selection()) {
single_value->field_pS__Handover__Command__radio__interface__message = other_value.pS__Handover__Command__radio__interface__message();
} else {
single_value->field_pS__Handover__Command__radio__interface__message.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PS__Handover__Command__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 PS__Handover__Command__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new PS__Handover__Command__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.PS_Handover_Command_BSSGP.");
break;
}
set_selection(other_value);
}

PS__Handover__Command__BSSGP_template::PS__Handover__Command__BSSGP_template()
{
}

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

PS__Handover__Command__BSSGP_template::PS__Handover__Command__BSSGP_template(const PS__Handover__Command__BSSGP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PS__Handover__Command__BSSGP_template::match(const PS__Handover__Command__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.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.pS__Handover__Command__radio__interface__message().is_bound()) return FALSE;
if(!single_value->field_pS__Handover__Command__radio__interface__message.match(other_value.pS__Handover__Command__radio__interface__message(), 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.PS_Handover_Command_BSSGP.");
}
return FALSE;
}

boolean PS__Handover__Command__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_pS__Handover__Command__radio__interface__message.is_bound();
}

boolean PS__Handover__Command__BSSGP_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_pS__Handover__Command__radio__interface__message.is_value();
}

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

PS__Handover__Command__BSSGP PS__Handover__Command__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.PS_Handover_Command_BSSGP.");
PS__Handover__Command__BSSGP 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_pS__Handover__Command__radio__interface__message.is_bound()) {
ret_val.pS__Handover__Command__radio__interface__message() = single_value->field_pS__Handover__Command__radio__interface__message.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

OCTETSTRING_template& PS__Handover__Command__BSSGP_template::pS__Handover__Command__radio__interface__message()
{
set_specific();
return single_value->field_pS__Handover__Command__radio__interface__message;
}

const OCTETSTRING_template& PS__Handover__Command__BSSGP_template::pS__Handover__Command__radio__interface__message() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pS_Handover_Command_radio_interface_message of a non-specific template of type @BSSGP_Types.PS_Handover_Command_BSSGP.");
return single_value->field_pS__Handover__Command__radio__interface__message;
}

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

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

void PS__Handover__Command__BSSGP_template::log_match(const PS__Handover__Command__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_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_pS__Handover__Command__radio__interface__message.match(match_value.pS__Handover__Command__radio__interface__message(), legacy)){
TTCN_Logger::log_logmatch_info(".pS_Handover_Command_radio_interface_message");
single_value->field_pS__Handover__Command__radio__interface__message.log_match(match_value.pS__Handover__Command__radio__interface__message(), 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(", pS_Handover_Command_radio_interface_message := ");
single_value->field_pS__Handover__Command__radio__interface__message.log_match(match_value.pS__Handover__Command__radio__interface__message(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PS__Handover__Command__BSSGP_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_pS__Handover__Command__radio__interface__message.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.PS_Handover_Command_BSSGP.");
}
}

void PS__Handover__Command__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_pS__Handover__Command__radio__interface__message.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PS__Handover__Command__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.PS_Handover_Command_BSSGP.");
}
}

void PS__Handover__Command__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: {
    PS__Handover__Command__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 (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.PS_Handover_Command_BSSGP 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) pS__Handover__Command__radio__interface__message().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(), "pS_Handover_Command_radio_interface_message")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__Handover__Command__radio__interface__message().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.PS_Handover_Command_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PS__Handover__Command__BSSGP_template* precondition = new PS__Handover__Command__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    PS__Handover__Command__BSSGP_template* implied_template = new PS__Handover__Command__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PS__Handover__Command__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PS_Handover_Command_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void PS__Handover__Command__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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PS_Handover_Command_BSSGP");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PS_Handover_Command_BSSGP");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PS_Handover_Command_BSSGP");
single_value->field_pS__Handover__Command__radio__interface__message.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PS_Handover_Command_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.PS_Handover_Command_BSSGP");
}

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

boolean PS__Handover__Command__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 SI__PSI__ContainerValue::copy_value(const SI__PSI__ContainerValue& other_value)
{
switch (other_value.union_selection) {
case ALT_sI__message__Container:
field_sI__message__Container = new SI__message__Container(*other_value.field_sI__message__Container);
break;
case ALT_pSI__message__Container:
field_pSI__message__Container = new PSI__message__Container(*other_value.field_pSI__message__Container);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.SI_PSI_ContainerValue.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean SI__PSI__ContainerValue::operator==(const SI__PSI__ContainerValue& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.SI_PSI_ContainerValue.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.SI_PSI_ContainerValue.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_sI__message__Container:
return *field_sI__message__Container == *other_value.field_sI__message__Container;
case ALT_pSI__message__Container:
return *field_pSI__message__Container == *other_value.field_pSI__message__Container;
default:
return FALSE;
}
}

SI__message__Container& SI__PSI__ContainerValue::sI__message__Container()
{
if (union_selection != ALT_sI__message__Container) {
clean_up();
field_sI__message__Container = new SI__message__Container;
union_selection = ALT_sI__message__Container;
}
return *field_sI__message__Container;
}

const SI__message__Container& SI__PSI__ContainerValue::sI__message__Container() const
{
if (union_selection != ALT_sI__message__Container) TTCN_error("Using non-selected field sI_message_Container in a value of union type @BSSGP_Types.SI_PSI_ContainerValue.");
return *field_sI__message__Container;
}

PSI__message__Container& SI__PSI__ContainerValue::pSI__message__Container()
{
if (union_selection != ALT_pSI__message__Container) {
clean_up();
field_pSI__message__Container = new PSI__message__Container;
union_selection = ALT_pSI__message__Container;
}
return *field_pSI__message__Container;
}

const PSI__message__Container& SI__PSI__ContainerValue::pSI__message__Container() const
{
if (union_selection != ALT_pSI__message__Container) TTCN_error("Using non-selected field pSI_message_Container in a value of union type @BSSGP_Types.SI_PSI_ContainerValue.");
return *field_pSI__message__Container;
}

boolean SI__PSI__ContainerValue::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.SI_PSI_ContainerValue.");
return union_selection == checked_selection;
}

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

boolean SI__PSI__ContainerValue::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_sI__message__Container: return field_sI__message__Container->is_value();
case ALT_pSI__message__Container: return field_pSI__message__Container->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void SI__PSI__ContainerValue::clean_up()
{
switch (union_selection) {
case ALT_sI__message__Container:
  delete field_sI__message__Container;
  break;
case ALT_pSI__message__Container:
  delete field_pSI__message__Container;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void SI__PSI__ContainerValue::log() const
{
switch (union_selection) {
case ALT_sI__message__Container:
TTCN_Logger::log_event_str("{ sI_message_Container := ");
field_sI__message__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_pSI__message__Container:
TTCN_Logger::log_event_str("{ pSI_message_Container := ");
field_pSI__message__Container->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void SI__PSI__ContainerValue::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, "sI_message_Container")) {
    sI__message__Container().set_param(*mp_last);
    if (!sI__message__Container().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "pSI_message_Container")) {
    pSI__message__Container().set_param(*mp_last);
    if (!pSI__message__Container().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BSSGP_Types.SI_PSI_ContainerValue.", last_name);
}

void SI__PSI__ContainerValue::set_implicit_omit()
{
switch (union_selection) {
case ALT_sI__message__Container:
field_sI__message__Container->set_implicit_omit(); break;
case ALT_pSI__message__Container:
field_pSI__message__Container->set_implicit_omit(); break;
default: break;
}
}

void SI__PSI__ContainerValue::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_sI__message__Container:
field_sI__message__Container->encode_text(text_buf);
break;
case ALT_pSI__message__Container:
field_pSI__message__Container->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.SI_PSI_ContainerValue.");
}
}

void SI__PSI__ContainerValue::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_sI__message__Container:
sI__message__Container().decode_text(text_buf);
break;
case ALT_pSI__message__Container:
pSI__message__Container().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.SI_PSI_ContainerValue.");
}
}

void SI__PSI__ContainerValue::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 SI__PSI__ContainerValue::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 SI__PSI__ContainerValue::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, SI__message__Container_descr_.raw->forceomit);
      decoded_length = sI__message__Container().RAW_decode(SI__message__Container_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, PSI__message__Container_descr_.raw->forceomit);
      decoded_length = pSI__message__Container().RAW_decode(PSI__message__Container_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, SI__message__Container_descr_.raw->forceomit);
      decoded_length = sI__message__Container().RAW_decode(SI__message__Container_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, PSI__message__Container_descr_.raw->forceomit);
      decoded_length = pSI__message__Container().RAW_decode(PSI__message__Container_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 SI__PSI__ContainerValue::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_sI__message__Container:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SI__message__Container_descr_.raw);
    encoded_length = field_sI__message__Container->RAW_encode(SI__message__Container_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SI__message__Container_descr_;
    break;
  case ALT_pSI__message__Container:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, PSI__message__Container_descr_.raw);
    encoded_length = field_pSI__message__Container->RAW_encode(PSI__message__Container_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &PSI__message__Container_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void SI__PSI__ContainerValue_template::copy_value(const SI__PSI__ContainerValue& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case SI__PSI__ContainerValue::ALT_sI__message__Container:
single_value.field_sI__message__Container = new SI__message__Container_template(other_value.sI__message__Container());
break;
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
single_value.field_pSI__message__Container = new PSI__message__Container_template(other_value.pSI__message__Container());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.SI_PSI_ContainerValue.");
}
set_selection(SPECIFIC_VALUE);
}

void SI__PSI__ContainerValue_template::copy_template(const SI__PSI__ContainerValue_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 SI__PSI__ContainerValue::ALT_sI__message__Container:
single_value.field_sI__message__Container = new SI__message__Container_template(*other_value.single_value.field_sI__message__Container);
break;
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
single_value.field_pSI__message__Container = new PSI__message__Container_template(*other_value.single_value.field_pSI__message__Container);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.SI_PSI_ContainerValue.");
}
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 SI__PSI__ContainerValue_template[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 SI__PSI__ContainerValue_template(*other_value.implication_.precondition);
implication_.implied_template = new SI__PSI__ContainerValue_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.SI_PSI_ContainerValue.");
}
set_selection(other_value);
}

SI__PSI__ContainerValue_template::SI__PSI__ContainerValue_template()
{
}

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

SI__PSI__ContainerValue_template::SI__PSI__ContainerValue_template(const SI__PSI__ContainerValue& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void SI__PSI__ContainerValue_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case SI__PSI__ContainerValue::ALT_sI__message__Container:
delete single_value.field_sI__message__Container;
break;
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
delete single_value.field_pSI__message__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;
}

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

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

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

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

boolean SI__PSI__ContainerValue_template::match(const SI__PSI__ContainerValue& 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:
{
SI__PSI__ContainerValue::union_selection_type value_selection = other_value.get_selection();
if (value_selection == SI__PSI__ContainerValue::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case SI__PSI__ContainerValue::ALT_sI__message__Container:
return single_value.field_sI__message__Container->match(other_value.sI__message__Container(), legacy);
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
return single_value.field_pSI__message__Container->match(other_value.pSI__message__Container(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.SI_PSI_ContainerValue.");
}
}
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.SI_PSI_ContainerValue.");
}
return FALSE;
}

boolean SI__PSI__ContainerValue_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case SI__PSI__ContainerValue::ALT_sI__message__Container:
return single_value.field_sI__message__Container->is_value();
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
return single_value.field_pSI__message__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.SI_PSI_ContainerValue.");
}
}

SI__PSI__ContainerValue SI__PSI__ContainerValue_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.SI_PSI_ContainerValue.");
SI__PSI__ContainerValue ret_val;
switch (single_value.union_selection) {
case SI__PSI__ContainerValue::ALT_sI__message__Container:
ret_val.sI__message__Container() = single_value.field_sI__message__Container->valueof();
break;
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
ret_val.pSI__message__Container() = single_value.field_pSI__message__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.SI_PSI_ContainerValue.");
}
return ret_val;
}

SI__PSI__ContainerValue_template& SI__PSI__ContainerValue_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.SI_PSI_ContainerValue.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.SI_PSI_ContainerValue.");
return value_list.list_value[list_index];
}
void SI__PSI__ContainerValue_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.SI_PSI_ContainerValue.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SI__PSI__ContainerValue_template[list_length];
}

SI__message__Container_template& SI__PSI__ContainerValue_template::sI__message__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SI__PSI__ContainerValue::ALT_sI__message__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sI__message__Container = new SI__message__Container_template(ANY_VALUE);
else single_value.field_sI__message__Container = new SI__message__Container_template;
single_value.union_selection = SI__PSI__ContainerValue::ALT_sI__message__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sI__message__Container;
}

const SI__message__Container_template& SI__PSI__ContainerValue_template::sI__message__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sI_message_Container in a non-specific template of union type @BSSGP_Types.SI_PSI_ContainerValue.");
if (single_value.union_selection != SI__PSI__ContainerValue::ALT_sI__message__Container) TTCN_error("Accessing non-selected field sI_message_Container in a template of union type @BSSGP_Types.SI_PSI_ContainerValue.");
return *single_value.field_sI__message__Container;
}

PSI__message__Container_template& SI__PSI__ContainerValue_template::pSI__message__Container()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SI__PSI__ContainerValue::ALT_pSI__message__Container) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_pSI__message__Container = new PSI__message__Container_template(ANY_VALUE);
else single_value.field_pSI__message__Container = new PSI__message__Container_template;
single_value.union_selection = SI__PSI__ContainerValue::ALT_pSI__message__Container;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_pSI__message__Container;
}

const PSI__message__Container_template& SI__PSI__ContainerValue_template::pSI__message__Container() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pSI_message_Container in a non-specific template of union type @BSSGP_Types.SI_PSI_ContainerValue.");
if (single_value.union_selection != SI__PSI__ContainerValue::ALT_pSI__message__Container) TTCN_error("Accessing non-selected field pSI_message_Container in a template of union type @BSSGP_Types.SI_PSI_ContainerValue.");
return *single_value.field_pSI__message__Container;
}

boolean SI__PSI__ContainerValue_template::ischosen(SI__PSI__ContainerValue::union_selection_type checked_selection) const
{
if (checked_selection == SI__PSI__ContainerValue::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.SI_PSI_ContainerValue.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == SI__PSI__ContainerValue::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.SI_PSI_ContainerValue.");
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.SI_PSI_ContainerValue 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 SI__PSI__ContainerValue_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case SI__PSI__ContainerValue::ALT_sI__message__Container:
TTCN_Logger::log_event_str("{ sI_message_Container := ");
single_value.field_sI__message__Container->log();
TTCN_Logger::log_event_str(" }");
break;
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
TTCN_Logger::log_event_str("{ pSI_message_Container := ");
single_value.field_pSI__message__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 SI__PSI__ContainerValue_template::log_match(const SI__PSI__ContainerValue& 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 SI__PSI__ContainerValue::ALT_sI__message__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sI_message_Container");
single_value.field_sI__message__Container->log_match(match_value.sI__message__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sI_message_Container := ");
single_value.field_sI__message__Container->log_match(match_value.sI__message__Container(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".pSI_message_Container");
single_value.field_pSI__message__Container->log_match(match_value.pSI__message__Container(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ pSI_message_Container := ");
single_value.field_pSI__message__Container->log_match(match_value.pSI__message__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 SI__PSI__ContainerValue_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 SI__PSI__ContainerValue::ALT_sI__message__Container:
single_value.field_sI__message__Container->encode_text(text_buf);
break;
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
single_value.field_pSI__message__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.SI_PSI_ContainerValue.");
}
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.SI_PSI_ContainerValue.");
}
}

void SI__PSI__ContainerValue_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = SI__PSI__ContainerValue::UNBOUND_VALUE;
SI__PSI__ContainerValue::union_selection_type new_selection = (SI__PSI__ContainerValue::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case SI__PSI__ContainerValue::ALT_sI__message__Container:
single_value.field_sI__message__Container = new SI__message__Container_template;
single_value.field_sI__message__Container->decode_text(text_buf);
break;
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
single_value.field_pSI__message__Container = new PSI__message__Container_template;
single_value.field_pSI__message__Container->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.SI_PSI_ContainerValue.");
}
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 SI__PSI__ContainerValue_template[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.SI_PSI_ContainerValue.");
}
}

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

boolean SI__PSI__ContainerValue_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 SI__PSI__ContainerValue_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.SI_PSI_ContainerValue'");
    }
    if (strcmp("sI_message_Container", param_field) == 0) {
      sI__message__Container().set_param(param);
      return;
    } else if (strcmp("pSI_message_Container", param_field) == 0) {
      pSI__message__Container().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BSSGP_Types.SI_PSI_ContainerValue'", 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: {
    SI__PSI__ContainerValue_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.SI_PSI_ContainerValue");
    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, "sI_message_Container")) {
      sI__message__Container().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "pSI_message_Container")) {
      pSI__message__Container().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BSSGP_Types.SI_PSI_ContainerValue.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    SI__PSI__ContainerValue_template* precondition = new SI__PSI__ContainerValue_template;
    precondition->set_param(*m_p->get_elem(0));
    SI__PSI__ContainerValue_template* implied_template = new SI__PSI__ContainerValue_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = SI__PSI__ContainerValue_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BSSGP_Types.SI_PSI_ContainerValue");
  }
  is_ifpresent = param.get_ifpresent();
}

void SI__PSI__ContainerValue_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 SI__PSI__ContainerValue::ALT_sI__message__Container:
single_value.field_sI__message__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI_PSI_ContainerValue");
return;
case SI__PSI__ContainerValue::ALT_pSI__message__Container:
single_value.field_pSI__message__Container->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI_PSI_ContainerValue");
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.SI_PSI_ContainerValue.");
}
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.SI_PSI_ContainerValue");
}

SI__message__Container::SI__message__Container()
{
}

SI__message__Container::SI__message__Container(const INTEGER& par_number__of__SI,
    const SI__message__List& par_sI__message__List)
  :   field_number__of__SI(par_number__of__SI),
  field_sI__message__List(par_sI__message__List)
{
}

SI__message__Container::SI__message__Container(const SI__message__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.SI_message_Container.");
if (other_value.number__of__SI().is_bound()) field_number__of__SI = other_value.number__of__SI();
else field_number__of__SI.clean_up();
if (other_value.sI__message__List().is_bound()) field_sI__message__List = other_value.sI__message__List();
else field_sI__message__List.clean_up();
}

void SI__message__Container::clean_up()
{
field_number__of__SI.clean_up();
field_sI__message__List.clean_up();
}

const TTCN_Typedescriptor_t* SI__message__Container::get_descriptor() const { return &SI__message__Container_descr_; }
SI__message__Container& SI__message__Container::operator=(const SI__message__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.SI_message_Container.");
  if (other_value.number__of__SI().is_bound()) field_number__of__SI = other_value.number__of__SI();
  else field_number__of__SI.clean_up();
  if (other_value.sI__message__List().is_bound()) field_sI__message__List = other_value.sI__message__List();
  else field_sI__message__List.clean_up();
}
return *this;
}

boolean SI__message__Container::operator==(const SI__message__Container& other_value) const
{
return field_number__of__SI==other_value.field_number__of__SI
  && field_sI__message__List==other_value.field_sI__message__List;
}

boolean SI__message__Container::is_bound() const
{
return (field_number__of__SI.is_bound())
  || (field_sI__message__List.is_bound());
}
boolean SI__message__Container::is_value() const
{
return field_number__of__SI.is_value()
  && field_sI__message__List.is_value();
}
void SI__message__Container::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ number_of_SI := ");
field_number__of__SI.log();
TTCN_Logger::log_event_str(", sI_message_List := ");
field_sI__message__List.log();
TTCN_Logger::log_event_str(" }");
}

void SI__message__Container::set_implicit_omit()
{
if (number__of__SI().is_bound()) number__of__SI().set_implicit_omit();
if (sI__message__List().is_bound()) sI__message__List().set_implicit_omit();
}

void SI__message__Container::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.SI_message_Container 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) number__of__SI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sI__message__List().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(), "number_of_SI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__SI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI_message_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI__message__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.SI_message_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.SI_message_Container");
  }
}

void SI__message__Container::encode_text(Text_Buf& text_buf) const
{
field_number__of__SI.encode_text(text_buf);
field_sI__message__List.encode_text(text_buf);
}

void SI__message__Container::decode_text(Text_Buf& text_buf)
{
field_number__of__SI.decode_text(text_buf);
field_sI__message__List.decode_text(text_buf);
}

void SI__message__Container::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 SI__message__Container::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 SI__message__Container::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SI__message__Container_number__of__SI_descr_.raw->forceomit);
  decoded_field_length = field_number__of__SI.RAW_decode(SI__message__Container_number__of__SI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_number__of__SI.convert_to_Integer(SI__message__Container_number__of__SI_descr_);
  field_number__of__SI = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, SI__message__List_descr_.raw->forceomit);
  decoded_field_length = field_sI__message__List.RAW_decode(SI__message__List_descr_, p_buf, limit, local_top_order, no_err, value_of_length_field0, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SI__message__Container::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, SI__message__Container_number__of__SI_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SI__message__List_descr_.raw);
  encoded_length += 7;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &SI__message__Container_number__of__SI_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = -1;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 7;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_sI__message__List.RAW_encode(SI__message__List_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct SI__message__Container_template::single_value_struct {
INTEGER_template field_number__of__SI;
SI__message__List_template field_sI__message__List;
};

void SI__message__Container_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_number__of__SI = ANY_VALUE;
single_value->field_sI__message__List = ANY_VALUE;
}
}
}

void SI__message__Container_template::copy_value(const SI__message__Container& other_value)
{
single_value = new single_value_struct;
if (other_value.number__of__SI().is_bound()) {
  single_value->field_number__of__SI = other_value.number__of__SI();
} else {
  single_value->field_number__of__SI.clean_up();
}
if (other_value.sI__message__List().is_bound()) {
  single_value->field_sI__message__List = other_value.sI__message__List();
} else {
  single_value->field_sI__message__List.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SI__message__Container_template::copy_template(const SI__message__Container_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.number__of__SI().get_selection()) {
single_value->field_number__of__SI = other_value.number__of__SI();
} else {
single_value->field_number__of__SI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sI__message__List().get_selection()) {
single_value->field_sI__message__List = other_value.sI__message__List();
} else {
single_value->field_sI__message__List.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 SI__message__Container_template[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 SI__message__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new SI__message__Container_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.SI_message_Container.");
break;
}
set_selection(other_value);
}

SI__message__Container_template::SI__message__Container_template()
{
}

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

SI__message__Container_template::SI__message__Container_template(const SI__message__Container& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SI__message__Container_template::match(const SI__message__Container& 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.number__of__SI().is_bound()) return FALSE;
if(!single_value->field_number__of__SI.match(other_value.number__of__SI(), legacy))return FALSE;
if(!other_value.sI__message__List().is_bound()) return FALSE;
if(!single_value->field_sI__message__List.match(other_value.sI__message__List(), 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.SI_message_Container.");
}
return FALSE;
}

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

boolean SI__message__Container_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_number__of__SI.is_value()
 && single_value->field_sI__message__List.is_value();
}

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

SI__message__Container SI__message__Container_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.SI_message_Container.");
SI__message__Container ret_val;
if (single_value->field_number__of__SI.is_bound()) {
ret_val.number__of__SI() = single_value->field_number__of__SI.valueof();
}
if (single_value->field_sI__message__List.is_bound()) {
ret_val.sI__message__List() = single_value->field_sI__message__List.valueof();
}
return ret_val;
}

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

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

INTEGER_template& SI__message__Container_template::number__of__SI()
{
set_specific();
return single_value->field_number__of__SI;
}

const INTEGER_template& SI__message__Container_template::number__of__SI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_SI of a non-specific template of type @BSSGP_Types.SI_message_Container.");
return single_value->field_number__of__SI;
}

SI__message__List_template& SI__message__Container_template::sI__message__List()
{
set_specific();
return single_value->field_sI__message__List;
}

const SI__message__List_template& SI__message__Container_template::sI__message__List() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI_message_List of a non-specific template of type @BSSGP_Types.SI_message_Container.");
return single_value->field_sI__message__List;
}

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

void SI__message__Container_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ number_of_SI := ");
single_value->field_number__of__SI.log();
TTCN_Logger::log_event_str(", sI_message_List := ");
single_value->field_sI__message__List.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 SI__message__Container_template::log_match(const SI__message__Container& 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_number__of__SI.match(match_value.number__of__SI(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_SI");
single_value->field_number__of__SI.log_match(match_value.number__of__SI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sI__message__List.match(match_value.sI__message__List(), legacy)){
TTCN_Logger::log_logmatch_info(".sI_message_List");
single_value->field_sI__message__List.log_match(match_value.sI__message__List(), 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("{ number_of_SI := ");
single_value->field_number__of__SI.log_match(match_value.number__of__SI(), legacy);
TTCN_Logger::log_event_str(", sI_message_List := ");
single_value->field_sI__message__List.log_match(match_value.sI__message__List(), 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 SI__message__Container_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_number__of__SI.encode_text(text_buf);
single_value->field_sI__message__List.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.SI_message_Container.");
}
}

void SI__message__Container_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_number__of__SI.decode_text(text_buf);
single_value->field_sI__message__List.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 SI__message__Container_template[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.SI_message_Container.");
}
}

void SI__message__Container_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: {
    SI__message__Container_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.SI_message_Container 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) number__of__SI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sI__message__List().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(), "number_of_SI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__SI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI_message_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI__message__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.SI_message_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SI__message__Container_template* precondition = new SI__message__Container_template;
    precondition->set_param(*param.get_elem(0));
    SI__message__Container_template* implied_template = new SI__message__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SI__message__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.SI_message_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void SI__message__Container_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_number__of__SI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI_message_Container");
single_value->field_sI__message__List.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI_message_Container");
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.SI_message_Container");
}

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

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

PSI__message__Container::PSI__message__Container()
{
}

PSI__message__Container::PSI__message__Container(const INTEGER& par_number__of__PSI,
    const PSI__message__List& par_pSI__message__List)
  :   field_number__of__PSI(par_number__of__PSI),
  field_pSI__message__List(par_pSI__message__List)
{
}

PSI__message__Container::PSI__message__Container(const PSI__message__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PSI_message_Container.");
if (other_value.number__of__PSI().is_bound()) field_number__of__PSI = other_value.number__of__PSI();
else field_number__of__PSI.clean_up();
if (other_value.pSI__message__List().is_bound()) field_pSI__message__List = other_value.pSI__message__List();
else field_pSI__message__List.clean_up();
}

void PSI__message__Container::clean_up()
{
field_number__of__PSI.clean_up();
field_pSI__message__List.clean_up();
}

const TTCN_Typedescriptor_t* PSI__message__Container::get_descriptor() const { return &PSI__message__Container_descr_; }
PSI__message__Container& PSI__message__Container::operator=(const PSI__message__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PSI_message_Container.");
  if (other_value.number__of__PSI().is_bound()) field_number__of__PSI = other_value.number__of__PSI();
  else field_number__of__PSI.clean_up();
  if (other_value.pSI__message__List().is_bound()) field_pSI__message__List = other_value.pSI__message__List();
  else field_pSI__message__List.clean_up();
}
return *this;
}

boolean PSI__message__Container::operator==(const PSI__message__Container& other_value) const
{
return field_number__of__PSI==other_value.field_number__of__PSI
  && field_pSI__message__List==other_value.field_pSI__message__List;
}

boolean PSI__message__Container::is_bound() const
{
return (field_number__of__PSI.is_bound())
  || (field_pSI__message__List.is_bound());
}
boolean PSI__message__Container::is_value() const
{
return field_number__of__PSI.is_value()
  && field_pSI__message__List.is_value();
}
void PSI__message__Container::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ number_of_PSI := ");
field_number__of__PSI.log();
TTCN_Logger::log_event_str(", pSI_message_List := ");
field_pSI__message__List.log();
TTCN_Logger::log_event_str(" }");
}

void PSI__message__Container::set_implicit_omit()
{
if (number__of__PSI().is_bound()) number__of__PSI().set_implicit_omit();
if (pSI__message__List().is_bound()) pSI__message__List().set_implicit_omit();
}

void PSI__message__Container::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.PSI_message_Container 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) number__of__PSI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pSI__message__List().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(), "number_of_PSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pSI_message_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pSI__message__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.PSI_message_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PSI_message_Container");
  }
}

void PSI__message__Container::encode_text(Text_Buf& text_buf) const
{
field_number__of__PSI.encode_text(text_buf);
field_pSI__message__List.encode_text(text_buf);
}

void PSI__message__Container::decode_text(Text_Buf& text_buf)
{
field_number__of__PSI.decode_text(text_buf);
field_pSI__message__List.decode_text(text_buf);
}

void PSI__message__Container::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 PSI__message__Container::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 PSI__message__Container::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, PSI__message__Container_number__of__PSI_descr_.raw->forceomit);
  decoded_field_length = field_number__of__PSI.RAW_decode(PSI__message__Container_number__of__PSI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_number__of__PSI.convert_to_Integer(PSI__message__Container_number__of__PSI_descr_);
  field_number__of__PSI = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 1;
  RAW_Force_Omit field_1_force_omit(1, force_omit, PSI__message__List_descr_.raw->forceomit);
  decoded_field_length = field_pSI__message__List.RAW_decode(PSI__message__List_descr_, p_buf, limit, local_top_order, no_err, value_of_length_field0, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PSI__message__Container::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, PSI__message__Container_number__of__PSI_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PSI__message__List_descr_.raw);
  encoded_length += 7;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &PSI__message__Container_number__of__PSI_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = -1;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[0]->length = 7;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  encoded_length += field_pSI__message__List.RAW_encode(PSI__message__List_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PSI__message__Container_template::single_value_struct {
INTEGER_template field_number__of__PSI;
PSI__message__List_template field_pSI__message__List;
};

void PSI__message__Container_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_number__of__PSI = ANY_VALUE;
single_value->field_pSI__message__List = ANY_VALUE;
}
}
}

void PSI__message__Container_template::copy_value(const PSI__message__Container& other_value)
{
single_value = new single_value_struct;
if (other_value.number__of__PSI().is_bound()) {
  single_value->field_number__of__PSI = other_value.number__of__PSI();
} else {
  single_value->field_number__of__PSI.clean_up();
}
if (other_value.pSI__message__List().is_bound()) {
  single_value->field_pSI__message__List = other_value.pSI__message__List();
} else {
  single_value->field_pSI__message__List.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PSI__message__Container_template::copy_template(const PSI__message__Container_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.number__of__PSI().get_selection()) {
single_value->field_number__of__PSI = other_value.number__of__PSI();
} else {
single_value->field_number__of__PSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pSI__message__List().get_selection()) {
single_value->field_pSI__message__List = other_value.pSI__message__List();
} else {
single_value->field_pSI__message__List.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 PSI__message__Container_template[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 PSI__message__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new PSI__message__Container_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.PSI_message_Container.");
break;
}
set_selection(other_value);
}

PSI__message__Container_template::PSI__message__Container_template()
{
}

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

PSI__message__Container_template::PSI__message__Container_template(const PSI__message__Container& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PSI__message__Container_template::match(const PSI__message__Container& 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.number__of__PSI().is_bound()) return FALSE;
if(!single_value->field_number__of__PSI.match(other_value.number__of__PSI(), legacy))return FALSE;
if(!other_value.pSI__message__List().is_bound()) return FALSE;
if(!single_value->field_pSI__message__List.match(other_value.pSI__message__List(), 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.PSI_message_Container.");
}
return FALSE;
}

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

boolean PSI__message__Container_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_number__of__PSI.is_value()
 && single_value->field_pSI__message__List.is_value();
}

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

PSI__message__Container PSI__message__Container_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.PSI_message_Container.");
PSI__message__Container ret_val;
if (single_value->field_number__of__PSI.is_bound()) {
ret_val.number__of__PSI() = single_value->field_number__of__PSI.valueof();
}
if (single_value->field_pSI__message__List.is_bound()) {
ret_val.pSI__message__List() = single_value->field_pSI__message__List.valueof();
}
return ret_val;
}

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

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

INTEGER_template& PSI__message__Container_template::number__of__PSI()
{
set_specific();
return single_value->field_number__of__PSI;
}

const INTEGER_template& PSI__message__Container_template::number__of__PSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_PSI of a non-specific template of type @BSSGP_Types.PSI_message_Container.");
return single_value->field_number__of__PSI;
}

PSI__message__List_template& PSI__message__Container_template::pSI__message__List()
{
set_specific();
return single_value->field_pSI__message__List;
}

const PSI__message__List_template& PSI__message__Container_template::pSI__message__List() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pSI_message_List of a non-specific template of type @BSSGP_Types.PSI_message_Container.");
return single_value->field_pSI__message__List;
}

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

void PSI__message__Container_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ number_of_PSI := ");
single_value->field_number__of__PSI.log();
TTCN_Logger::log_event_str(", pSI_message_List := ");
single_value->field_pSI__message__List.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 PSI__message__Container_template::log_match(const PSI__message__Container& 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_number__of__PSI.match(match_value.number__of__PSI(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_PSI");
single_value->field_number__of__PSI.log_match(match_value.number__of__PSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pSI__message__List.match(match_value.pSI__message__List(), legacy)){
TTCN_Logger::log_logmatch_info(".pSI_message_List");
single_value->field_pSI__message__List.log_match(match_value.pSI__message__List(), 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("{ number_of_PSI := ");
single_value->field_number__of__PSI.log_match(match_value.number__of__PSI(), legacy);
TTCN_Logger::log_event_str(", pSI_message_List := ");
single_value->field_pSI__message__List.log_match(match_value.pSI__message__List(), 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 PSI__message__Container_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_number__of__PSI.encode_text(text_buf);
single_value->field_pSI__message__List.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.PSI_message_Container.");
}
}

void PSI__message__Container_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_number__of__PSI.decode_text(text_buf);
single_value->field_pSI__message__List.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 PSI__message__Container_template[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.PSI_message_Container.");
}
}

void PSI__message__Container_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: {
    PSI__message__Container_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.PSI_message_Container 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) number__of__PSI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pSI__message__List().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(), "number_of_PSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pSI_message_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pSI__message__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.PSI_message_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PSI__message__Container_template* precondition = new PSI__message__Container_template;
    precondition->set_param(*param.get_elem(0));
    PSI__message__Container_template* implied_template = new PSI__message__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PSI__message__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PSI_message_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void PSI__message__Container_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_number__of__PSI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PSI_message_Container");
single_value->field_pSI__message__List.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PSI_message_Container");
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.PSI_message_Container");
}

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

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

SI__PSI__Container::SI__PSI__Container()
{
}

SI__PSI__Container::SI__PSI__Container(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_typeField,
    const SI__PSI__ContainerValue& par_sI__PSI__ContainerValue)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_typeField(par_typeField),
  field_sI__PSI__ContainerValue(par_sI__PSI__ContainerValue)
{
}

SI__PSI__Container::SI__PSI__Container(const SI__PSI__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.SI_PSI_Container.");
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.typeField().is_bound()) field_typeField = other_value.typeField();
else field_typeField.clean_up();
if (other_value.sI__PSI__ContainerValue().is_bound()) field_sI__PSI__ContainerValue = other_value.sI__PSI__ContainerValue();
else field_sI__PSI__ContainerValue.clean_up();
}

void SI__PSI__Container::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_typeField.clean_up();
field_sI__PSI__ContainerValue.clean_up();
}

const TTCN_Typedescriptor_t* SI__PSI__Container::get_descriptor() const { return &SI__PSI__Container_descr_; }
SI__PSI__Container& SI__PSI__Container::operator=(const SI__PSI__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.SI_PSI_Container.");
  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.typeField().is_bound()) field_typeField = other_value.typeField();
  else field_typeField.clean_up();
  if (other_value.sI__PSI__ContainerValue().is_bound()) field_sI__PSI__ContainerValue = other_value.sI__PSI__ContainerValue();
  else field_sI__PSI__ContainerValue.clean_up();
}
return *this;
}

boolean SI__PSI__Container::operator==(const SI__PSI__Container& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_typeField==other_value.field_typeField
  && field_sI__PSI__ContainerValue==other_value.field_sI__PSI__ContainerValue;
}

boolean SI__PSI__Container::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_typeField.is_bound())
  || (field_sI__PSI__ContainerValue.is_bound());
}
boolean SI__PSI__Container::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_typeField.is_value()
  && field_sI__PSI__ContainerValue.is_value();
}
void SI__PSI__Container::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(", typeField := ");
field_typeField.log();
TTCN_Logger::log_event_str(", sI_PSI_ContainerValue := ");
field_sI__PSI__ContainerValue.log();
TTCN_Logger::log_event_str(" }");
}

void SI__PSI__Container::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 (typeField().is_bound()) typeField().set_implicit_omit();
if (sI__PSI__ContainerValue().is_bound()) sI__PSI__ContainerValue().set_implicit_omit();
}

void SI__PSI__Container::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.SI_PSI_Container 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) typeField().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sI__PSI__ContainerValue().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(), "typeField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI_PSI_ContainerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI__PSI__ContainerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.SI_PSI_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.SI_PSI_Container");
  }
}

void SI__PSI__Container::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_typeField.encode_text(text_buf);
field_sI__PSI__ContainerValue.encode_text(text_buf);
}

void SI__PSI__Container::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_typeField.decode_text(text_buf);
field_sI__PSI__ContainerValue.decode_text(text_buf);
}

void SI__PSI__Container::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 SI__PSI__Container::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 SI__PSI__Container::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, SI__PSI__Container_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(SI__PSI__Container_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, SI__PSI__Container_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(SI__PSI__Container_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_typeField.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;
  if (field_typeField ==  bs_1) selected_field = 0;
  else if (field_typeField ==  bs_0) selected_field = 1;
  else selected_field = -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, SI__PSI__Container_sI__PSI__ContainerValue_descr_.raw->forceomit);
  decoded_field_length = field_sI__PSI__ContainerValue.RAW_decode(SI__PSI__Container_sI__PSI__ContainerValue_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, selected_field, 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_103) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SI__PSI__Container::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, SI__PSI__Container_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SI__PSI__Container_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, SI__PSI__Container_sI__PSI__ContainerValue_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(SI__PSI__Container_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(SI__PSI__Container_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_typeField.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_sI__PSI__ContainerValue.RAW_encode(SI__PSI__Container_sI__PSI__ContainerValue_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(SI__PSI__Container_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(SI__PSI__Container_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:;
  }
  switch (field_sI__PSI__ContainerValue.get_selection()) {
  case SI__PSI__ContainerValue::ALT_sI__message__Container:
  if (field_typeField !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 3 };
  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(General__Types::BIT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SI__PSI__ContainerValue::ALT_pSI__message__Container:
  if (field_typeField !=  bs_0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 3 };
  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(General__Types::BIT1_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  if (field_iEI !=  os_103) {
  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_103.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 SI__PSI__Container_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_typeField;
SI__PSI__ContainerValue_template field_sI__PSI__ContainerValue;
};

void SI__PSI__Container_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_typeField = ANY_VALUE;
single_value->field_sI__PSI__ContainerValue = ANY_VALUE;
}
}
}

void SI__PSI__Container_template::copy_value(const SI__PSI__Container& 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.typeField().is_bound()) {
  single_value->field_typeField = other_value.typeField();
} else {
  single_value->field_typeField.clean_up();
}
if (other_value.sI__PSI__ContainerValue().is_bound()) {
  single_value->field_sI__PSI__ContainerValue = other_value.sI__PSI__ContainerValue();
} else {
  single_value->field_sI__PSI__ContainerValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SI__PSI__Container_template::copy_template(const SI__PSI__Container_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.typeField().get_selection()) {
single_value->field_typeField = other_value.typeField();
} else {
single_value->field_typeField.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sI__PSI__ContainerValue().get_selection()) {
single_value->field_sI__PSI__ContainerValue = other_value.sI__PSI__ContainerValue();
} else {
single_value->field_sI__PSI__ContainerValue.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 SI__PSI__Container_template[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 SI__PSI__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new SI__PSI__Container_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.SI_PSI_Container.");
break;
}
set_selection(other_value);
}

SI__PSI__Container_template::SI__PSI__Container_template()
{
}

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

SI__PSI__Container_template::SI__PSI__Container_template(const SI__PSI__Container& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SI__PSI__Container_template::match(const SI__PSI__Container& 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.typeField().is_bound()) return FALSE;
if(!single_value->field_typeField.match(other_value.typeField(), legacy))return FALSE;
if(!other_value.sI__PSI__ContainerValue().is_bound()) return FALSE;
if(!single_value->field_sI__PSI__ContainerValue.match(other_value.sI__PSI__ContainerValue(), 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.SI_PSI_Container.");
}
return FALSE;
}

boolean SI__PSI__Container_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_typeField.is_bound()
 || single_value->field_sI__PSI__ContainerValue.is_bound();
}

boolean SI__PSI__Container_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_typeField.is_value()
 && single_value->field_sI__PSI__ContainerValue.is_value();
}

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

SI__PSI__Container SI__PSI__Container_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.SI_PSI_Container.");
SI__PSI__Container 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_typeField.is_bound()) {
ret_val.typeField() = single_value->field_typeField.valueof();
}
if (single_value->field_sI__PSI__ContainerValue.is_bound()) {
ret_val.sI__PSI__ContainerValue() = single_value->field_sI__PSI__ContainerValue.valueof();
}
return ret_val;
}

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

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

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

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

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

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

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

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

BITSTRING_template& SI__PSI__Container_template::typeField()
{
set_specific();
return single_value->field_typeField;
}

const BITSTRING_template& SI__PSI__Container_template::typeField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field typeField of a non-specific template of type @BSSGP_Types.SI_PSI_Container.");
return single_value->field_typeField;
}

SI__PSI__ContainerValue_template& SI__PSI__Container_template::sI__PSI__ContainerValue()
{
set_specific();
return single_value->field_sI__PSI__ContainerValue;
}

const SI__PSI__ContainerValue_template& SI__PSI__Container_template::sI__PSI__ContainerValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI_PSI_ContainerValue of a non-specific template of type @BSSGP_Types.SI_PSI_Container.");
return single_value->field_sI__PSI__ContainerValue;
}

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

void SI__PSI__Container_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(", typeField := ");
single_value->field_typeField.log();
TTCN_Logger::log_event_str(", sI_PSI_ContainerValue := ");
single_value->field_sI__PSI__ContainerValue.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 SI__PSI__Container_template::log_match(const SI__PSI__Container& 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_typeField.match(match_value.typeField(), legacy)){
TTCN_Logger::log_logmatch_info(".typeField");
single_value->field_typeField.log_match(match_value.typeField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sI__PSI__ContainerValue.match(match_value.sI__PSI__ContainerValue(), legacy)){
TTCN_Logger::log_logmatch_info(".sI_PSI_ContainerValue");
single_value->field_sI__PSI__ContainerValue.log_match(match_value.sI__PSI__ContainerValue(), 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(", typeField := ");
single_value->field_typeField.log_match(match_value.typeField(), legacy);
TTCN_Logger::log_event_str(", sI_PSI_ContainerValue := ");
single_value->field_sI__PSI__ContainerValue.log_match(match_value.sI__PSI__ContainerValue(), 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 SI__PSI__Container_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_typeField.encode_text(text_buf);
single_value->field_sI__PSI__ContainerValue.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.SI_PSI_Container.");
}
}

void SI__PSI__Container_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_typeField.decode_text(text_buf);
single_value->field_sI__PSI__ContainerValue.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 SI__PSI__Container_template[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.SI_PSI_Container.");
}
}

void SI__PSI__Container_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: {
    SI__PSI__Container_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.SI_PSI_Container 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) typeField().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sI__PSI__ContainerValue().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(), "typeField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI_PSI_ContainerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI__PSI__ContainerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.SI_PSI_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SI__PSI__Container_template* precondition = new SI__PSI__Container_template;
    precondition->set_param(*param.get_elem(0));
    SI__PSI__Container_template* implied_template = new SI__PSI__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SI__PSI__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.SI_PSI_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void SI__PSI__Container_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.SI_PSI_Container");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI_PSI_Container");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI_PSI_Container");
single_value->field_typeField.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI_PSI_Container");
single_value->field_sI__PSI__ContainerValue.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.SI_PSI_Container");
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.SI_PSI_Container");
}

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

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

DTM__Handover__Command::DTM__Handover__Command()
{
}

DTM__Handover__Command::DTM__Handover__Command(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_dTM__HandoverCommandValue)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_dTM__HandoverCommandValue(par_dTM__HandoverCommandValue)
{
}

DTM__Handover__Command::DTM__Handover__Command(const DTM__Handover__Command& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.DTM_Handover_Command.");
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.dTM__HandoverCommandValue().is_bound()) field_dTM__HandoverCommandValue = other_value.dTM__HandoverCommandValue();
else field_dTM__HandoverCommandValue.clean_up();
}

void DTM__Handover__Command::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_dTM__HandoverCommandValue.clean_up();
}

const TTCN_Typedescriptor_t* DTM__Handover__Command::get_descriptor() const { return &DTM__Handover__Command_descr_; }
DTM__Handover__Command& DTM__Handover__Command::operator=(const DTM__Handover__Command& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.DTM_Handover_Command.");
  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.dTM__HandoverCommandValue().is_bound()) field_dTM__HandoverCommandValue = other_value.dTM__HandoverCommandValue();
  else field_dTM__HandoverCommandValue.clean_up();
}
return *this;
}

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

boolean DTM__Handover__Command::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_dTM__HandoverCommandValue.is_bound());
}
boolean DTM__Handover__Command::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_dTM__HandoverCommandValue.is_value();
}
void DTM__Handover__Command::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(", dTM_HandoverCommandValue := ");
field_dTM__HandoverCommandValue.log();
TTCN_Logger::log_event_str(" }");
}

void DTM__Handover__Command::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 (dTM__HandoverCommandValue().is_bound()) dTM__HandoverCommandValue().set_implicit_omit();
}

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

void DTM__Handover__Command::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_dTM__HandoverCommandValue.encode_text(text_buf);
}

void DTM__Handover__Command::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_dTM__HandoverCommandValue.decode_text(text_buf);
}

void DTM__Handover__Command::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 DTM__Handover__Command::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 DTM__Handover__Command::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, DTM__Handover__Command_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(DTM__Handover__Command_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, DTM__Handover__Command_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(DTM__Handover__Command_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_dTM__HandoverCommandValue.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_104) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int DTM__Handover__Command::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, DTM__Handover__Command_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DTM__Handover__Command_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(DTM__Handover__Command_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(DTM__Handover__Command_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_dTM__HandoverCommandValue.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(DTM__Handover__Command_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(DTM__Handover__Command_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_104) {
  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_104.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 DTM__Handover__Command_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_dTM__HandoverCommandValue;
};

void DTM__Handover__Command_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_dTM__HandoverCommandValue = ANY_VALUE;
}
}
}

void DTM__Handover__Command_template::copy_value(const DTM__Handover__Command& 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.dTM__HandoverCommandValue().is_bound()) {
  single_value->field_dTM__HandoverCommandValue = other_value.dTM__HandoverCommandValue();
} else {
  single_value->field_dTM__HandoverCommandValue.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void DTM__Handover__Command_template::copy_template(const DTM__Handover__Command_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.dTM__HandoverCommandValue().get_selection()) {
single_value->field_dTM__HandoverCommandValue = other_value.dTM__HandoverCommandValue();
} else {
single_value->field_dTM__HandoverCommandValue.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 DTM__Handover__Command_template[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 DTM__Handover__Command_template(*other_value.implication_.precondition);
implication_.implied_template = new DTM__Handover__Command_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.DTM_Handover_Command.");
break;
}
set_selection(other_value);
}

DTM__Handover__Command_template::DTM__Handover__Command_template()
{
}

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

DTM__Handover__Command_template::DTM__Handover__Command_template(const DTM__Handover__Command& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean DTM__Handover__Command_template::match(const DTM__Handover__Command& 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.dTM__HandoverCommandValue().is_bound()) return FALSE;
if(!single_value->field_dTM__HandoverCommandValue.match(other_value.dTM__HandoverCommandValue(), 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.DTM_Handover_Command.");
}
return FALSE;
}

boolean DTM__Handover__Command_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_dTM__HandoverCommandValue.is_bound();
}

boolean DTM__Handover__Command_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_dTM__HandoverCommandValue.is_value();
}

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

DTM__Handover__Command DTM__Handover__Command_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.DTM_Handover_Command.");
DTM__Handover__Command 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_dTM__HandoverCommandValue.is_bound()) {
ret_val.dTM__HandoverCommandValue() = single_value->field_dTM__HandoverCommandValue.valueof();
}
return ret_val;
}

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

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

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

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

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

const BITSTRING_template& DTM__Handover__Command_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.DTM_Handover_Command.");
return single_value->field_ext;
}

LIN2__2a_template& DTM__Handover__Command_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& DTM__Handover__Command_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.DTM_Handover_Command.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& DTM__Handover__Command_template::dTM__HandoverCommandValue()
{
set_specific();
return single_value->field_dTM__HandoverCommandValue;
}

const OCTETSTRING_template& DTM__Handover__Command_template::dTM__HandoverCommandValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dTM_HandoverCommandValue of a non-specific template of type @BSSGP_Types.DTM_Handover_Command.");
return single_value->field_dTM__HandoverCommandValue;
}

int DTM__Handover__Command_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTM_Handover_Command 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.DTM_Handover_Command 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.DTM_Handover_Command 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.DTM_Handover_Command containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTM_Handover_Command containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTM_Handover_Command containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTM_Handover_Command containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTM_Handover_Command containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTM_Handover_Command containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.DTM_Handover_Command.");
  }
  return 0;
}

void DTM__Handover__Command_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(", dTM_HandoverCommandValue := ");
single_value->field_dTM__HandoverCommandValue.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 DTM__Handover__Command_template::log_match(const DTM__Handover__Command& 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_dTM__HandoverCommandValue.match(match_value.dTM__HandoverCommandValue(), legacy)){
TTCN_Logger::log_logmatch_info(".dTM_HandoverCommandValue");
single_value->field_dTM__HandoverCommandValue.log_match(match_value.dTM__HandoverCommandValue(), 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(", dTM_HandoverCommandValue := ");
single_value->field_dTM__HandoverCommandValue.log_match(match_value.dTM__HandoverCommandValue(), 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 DTM__Handover__Command_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_dTM__HandoverCommandValue.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.DTM_Handover_Command.");
}
}

void DTM__Handover__Command_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_dTM__HandoverCommandValue.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 DTM__Handover__Command_template[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.DTM_Handover_Command.");
}
}

void DTM__Handover__Command_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: {
    DTM__Handover__Command_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.DTM_Handover_Command 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) dTM__HandoverCommandValue().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(), "dTM_HandoverCommandValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dTM__HandoverCommandValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.DTM_Handover_Command: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    DTM__Handover__Command_template* precondition = new DTM__Handover__Command_template;
    precondition->set_param(*param.get_elem(0));
    DTM__Handover__Command_template* implied_template = new DTM__Handover__Command_template;
    implied_template->set_param(*param.get_elem(1));
    *this = DTM__Handover__Command_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.DTM_Handover_Command");
  }
  is_ifpresent = param.get_ifpresent();
}

void DTM__Handover__Command_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.DTM_Handover_Command");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DTM_Handover_Command");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DTM_Handover_Command");
single_value->field_dTM__HandoverCommandValue.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DTM_Handover_Command");
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.DTM_Handover_Command");
}

boolean DTM__Handover__Command_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean DTM__Handover__Command_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;
}

Target__BSS__to__Source__BSS__Transparent__Container::Target__BSS__to__Source__BSS__Transparent__Container()
{
}

Target__BSS__to__Source__BSS__Transparent__Container::Target__BSS__to__Source__BSS__Transparent__Container(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const Target__BSS__to__Source__BSS__Transparent__Container__Contents& par_target__BSS__to__Source__BSS__Transparent__Container__Contents)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_target__BSS__to__Source__BSS__Transparent__Container__Contents(par_target__BSS__to__Source__BSS__Transparent__Container__Contents)
{
}

Target__BSS__to__Source__BSS__Transparent__Container::Target__BSS__to__Source__BSS__Transparent__Container(const Target__BSS__to__Source__BSS__Transparent__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container.");
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.target__BSS__to__Source__BSS__Transparent__Container__Contents().is_bound()) field_target__BSS__to__Source__BSS__Transparent__Container__Contents = other_value.target__BSS__to__Source__BSS__Transparent__Container__Contents();
else field_target__BSS__to__Source__BSS__Transparent__Container__Contents.clean_up();
}

void Target__BSS__to__Source__BSS__Transparent__Container::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_target__BSS__to__Source__BSS__Transparent__Container__Contents.clean_up();
}

const TTCN_Typedescriptor_t* Target__BSS__to__Source__BSS__Transparent__Container::get_descriptor() const { return &Target__BSS__to__Source__BSS__Transparent__Container_descr_; }
Target__BSS__to__Source__BSS__Transparent__Container& Target__BSS__to__Source__BSS__Transparent__Container::operator=(const Target__BSS__to__Source__BSS__Transparent__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container.");
  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.target__BSS__to__Source__BSS__Transparent__Container__Contents().is_bound()) field_target__BSS__to__Source__BSS__Transparent__Container__Contents = other_value.target__BSS__to__Source__BSS__Transparent__Container__Contents();
  else field_target__BSS__to__Source__BSS__Transparent__Container__Contents.clean_up();
}
return *this;
}

boolean Target__BSS__to__Source__BSS__Transparent__Container::operator==(const Target__BSS__to__Source__BSS__Transparent__Container& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_target__BSS__to__Source__BSS__Transparent__Container__Contents==other_value.field_target__BSS__to__Source__BSS__Transparent__Container__Contents;
}

boolean Target__BSS__to__Source__BSS__Transparent__Container::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_target__BSS__to__Source__BSS__Transparent__Container__Contents.is_bound());
}
boolean Target__BSS__to__Source__BSS__Transparent__Container::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_target__BSS__to__Source__BSS__Transparent__Container__Contents.is_value();
}
void Target__BSS__to__Source__BSS__Transparent__Container::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(", target_BSS_to_Source_BSS_Transparent_Container_Contents := ");
field_target__BSS__to__Source__BSS__Transparent__Container__Contents.log();
TTCN_Logger::log_event_str(" }");
}

void Target__BSS__to__Source__BSS__Transparent__Container::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 (target__BSS__to__Source__BSS__Transparent__Container__Contents().is_bound()) target__BSS__to__Source__BSS__Transparent__Container__Contents().set_implicit_omit();
}

void Target__BSS__to__Source__BSS__Transparent__Container::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.Target_BSS_to_Source_BSS_Transparent_Container 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) target__BSS__to__Source__BSS__Transparent__Container__Contents().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(), "target_BSS_to_Source_BSS_Transparent_Container_Contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__BSS__to__Source__BSS__Transparent__Container__Contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Target_BSS_to_Source_BSS_Transparent_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container");
  }
}

void Target__BSS__to__Source__BSS__Transparent__Container::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_target__BSS__to__Source__BSS__Transparent__Container__Contents.encode_text(text_buf);
}

void Target__BSS__to__Source__BSS__Transparent__Container::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_target__BSS__to__Source__BSS__Transparent__Container__Contents.decode_text(text_buf);
}

void Target__BSS__to__Source__BSS__Transparent__Container::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 Target__BSS__to__Source__BSS__Transparent__Container::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 Target__BSS__to__Source__BSS__Transparent__Container::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, Target__BSS__to__Source__BSS__Transparent__Container_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Target__BSS__to__Source__BSS__Transparent__Container_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, Target__BSS__to__Source__BSS__Transparent__Container_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Target__BSS__to__Source__BSS__Transparent__Container_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, Target__BSS__to__Source__BSS__Transparent__Container__Contents_descr_.raw->forceomit);
  decoded_field_length = field_target__BSS__to__Source__BSS__Transparent__Container__Contents.RAW_decode(Target__BSS__to__Source__BSS__Transparent__Container__Contents_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_105) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Target__BSS__to__Source__BSS__Transparent__Container::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, Target__BSS__to__Source__BSS__Transparent__Container_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Target__BSS__to__Source__BSS__Transparent__Container_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Target__BSS__to__Source__BSS__Transparent__Container__Contents_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Target__BSS__to__Source__BSS__Transparent__Container_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Target__BSS__to__Source__BSS__Transparent__Container_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_target__BSS__to__Source__BSS__Transparent__Container__Contents.RAW_encode(Target__BSS__to__Source__BSS__Transparent__Container__Contents_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(Target__BSS__to__Source__BSS__Transparent__Container_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(Target__BSS__to__Source__BSS__Transparent__Container_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_105) {
  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_105.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 Target__BSS__to__Source__BSS__Transparent__Container_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
Target__BSS__to__Source__BSS__Transparent__Container__Contents_template field_target__BSS__to__Source__BSS__Transparent__Container__Contents;
};

void Target__BSS__to__Source__BSS__Transparent__Container_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_target__BSS__to__Source__BSS__Transparent__Container__Contents = ANY_VALUE;
}
}
}

void Target__BSS__to__Source__BSS__Transparent__Container_template::copy_value(const Target__BSS__to__Source__BSS__Transparent__Container& 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.target__BSS__to__Source__BSS__Transparent__Container__Contents().is_bound()) {
  single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents = other_value.target__BSS__to__Source__BSS__Transparent__Container__Contents();
} else {
  single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Target__BSS__to__Source__BSS__Transparent__Container_template::copy_template(const Target__BSS__to__Source__BSS__Transparent__Container_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.target__BSS__to__Source__BSS__Transparent__Container__Contents().get_selection()) {
single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents = other_value.target__BSS__to__Source__BSS__Transparent__Container__Contents();
} else {
single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents.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 Target__BSS__to__Source__BSS__Transparent__Container_template[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 Target__BSS__to__Source__BSS__Transparent__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new Target__BSS__to__Source__BSS__Transparent__Container_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.Target_BSS_to_Source_BSS_Transparent_Container.");
break;
}
set_selection(other_value);
}

Target__BSS__to__Source__BSS__Transparent__Container_template::Target__BSS__to__Source__BSS__Transparent__Container_template()
{
}

Target__BSS__to__Source__BSS__Transparent__Container_template::Target__BSS__to__Source__BSS__Transparent__Container_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Target__BSS__to__Source__BSS__Transparent__Container_template::Target__BSS__to__Source__BSS__Transparent__Container_template(const Target__BSS__to__Source__BSS__Transparent__Container& other_value)
{
copy_value(other_value);
}

Target__BSS__to__Source__BSS__Transparent__Container_template::Target__BSS__to__Source__BSS__Transparent__Container_template(const OPTIONAL<Target__BSS__to__Source__BSS__Transparent__Container>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Target__BSS__to__Source__BSS__Transparent__Container&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container from an unbound optional field.");
}
}

Target__BSS__to__Source__BSS__Transparent__Container_template::Target__BSS__to__Source__BSS__Transparent__Container_template(Target__BSS__to__Source__BSS__Transparent__Container_template* p_precondition, Target__BSS__to__Source__BSS__Transparent__Container_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Target__BSS__to__Source__BSS__Transparent__Container_template::Target__BSS__to__Source__BSS__Transparent__Container_template(Dynamic_Match_Interface<Target__BSS__to__Source__BSS__Transparent__Container>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Target__BSS__to__Source__BSS__Transparent__Container>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Target__BSS__to__Source__BSS__Transparent__Container_template::Target__BSS__to__Source__BSS__Transparent__Container_template(const Target__BSS__to__Source__BSS__Transparent__Container_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Target__BSS__to__Source__BSS__Transparent__Container_template::~Target__BSS__to__Source__BSS__Transparent__Container_template()
{
clean_up();
}

Target__BSS__to__Source__BSS__Transparent__Container_template& Target__BSS__to__Source__BSS__Transparent__Container_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Target__BSS__to__Source__BSS__Transparent__Container_template& Target__BSS__to__Source__BSS__Transparent__Container_template::operator=(const Target__BSS__to__Source__BSS__Transparent__Container& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Target__BSS__to__Source__BSS__Transparent__Container_template& Target__BSS__to__Source__BSS__Transparent__Container_template::operator=(const OPTIONAL<Target__BSS__to__Source__BSS__Transparent__Container>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Target__BSS__to__Source__BSS__Transparent__Container&)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.Target_BSS_to_Source_BSS_Transparent_Container.");
}
return *this;
}

Target__BSS__to__Source__BSS__Transparent__Container_template& Target__BSS__to__Source__BSS__Transparent__Container_template::operator=(const Target__BSS__to__Source__BSS__Transparent__Container_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Target__BSS__to__Source__BSS__Transparent__Container_template::match(const Target__BSS__to__Source__BSS__Transparent__Container& 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.target__BSS__to__Source__BSS__Transparent__Container__Contents().is_bound()) return FALSE;
if(!single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents.match(other_value.target__BSS__to__Source__BSS__Transparent__Container__Contents(), 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.Target_BSS_to_Source_BSS_Transparent_Container.");
}
return FALSE;
}

boolean Target__BSS__to__Source__BSS__Transparent__Container_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_target__BSS__to__Source__BSS__Transparent__Container__Contents.is_bound();
}

boolean Target__BSS__to__Source__BSS__Transparent__Container_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_target__BSS__to__Source__BSS__Transparent__Container__Contents.is_value();
}

void Target__BSS__to__Source__BSS__Transparent__Container_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;
}

Target__BSS__to__Source__BSS__Transparent__Container Target__BSS__to__Source__BSS__Transparent__Container_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.Target_BSS_to_Source_BSS_Transparent_Container.");
Target__BSS__to__Source__BSS__Transparent__Container 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_target__BSS__to__Source__BSS__Transparent__Container__Contents.is_bound()) {
ret_val.target__BSS__to__Source__BSS__Transparent__Container__Contents() = single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents.valueof();
}
return ret_val;
}

void Target__BSS__to__Source__BSS__Transparent__Container_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.Target_BSS_to_Source_BSS_Transparent_Container.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Target__BSS__to__Source__BSS__Transparent__Container_template[list_length];
}

Target__BSS__to__Source__BSS__Transparent__Container_template& Target__BSS__to__Source__BSS__Transparent__Container_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.Target_BSS_to_Source_BSS_Transparent_Container.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& Target__BSS__to__Source__BSS__Transparent__Container_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Target__BSS__to__Source__BSS__Transparent__Container_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container.");
return single_value->field_iEI;
}

BITSTRING_template& Target__BSS__to__Source__BSS__Transparent__Container_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Target__BSS__to__Source__BSS__Transparent__Container_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container.");
return single_value->field_ext;
}

LIN2__2a_template& Target__BSS__to__Source__BSS__Transparent__Container_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Target__BSS__to__Source__BSS__Transparent__Container_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container.");
return single_value->field_lengthIndicator;
}

Target__BSS__to__Source__BSS__Transparent__Container__Contents_template& Target__BSS__to__Source__BSS__Transparent__Container_template::target__BSS__to__Source__BSS__Transparent__Container__Contents()
{
set_specific();
return single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents;
}

const Target__BSS__to__Source__BSS__Transparent__Container__Contents_template& Target__BSS__to__Source__BSS__Transparent__Container_template::target__BSS__to__Source__BSS__Transparent__Container__Contents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field target_BSS_to_Source_BSS_Transparent_Container_Contents of a non-specific template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container.");
return single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents;
}

int Target__BSS__to__Source__BSS__Transparent__Container_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container 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.Target_BSS_to_Source_BSS_Transparent_Container 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.Target_BSS_to_Source_BSS_Transparent_Container 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.Target_BSS_to_Source_BSS_Transparent_Container containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container.");
  }
  return 0;
}

void Target__BSS__to__Source__BSS__Transparent__Container_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(", target_BSS_to_Source_BSS_Transparent_Container_Contents := ");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents.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 Target__BSS__to__Source__BSS__Transparent__Container_template::log_match(const Target__BSS__to__Source__BSS__Transparent__Container& 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_target__BSS__to__Source__BSS__Transparent__Container__Contents.match(match_value.target__BSS__to__Source__BSS__Transparent__Container__Contents(), legacy)){
TTCN_Logger::log_logmatch_info(".target_BSS_to_Source_BSS_Transparent_Container_Contents");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents.log_match(match_value.target__BSS__to__Source__BSS__Transparent__Container__Contents(), 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(", target_BSS_to_Source_BSS_Transparent_Container_Contents := ");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents.log_match(match_value.target__BSS__to__Source__BSS__Transparent__Container__Contents(), 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 Target__BSS__to__Source__BSS__Transparent__Container_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_target__BSS__to__Source__BSS__Transparent__Container__Contents.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.Target_BSS_to_Source_BSS_Transparent_Container.");
}
}

void Target__BSS__to__Source__BSS__Transparent__Container_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_target__BSS__to__Source__BSS__Transparent__Container__Contents.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 Target__BSS__to__Source__BSS__Transparent__Container_template[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.Target_BSS_to_Source_BSS_Transparent_Container.");
}
}

void Target__BSS__to__Source__BSS__Transparent__Container_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: {
    Target__BSS__to__Source__BSS__Transparent__Container_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.Target_BSS_to_Source_BSS_Transparent_Container 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) target__BSS__to__Source__BSS__Transparent__Container__Contents().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(), "target_BSS_to_Source_BSS_Transparent_Container_Contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          target__BSS__to__Source__BSS__Transparent__Container__Contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Target_BSS_to_Source_BSS_Transparent_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Target__BSS__to__Source__BSS__Transparent__Container_template* precondition = new Target__BSS__to__Source__BSS__Transparent__Container_template;
    precondition->set_param(*param.get_elem(0));
    Target__BSS__to__Source__BSS__Transparent__Container_template* implied_template = new Target__BSS__to__Source__BSS__Transparent__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Target__BSS__to__Source__BSS__Transparent__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void Target__BSS__to__Source__BSS__Transparent__Container_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.Target_BSS_to_Source_BSS_Transparent_Container");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container");
single_value->field_target__BSS__to__Source__BSS__Transparent__Container__Contents.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Target_BSS_to_Source_BSS_Transparent_Container");
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.Target_BSS_to_Source_BSS_Transparent_Container");
}

boolean Target__BSS__to__Source__BSS__Transparent__Container_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Target__BSS__to__Source__BSS__Transparent__Container_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;
}

NAS__Container__for__PS__HO::NAS__Container__for__PS__HO()
{
}

NAS__Container__for__PS__HO::NAS__Container__for__PS__HO(const BITSTRING& par_typeOfCipheringAlgorithm,
    const BITSTRING& par_spare1,
    const BITSTRING& par_oldXID,
    const BITSTRING& par_spare2,
    const OCTETSTRING& par_iOV__UI)
  :   field_typeOfCipheringAlgorithm(par_typeOfCipheringAlgorithm),
  field_spare1(par_spare1),
  field_oldXID(par_oldXID),
  field_spare2(par_spare2),
  field_iOV__UI(par_iOV__UI)
{
}

NAS__Container__for__PS__HO::NAS__Container__for__PS__HO(const NAS__Container__for__PS__HO& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.NAS_Container_for_PS_HO.");
if (other_value.typeOfCipheringAlgorithm().is_bound()) field_typeOfCipheringAlgorithm = other_value.typeOfCipheringAlgorithm();
else field_typeOfCipheringAlgorithm.clean_up();
if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
else field_spare1.clean_up();
if (other_value.oldXID().is_bound()) field_oldXID = other_value.oldXID();
else field_oldXID.clean_up();
if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
else field_spare2.clean_up();
if (other_value.iOV__UI().is_bound()) field_iOV__UI = other_value.iOV__UI();
else field_iOV__UI.clean_up();
}

void NAS__Container__for__PS__HO::clean_up()
{
field_typeOfCipheringAlgorithm.clean_up();
field_spare1.clean_up();
field_oldXID.clean_up();
field_spare2.clean_up();
field_iOV__UI.clean_up();
}

const TTCN_Typedescriptor_t* NAS__Container__for__PS__HO::get_descriptor() const { return &NAS__Container__for__PS__HO_descr_; }
NAS__Container__for__PS__HO& NAS__Container__for__PS__HO::operator=(const NAS__Container__for__PS__HO& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.NAS_Container_for_PS_HO.");
  if (other_value.typeOfCipheringAlgorithm().is_bound()) field_typeOfCipheringAlgorithm = other_value.typeOfCipheringAlgorithm();
  else field_typeOfCipheringAlgorithm.clean_up();
  if (other_value.spare1().is_bound()) field_spare1 = other_value.spare1();
  else field_spare1.clean_up();
  if (other_value.oldXID().is_bound()) field_oldXID = other_value.oldXID();
  else field_oldXID.clean_up();
  if (other_value.spare2().is_bound()) field_spare2 = other_value.spare2();
  else field_spare2.clean_up();
  if (other_value.iOV__UI().is_bound()) field_iOV__UI = other_value.iOV__UI();
  else field_iOV__UI.clean_up();
}
return *this;
}

boolean NAS__Container__for__PS__HO::operator==(const NAS__Container__for__PS__HO& other_value) const
{
return field_typeOfCipheringAlgorithm==other_value.field_typeOfCipheringAlgorithm
  && field_spare1==other_value.field_spare1
  && field_oldXID==other_value.field_oldXID
  && field_spare2==other_value.field_spare2
  && field_iOV__UI==other_value.field_iOV__UI;
}

boolean NAS__Container__for__PS__HO::is_bound() const
{
return (field_typeOfCipheringAlgorithm.is_bound())
  || (field_spare1.is_bound())
  || (field_oldXID.is_bound())
  || (field_spare2.is_bound())
  || (field_iOV__UI.is_bound());
}
boolean NAS__Container__for__PS__HO::is_value() const
{
return field_typeOfCipheringAlgorithm.is_value()
  && field_spare1.is_value()
  && field_oldXID.is_value()
  && field_spare2.is_value()
  && field_iOV__UI.is_value();
}
void NAS__Container__for__PS__HO::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ typeOfCipheringAlgorithm := ");
field_typeOfCipheringAlgorithm.log();
TTCN_Logger::log_event_str(", spare1 := ");
field_spare1.log();
TTCN_Logger::log_event_str(", oldXID := ");
field_oldXID.log();
TTCN_Logger::log_event_str(", spare2 := ");
field_spare2.log();
TTCN_Logger::log_event_str(", iOV_UI := ");
field_iOV__UI.log();
TTCN_Logger::log_event_str(" }");
}

void NAS__Container__for__PS__HO::set_implicit_omit()
{
if (typeOfCipheringAlgorithm().is_bound()) typeOfCipheringAlgorithm().set_implicit_omit();
if (spare1().is_bound()) spare1().set_implicit_omit();
if (oldXID().is_bound()) oldXID().set_implicit_omit();
if (spare2().is_bound()) spare2().set_implicit_omit();
if (iOV__UI().is_bound()) iOV__UI().set_implicit_omit();
}

void NAS__Container__for__PS__HO::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.NAS_Container_for_PS_HO 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) typeOfCipheringAlgorithm().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) oldXID().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) iOV__UI().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(), "typeOfCipheringAlgorithm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeOfCipheringAlgorithm().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldXID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldXID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iOV_UI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iOV__UI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.NAS_Container_for_PS_HO: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.NAS_Container_for_PS_HO");
  }
}

void NAS__Container__for__PS__HO::encode_text(Text_Buf& text_buf) const
{
field_typeOfCipheringAlgorithm.encode_text(text_buf);
field_spare1.encode_text(text_buf);
field_oldXID.encode_text(text_buf);
field_spare2.encode_text(text_buf);
field_iOV__UI.encode_text(text_buf);
}

void NAS__Container__for__PS__HO::decode_text(Text_Buf& text_buf)
{
field_typeOfCipheringAlgorithm.decode_text(text_buf);
field_spare1.decode_text(text_buf);
field_oldXID.decode_text(text_buf);
field_spare2.decode_text(text_buf);
field_iOV__UI.decode_text(text_buf);
}

void NAS__Container__for__PS__HO::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 NAS__Container__for__PS__HO::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 NAS__Container__for__PS__HO::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_typeOfCipheringAlgorithm.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare1.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_oldXID.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_spare2.RAW_decode(General__Types::BIT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_iOV__UI.RAW_decode(General__Types::OCT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NAS__Container__for__PS__HO::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::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::OCT4_descr_.raw);
  encoded_length += field_typeOfCipheringAlgorithm.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare1.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_oldXID.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_spare2.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_iOV__UI.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct NAS__Container__for__PS__HO_template::single_value_struct {
BITSTRING_template field_typeOfCipheringAlgorithm;
BITSTRING_template field_spare1;
BITSTRING_template field_oldXID;
BITSTRING_template field_spare2;
OCTETSTRING_template field_iOV__UI;
};

void NAS__Container__for__PS__HO_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_typeOfCipheringAlgorithm = ANY_VALUE;
single_value->field_spare1 = ANY_VALUE;
single_value->field_oldXID = ANY_VALUE;
single_value->field_spare2 = ANY_VALUE;
single_value->field_iOV__UI = ANY_VALUE;
}
}
}

void NAS__Container__for__PS__HO_template::copy_value(const NAS__Container__for__PS__HO& other_value)
{
single_value = new single_value_struct;
if (other_value.typeOfCipheringAlgorithm().is_bound()) {
  single_value->field_typeOfCipheringAlgorithm = other_value.typeOfCipheringAlgorithm();
} else {
  single_value->field_typeOfCipheringAlgorithm.clean_up();
}
if (other_value.spare1().is_bound()) {
  single_value->field_spare1 = other_value.spare1();
} else {
  single_value->field_spare1.clean_up();
}
if (other_value.oldXID().is_bound()) {
  single_value->field_oldXID = other_value.oldXID();
} else {
  single_value->field_oldXID.clean_up();
}
if (other_value.spare2().is_bound()) {
  single_value->field_spare2 = other_value.spare2();
} else {
  single_value->field_spare2.clean_up();
}
if (other_value.iOV__UI().is_bound()) {
  single_value->field_iOV__UI = other_value.iOV__UI();
} else {
  single_value->field_iOV__UI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NAS__Container__for__PS__HO_template::copy_template(const NAS__Container__for__PS__HO_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.typeOfCipheringAlgorithm().get_selection()) {
single_value->field_typeOfCipheringAlgorithm = other_value.typeOfCipheringAlgorithm();
} else {
single_value->field_typeOfCipheringAlgorithm.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare1().get_selection()) {
single_value->field_spare1 = other_value.spare1();
} else {
single_value->field_spare1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldXID().get_selection()) {
single_value->field_oldXID = other_value.oldXID();
} else {
single_value->field_oldXID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare2().get_selection()) {
single_value->field_spare2 = other_value.spare2();
} else {
single_value->field_spare2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.iOV__UI().get_selection()) {
single_value->field_iOV__UI = other_value.iOV__UI();
} else {
single_value->field_iOV__UI.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 NAS__Container__for__PS__HO_template[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 NAS__Container__for__PS__HO_template(*other_value.implication_.precondition);
implication_.implied_template = new NAS__Container__for__PS__HO_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.NAS_Container_for_PS_HO.");
break;
}
set_selection(other_value);
}

NAS__Container__for__PS__HO_template::NAS__Container__for__PS__HO_template()
{
}

NAS__Container__for__PS__HO_template::NAS__Container__for__PS__HO_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

NAS__Container__for__PS__HO_template::NAS__Container__for__PS__HO_template(const NAS__Container__for__PS__HO& other_value)
{
copy_value(other_value);
}

NAS__Container__for__PS__HO_template::NAS__Container__for__PS__HO_template(const OPTIONAL<NAS__Container__for__PS__HO>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NAS__Container__for__PS__HO&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.NAS_Container_for_PS_HO from an unbound optional field.");
}
}

NAS__Container__for__PS__HO_template::NAS__Container__for__PS__HO_template(NAS__Container__for__PS__HO_template* p_precondition, NAS__Container__for__PS__HO_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

NAS__Container__for__PS__HO_template::NAS__Container__for__PS__HO_template(Dynamic_Match_Interface<NAS__Container__for__PS__HO>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<NAS__Container__for__PS__HO>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

NAS__Container__for__PS__HO_template::NAS__Container__for__PS__HO_template(const NAS__Container__for__PS__HO_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

NAS__Container__for__PS__HO_template::~NAS__Container__for__PS__HO_template()
{
clean_up();
}

NAS__Container__for__PS__HO_template& NAS__Container__for__PS__HO_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

NAS__Container__for__PS__HO_template& NAS__Container__for__PS__HO_template::operator=(const NAS__Container__for__PS__HO& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

NAS__Container__for__PS__HO_template& NAS__Container__for__PS__HO_template::operator=(const OPTIONAL<NAS__Container__for__PS__HO>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NAS__Container__for__PS__HO&)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.NAS_Container_for_PS_HO.");
}
return *this;
}

NAS__Container__for__PS__HO_template& NAS__Container__for__PS__HO_template::operator=(const NAS__Container__for__PS__HO_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean NAS__Container__for__PS__HO_template::match(const NAS__Container__for__PS__HO& 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.typeOfCipheringAlgorithm().is_bound()) return FALSE;
if(!single_value->field_typeOfCipheringAlgorithm.match(other_value.typeOfCipheringAlgorithm(), legacy))return FALSE;
if(!other_value.spare1().is_bound()) return FALSE;
if(!single_value->field_spare1.match(other_value.spare1(), legacy))return FALSE;
if(!other_value.oldXID().is_bound()) return FALSE;
if(!single_value->field_oldXID.match(other_value.oldXID(), legacy))return FALSE;
if(!other_value.spare2().is_bound()) return FALSE;
if(!single_value->field_spare2.match(other_value.spare2(), legacy))return FALSE;
if(!other_value.iOV__UI().is_bound()) return FALSE;
if(!single_value->field_iOV__UI.match(other_value.iOV__UI(), 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.NAS_Container_for_PS_HO.");
}
return FALSE;
}

boolean NAS__Container__for__PS__HO_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_typeOfCipheringAlgorithm.is_bound()
 || single_value->field_spare1.is_bound()
 || single_value->field_oldXID.is_bound()
 || single_value->field_spare2.is_bound()
 || single_value->field_iOV__UI.is_bound();
}

boolean NAS__Container__for__PS__HO_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_typeOfCipheringAlgorithm.is_value()
 && single_value->field_spare1.is_value()
 && single_value->field_oldXID.is_value()
 && single_value->field_spare2.is_value()
 && single_value->field_iOV__UI.is_value();
}

void NAS__Container__for__PS__HO_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;
}

NAS__Container__for__PS__HO NAS__Container__for__PS__HO_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.NAS_Container_for_PS_HO.");
NAS__Container__for__PS__HO ret_val;
if (single_value->field_typeOfCipheringAlgorithm.is_bound()) {
ret_val.typeOfCipheringAlgorithm() = single_value->field_typeOfCipheringAlgorithm.valueof();
}
if (single_value->field_spare1.is_bound()) {
ret_val.spare1() = single_value->field_spare1.valueof();
}
if (single_value->field_oldXID.is_bound()) {
ret_val.oldXID() = single_value->field_oldXID.valueof();
}
if (single_value->field_spare2.is_bound()) {
ret_val.spare2() = single_value->field_spare2.valueof();
}
if (single_value->field_iOV__UI.is_bound()) {
ret_val.iOV__UI() = single_value->field_iOV__UI.valueof();
}
return ret_val;
}

void NAS__Container__for__PS__HO_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.NAS_Container_for_PS_HO.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NAS__Container__for__PS__HO_template[list_length];
}

NAS__Container__for__PS__HO_template& NAS__Container__for__PS__HO_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.NAS_Container_for_PS_HO.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.NAS_Container_for_PS_HO.");
return value_list.list_value[list_index];
}

BITSTRING_template& NAS__Container__for__PS__HO_template::typeOfCipheringAlgorithm()
{
set_specific();
return single_value->field_typeOfCipheringAlgorithm;
}

const BITSTRING_template& NAS__Container__for__PS__HO_template::typeOfCipheringAlgorithm() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field typeOfCipheringAlgorithm of a non-specific template of type @BSSGP_Types.NAS_Container_for_PS_HO.");
return single_value->field_typeOfCipheringAlgorithm;
}

BITSTRING_template& NAS__Container__for__PS__HO_template::spare1()
{
set_specific();
return single_value->field_spare1;
}

const BITSTRING_template& NAS__Container__for__PS__HO_template::spare1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare1 of a non-specific template of type @BSSGP_Types.NAS_Container_for_PS_HO.");
return single_value->field_spare1;
}

BITSTRING_template& NAS__Container__for__PS__HO_template::oldXID()
{
set_specific();
return single_value->field_oldXID;
}

const BITSTRING_template& NAS__Container__for__PS__HO_template::oldXID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldXID of a non-specific template of type @BSSGP_Types.NAS_Container_for_PS_HO.");
return single_value->field_oldXID;
}

BITSTRING_template& NAS__Container__for__PS__HO_template::spare2()
{
set_specific();
return single_value->field_spare2;
}

const BITSTRING_template& NAS__Container__for__PS__HO_template::spare2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare2 of a non-specific template of type @BSSGP_Types.NAS_Container_for_PS_HO.");
return single_value->field_spare2;
}

OCTETSTRING_template& NAS__Container__for__PS__HO_template::iOV__UI()
{
set_specific();
return single_value->field_iOV__UI;
}

const OCTETSTRING_template& NAS__Container__for__PS__HO_template::iOV__UI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iOV_UI of a non-specific template of type @BSSGP_Types.NAS_Container_for_PS_HO.");
return single_value->field_iOV__UI;
}

int NAS__Container__for__PS__HO_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_Container_for_PS_HO 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.NAS_Container_for_PS_HO 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.NAS_Container_for_PS_HO 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.NAS_Container_for_PS_HO containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_Container_for_PS_HO containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_Container_for_PS_HO containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_Container_for_PS_HO containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_Container_for_PS_HO containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_Container_for_PS_HO containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.NAS_Container_for_PS_HO.");
  }
  return 0;
}

void NAS__Container__for__PS__HO_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ typeOfCipheringAlgorithm := ");
single_value->field_typeOfCipheringAlgorithm.log();
TTCN_Logger::log_event_str(", spare1 := ");
single_value->field_spare1.log();
TTCN_Logger::log_event_str(", oldXID := ");
single_value->field_oldXID.log();
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log();
TTCN_Logger::log_event_str(", iOV_UI := ");
single_value->field_iOV__UI.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 NAS__Container__for__PS__HO_template::log_match(const NAS__Container__for__PS__HO& 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_typeOfCipheringAlgorithm.match(match_value.typeOfCipheringAlgorithm(), legacy)){
TTCN_Logger::log_logmatch_info(".typeOfCipheringAlgorithm");
single_value->field_typeOfCipheringAlgorithm.log_match(match_value.typeOfCipheringAlgorithm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare1.match(match_value.spare1(), legacy)){
TTCN_Logger::log_logmatch_info(".spare1");
single_value->field_spare1.log_match(match_value.spare1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oldXID.match(match_value.oldXID(), legacy)){
TTCN_Logger::log_logmatch_info(".oldXID");
single_value->field_oldXID.log_match(match_value.oldXID(), 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);
}
if(!single_value->field_iOV__UI.match(match_value.iOV__UI(), legacy)){
TTCN_Logger::log_logmatch_info(".iOV_UI");
single_value->field_iOV__UI.log_match(match_value.iOV__UI(), 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("{ typeOfCipheringAlgorithm := ");
single_value->field_typeOfCipheringAlgorithm.log_match(match_value.typeOfCipheringAlgorithm(), legacy);
TTCN_Logger::log_event_str(", spare1 := ");
single_value->field_spare1.log_match(match_value.spare1(), legacy);
TTCN_Logger::log_event_str(", oldXID := ");
single_value->field_oldXID.log_match(match_value.oldXID(), legacy);
TTCN_Logger::log_event_str(", spare2 := ");
single_value->field_spare2.log_match(match_value.spare2(), legacy);
TTCN_Logger::log_event_str(", iOV_UI := ");
single_value->field_iOV__UI.log_match(match_value.iOV__UI(), 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 NAS__Container__for__PS__HO_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_typeOfCipheringAlgorithm.encode_text(text_buf);
single_value->field_spare1.encode_text(text_buf);
single_value->field_oldXID.encode_text(text_buf);
single_value->field_spare2.encode_text(text_buf);
single_value->field_iOV__UI.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.NAS_Container_for_PS_HO.");
}
}

void NAS__Container__for__PS__HO_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_typeOfCipheringAlgorithm.decode_text(text_buf);
single_value->field_spare1.decode_text(text_buf);
single_value->field_oldXID.decode_text(text_buf);
single_value->field_spare2.decode_text(text_buf);
single_value->field_iOV__UI.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 NAS__Container__for__PS__HO_template[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.NAS_Container_for_PS_HO.");
}
}

void NAS__Container__for__PS__HO_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: {
    NAS__Container__for__PS__HO_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.NAS_Container_for_PS_HO 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) typeOfCipheringAlgorithm().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare1().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) oldXID().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) spare2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) iOV__UI().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(), "typeOfCipheringAlgorithm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeOfCipheringAlgorithm().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldXID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldXID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "iOV_UI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iOV__UI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.NAS_Container_for_PS_HO: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NAS__Container__for__PS__HO_template* precondition = new NAS__Container__for__PS__HO_template;
    precondition->set_param(*param.get_elem(0));
    NAS__Container__for__PS__HO_template* implied_template = new NAS__Container__for__PS__HO_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NAS__Container__for__PS__HO_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.NAS_Container_for_PS_HO");
  }
  is_ifpresent = param.get_ifpresent();
}

void NAS__Container__for__PS__HO_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_typeOfCipheringAlgorithm.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.NAS_Container_for_PS_HO");
single_value->field_spare1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.NAS_Container_for_PS_HO");
single_value->field_oldXID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.NAS_Container_for_PS_HO");
single_value->field_spare2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.NAS_Container_for_PS_HO");
single_value->field_iOV__UI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.NAS_Container_for_PS_HO");
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.NAS_Container_for_PS_HO");
}

boolean NAS__Container__for__PS__HO_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean NAS__Container__for__PS__HO_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;
}

NAS__container__for__PS__Handover::NAS__container__for__PS__Handover()
{
}

NAS__container__for__PS__Handover::NAS__container__for__PS__Handover(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const NAS__Container__for__PS__HO& par_nAS__Container__for__PS__HO)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_nAS__Container__for__PS__HO(par_nAS__Container__for__PS__HO)
{
}

NAS__container__for__PS__Handover::NAS__container__for__PS__Handover(const NAS__container__for__PS__Handover& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.NAS_container_for_PS_Handover.");
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.nAS__Container__for__PS__HO().is_bound()) field_nAS__Container__for__PS__HO = other_value.nAS__Container__for__PS__HO();
else field_nAS__Container__for__PS__HO.clean_up();
}

void NAS__container__for__PS__Handover::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_nAS__Container__for__PS__HO.clean_up();
}

const TTCN_Typedescriptor_t* NAS__container__for__PS__Handover::get_descriptor() const { return &NAS__container__for__PS__Handover_descr_; }
NAS__container__for__PS__Handover& NAS__container__for__PS__Handover::operator=(const NAS__container__for__PS__Handover& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.NAS_container_for_PS_Handover.");
  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.nAS__Container__for__PS__HO().is_bound()) field_nAS__Container__for__PS__HO = other_value.nAS__Container__for__PS__HO();
  else field_nAS__Container__for__PS__HO.clean_up();
}
return *this;
}

boolean NAS__container__for__PS__Handover::operator==(const NAS__container__for__PS__Handover& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_nAS__Container__for__PS__HO==other_value.field_nAS__Container__for__PS__HO;
}

boolean NAS__container__for__PS__Handover::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_nAS__Container__for__PS__HO.is_bound());
}
boolean NAS__container__for__PS__Handover::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_nAS__Container__for__PS__HO.is_value();
}
void NAS__container__for__PS__Handover::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(", nAS_Container_for_PS_HO := ");
field_nAS__Container__for__PS__HO.log();
TTCN_Logger::log_event_str(" }");
}

void NAS__container__for__PS__Handover::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 (nAS__Container__for__PS__HO().is_bound()) nAS__Container__for__PS__HO().set_implicit_omit();
}

void NAS__container__for__PS__Handover::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.NAS_container_for_PS_Handover 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) nAS__Container__for__PS__HO().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(), "nAS_Container_for_PS_HO")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nAS__Container__for__PS__HO().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.NAS_container_for_PS_Handover: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.NAS_container_for_PS_Handover");
  }
}

void NAS__container__for__PS__Handover::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_nAS__Container__for__PS__HO.encode_text(text_buf);
}

void NAS__container__for__PS__Handover::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_nAS__Container__for__PS__HO.decode_text(text_buf);
}

void NAS__container__for__PS__Handover::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 NAS__container__for__PS__Handover::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 NAS__container__for__PS__Handover::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, NAS__container__for__PS__Handover_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(NAS__container__for__PS__Handover_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, NAS__container__for__PS__Handover_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(NAS__container__for__PS__Handover_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, NAS__Container__for__PS__HO_descr_.raw->forceomit);
  decoded_field_length = field_nAS__Container__for__PS__HO.RAW_decode(NAS__Container__for__PS__HO_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_110) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int NAS__container__for__PS__Handover::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, NAS__container__for__PS__Handover_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, NAS__container__for__PS__Handover_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, NAS__Container__for__PS__HO_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(NAS__container__for__PS__Handover_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(NAS__container__for__PS__Handover_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_nAS__Container__for__PS__HO.RAW_encode(NAS__Container__for__PS__HO_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(NAS__container__for__PS__Handover_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(NAS__container__for__PS__Handover_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_110) {
  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_110.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 NAS__container__for__PS__Handover_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
NAS__Container__for__PS__HO_template field_nAS__Container__for__PS__HO;
};

void NAS__container__for__PS__Handover_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_nAS__Container__for__PS__HO = ANY_VALUE;
}
}
}

void NAS__container__for__PS__Handover_template::copy_value(const NAS__container__for__PS__Handover& 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.nAS__Container__for__PS__HO().is_bound()) {
  single_value->field_nAS__Container__for__PS__HO = other_value.nAS__Container__for__PS__HO();
} else {
  single_value->field_nAS__Container__for__PS__HO.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void NAS__container__for__PS__Handover_template::copy_template(const NAS__container__for__PS__Handover_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.nAS__Container__for__PS__HO().get_selection()) {
single_value->field_nAS__Container__for__PS__HO = other_value.nAS__Container__for__PS__HO();
} else {
single_value->field_nAS__Container__for__PS__HO.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 NAS__container__for__PS__Handover_template[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 NAS__container__for__PS__Handover_template(*other_value.implication_.precondition);
implication_.implied_template = new NAS__container__for__PS__Handover_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.NAS_container_for_PS_Handover.");
break;
}
set_selection(other_value);
}

NAS__container__for__PS__Handover_template::NAS__container__for__PS__Handover_template()
{
}

NAS__container__for__PS__Handover_template::NAS__container__for__PS__Handover_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

NAS__container__for__PS__Handover_template::NAS__container__for__PS__Handover_template(const NAS__container__for__PS__Handover& other_value)
{
copy_value(other_value);
}

NAS__container__for__PS__Handover_template::NAS__container__for__PS__Handover_template(const OPTIONAL<NAS__container__for__PS__Handover>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NAS__container__for__PS__Handover&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.NAS_container_for_PS_Handover from an unbound optional field.");
}
}

NAS__container__for__PS__Handover_template::NAS__container__for__PS__Handover_template(NAS__container__for__PS__Handover_template* p_precondition, NAS__container__for__PS__Handover_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

NAS__container__for__PS__Handover_template::NAS__container__for__PS__Handover_template(Dynamic_Match_Interface<NAS__container__for__PS__Handover>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<NAS__container__for__PS__Handover>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

NAS__container__for__PS__Handover_template::NAS__container__for__PS__Handover_template(const NAS__container__for__PS__Handover_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

NAS__container__for__PS__Handover_template::~NAS__container__for__PS__Handover_template()
{
clean_up();
}

NAS__container__for__PS__Handover_template& NAS__container__for__PS__Handover_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

NAS__container__for__PS__Handover_template& NAS__container__for__PS__Handover_template::operator=(const NAS__container__for__PS__Handover& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

NAS__container__for__PS__Handover_template& NAS__container__for__PS__Handover_template::operator=(const OPTIONAL<NAS__container__for__PS__Handover>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const NAS__container__for__PS__Handover&)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.NAS_container_for_PS_Handover.");
}
return *this;
}

NAS__container__for__PS__Handover_template& NAS__container__for__PS__Handover_template::operator=(const NAS__container__for__PS__Handover_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean NAS__container__for__PS__Handover_template::match(const NAS__container__for__PS__Handover& 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.nAS__Container__for__PS__HO().is_bound()) return FALSE;
if(!single_value->field_nAS__Container__for__PS__HO.match(other_value.nAS__Container__for__PS__HO(), 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.NAS_container_for_PS_Handover.");
}
return FALSE;
}

boolean NAS__container__for__PS__Handover_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_nAS__Container__for__PS__HO.is_bound();
}

boolean NAS__container__for__PS__Handover_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_nAS__Container__for__PS__HO.is_value();
}

void NAS__container__for__PS__Handover_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;
}

NAS__container__for__PS__Handover NAS__container__for__PS__Handover_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.NAS_container_for_PS_Handover.");
NAS__container__for__PS__Handover 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_nAS__Container__for__PS__HO.is_bound()) {
ret_val.nAS__Container__for__PS__HO() = single_value->field_nAS__Container__for__PS__HO.valueof();
}
return ret_val;
}

void NAS__container__for__PS__Handover_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.NAS_container_for_PS_Handover.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NAS__container__for__PS__Handover_template[list_length];
}

NAS__container__for__PS__Handover_template& NAS__container__for__PS__Handover_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.NAS_container_for_PS_Handover.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.NAS_container_for_PS_Handover.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& NAS__container__for__PS__Handover_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& NAS__container__for__PS__Handover_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.NAS_container_for_PS_Handover.");
return single_value->field_iEI;
}

BITSTRING_template& NAS__container__for__PS__Handover_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& NAS__container__for__PS__Handover_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.NAS_container_for_PS_Handover.");
return single_value->field_ext;
}

LIN2__2a_template& NAS__container__for__PS__Handover_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& NAS__container__for__PS__Handover_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.NAS_container_for_PS_Handover.");
return single_value->field_lengthIndicator;
}

NAS__Container__for__PS__HO_template& NAS__container__for__PS__Handover_template::nAS__Container__for__PS__HO()
{
set_specific();
return single_value->field_nAS__Container__for__PS__HO;
}

const NAS__Container__for__PS__HO_template& NAS__container__for__PS__Handover_template::nAS__Container__for__PS__HO() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nAS_Container_for_PS_HO of a non-specific template of type @BSSGP_Types.NAS_container_for_PS_Handover.");
return single_value->field_nAS__Container__for__PS__HO;
}

int NAS__container__for__PS__Handover_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_container_for_PS_Handover 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.NAS_container_for_PS_Handover 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.NAS_container_for_PS_Handover 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.NAS_container_for_PS_Handover containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_container_for_PS_Handover containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_container_for_PS_Handover containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_container_for_PS_Handover containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_container_for_PS_Handover containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.NAS_container_for_PS_Handover containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.NAS_container_for_PS_Handover.");
  }
  return 0;
}

void NAS__container__for__PS__Handover_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(", nAS_Container_for_PS_HO := ");
single_value->field_nAS__Container__for__PS__HO.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 NAS__container__for__PS__Handover_template::log_match(const NAS__container__for__PS__Handover& 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_nAS__Container__for__PS__HO.match(match_value.nAS__Container__for__PS__HO(), legacy)){
TTCN_Logger::log_logmatch_info(".nAS_Container_for_PS_HO");
single_value->field_nAS__Container__for__PS__HO.log_match(match_value.nAS__Container__for__PS__HO(), 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(", nAS_Container_for_PS_HO := ");
single_value->field_nAS__Container__for__PS__HO.log_match(match_value.nAS__Container__for__PS__HO(), 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 NAS__container__for__PS__Handover_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_nAS__Container__for__PS__HO.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.NAS_container_for_PS_Handover.");
}
}

void NAS__container__for__PS__Handover_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_nAS__Container__for__PS__HO.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 NAS__container__for__PS__Handover_template[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.NAS_container_for_PS_Handover.");
}
}

void NAS__container__for__PS__Handover_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: {
    NAS__container__for__PS__Handover_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.NAS_container_for_PS_Handover 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) nAS__Container__for__PS__HO().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(), "nAS_Container_for_PS_HO")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nAS__Container__for__PS__HO().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.NAS_container_for_PS_Handover: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    NAS__container__for__PS__Handover_template* precondition = new NAS__container__for__PS__Handover_template;
    precondition->set_param(*param.get_elem(0));
    NAS__container__for__PS__Handover_template* implied_template = new NAS__container__for__PS__Handover_template;
    implied_template->set_param(*param.get_elem(1));
    *this = NAS__container__for__PS__Handover_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.NAS_container_for_PS_Handover");
  }
  is_ifpresent = param.get_ifpresent();
}

void NAS__container__for__PS__Handover_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.NAS_container_for_PS_Handover");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.NAS_container_for_PS_Handover");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.NAS_container_for_PS_Handover");
single_value->field_nAS__Container__for__PS__HO.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.NAS_container_for_PS_Handover");
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.NAS_container_for_PS_Handover");
}

boolean NAS__container__for__PS__Handover_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean NAS__container__for__PS__Handover_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 Single__PFC__BSSGP Multiple__PFCs__BSSGP::UNBOUND_ELEM;
Multiple__PFCs__BSSGP::Multiple__PFCs__BSSGP()
{
val_ptr = NULL;
}

Multiple__PFCs__BSSGP::Multiple__PFCs__BSSGP(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

Multiple__PFCs__BSSGP::Multiple__PFCs__BSSGP(const Multiple__PFCs__BSSGP& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

Multiple__PFCs__BSSGP::~Multiple__PFCs__BSSGP()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void Multiple__PFCs__BSSGP::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.");
}
}

Multiple__PFCs__BSSGP& Multiple__PFCs__BSSGP::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;
}

Multiple__PFCs__BSSGP& Multiple__PFCs__BSSGP::operator=(const Multiple__PFCs__BSSGP& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean Multiple__PFCs__BSSGP::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
return val_ptr->n_elements == 0 ;
}

boolean Multiple__PFCs__BSSGP::operator==(const Multiple__PFCs__BSSGP& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
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;
}

Single__PFC__BSSGP& Multiple__PFCs__BSSGP::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.Multiple_PFCs_BSSGP 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 = (Single__PFC__BSSGP**)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 Single__PFC__BSSGP(*(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 Single__PFC__BSSGP;
}
return *val_ptr->value_elements[index_value];
}

Single__PFC__BSSGP& Multiple__PFCs__BSSGP::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
return (*this)[(int)index_value];
}

const Single__PFC__BSSGP& Multiple__PFCs__BSSGP::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.Multiple_PFCs_BSSGP 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.Multiple_PFCs_BSSGP: 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 Single__PFC__BSSGP& Multiple__PFCs__BSSGP::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
return (*this)[(int)index_value];
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
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;
Multiple__PFCs__BSSGP 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 Single__PFC__BSSGP(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP::operator+(const Multiple__PFCs__BSSGP& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BSSGP_Types.Multiple_PFCs_BSSGP concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
Multiple__PFCs__BSSGP 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 Single__PFC__BSSGP(*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 Single__PFC__BSSGP(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP::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.Multiple_PFCs_BSSGP.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Types.Multiple_PFCs_BSSGP","element");
Multiple__PFCs__BSSGP 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 Single__PFC__BSSGP(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP::replace(int index, int len, const Multiple__PFCs__BSSGP& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BSSGP_Types.Multiple_PFCs_BSSGP","element");
Multiple__PFCs__BSSGP 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 Single__PFC__BSSGP(*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 Single__PFC__BSSGP(*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 Single__PFC__BSSGP(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP::replace(int index, int len, const Multiple__PFCs__BSSGP_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 Multiple__PFCs__BSSGP::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
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 = (Single__PFC__BSSGP**)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 Single__PFC__BSSGP(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (Single__PFC__BSSGP**)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.Multiple_PFCs_BSSGP: %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 = (Single__PFC__BSSGP**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean Multiple__PFCs__BSSGP::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 Multiple__PFCs__BSSGP::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
return val_ptr->n_elements;
}

int Multiple__PFCs__BSSGP::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
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 Multiple__PFCs__BSSGP::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 Multiple__PFCs__BSSGP::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 Multiple__PFCs__BSSGP::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.Multiple_PFCs_BSSGP");
    }
    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.Multiple_PFCs_BSSGP");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void Multiple__PFCs__BSSGP::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
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 Multiple__PFCs__BSSGP::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.Multiple_PFCs_BSSGP.");
val_ptr->value_elements = (Single__PFC__BSSGP**)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 Single__PFC__BSSGP;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void Multiple__PFCs__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 Multiple__PFCs__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 Multiple__PFCs__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 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 Multiple__PFCs__BSSGP::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 Multiple__PFCs__BSSGP_template::copy_value(const Multiple__PFCs__BSSGP& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Types.Multiple_PFCs_BSSGP with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (Single__PFC__BSSGP_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 Single__PFC__BSSGP_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new Single__PFC__BSSGP_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void Multiple__PFCs__BSSGP_template::copy_template(const Multiple__PFCs__BSSGP_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 = (Single__PFC__BSSGP_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 Single__PFC__BSSGP_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new Single__PFC__BSSGP_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 Multiple__PFCs__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 Multiple__PFCs__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Multiple__PFCs__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.Multiple_PFCs_BSSGP.");
break;
}
set_selection(other_value);
}

boolean Multiple__PFCs__BSSGP_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 Multiple__PFCs__BSSGP_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const Multiple__PFCs__BSSGP*)value_ptr)[value_index], legacy);
else return ((const Multiple__PFCs__BSSGP_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

Multiple__PFCs__BSSGP_template::Multiple__PFCs__BSSGP_template()
{
}

Multiple__PFCs__BSSGP_template::Multiple__PFCs__BSSGP_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

Multiple__PFCs__BSSGP_template::Multiple__PFCs__BSSGP_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

Multiple__PFCs__BSSGP_template::Multiple__PFCs__BSSGP_template(const Multiple__PFCs__BSSGP& other_value)
{
copy_value(other_value);
}

Multiple__PFCs__BSSGP_template::Multiple__PFCs__BSSGP_template(const OPTIONAL<Multiple__PFCs__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Multiple__PFCs__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Multiple_PFCs_BSSGP from an unbound optional field.");
}
}

Multiple__PFCs__BSSGP_template::Multiple__PFCs__BSSGP_template(Multiple__PFCs__BSSGP_template* p_precondition, Multiple__PFCs__BSSGP_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Multiple__PFCs__BSSGP_template::Multiple__PFCs__BSSGP_template(Dynamic_Match_Interface<Multiple__PFCs__BSSGP>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Multiple__PFCs__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Multiple__PFCs__BSSGP_template::Multiple__PFCs__BSSGP_template(const Multiple__PFCs__BSSGP_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

Multiple__PFCs__BSSGP_template::~Multiple__PFCs__BSSGP_template()
{
clean_up();
}

void Multiple__PFCs__BSSGP_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;
}

Multiple__PFCs__BSSGP_template& Multiple__PFCs__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Multiple__PFCs__BSSGP_template& Multiple__PFCs__BSSGP_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

Multiple__PFCs__BSSGP_template& Multiple__PFCs__BSSGP_template::operator=(const Multiple__PFCs__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Multiple__PFCs__BSSGP_template& Multiple__PFCs__BSSGP_template::operator=(const OPTIONAL<Multiple__PFCs__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Multiple__PFCs__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.Multiple_PFCs_BSSGP.");
}
return *this;
}

Multiple__PFCs__BSSGP_template& Multiple__PFCs__BSSGP_template::operator=(const Multiple__PFCs__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

Single__PFC__BSSGP_template& Multiple__PFCs__BSSGP_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.Multiple_PFCs_BSSGP 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.Multiple_PFCs_BSSGP.");
    break;
}
return *single_value.value_elements[index_value];
}

Single__PFC__BSSGP_template& Multiple__PFCs__BSSGP_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
return (*this)[(int)index_value];
}

const Single__PFC__BSSGP_template& Multiple__PFCs__BSSGP_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.Multiple_PFCs_BSSGP 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.Multiple_PFCs_BSSGP.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Types.Multiple_PFCs_BSSGP: 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 Single__PFC__BSSGP_template& Multiple__PFCs__BSSGP_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
return (*this)[(int)index_value];
}

void Multiple__PFCs__BSSGP_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.Multiple_PFCs_BSSGP.");
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 = (Single__PFC__BSSGP_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 Single__PFC__BSSGP_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 Single__PFC__BSSGP_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 = (Single__PFC__BSSGP_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int Multiple__PFCs__BSSGP_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 Multiple__PFCs__BSSGP_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.Multiple_PFCs_BSSGP 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.Multiple_PFCs_BSSGP 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.Multiple_PFCs_BSSGP 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.Multiple_PFCs_BSSGP 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.Multiple_PFCs_BSSGP 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.Multiple_PFCs_BSSGP containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Multiple_PFCs_BSSGP.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BSSGP_Types.Multiple_PFCs_BSSGP");
}

boolean Multiple__PFCs__BSSGP_template::match(const Multiple__PFCs__BSSGP& 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.Multiple_PFCs_BSSGP.");
}
return FALSE;
}

boolean Multiple__PFCs__BSSGP_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;
}

Multiple__PFCs__BSSGP Multiple__PFCs__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.Multiple_PFCs_BSSGP.");
Multiple__PFCs__BSSGP 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;
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP_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);
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP_template::replace(int index, int len, const Multiple__PFCs__BSSGP_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());
}

Multiple__PFCs__BSSGP Multiple__PFCs__BSSGP_template::replace(int index, int len, const Multiple__PFCs__BSSGP& 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 Multiple__PFCs__BSSGP_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 Multiple__PFCs__BSSGP_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
}
set_selection(template_type);
}

Multiple__PFCs__BSSGP_template& Multiple__PFCs__BSSGP_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.Multiple_PFCs_BSSGP.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
return value_list.list_value[list_index];
}

void Multiple__PFCs__BSSGP_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 Multiple__PFCs__BSSGP_template::log_match(const Multiple__PFCs__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 && 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 Multiple__PFCs__BSSGP_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.Multiple_PFCs_BSSGP.");
}
}

void Multiple__PFCs__BSSGP_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.Multiple_PFCs_BSSGP.");
single_value.value_elements = (Single__PFC__BSSGP_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 Single__PFC__BSSGP_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 Multiple__PFCs__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 for a template of type @BSSGP_Types.Multiple_PFCs_BSSGP.");
}
}

boolean Multiple__PFCs__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Multiple__PFCs__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 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 Multiple__PFCs__BSSGP_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: {
    Multiple__PFCs__BSSGP_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: {
    Multiple__PFCs__BSSGP_template* precondition = new Multiple__PFCs__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Multiple__PFCs__BSSGP_template* implied_template = new Multiple__PFCs__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Multiple__PFCs__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BSSGP_Types.Multiple_PFCs_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void Multiple__PFCs__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;
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.Multiple_PFCs_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.Multiple_PFCs_BSSGP");
}

boolean Multiple__PFCs__BSSGP_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);
}
}
Single__PFC__BSSGP::Single__PFC__BSSGP()
{
}

Single__PFC__BSSGP::Single__PFC__BSSGP(const PFI& par_pFI,
    const GPRS__Timer& par_pFT,
    const ABQP& par_aBQP,
    const OPTIONAL< Priority__BSSGP >& par_allocation__Retention__Priority,
    const OPTIONAL< GPRS__Timer >& par_t10)
  :   field_pFI(par_pFI),
  field_pFT(par_pFT),
  field_aBQP(par_aBQP),
  field_allocation__Retention__Priority(par_allocation__Retention__Priority),
  field_t10(par_t10)
{
}

Single__PFC__BSSGP::Single__PFC__BSSGP(const Single__PFC__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Single_PFC_BSSGP.");
if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
else field_pFI.clean_up();
if (other_value.pFT().is_bound()) field_pFT = other_value.pFT();
else field_pFT.clean_up();
if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
else field_aBQP.clean_up();
if (other_value.allocation__Retention__Priority().is_bound()) field_allocation__Retention__Priority = other_value.allocation__Retention__Priority();
else field_allocation__Retention__Priority.clean_up();
if (other_value.t10().is_bound()) field_t10 = other_value.t10();
else field_t10.clean_up();
}

void Single__PFC__BSSGP::clean_up()
{
field_pFI.clean_up();
field_pFT.clean_up();
field_aBQP.clean_up();
field_allocation__Retention__Priority.clean_up();
field_t10.clean_up();
}

const TTCN_Typedescriptor_t* Single__PFC__BSSGP::get_descriptor() const { return &Single__PFC__BSSGP_descr_; }
Single__PFC__BSSGP& Single__PFC__BSSGP::operator=(const Single__PFC__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Single_PFC_BSSGP.");
  if (other_value.pFI().is_bound()) field_pFI = other_value.pFI();
  else field_pFI.clean_up();
  if (other_value.pFT().is_bound()) field_pFT = other_value.pFT();
  else field_pFT.clean_up();
  if (other_value.aBQP().is_bound()) field_aBQP = other_value.aBQP();
  else field_aBQP.clean_up();
  if (other_value.allocation__Retention__Priority().is_bound()) field_allocation__Retention__Priority = other_value.allocation__Retention__Priority();
  else field_allocation__Retention__Priority.clean_up();
  if (other_value.t10().is_bound()) field_t10 = other_value.t10();
  else field_t10.clean_up();
}
return *this;
}

boolean Single__PFC__BSSGP::operator==(const Single__PFC__BSSGP& other_value) const
{
return field_pFI==other_value.field_pFI
  && field_pFT==other_value.field_pFT
  && field_aBQP==other_value.field_aBQP
  && field_allocation__Retention__Priority==other_value.field_allocation__Retention__Priority
  && field_t10==other_value.field_t10;
}

boolean Single__PFC__BSSGP::is_bound() const
{
return (field_pFI.is_bound())
  || (field_pFT.is_bound())
  || (field_aBQP.is_bound())
  || (OPTIONAL_OMIT == field_allocation__Retention__Priority.get_selection() || field_allocation__Retention__Priority.is_bound())
  || (OPTIONAL_OMIT == field_t10.get_selection() || field_t10.is_bound());
}
boolean Single__PFC__BSSGP::is_value() const
{
return field_pFI.is_value()
  && field_pFT.is_value()
  && field_aBQP.is_value()
  && (OPTIONAL_OMIT == field_allocation__Retention__Priority.get_selection() || field_allocation__Retention__Priority.is_value())
  && (OPTIONAL_OMIT == field_t10.get_selection() || field_t10.is_value());
}
int Single__PFC__BSSGP::size_of() const
{
  int ret_val = 3;
  if (field_allocation__Retention__Priority.ispresent()) ret_val++;
  if (field_t10.ispresent()) ret_val++;
  return ret_val;
}

void Single__PFC__BSSGP::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ pFI := ");
field_pFI.log();
TTCN_Logger::log_event_str(", pFT := ");
field_pFT.log();
TTCN_Logger::log_event_str(", aBQP := ");
field_aBQP.log();
TTCN_Logger::log_event_str(", allocation_Retention_Priority := ");
field_allocation__Retention__Priority.log();
TTCN_Logger::log_event_str(", t10 := ");
field_t10.log();
TTCN_Logger::log_event_str(" }");
}

void Single__PFC__BSSGP::set_implicit_omit()
{
if (pFI().is_bound()) pFI().set_implicit_omit();
if (pFT().is_bound()) pFT().set_implicit_omit();
if (aBQP().is_bound()) aBQP().set_implicit_omit();
if (!allocation__Retention__Priority().is_bound()) allocation__Retention__Priority() = OMIT_VALUE;
else allocation__Retention__Priority().set_implicit_omit();
if (!t10().is_bound()) t10() = OMIT_VALUE;
else t10().set_implicit_omit();
}

void Single__PFC__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 (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Single_PFC_BSSGP 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) pFI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pFT().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) aBQP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) allocation__Retention__Priority().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) t10().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(), "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(), "pFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "allocation_Retention_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocation__Retention__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(), "t10")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t10().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Single_PFC_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Single_PFC_BSSGP");
  }
}

void Single__PFC__BSSGP::encode_text(Text_Buf& text_buf) const
{
field_pFI.encode_text(text_buf);
field_pFT.encode_text(text_buf);
field_aBQP.encode_text(text_buf);
field_allocation__Retention__Priority.encode_text(text_buf);
field_t10.encode_text(text_buf);
}

void Single__PFC__BSSGP::decode_text(Text_Buf& text_buf)
{
field_pFI.decode_text(text_buf);
field_pFT.decode_text(text_buf);
field_aBQP.decode_text(text_buf);
field_allocation__Retention__Priority.decode_text(text_buf);
field_t10.decode_text(text_buf);
}

void Single__PFC__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 Single__PFC__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 Single__PFC__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, PFI_descr_.raw->forceomit);
  decoded_field_length = field_pFI.RAW_decode(PFI_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, GPRS__Timer_descr_.raw->forceomit);
  decoded_field_length = field_pFT.RAW_decode(GPRS__Timer_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, ABQP_descr_.raw->forceomit);
  decoded_field_length = field_aBQP.RAW_decode(ABQP_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_allocation__Retention__Priority = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, Priority__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_allocation__Retention__Priority().RAW_decode(Priority__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_allocation__Retention__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_allocation__Retention__Priority=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_t10 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, GPRS__Timer_descr_.raw->forceomit);
  decoded_field_length = field_t10().RAW_decode(GPRS__Timer_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_t10 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_t10=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Single__PFC__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 = 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, PFI_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GPRS__Timer_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ABQP_descr_.raw);
  if (field_allocation__Retention__Priority.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Priority__BSSGP_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_t10.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, GPRS__Timer_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_pFI.RAW_encode(PFI_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pFT.RAW_encode(GPRS__Timer_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_aBQP.RAW_encode(ABQP_descr_, *myleaf.body.node.nodes[2]);
  if (field_allocation__Retention__Priority.ispresent()) {
  encoded_length += field_allocation__Retention__Priority().RAW_encode(Priority__BSSGP_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_t10.ispresent()) {
  encoded_length += field_t10().RAW_encode(GPRS__Timer_descr_, *myleaf.body.node.nodes[4]);
  }
  return myleaf.length = encoded_length;
}

struct Single__PFC__BSSGP_template::single_value_struct {
PFI_template field_pFI;
GPRS__Timer_template field_pFT;
ABQP_template field_aBQP;
Priority__BSSGP_template field_allocation__Retention__Priority;
GPRS__Timer_template field_t10;
};

void Single__PFC__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_pFI = ANY_VALUE;
single_value->field_pFT = ANY_VALUE;
single_value->field_aBQP = ANY_VALUE;
single_value->field_allocation__Retention__Priority = ANY_OR_OMIT;
single_value->field_t10 = ANY_OR_OMIT;
}
}
}

void Single__PFC__BSSGP_template::copy_value(const Single__PFC__BSSGP& other_value)
{
single_value = new single_value_struct;
if (other_value.pFI().is_bound()) {
  single_value->field_pFI = other_value.pFI();
} else {
  single_value->field_pFI.clean_up();
}
if (other_value.pFT().is_bound()) {
  single_value->field_pFT = other_value.pFT();
} else {
  single_value->field_pFT.clean_up();
}
if (other_value.aBQP().is_bound()) {
  single_value->field_aBQP = other_value.aBQP();
} else {
  single_value->field_aBQP.clean_up();
}
if (other_value.allocation__Retention__Priority().is_bound()) {
  if (other_value.allocation__Retention__Priority().ispresent()) single_value->field_allocation__Retention__Priority = other_value.allocation__Retention__Priority()();
  else single_value->field_allocation__Retention__Priority = OMIT_VALUE;
} else {
  single_value->field_allocation__Retention__Priority.clean_up();
}
if (other_value.t10().is_bound()) {
  if (other_value.t10().ispresent()) single_value->field_t10 = other_value.t10()();
  else single_value->field_t10 = OMIT_VALUE;
} else {
  single_value->field_t10.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Single__PFC__BSSGP_template::copy_template(const Single__PFC__BSSGP_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
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.pFT().get_selection()) {
single_value->field_pFT = other_value.pFT();
} else {
single_value->field_pFT.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.allocation__Retention__Priority().get_selection()) {
single_value->field_allocation__Retention__Priority = other_value.allocation__Retention__Priority();
} else {
single_value->field_allocation__Retention__Priority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t10().get_selection()) {
single_value->field_t10 = other_value.t10();
} else {
single_value->field_t10.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 Single__PFC__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 Single__PFC__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Single__PFC__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.Single_PFC_BSSGP.");
break;
}
set_selection(other_value);
}

Single__PFC__BSSGP_template::Single__PFC__BSSGP_template()
{
}

Single__PFC__BSSGP_template::Single__PFC__BSSGP_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Single__PFC__BSSGP_template::Single__PFC__BSSGP_template(const Single__PFC__BSSGP& other_value)
{
copy_value(other_value);
}

Single__PFC__BSSGP_template::Single__PFC__BSSGP_template(const OPTIONAL<Single__PFC__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Single__PFC__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Single_PFC_BSSGP from an unbound optional field.");
}
}

Single__PFC__BSSGP_template::Single__PFC__BSSGP_template(Single__PFC__BSSGP_template* p_precondition, Single__PFC__BSSGP_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Single__PFC__BSSGP_template::Single__PFC__BSSGP_template(Dynamic_Match_Interface<Single__PFC__BSSGP>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Single__PFC__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Single__PFC__BSSGP_template::Single__PFC__BSSGP_template(const Single__PFC__BSSGP_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Single__PFC__BSSGP_template::~Single__PFC__BSSGP_template()
{
clean_up();
}

Single__PFC__BSSGP_template& Single__PFC__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Single__PFC__BSSGP_template& Single__PFC__BSSGP_template::operator=(const Single__PFC__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Single__PFC__BSSGP_template& Single__PFC__BSSGP_template::operator=(const OPTIONAL<Single__PFC__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Single__PFC__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.Single_PFC_BSSGP.");
}
return *this;
}

Single__PFC__BSSGP_template& Single__PFC__BSSGP_template::operator=(const Single__PFC__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Single__PFC__BSSGP_template::match(const Single__PFC__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.pFI().is_bound()) return FALSE;
if(!single_value->field_pFI.match(other_value.pFI(), legacy))return FALSE;
if(!other_value.pFT().is_bound()) return FALSE;
if(!single_value->field_pFT.match(other_value.pFT(), legacy))return FALSE;
if(!other_value.aBQP().is_bound()) return FALSE;
if(!single_value->field_aBQP.match(other_value.aBQP(), legacy))return FALSE;
if(!other_value.allocation__Retention__Priority().is_bound()) return FALSE;
if((other_value.allocation__Retention__Priority().ispresent() ? !single_value->field_allocation__Retention__Priority.match((const Priority__BSSGP&)other_value.allocation__Retention__Priority(), legacy) : !single_value->field_allocation__Retention__Priority.match_omit(legacy)))return FALSE;
if(!other_value.t10().is_bound()) return FALSE;
if((other_value.t10().ispresent() ? !single_value->field_t10.match((const GPRS__Timer&)other_value.t10(), legacy) : !single_value->field_t10.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.Single_PFC_BSSGP.");
}
return FALSE;
}

boolean Single__PFC__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_pFI.is_bound()
 || single_value->field_pFT.is_bound()
 || single_value->field_aBQP.is_bound()
 || (single_value->field_allocation__Retention__Priority.is_omit() || single_value->field_allocation__Retention__Priority.is_bound())
 || (single_value->field_t10.is_omit() || single_value->field_t10.is_bound());
}

boolean Single__PFC__BSSGP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_pFI.is_value()
 && single_value->field_pFT.is_value()
 && single_value->field_aBQP.is_value()
 && (single_value->field_allocation__Retention__Priority.is_omit() || single_value->field_allocation__Retention__Priority.is_value())
 && (single_value->field_t10.is_omit() || single_value->field_t10.is_value());
}

void Single__PFC__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;
}

Single__PFC__BSSGP Single__PFC__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.Single_PFC_BSSGP.");
Single__PFC__BSSGP ret_val;
if (single_value->field_pFI.is_bound()) {
ret_val.pFI() = single_value->field_pFI.valueof();
}
if (single_value->field_pFT.is_bound()) {
ret_val.pFT() = single_value->field_pFT.valueof();
}
if (single_value->field_aBQP.is_bound()) {
ret_val.aBQP() = single_value->field_aBQP.valueof();
}
if (single_value->field_allocation__Retention__Priority.is_omit()) ret_val.allocation__Retention__Priority() = OMIT_VALUE;
else if (single_value->field_allocation__Retention__Priority.is_bound()) {
ret_val.allocation__Retention__Priority() = single_value->field_allocation__Retention__Priority.valueof();
}
if (single_value->field_t10.is_omit()) ret_val.t10() = OMIT_VALUE;
else if (single_value->field_t10.is_bound()) {
ret_val.t10() = single_value->field_t10.valueof();
}
return ret_val;
}

void Single__PFC__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.Single_PFC_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Single__PFC__BSSGP_template[list_length];
}

Single__PFC__BSSGP_template& Single__PFC__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.Single_PFC_BSSGP.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Single_PFC_BSSGP.");
return value_list.list_value[list_index];
}

PFI_template& Single__PFC__BSSGP_template::pFI()
{
set_specific();
return single_value->field_pFI;
}

const PFI_template& Single__PFC__BSSGP_template::pFI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI of a non-specific template of type @BSSGP_Types.Single_PFC_BSSGP.");
return single_value->field_pFI;
}

GPRS__Timer_template& Single__PFC__BSSGP_template::pFT()
{
set_specific();
return single_value->field_pFT;
}

const GPRS__Timer_template& Single__PFC__BSSGP_template::pFT() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFT of a non-specific template of type @BSSGP_Types.Single_PFC_BSSGP.");
return single_value->field_pFT;
}

ABQP_template& Single__PFC__BSSGP_template::aBQP()
{
set_specific();
return single_value->field_aBQP;
}

const ABQP_template& Single__PFC__BSSGP_template::aBQP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aBQP of a non-specific template of type @BSSGP_Types.Single_PFC_BSSGP.");
return single_value->field_aBQP;
}

Priority__BSSGP_template& Single__PFC__BSSGP_template::allocation__Retention__Priority()
{
set_specific();
return single_value->field_allocation__Retention__Priority;
}

const Priority__BSSGP_template& Single__PFC__BSSGP_template::allocation__Retention__Priority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field allocation_Retention_Priority of a non-specific template of type @BSSGP_Types.Single_PFC_BSSGP.");
return single_value->field_allocation__Retention__Priority;
}

GPRS__Timer_template& Single__PFC__BSSGP_template::t10()
{
set_specific();
return single_value->field_t10;
}

const GPRS__Timer_template& Single__PFC__BSSGP_template::t10() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t10 of a non-specific template of type @BSSGP_Types.Single_PFC_BSSGP.");
return single_value->field_t10;
}

int Single__PFC__BSSGP_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFC_BSSGP which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_allocation__Retention__Priority.is_present()) ret_val++;
      if (single_value->field_t10.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.Single_PFC_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.Single_PFC_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.Single_PFC_BSSGP containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFC_BSSGP containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFC_BSSGP containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFC_BSSGP containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFC_BSSGP containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFC_BSSGP containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Single_PFC_BSSGP.");
  }
  return 0;
}

void Single__PFC__BSSGP_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ pFI := ");
single_value->field_pFI.log();
TTCN_Logger::log_event_str(", pFT := ");
single_value->field_pFT.log();
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log();
TTCN_Logger::log_event_str(", allocation_Retention_Priority := ");
single_value->field_allocation__Retention__Priority.log();
TTCN_Logger::log_event_str(", t10 := ");
single_value->field_t10.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 Single__PFC__BSSGP_template::log_match(const Single__PFC__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_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);
}
if(!single_value->field_pFT.match(match_value.pFT(), legacy)){
TTCN_Logger::log_logmatch_info(".pFT");
single_value->field_pFT.log_match(match_value.pFT(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
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);
}
if (match_value.allocation__Retention__Priority().ispresent()){
if(!single_value->field_allocation__Retention__Priority.match(match_value.allocation__Retention__Priority(), legacy)){
TTCN_Logger::log_logmatch_info(".allocation_Retention_Priority");
single_value->field_allocation__Retention__Priority.log_match(match_value.allocation__Retention__Priority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_allocation__Retention__Priority.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".allocation_Retention_Priority := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_allocation__Retention__Priority.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t10().ispresent()){
if(!single_value->field_t10.match(match_value.t10(), legacy)){
TTCN_Logger::log_logmatch_info(".t10");
single_value->field_t10.log_match(match_value.t10(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t10.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t10 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t10.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("{ pFI := ");
single_value->field_pFI.log_match(match_value.pFI(), legacy);
TTCN_Logger::log_event_str(", pFT := ");
single_value->field_pFT.log_match(match_value.pFT(), legacy);
TTCN_Logger::log_event_str(", aBQP := ");
single_value->field_aBQP.log_match(match_value.aBQP(), legacy);
TTCN_Logger::log_event_str(", allocation_Retention_Priority := ");
if (match_value.allocation__Retention__Priority().ispresent()) {
single_value->field_allocation__Retention__Priority.log_match(match_value.allocation__Retention__Priority(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_allocation__Retention__Priority.log();
if (single_value->field_allocation__Retention__Priority.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t10 := ");
if (match_value.t10().ispresent()) {
single_value->field_t10.log_match(match_value.t10(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t10.log();
if (single_value->field_t10.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 Single__PFC__BSSGP_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_pFI.encode_text(text_buf);
single_value->field_pFT.encode_text(text_buf);
single_value->field_aBQP.encode_text(text_buf);
single_value->field_allocation__Retention__Priority.encode_text(text_buf);
single_value->field_t10.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.Single_PFC_BSSGP.");
}
}

void Single__PFC__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_pFI.decode_text(text_buf);
single_value->field_pFT.decode_text(text_buf);
single_value->field_aBQP.decode_text(text_buf);
single_value->field_allocation__Retention__Priority.decode_text(text_buf);
single_value->field_t10.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 Single__PFC__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.Single_PFC_BSSGP.");
}
}

void Single__PFC__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: {
    Single__PFC__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 (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Single_PFC_BSSGP 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) pFI().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pFT().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) aBQP().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) allocation__Retention__Priority().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) t10().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(), "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(), "pFT")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFT().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "allocation_Retention_Priority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocation__Retention__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(), "t10")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t10().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Single_PFC_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Single__PFC__BSSGP_template* precondition = new Single__PFC__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Single__PFC__BSSGP_template* implied_template = new Single__PFC__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Single__PFC__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Single_PFC_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void Single__PFC__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_pFI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Single_PFC_BSSGP");
single_value->field_pFT.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Single_PFC_BSSGP");
single_value->field_aBQP.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Single_PFC_BSSGP");
single_value->field_allocation__Retention__Priority.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Single_PFC_BSSGP");
single_value->field_t10.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Single_PFC_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.Single_PFC_BSSGP");
}

boolean Single__PFC__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Single__PFC__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;
}

PFCs__to__be__set__up__list::PFCs__to__be__set__up__list()
{
}

PFCs__to__be__set__up__list::PFCs__to__be__set__up__list(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const INTEGER& par_number__of__PFCs,
    const Multiple__PFCs__BSSGP& par_pFCs)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_number__of__PFCs(par_number__of__PFCs),
  field_pFCs(par_pFCs)
{
}

PFCs__to__be__set__up__list::PFCs__to__be__set__up__list(const PFCs__to__be__set__up__list& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.PFCs_to_be_set_up_list.");
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.number__of__PFCs().is_bound()) field_number__of__PFCs = other_value.number__of__PFCs();
else field_number__of__PFCs.clean_up();
if (other_value.pFCs().is_bound()) field_pFCs = other_value.pFCs();
else field_pFCs.clean_up();
}

void PFCs__to__be__set__up__list::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_number__of__PFCs.clean_up();
field_pFCs.clean_up();
}

const TTCN_Typedescriptor_t* PFCs__to__be__set__up__list::get_descriptor() const { return &PFCs__to__be__set__up__list_descr_; }
PFCs__to__be__set__up__list& PFCs__to__be__set__up__list::operator=(const PFCs__to__be__set__up__list& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.PFCs_to_be_set_up_list.");
  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.number__of__PFCs().is_bound()) field_number__of__PFCs = other_value.number__of__PFCs();
  else field_number__of__PFCs.clean_up();
  if (other_value.pFCs().is_bound()) field_pFCs = other_value.pFCs();
  else field_pFCs.clean_up();
}
return *this;
}

boolean PFCs__to__be__set__up__list::operator==(const PFCs__to__be__set__up__list& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_number__of__PFCs==other_value.field_number__of__PFCs
  && field_pFCs==other_value.field_pFCs;
}

boolean PFCs__to__be__set__up__list::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_number__of__PFCs.is_bound())
  || (field_pFCs.is_bound());
}
boolean PFCs__to__be__set__up__list::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_number__of__PFCs.is_value()
  && field_pFCs.is_value();
}
void PFCs__to__be__set__up__list::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(", number_of_PFCs := ");
field_number__of__PFCs.log();
TTCN_Logger::log_event_str(", pFCs := ");
field_pFCs.log();
TTCN_Logger::log_event_str(" }");
}

void PFCs__to__be__set__up__list::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 (number__of__PFCs().is_bound()) number__of__PFCs().set_implicit_omit();
if (pFCs().is_bound()) pFCs().set_implicit_omit();
}

void PFCs__to__be__set__up__list::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.PFCs_to_be_set_up_list 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) number__of__PFCs().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFCs().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(), "number_of_PFCs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PFCs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFCs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFCs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.PFCs_to_be_set_up_list: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.PFCs_to_be_set_up_list");
  }
}

void PFCs__to__be__set__up__list::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_number__of__PFCs.encode_text(text_buf);
field_pFCs.encode_text(text_buf);
}

void PFCs__to__be__set__up__list::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_number__of__PFCs.decode_text(text_buf);
field_pFCs.decode_text(text_buf);
}

void PFCs__to__be__set__up__list::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 PFCs__to__be__set__up__list::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 PFCs__to__be__set__up__list::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;
  int value_of_length_field3 = 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, PFCs__to__be__set__up__list_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(PFCs__to__be__set__up__list_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, PFCs__to__be__set__up__list_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(PFCs__to__be__set__up__list_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, PFCs__to__be__set__up__list_number__of__PFCs_descr_.raw->forceomit);
  decoded_field_length = field_number__of__PFCs.RAW_decode(PFCs__to__be__set__up__list_number__of__PFCs_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());
  INTEGER tmp3 = field_number__of__PFCs.convert_to_Integer(PFCs__to__be__set__up__list_number__of__PFCs_descr_);
  field_number__of__PFCs = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 1;
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Multiple__PFCs__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_pFCs.RAW_decode(Multiple__PFCs__BSSGP_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, value_of_length_field3, 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;
  value_of_length_field3 -= decoded_field_length;
  if (field_iEI !=  os_109) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PFCs__to__be__set__up__list::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, PFCs__to__be__set__up__list_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PFCs__to__be__set__up__list_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PFCs__to__be__set__up__list_number__of__PFCs_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Multiple__PFCs__BSSGP_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(PFCs__to__be__set__up__list_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(PFCs__to__be__set__up__list_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &PFCs__to__be__set__up__list_number__of__PFCs_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = -1;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[3]->length = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_pFCs.RAW_encode(Multiple__PFCs__BSSGP_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(PFCs__to__be__set__up__list_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(PFCs__to__be__set__up__list_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_109) {
  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_109.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 PFCs__to__be__set__up__list_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
INTEGER_template field_number__of__PFCs;
Multiple__PFCs__BSSGP_template field_pFCs;
};

void PFCs__to__be__set__up__list_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_number__of__PFCs = ANY_VALUE;
single_value->field_pFCs = ANY_VALUE;
}
}
}

void PFCs__to__be__set__up__list_template::copy_value(const PFCs__to__be__set__up__list& 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.number__of__PFCs().is_bound()) {
  single_value->field_number__of__PFCs = other_value.number__of__PFCs();
} else {
  single_value->field_number__of__PFCs.clean_up();
}
if (other_value.pFCs().is_bound()) {
  single_value->field_pFCs = other_value.pFCs();
} else {
  single_value->field_pFCs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PFCs__to__be__set__up__list_template::copy_template(const PFCs__to__be__set__up__list_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.number__of__PFCs().get_selection()) {
single_value->field_number__of__PFCs = other_value.number__of__PFCs();
} else {
single_value->field_number__of__PFCs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFCs().get_selection()) {
single_value->field_pFCs = other_value.pFCs();
} else {
single_value->field_pFCs.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 PFCs__to__be__set__up__list_template[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 PFCs__to__be__set__up__list_template(*other_value.implication_.precondition);
implication_.implied_template = new PFCs__to__be__set__up__list_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.PFCs_to_be_set_up_list.");
break;
}
set_selection(other_value);
}

PFCs__to__be__set__up__list_template::PFCs__to__be__set__up__list_template()
{
}

PFCs__to__be__set__up__list_template::PFCs__to__be__set__up__list_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PFCs__to__be__set__up__list_template::PFCs__to__be__set__up__list_template(const PFCs__to__be__set__up__list& other_value)
{
copy_value(other_value);
}

PFCs__to__be__set__up__list_template::PFCs__to__be__set__up__list_template(const OPTIONAL<PFCs__to__be__set__up__list>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PFCs__to__be__set__up__list&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.PFCs_to_be_set_up_list from an unbound optional field.");
}
}

PFCs__to__be__set__up__list_template::PFCs__to__be__set__up__list_template(PFCs__to__be__set__up__list_template* p_precondition, PFCs__to__be__set__up__list_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PFCs__to__be__set__up__list_template::PFCs__to__be__set__up__list_template(Dynamic_Match_Interface<PFCs__to__be__set__up__list>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PFCs__to__be__set__up__list>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PFCs__to__be__set__up__list_template::PFCs__to__be__set__up__list_template(const PFCs__to__be__set__up__list_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PFCs__to__be__set__up__list_template::~PFCs__to__be__set__up__list_template()
{
clean_up();
}

PFCs__to__be__set__up__list_template& PFCs__to__be__set__up__list_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PFCs__to__be__set__up__list_template& PFCs__to__be__set__up__list_template::operator=(const PFCs__to__be__set__up__list& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PFCs__to__be__set__up__list_template& PFCs__to__be__set__up__list_template::operator=(const OPTIONAL<PFCs__to__be__set__up__list>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PFCs__to__be__set__up__list&)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.PFCs_to_be_set_up_list.");
}
return *this;
}

PFCs__to__be__set__up__list_template& PFCs__to__be__set__up__list_template::operator=(const PFCs__to__be__set__up__list_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PFCs__to__be__set__up__list_template::match(const PFCs__to__be__set__up__list& 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.number__of__PFCs().is_bound()) return FALSE;
if(!single_value->field_number__of__PFCs.match(other_value.number__of__PFCs(), legacy))return FALSE;
if(!other_value.pFCs().is_bound()) return FALSE;
if(!single_value->field_pFCs.match(other_value.pFCs(), 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.PFCs_to_be_set_up_list.");
}
return FALSE;
}

boolean PFCs__to__be__set__up__list_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_number__of__PFCs.is_bound()
 || single_value->field_pFCs.is_bound();
}

boolean PFCs__to__be__set__up__list_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_number__of__PFCs.is_value()
 && single_value->field_pFCs.is_value();
}

void PFCs__to__be__set__up__list_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;
}

PFCs__to__be__set__up__list PFCs__to__be__set__up__list_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.PFCs_to_be_set_up_list.");
PFCs__to__be__set__up__list 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_number__of__PFCs.is_bound()) {
ret_val.number__of__PFCs() = single_value->field_number__of__PFCs.valueof();
}
if (single_value->field_pFCs.is_bound()) {
ret_val.pFCs() = single_value->field_pFCs.valueof();
}
return ret_val;
}

void PFCs__to__be__set__up__list_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.PFCs_to_be_set_up_list.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PFCs__to__be__set__up__list_template[list_length];
}

PFCs__to__be__set__up__list_template& PFCs__to__be__set__up__list_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.PFCs_to_be_set_up_list.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PFCs_to_be_set_up_list.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& PFCs__to__be__set__up__list_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& PFCs__to__be__set__up__list_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.PFCs_to_be_set_up_list.");
return single_value->field_iEI;
}

BITSTRING_template& PFCs__to__be__set__up__list_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& PFCs__to__be__set__up__list_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.PFCs_to_be_set_up_list.");
return single_value->field_ext;
}

LIN2__2a_template& PFCs__to__be__set__up__list_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& PFCs__to__be__set__up__list_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.PFCs_to_be_set_up_list.");
return single_value->field_lengthIndicator;
}

INTEGER_template& PFCs__to__be__set__up__list_template::number__of__PFCs()
{
set_specific();
return single_value->field_number__of__PFCs;
}

const INTEGER_template& PFCs__to__be__set__up__list_template::number__of__PFCs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_PFCs of a non-specific template of type @BSSGP_Types.PFCs_to_be_set_up_list.");
return single_value->field_number__of__PFCs;
}

Multiple__PFCs__BSSGP_template& PFCs__to__be__set__up__list_template::pFCs()
{
set_specific();
return single_value->field_pFCs;
}

const Multiple__PFCs__BSSGP_template& PFCs__to__be__set__up__list_template::pFCs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFCs of a non-specific template of type @BSSGP_Types.PFCs_to_be_set_up_list.");
return single_value->field_pFCs;
}

int PFCs__to__be__set__up__list_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFCs_to_be_set_up_list 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.PFCs_to_be_set_up_list 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.PFCs_to_be_set_up_list 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.PFCs_to_be_set_up_list containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFCs_to_be_set_up_list containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFCs_to_be_set_up_list containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFCs_to_be_set_up_list containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFCs_to_be_set_up_list containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PFCs_to_be_set_up_list containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PFCs_to_be_set_up_list.");
  }
  return 0;
}

void PFCs__to__be__set__up__list_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(", number_of_PFCs := ");
single_value->field_number__of__PFCs.log();
TTCN_Logger::log_event_str(", pFCs := ");
single_value->field_pFCs.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 PFCs__to__be__set__up__list_template::log_match(const PFCs__to__be__set__up__list& 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_number__of__PFCs.match(match_value.number__of__PFCs(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_PFCs");
single_value->field_number__of__PFCs.log_match(match_value.number__of__PFCs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFCs.match(match_value.pFCs(), legacy)){
TTCN_Logger::log_logmatch_info(".pFCs");
single_value->field_pFCs.log_match(match_value.pFCs(), 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(", number_of_PFCs := ");
single_value->field_number__of__PFCs.log_match(match_value.number__of__PFCs(), legacy);
TTCN_Logger::log_event_str(", pFCs := ");
single_value->field_pFCs.log_match(match_value.pFCs(), 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 PFCs__to__be__set__up__list_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_number__of__PFCs.encode_text(text_buf);
single_value->field_pFCs.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.PFCs_to_be_set_up_list.");
}
}

void PFCs__to__be__set__up__list_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_number__of__PFCs.decode_text(text_buf);
single_value->field_pFCs.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 PFCs__to__be__set__up__list_template[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.PFCs_to_be_set_up_list.");
}
}

void PFCs__to__be__set__up__list_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: {
    PFCs__to__be__set__up__list_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.PFCs_to_be_set_up_list 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) number__of__PFCs().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFCs().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(), "number_of_PFCs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PFCs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFCs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFCs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.PFCs_to_be_set_up_list: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PFCs__to__be__set__up__list_template* precondition = new PFCs__to__be__set__up__list_template;
    precondition->set_param(*param.get_elem(0));
    PFCs__to__be__set__up__list_template* implied_template = new PFCs__to__be__set__up__list_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PFCs__to__be__set__up__list_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.PFCs_to_be_set_up_list");
  }
  is_ifpresent = param.get_ifpresent();
}

void PFCs__to__be__set__up__list_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.PFCs_to_be_set_up_list");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFCs_to_be_set_up_list");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFCs_to_be_set_up_list");
single_value->field_number__of__PFCs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFCs_to_be_set_up_list");
single_value->field_pFCs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PFCs_to_be_set_up_list");
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.PFCs_to_be_set_up_list");
}

boolean PFCs__to__be__set__up__list_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PFCs__to__be__set__up__list_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 Single__PFI__BSSGP Multiple__PFIs__BSSGP::UNBOUND_ELEM;
Multiple__PFIs__BSSGP::Multiple__PFIs__BSSGP()
{
val_ptr = NULL;
}

Multiple__PFIs__BSSGP::Multiple__PFIs__BSSGP(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

Multiple__PFIs__BSSGP::Multiple__PFIs__BSSGP(const Multiple__PFIs__BSSGP& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

Multiple__PFIs__BSSGP::~Multiple__PFIs__BSSGP()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void Multiple__PFIs__BSSGP::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.");
}
}

Multiple__PFIs__BSSGP& Multiple__PFIs__BSSGP::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;
}

Multiple__PFIs__BSSGP& Multiple__PFIs__BSSGP::operator=(const Multiple__PFIs__BSSGP& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean Multiple__PFIs__BSSGP::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
return val_ptr->n_elements == 0 ;
}

boolean Multiple__PFIs__BSSGP::operator==(const Multiple__PFIs__BSSGP& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
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;
}

Single__PFI__BSSGP& Multiple__PFIs__BSSGP::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.Multiple_PFIs_BSSGP 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 = (Single__PFI__BSSGP**)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 Single__PFI__BSSGP(*(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 Single__PFI__BSSGP;
}
return *val_ptr->value_elements[index_value];
}

Single__PFI__BSSGP& Multiple__PFIs__BSSGP::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
return (*this)[(int)index_value];
}

const Single__PFI__BSSGP& Multiple__PFIs__BSSGP::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.Multiple_PFIs_BSSGP 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.Multiple_PFIs_BSSGP: 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 Single__PFI__BSSGP& Multiple__PFIs__BSSGP::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
return (*this)[(int)index_value];
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
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;
Multiple__PFIs__BSSGP 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 Single__PFI__BSSGP(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP::operator+(const Multiple__PFIs__BSSGP& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BSSGP_Types.Multiple_PFIs_BSSGP concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
Multiple__PFIs__BSSGP 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 Single__PFI__BSSGP(*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 Single__PFI__BSSGP(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP::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.Multiple_PFIs_BSSGP.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Types.Multiple_PFIs_BSSGP","element");
Multiple__PFIs__BSSGP 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 Single__PFI__BSSGP(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP::replace(int index, int len, const Multiple__PFIs__BSSGP& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BSSGP_Types.Multiple_PFIs_BSSGP","element");
Multiple__PFIs__BSSGP 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 Single__PFI__BSSGP(*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 Single__PFI__BSSGP(*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 Single__PFI__BSSGP(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP::replace(int index, int len, const Multiple__PFIs__BSSGP_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 Multiple__PFIs__BSSGP::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
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 = (Single__PFI__BSSGP**)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 Single__PFI__BSSGP(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (Single__PFI__BSSGP**)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.Multiple_PFIs_BSSGP: %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 = (Single__PFI__BSSGP**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean Multiple__PFIs__BSSGP::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 Multiple__PFIs__BSSGP::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
return val_ptr->n_elements;
}

int Multiple__PFIs__BSSGP::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
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 Multiple__PFIs__BSSGP::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 Multiple__PFIs__BSSGP::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 Multiple__PFIs__BSSGP::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.Multiple_PFIs_BSSGP");
    }
    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.Multiple_PFIs_BSSGP");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void Multiple__PFIs__BSSGP::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
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 Multiple__PFIs__BSSGP::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.Multiple_PFIs_BSSGP.");
val_ptr->value_elements = (Single__PFI__BSSGP**)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 Single__PFI__BSSGP;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void Multiple__PFIs__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 Multiple__PFIs__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 Multiple__PFIs__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 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 Multiple__PFIs__BSSGP::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 Multiple__PFIs__BSSGP_template::copy_value(const Multiple__PFIs__BSSGP& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Types.Multiple_PFIs_BSSGP with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (Single__PFI__BSSGP_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 Single__PFI__BSSGP_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new Single__PFI__BSSGP_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void Multiple__PFIs__BSSGP_template::copy_template(const Multiple__PFIs__BSSGP_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 = (Single__PFI__BSSGP_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 Single__PFI__BSSGP_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new Single__PFI__BSSGP_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 Multiple__PFIs__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 Multiple__PFIs__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Multiple__PFIs__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.Multiple_PFIs_BSSGP.");
break;
}
set_selection(other_value);
}

boolean Multiple__PFIs__BSSGP_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 Multiple__PFIs__BSSGP_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const Multiple__PFIs__BSSGP*)value_ptr)[value_index], legacy);
else return ((const Multiple__PFIs__BSSGP_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

Multiple__PFIs__BSSGP_template::Multiple__PFIs__BSSGP_template()
{
}

Multiple__PFIs__BSSGP_template::Multiple__PFIs__BSSGP_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

Multiple__PFIs__BSSGP_template::Multiple__PFIs__BSSGP_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

Multiple__PFIs__BSSGP_template::Multiple__PFIs__BSSGP_template(const Multiple__PFIs__BSSGP& other_value)
{
copy_value(other_value);
}

Multiple__PFIs__BSSGP_template::Multiple__PFIs__BSSGP_template(const OPTIONAL<Multiple__PFIs__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Multiple__PFIs__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Multiple_PFIs_BSSGP from an unbound optional field.");
}
}

Multiple__PFIs__BSSGP_template::Multiple__PFIs__BSSGP_template(Multiple__PFIs__BSSGP_template* p_precondition, Multiple__PFIs__BSSGP_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Multiple__PFIs__BSSGP_template::Multiple__PFIs__BSSGP_template(Dynamic_Match_Interface<Multiple__PFIs__BSSGP>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Multiple__PFIs__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Multiple__PFIs__BSSGP_template::Multiple__PFIs__BSSGP_template(const Multiple__PFIs__BSSGP_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

Multiple__PFIs__BSSGP_template::~Multiple__PFIs__BSSGP_template()
{
clean_up();
}

void Multiple__PFIs__BSSGP_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;
}

Multiple__PFIs__BSSGP_template& Multiple__PFIs__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Multiple__PFIs__BSSGP_template& Multiple__PFIs__BSSGP_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

Multiple__PFIs__BSSGP_template& Multiple__PFIs__BSSGP_template::operator=(const Multiple__PFIs__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Multiple__PFIs__BSSGP_template& Multiple__PFIs__BSSGP_template::operator=(const OPTIONAL<Multiple__PFIs__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Multiple__PFIs__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.Multiple_PFIs_BSSGP.");
}
return *this;
}

Multiple__PFIs__BSSGP_template& Multiple__PFIs__BSSGP_template::operator=(const Multiple__PFIs__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

Single__PFI__BSSGP_template& Multiple__PFIs__BSSGP_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.Multiple_PFIs_BSSGP 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.Multiple_PFIs_BSSGP.");
    break;
}
return *single_value.value_elements[index_value];
}

Single__PFI__BSSGP_template& Multiple__PFIs__BSSGP_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
return (*this)[(int)index_value];
}

const Single__PFI__BSSGP_template& Multiple__PFIs__BSSGP_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.Multiple_PFIs_BSSGP 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.Multiple_PFIs_BSSGP.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Types.Multiple_PFIs_BSSGP: 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 Single__PFI__BSSGP_template& Multiple__PFIs__BSSGP_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
return (*this)[(int)index_value];
}

void Multiple__PFIs__BSSGP_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.Multiple_PFIs_BSSGP.");
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 = (Single__PFI__BSSGP_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 Single__PFI__BSSGP_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 Single__PFI__BSSGP_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 = (Single__PFI__BSSGP_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int Multiple__PFIs__BSSGP_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 Multiple__PFIs__BSSGP_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.Multiple_PFIs_BSSGP 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.Multiple_PFIs_BSSGP 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.Multiple_PFIs_BSSGP 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.Multiple_PFIs_BSSGP 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.Multiple_PFIs_BSSGP 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.Multiple_PFIs_BSSGP containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Multiple_PFIs_BSSGP.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BSSGP_Types.Multiple_PFIs_BSSGP");
}

boolean Multiple__PFIs__BSSGP_template::match(const Multiple__PFIs__BSSGP& 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.Multiple_PFIs_BSSGP.");
}
return FALSE;
}

boolean Multiple__PFIs__BSSGP_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;
}

Multiple__PFIs__BSSGP Multiple__PFIs__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.Multiple_PFIs_BSSGP.");
Multiple__PFIs__BSSGP 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;
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP_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);
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP_template::replace(int index, int len, const Multiple__PFIs__BSSGP_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());
}

Multiple__PFIs__BSSGP Multiple__PFIs__BSSGP_template::replace(int index, int len, const Multiple__PFIs__BSSGP& 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 Multiple__PFIs__BSSGP_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 Multiple__PFIs__BSSGP_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
}
set_selection(template_type);
}

Multiple__PFIs__BSSGP_template& Multiple__PFIs__BSSGP_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.Multiple_PFIs_BSSGP.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
return value_list.list_value[list_index];
}

void Multiple__PFIs__BSSGP_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 Multiple__PFIs__BSSGP_template::log_match(const Multiple__PFIs__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 && 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 Multiple__PFIs__BSSGP_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.Multiple_PFIs_BSSGP.");
}
}

void Multiple__PFIs__BSSGP_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.Multiple_PFIs_BSSGP.");
single_value.value_elements = (Single__PFI__BSSGP_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 Single__PFI__BSSGP_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 Multiple__PFIs__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 for a template of type @BSSGP_Types.Multiple_PFIs_BSSGP.");
}
}

boolean Multiple__PFIs__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Multiple__PFIs__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 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 Multiple__PFIs__BSSGP_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: {
    Multiple__PFIs__BSSGP_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: {
    Multiple__PFIs__BSSGP_template* precondition = new Multiple__PFIs__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Multiple__PFIs__BSSGP_template* implied_template = new Multiple__PFIs__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Multiple__PFIs__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BSSGP_Types.Multiple_PFIs_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void Multiple__PFIs__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;
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.Multiple_PFIs_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.Multiple_PFIs_BSSGP");
}

boolean Multiple__PFIs__BSSGP_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);
}
}
Single__PFI__BSSGP::Single__PFI__BSSGP()
{
}

Single__PFI__BSSGP::Single__PFI__BSSGP(const BITSTRING& par_pFI__Value,
    const BITSTRING& par_spare)
  :   field_pFI__Value(par_pFI__Value),
  field_spare(par_spare)
{
}

Single__PFI__BSSGP::Single__PFI__BSSGP(const Single__PFI__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Single_PFI_BSSGP.");
if (other_value.pFI__Value().is_bound()) field_pFI__Value = other_value.pFI__Value();
else field_pFI__Value.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void Single__PFI__BSSGP::clean_up()
{
field_pFI__Value.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* Single__PFI__BSSGP::get_descriptor() const { return &Single__PFI__BSSGP_descr_; }
Single__PFI__BSSGP& Single__PFI__BSSGP::operator=(const Single__PFI__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Single_PFI_BSSGP.");
  if (other_value.pFI__Value().is_bound()) field_pFI__Value = other_value.pFI__Value();
  else field_pFI__Value.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean Single__PFI__BSSGP::operator==(const Single__PFI__BSSGP& other_value) const
{
return field_pFI__Value==other_value.field_pFI__Value
  && field_spare==other_value.field_spare;
}

boolean Single__PFI__BSSGP::is_bound() const
{
return (field_pFI__Value.is_bound())
  || (field_spare.is_bound());
}
boolean Single__PFI__BSSGP::is_value() const
{
return field_pFI__Value.is_value()
  && field_spare.is_value();
}
void Single__PFI__BSSGP::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ pFI_Value := ");
field_pFI__Value.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void Single__PFI__BSSGP::set_implicit_omit()
{
if (pFI__Value().is_bound()) pFI__Value().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void Single__PFI__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.Single_PFI_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) pFI__Value().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI__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.Single_PFI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Single_PFI_BSSGP");
  }
}

void Single__PFI__BSSGP::encode_text(Text_Buf& text_buf) const
{
field_pFI__Value.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void Single__PFI__BSSGP::decode_text(Text_Buf& text_buf)
{
field_pFI__Value.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void Single__PFI__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 Single__PFI__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 Single__PFI__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, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_pFI__Value.RAW_decode(General__Types::BIT7_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Single__PFI__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, General__Types::BIT7_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_pFI__Value.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct Single__PFI__BSSGP_template::single_value_struct {
BITSTRING_template field_pFI__Value;
BITSTRING_template field_spare;
};

void Single__PFI__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_pFI__Value = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void Single__PFI__BSSGP_template::copy_value(const Single__PFI__BSSGP& other_value)
{
single_value = new single_value_struct;
if (other_value.pFI__Value().is_bound()) {
  single_value->field_pFI__Value = other_value.pFI__Value();
} else {
  single_value->field_pFI__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 Single__PFI__BSSGP_template::copy_template(const Single__PFI__BSSGP_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.pFI__Value().get_selection()) {
single_value->field_pFI__Value = other_value.pFI__Value();
} else {
single_value->field_pFI__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 Single__PFI__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 Single__PFI__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Single__PFI__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.Single_PFI_BSSGP.");
break;
}
set_selection(other_value);
}

Single__PFI__BSSGP_template::Single__PFI__BSSGP_template()
{
}

Single__PFI__BSSGP_template::Single__PFI__BSSGP_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Single__PFI__BSSGP_template::Single__PFI__BSSGP_template(const Single__PFI__BSSGP& other_value)
{
copy_value(other_value);
}

Single__PFI__BSSGP_template::Single__PFI__BSSGP_template(const OPTIONAL<Single__PFI__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Single__PFI__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Single_PFI_BSSGP from an unbound optional field.");
}
}

Single__PFI__BSSGP_template::Single__PFI__BSSGP_template(Single__PFI__BSSGP_template* p_precondition, Single__PFI__BSSGP_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Single__PFI__BSSGP_template::Single__PFI__BSSGP_template(Dynamic_Match_Interface<Single__PFI__BSSGP>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Single__PFI__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Single__PFI__BSSGP_template::Single__PFI__BSSGP_template(const Single__PFI__BSSGP_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Single__PFI__BSSGP_template::~Single__PFI__BSSGP_template()
{
clean_up();
}

Single__PFI__BSSGP_template& Single__PFI__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Single__PFI__BSSGP_template& Single__PFI__BSSGP_template::operator=(const Single__PFI__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Single__PFI__BSSGP_template& Single__PFI__BSSGP_template::operator=(const OPTIONAL<Single__PFI__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Single__PFI__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.Single_PFI_BSSGP.");
}
return *this;
}

Single__PFI__BSSGP_template& Single__PFI__BSSGP_template::operator=(const Single__PFI__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Single__PFI__BSSGP_template::match(const Single__PFI__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.pFI__Value().is_bound()) return FALSE;
if(!single_value->field_pFI__Value.match(other_value.pFI__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.Single_PFI_BSSGP.");
}
return FALSE;
}

boolean Single__PFI__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_pFI__Value.is_bound()
 || single_value->field_spare.is_bound();
}

boolean Single__PFI__BSSGP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_pFI__Value.is_value()
 && single_value->field_spare.is_value();
}

void Single__PFI__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;
}

Single__PFI__BSSGP Single__PFI__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.Single_PFI_BSSGP.");
Single__PFI__BSSGP ret_val;
if (single_value->field_pFI__Value.is_bound()) {
ret_val.pFI__Value() = single_value->field_pFI__Value.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void Single__PFI__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.Single_PFI_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Single__PFI__BSSGP_template[list_length];
}

Single__PFI__BSSGP_template& Single__PFI__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.Single_PFI_BSSGP.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Single_PFI_BSSGP.");
return value_list.list_value[list_index];
}

BITSTRING_template& Single__PFI__BSSGP_template::pFI__Value()
{
set_specific();
return single_value->field_pFI__Value;
}

const BITSTRING_template& Single__PFI__BSSGP_template::pFI__Value() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFI_Value of a non-specific template of type @BSSGP_Types.Single_PFI_BSSGP.");
return single_value->field_pFI__Value;
}

BITSTRING_template& Single__PFI__BSSGP_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& Single__PFI__BSSGP_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @BSSGP_Types.Single_PFI_BSSGP.");
return single_value->field_spare;
}

int Single__PFI__BSSGP_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFI_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.Single_PFI_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.Single_PFI_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.Single_PFI_BSSGP containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFI_BSSGP containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFI_BSSGP containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFI_BSSGP containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFI_BSSGP containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Single_PFI_BSSGP containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Single_PFI_BSSGP.");
  }
  return 0;
}

void Single__PFI__BSSGP_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ pFI_Value := ");
single_value->field_pFI__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 Single__PFI__BSSGP_template::log_match(const Single__PFI__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_pFI__Value.match(match_value.pFI__Value(), legacy)){
TTCN_Logger::log_logmatch_info(".pFI_Value");
single_value->field_pFI__Value.log_match(match_value.pFI__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("{ pFI_Value := ");
single_value->field_pFI__Value.log_match(match_value.pFI__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 Single__PFI__BSSGP_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_pFI__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.Single_PFI_BSSGP.");
}
}

void Single__PFI__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_pFI__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 Single__PFI__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.Single_PFI_BSSGP.");
}
}

void Single__PFI__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: {
    Single__PFI__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.Single_PFI_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) pFI__Value().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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_Value")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFI__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.Single_PFI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Single__PFI__BSSGP_template* precondition = new Single__PFI__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Single__PFI__BSSGP_template* implied_template = new Single__PFI__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Single__PFI__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Single_PFI_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void Single__PFI__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_pFI__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Single_PFI_BSSGP");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Single_PFI_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.Single_PFI_BSSGP");
}

boolean Single__PFI__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Single__PFI__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;
}

List__of__set__up__PFCs__BSSGP::List__of__set__up__PFCs__BSSGP()
{
}

List__of__set__up__PFCs__BSSGP::List__of__set__up__PFCs__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const INTEGER& par_number__of__PFCs,
    const Multiple__PFIs__BSSGP& par_pFIs)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_number__of__PFCs(par_number__of__PFCs),
  field_pFIs(par_pFIs)
{
}

List__of__set__up__PFCs__BSSGP::List__of__set__up__PFCs__BSSGP(const List__of__set__up__PFCs__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP.");
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.number__of__PFCs().is_bound()) field_number__of__PFCs = other_value.number__of__PFCs();
else field_number__of__PFCs.clean_up();
if (other_value.pFIs().is_bound()) field_pFIs = other_value.pFIs();
else field_pFIs.clean_up();
}

void List__of__set__up__PFCs__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_number__of__PFCs.clean_up();
field_pFIs.clean_up();
}

const TTCN_Typedescriptor_t* List__of__set__up__PFCs__BSSGP::get_descriptor() const { return &List__of__set__up__PFCs__BSSGP_descr_; }
List__of__set__up__PFCs__BSSGP& List__of__set__up__PFCs__BSSGP::operator=(const List__of__set__up__PFCs__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP.");
  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.number__of__PFCs().is_bound()) field_number__of__PFCs = other_value.number__of__PFCs();
  else field_number__of__PFCs.clean_up();
  if (other_value.pFIs().is_bound()) field_pFIs = other_value.pFIs();
  else field_pFIs.clean_up();
}
return *this;
}

boolean List__of__set__up__PFCs__BSSGP::operator==(const List__of__set__up__PFCs__BSSGP& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_number__of__PFCs==other_value.field_number__of__PFCs
  && field_pFIs==other_value.field_pFIs;
}

boolean List__of__set__up__PFCs__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_number__of__PFCs.is_bound())
  || (field_pFIs.is_bound());
}
boolean List__of__set__up__PFCs__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_number__of__PFCs.is_value()
  && field_pFIs.is_value();
}
void List__of__set__up__PFCs__BSSGP::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(", number_of_PFCs := ");
field_number__of__PFCs.log();
TTCN_Logger::log_event_str(", pFIs := ");
field_pFIs.log();
TTCN_Logger::log_event_str(" }");
}

void List__of__set__up__PFCs__BSSGP::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 (number__of__PFCs().is_bound()) number__of__PFCs().set_implicit_omit();
if (pFIs().is_bound()) pFIs().set_implicit_omit();
}

void List__of__set__up__PFCs__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 (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP 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) number__of__PFCs().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFIs().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(), "number_of_PFCs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PFCs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFIs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFIs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.List_of_set_up_PFCs_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.List_of_set_up_PFCs_BSSGP");
  }
}

void List__of__set__up__PFCs__BSSGP::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_number__of__PFCs.encode_text(text_buf);
field_pFIs.encode_text(text_buf);
}

void List__of__set__up__PFCs__BSSGP::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_number__of__PFCs.decode_text(text_buf);
field_pFIs.decode_text(text_buf);
}

void List__of__set__up__PFCs__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 List__of__set__up__PFCs__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 List__of__set__up__PFCs__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;
  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;
  int value_of_length_field3 = 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, List__of__set__up__PFCs__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(List__of__set__up__PFCs__BSSGP_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, List__of__set__up__PFCs__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(List__of__set__up__PFCs__BSSGP_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, List__of__set__up__PFCs__BSSGP_number__of__PFCs_descr_.raw->forceomit);
  decoded_field_length = field_number__of__PFCs.RAW_decode(List__of__set__up__PFCs__BSSGP_number__of__PFCs_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());
  INTEGER tmp3 = field_number__of__PFCs.convert_to_Integer(List__of__set__up__PFCs__BSSGP_number__of__PFCs_descr_);
  field_number__of__PFCs = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 1;
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Multiple__PFIs__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_pFIs.RAW_decode(Multiple__PFIs__BSSGP_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, value_of_length_field3, 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;
  value_of_length_field3 -= decoded_field_length;
  if (field_iEI !=  os_101) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int List__of__set__up__PFCs__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 = 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, List__of__set__up__PFCs__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, List__of__set__up__PFCs__BSSGP_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, List__of__set__up__PFCs__BSSGP_number__of__PFCs_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Multiple__PFIs__BSSGP_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(List__of__set__up__PFCs__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(List__of__set__up__PFCs__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &List__of__set__up__PFCs__BSSGP_number__of__PFCs_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = -1;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[3]->length = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_pFIs.RAW_encode(Multiple__PFIs__BSSGP_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(List__of__set__up__PFCs__BSSGP_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(List__of__set__up__PFCs__BSSGP_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_101) {
  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_101.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 List__of__set__up__PFCs__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
INTEGER_template field_number__of__PFCs;
Multiple__PFIs__BSSGP_template field_pFIs;
};

void List__of__set__up__PFCs__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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_number__of__PFCs = ANY_VALUE;
single_value->field_pFIs = ANY_VALUE;
}
}
}

void List__of__set__up__PFCs__BSSGP_template::copy_value(const List__of__set__up__PFCs__BSSGP& 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.number__of__PFCs().is_bound()) {
  single_value->field_number__of__PFCs = other_value.number__of__PFCs();
} else {
  single_value->field_number__of__PFCs.clean_up();
}
if (other_value.pFIs().is_bound()) {
  single_value->field_pFIs = other_value.pFIs();
} else {
  single_value->field_pFIs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void List__of__set__up__PFCs__BSSGP_template::copy_template(const List__of__set__up__PFCs__BSSGP_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.number__of__PFCs().get_selection()) {
single_value->field_number__of__PFCs = other_value.number__of__PFCs();
} else {
single_value->field_number__of__PFCs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFIs().get_selection()) {
single_value->field_pFIs = other_value.pFIs();
} else {
single_value->field_pFIs.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 List__of__set__up__PFCs__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 List__of__set__up__PFCs__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new List__of__set__up__PFCs__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.List_of_set_up_PFCs_BSSGP.");
break;
}
set_selection(other_value);
}

List__of__set__up__PFCs__BSSGP_template::List__of__set__up__PFCs__BSSGP_template()
{
}

List__of__set__up__PFCs__BSSGP_template::List__of__set__up__PFCs__BSSGP_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

List__of__set__up__PFCs__BSSGP_template::List__of__set__up__PFCs__BSSGP_template(const List__of__set__up__PFCs__BSSGP& other_value)
{
copy_value(other_value);
}

List__of__set__up__PFCs__BSSGP_template::List__of__set__up__PFCs__BSSGP_template(const OPTIONAL<List__of__set__up__PFCs__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const List__of__set__up__PFCs__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP from an unbound optional field.");
}
}

List__of__set__up__PFCs__BSSGP_template::List__of__set__up__PFCs__BSSGP_template(List__of__set__up__PFCs__BSSGP_template* p_precondition, List__of__set__up__PFCs__BSSGP_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

List__of__set__up__PFCs__BSSGP_template::List__of__set__up__PFCs__BSSGP_template(Dynamic_Match_Interface<List__of__set__up__PFCs__BSSGP>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<List__of__set__up__PFCs__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

List__of__set__up__PFCs__BSSGP_template::List__of__set__up__PFCs__BSSGP_template(const List__of__set__up__PFCs__BSSGP_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

List__of__set__up__PFCs__BSSGP_template::~List__of__set__up__PFCs__BSSGP_template()
{
clean_up();
}

List__of__set__up__PFCs__BSSGP_template& List__of__set__up__PFCs__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

List__of__set__up__PFCs__BSSGP_template& List__of__set__up__PFCs__BSSGP_template::operator=(const List__of__set__up__PFCs__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

List__of__set__up__PFCs__BSSGP_template& List__of__set__up__PFCs__BSSGP_template::operator=(const OPTIONAL<List__of__set__up__PFCs__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const List__of__set__up__PFCs__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.List_of_set_up_PFCs_BSSGP.");
}
return *this;
}

List__of__set__up__PFCs__BSSGP_template& List__of__set__up__PFCs__BSSGP_template::operator=(const List__of__set__up__PFCs__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean List__of__set__up__PFCs__BSSGP_template::match(const List__of__set__up__PFCs__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.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.number__of__PFCs().is_bound()) return FALSE;
if(!single_value->field_number__of__PFCs.match(other_value.number__of__PFCs(), legacy))return FALSE;
if(!other_value.pFIs().is_bound()) return FALSE;
if(!single_value->field_pFIs.match(other_value.pFIs(), 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.List_of_set_up_PFCs_BSSGP.");
}
return FALSE;
}

boolean List__of__set__up__PFCs__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_number__of__PFCs.is_bound()
 || single_value->field_pFIs.is_bound();
}

boolean List__of__set__up__PFCs__BSSGP_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_number__of__PFCs.is_value()
 && single_value->field_pFIs.is_value();
}

void List__of__set__up__PFCs__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;
}

List__of__set__up__PFCs__BSSGP List__of__set__up__PFCs__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.List_of_set_up_PFCs_BSSGP.");
List__of__set__up__PFCs__BSSGP 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_number__of__PFCs.is_bound()) {
ret_val.number__of__PFCs() = single_value->field_number__of__PFCs.valueof();
}
if (single_value->field_pFIs.is_bound()) {
ret_val.pFIs() = single_value->field_pFIs.valueof();
}
return ret_val;
}

void List__of__set__up__PFCs__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.List_of_set_up_PFCs_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new List__of__set__up__PFCs__BSSGP_template[list_length];
}

List__of__set__up__PFCs__BSSGP_template& List__of__set__up__PFCs__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.List_of_set_up_PFCs_BSSGP.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& List__of__set__up__PFCs__BSSGP_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& List__of__set__up__PFCs__BSSGP_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP.");
return single_value->field_iEI;
}

BITSTRING_template& List__of__set__up__PFCs__BSSGP_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& List__of__set__up__PFCs__BSSGP_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP.");
return single_value->field_ext;
}

LIN2__2a_template& List__of__set__up__PFCs__BSSGP_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& List__of__set__up__PFCs__BSSGP_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP.");
return single_value->field_lengthIndicator;
}

INTEGER_template& List__of__set__up__PFCs__BSSGP_template::number__of__PFCs()
{
set_specific();
return single_value->field_number__of__PFCs;
}

const INTEGER_template& List__of__set__up__PFCs__BSSGP_template::number__of__PFCs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_PFCs of a non-specific template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP.");
return single_value->field_number__of__PFCs;
}

Multiple__PFIs__BSSGP_template& List__of__set__up__PFCs__BSSGP_template::pFIs()
{
set_specific();
return single_value->field_pFIs;
}

const Multiple__PFIs__BSSGP_template& List__of__set__up__PFCs__BSSGP_template::pFIs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFIs of a non-specific template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP.");
return single_value->field_pFIs;
}

int List__of__set__up__PFCs__BSSGP_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP 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.List_of_set_up_PFCs_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.List_of_set_up_PFCs_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.List_of_set_up_PFCs_BSSGP containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP.");
  }
  return 0;
}

void List__of__set__up__PFCs__BSSGP_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(", number_of_PFCs := ");
single_value->field_number__of__PFCs.log();
TTCN_Logger::log_event_str(", pFIs := ");
single_value->field_pFIs.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 List__of__set__up__PFCs__BSSGP_template::log_match(const List__of__set__up__PFCs__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_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_number__of__PFCs.match(match_value.number__of__PFCs(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_PFCs");
single_value->field_number__of__PFCs.log_match(match_value.number__of__PFCs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFIs.match(match_value.pFIs(), legacy)){
TTCN_Logger::log_logmatch_info(".pFIs");
single_value->field_pFIs.log_match(match_value.pFIs(), 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(", number_of_PFCs := ");
single_value->field_number__of__PFCs.log_match(match_value.number__of__PFCs(), legacy);
TTCN_Logger::log_event_str(", pFIs := ");
single_value->field_pFIs.log_match(match_value.pFIs(), 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 List__of__set__up__PFCs__BSSGP_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_number__of__PFCs.encode_text(text_buf);
single_value->field_pFIs.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.List_of_set_up_PFCs_BSSGP.");
}
}

void List__of__set__up__PFCs__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_number__of__PFCs.decode_text(text_buf);
single_value->field_pFIs.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 List__of__set__up__PFCs__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.List_of_set_up_PFCs_BSSGP.");
}
}

void List__of__set__up__PFCs__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: {
    List__of__set__up__PFCs__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 (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.List_of_set_up_PFCs_BSSGP 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) number__of__PFCs().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFIs().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(), "number_of_PFCs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PFCs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFIs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFIs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.List_of_set_up_PFCs_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    List__of__set__up__PFCs__BSSGP_template* precondition = new List__of__set__up__PFCs__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    List__of__set__up__PFCs__BSSGP_template* implied_template = new List__of__set__up__PFCs__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = List__of__set__up__PFCs__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.List_of_set_up_PFCs_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void List__of__set__up__PFCs__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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.List_of_set_up_PFCs_BSSGP");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.List_of_set_up_PFCs_BSSGP");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.List_of_set_up_PFCs_BSSGP");
single_value->field_number__of__PFCs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.List_of_set_up_PFCs_BSSGP");
single_value->field_pFIs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.List_of_set_up_PFCs_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.List_of_set_up_PFCs_BSSGP");
}

boolean List__of__set__up__PFCs__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean List__of__set__up__PFCs__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;
}

Extended__Feature__Bitmap::Extended__Feature__Bitmap()
{
}

Extended__Feature__Bitmap::Extended__Feature__Bitmap(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const BITSTRING& par_pS__Handover,
    const BITSTRING& par_gigabitInterface,
    const BITSTRING& par_mOCN,
    const BITSTRING& par_cS__PS__Coordination__Enhancements,
    const BITSTRING& par_spare)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_pS__Handover(par_pS__Handover),
  field_gigabitInterface(par_gigabitInterface),
  field_mOCN(par_mOCN),
  field_cS__PS__Coordination__Enhancements(par_cS__PS__Coordination__Enhancements),
  field_spare(par_spare)
{
}

Extended__Feature__Bitmap::Extended__Feature__Bitmap(const Extended__Feature__Bitmap& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Extended_Feature_Bitmap.");
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.pS__Handover().is_bound()) field_pS__Handover = other_value.pS__Handover();
else field_pS__Handover.clean_up();
if (other_value.gigabitInterface().is_bound()) field_gigabitInterface = other_value.gigabitInterface();
else field_gigabitInterface.clean_up();
if (other_value.mOCN().is_bound()) field_mOCN = other_value.mOCN();
else field_mOCN.clean_up();
if (other_value.cS__PS__Coordination__Enhancements().is_bound()) field_cS__PS__Coordination__Enhancements = other_value.cS__PS__Coordination__Enhancements();
else field_cS__PS__Coordination__Enhancements.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void Extended__Feature__Bitmap::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_pS__Handover.clean_up();
field_gigabitInterface.clean_up();
field_mOCN.clean_up();
field_cS__PS__Coordination__Enhancements.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* Extended__Feature__Bitmap::get_descriptor() const { return &Extended__Feature__Bitmap_descr_; }
Extended__Feature__Bitmap& Extended__Feature__Bitmap::operator=(const Extended__Feature__Bitmap& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Extended_Feature_Bitmap.");
  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.pS__Handover().is_bound()) field_pS__Handover = other_value.pS__Handover();
  else field_pS__Handover.clean_up();
  if (other_value.gigabitInterface().is_bound()) field_gigabitInterface = other_value.gigabitInterface();
  else field_gigabitInterface.clean_up();
  if (other_value.mOCN().is_bound()) field_mOCN = other_value.mOCN();
  else field_mOCN.clean_up();
  if (other_value.cS__PS__Coordination__Enhancements().is_bound()) field_cS__PS__Coordination__Enhancements = other_value.cS__PS__Coordination__Enhancements();
  else field_cS__PS__Coordination__Enhancements.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean Extended__Feature__Bitmap::operator==(const Extended__Feature__Bitmap& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_pS__Handover==other_value.field_pS__Handover
  && field_gigabitInterface==other_value.field_gigabitInterface
  && field_mOCN==other_value.field_mOCN
  && field_cS__PS__Coordination__Enhancements==other_value.field_cS__PS__Coordination__Enhancements
  && field_spare==other_value.field_spare;
}

boolean Extended__Feature__Bitmap::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_pS__Handover.is_bound())
  || (field_gigabitInterface.is_bound())
  || (field_mOCN.is_bound())
  || (field_cS__PS__Coordination__Enhancements.is_bound())
  || (field_spare.is_bound());
}
boolean Extended__Feature__Bitmap::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_pS__Handover.is_value()
  && field_gigabitInterface.is_value()
  && field_mOCN.is_value()
  && field_cS__PS__Coordination__Enhancements.is_value()
  && field_spare.is_value();
}
void Extended__Feature__Bitmap::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(", pS_Handover := ");
field_pS__Handover.log();
TTCN_Logger::log_event_str(", gigabitInterface := ");
field_gigabitInterface.log();
TTCN_Logger::log_event_str(", mOCN := ");
field_mOCN.log();
TTCN_Logger::log_event_str(", cS_PS_Coordination_Enhancements := ");
field_cS__PS__Coordination__Enhancements.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void Extended__Feature__Bitmap::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 (pS__Handover().is_bound()) pS__Handover().set_implicit_omit();
if (gigabitInterface().is_bound()) gigabitInterface().set_implicit_omit();
if (mOCN().is_bound()) mOCN().set_implicit_omit();
if (cS__PS__Coordination__Enhancements().is_bound()) cS__PS__Coordination__Enhancements().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void Extended__Feature__Bitmap::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Extended_Feature_Bitmap has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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) pS__Handover().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gigabitInterface().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mOCN().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cS__PS__Coordination__Enhancements().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "pS_Handover")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__Handover().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gigabitInterface")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gigabitInterface().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mOCN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mOCN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_PS_Coordination_Enhancements")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__PS__Coordination__Enhancements().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.Extended_Feature_Bitmap: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Extended_Feature_Bitmap");
  }
}

void Extended__Feature__Bitmap::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_pS__Handover.encode_text(text_buf);
field_gigabitInterface.encode_text(text_buf);
field_mOCN.encode_text(text_buf);
field_cS__PS__Coordination__Enhancements.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void Extended__Feature__Bitmap::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_pS__Handover.decode_text(text_buf);
field_gigabitInterface.decode_text(text_buf);
field_mOCN.decode_text(text_buf);
field_cS__PS__Coordination__Enhancements.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void Extended__Feature__Bitmap::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 Extended__Feature__Bitmap::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 Extended__Feature__Bitmap::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, Extended__Feature__Bitmap_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Extended__Feature__Bitmap_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, Extended__Feature__Bitmap_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Extended__Feature__Bitmap_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_pS__Handover.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_gigabitInterface.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_mOCN.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_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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_cS__PS__Coordination__Enhancements.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_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::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_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;
  if (field_iEI !=  os_71) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Extended__Feature__Bitmap::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Extended__Feature__Bitmap_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Extended__Feature__Bitmap_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::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT4_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Extended__Feature__Bitmap_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Extended__Feature__Bitmap_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_pS__Handover.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_gigabitInterface.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mOCN.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_cS__PS__Coordination__Enhancements.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[7]);
  {
  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 = 5;
  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(5);
  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;
  }
  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(Extended__Feature__Bitmap_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(Extended__Feature__Bitmap_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_71) {
  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_71.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 Extended__Feature__Bitmap_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
BITSTRING_template field_pS__Handover;
BITSTRING_template field_gigabitInterface;
BITSTRING_template field_mOCN;
BITSTRING_template field_cS__PS__Coordination__Enhancements;
BITSTRING_template field_spare;
};

void Extended__Feature__Bitmap_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_pS__Handover = ANY_VALUE;
single_value->field_gigabitInterface = ANY_VALUE;
single_value->field_mOCN = ANY_VALUE;
single_value->field_cS__PS__Coordination__Enhancements = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void Extended__Feature__Bitmap_template::copy_value(const Extended__Feature__Bitmap& 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.pS__Handover().is_bound()) {
  single_value->field_pS__Handover = other_value.pS__Handover();
} else {
  single_value->field_pS__Handover.clean_up();
}
if (other_value.gigabitInterface().is_bound()) {
  single_value->field_gigabitInterface = other_value.gigabitInterface();
} else {
  single_value->field_gigabitInterface.clean_up();
}
if (other_value.mOCN().is_bound()) {
  single_value->field_mOCN = other_value.mOCN();
} else {
  single_value->field_mOCN.clean_up();
}
if (other_value.cS__PS__Coordination__Enhancements().is_bound()) {
  single_value->field_cS__PS__Coordination__Enhancements = other_value.cS__PS__Coordination__Enhancements();
} else {
  single_value->field_cS__PS__Coordination__Enhancements.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 Extended__Feature__Bitmap_template::copy_template(const Extended__Feature__Bitmap_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.pS__Handover().get_selection()) {
single_value->field_pS__Handover = other_value.pS__Handover();
} else {
single_value->field_pS__Handover.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gigabitInterface().get_selection()) {
single_value->field_gigabitInterface = other_value.gigabitInterface();
} else {
single_value->field_gigabitInterface.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mOCN().get_selection()) {
single_value->field_mOCN = other_value.mOCN();
} else {
single_value->field_mOCN.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cS__PS__Coordination__Enhancements().get_selection()) {
single_value->field_cS__PS__Coordination__Enhancements = other_value.cS__PS__Coordination__Enhancements();
} else {
single_value->field_cS__PS__Coordination__Enhancements.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 Extended__Feature__Bitmap_template[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 Extended__Feature__Bitmap_template(*other_value.implication_.precondition);
implication_.implied_template = new Extended__Feature__Bitmap_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.Extended_Feature_Bitmap.");
break;
}
set_selection(other_value);
}

Extended__Feature__Bitmap_template::Extended__Feature__Bitmap_template()
{
}

Extended__Feature__Bitmap_template::Extended__Feature__Bitmap_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Extended__Feature__Bitmap_template::Extended__Feature__Bitmap_template(const Extended__Feature__Bitmap& other_value)
{
copy_value(other_value);
}

Extended__Feature__Bitmap_template::Extended__Feature__Bitmap_template(const OPTIONAL<Extended__Feature__Bitmap>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Extended__Feature__Bitmap&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Extended_Feature_Bitmap from an unbound optional field.");
}
}

Extended__Feature__Bitmap_template::Extended__Feature__Bitmap_template(Extended__Feature__Bitmap_template* p_precondition, Extended__Feature__Bitmap_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Extended__Feature__Bitmap_template::Extended__Feature__Bitmap_template(Dynamic_Match_Interface<Extended__Feature__Bitmap>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Extended__Feature__Bitmap>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Extended__Feature__Bitmap_template::Extended__Feature__Bitmap_template(const Extended__Feature__Bitmap_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Extended__Feature__Bitmap_template::~Extended__Feature__Bitmap_template()
{
clean_up();
}

Extended__Feature__Bitmap_template& Extended__Feature__Bitmap_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Extended__Feature__Bitmap_template& Extended__Feature__Bitmap_template::operator=(const Extended__Feature__Bitmap& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Extended__Feature__Bitmap_template& Extended__Feature__Bitmap_template::operator=(const OPTIONAL<Extended__Feature__Bitmap>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Extended__Feature__Bitmap&)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.Extended_Feature_Bitmap.");
}
return *this;
}

Extended__Feature__Bitmap_template& Extended__Feature__Bitmap_template::operator=(const Extended__Feature__Bitmap_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Extended__Feature__Bitmap_template::match(const Extended__Feature__Bitmap& 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.pS__Handover().is_bound()) return FALSE;
if(!single_value->field_pS__Handover.match(other_value.pS__Handover(), legacy))return FALSE;
if(!other_value.gigabitInterface().is_bound()) return FALSE;
if(!single_value->field_gigabitInterface.match(other_value.gigabitInterface(), legacy))return FALSE;
if(!other_value.mOCN().is_bound()) return FALSE;
if(!single_value->field_mOCN.match(other_value.mOCN(), legacy))return FALSE;
if(!other_value.cS__PS__Coordination__Enhancements().is_bound()) return FALSE;
if(!single_value->field_cS__PS__Coordination__Enhancements.match(other_value.cS__PS__Coordination__Enhancements(), 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.Extended_Feature_Bitmap.");
}
return FALSE;
}

boolean Extended__Feature__Bitmap_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_pS__Handover.is_bound()
 || single_value->field_gigabitInterface.is_bound()
 || single_value->field_mOCN.is_bound()
 || single_value->field_cS__PS__Coordination__Enhancements.is_bound()
 || single_value->field_spare.is_bound();
}

boolean Extended__Feature__Bitmap_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_pS__Handover.is_value()
 && single_value->field_gigabitInterface.is_value()
 && single_value->field_mOCN.is_value()
 && single_value->field_cS__PS__Coordination__Enhancements.is_value()
 && single_value->field_spare.is_value();
}

void Extended__Feature__Bitmap_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;
}

Extended__Feature__Bitmap Extended__Feature__Bitmap_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.Extended_Feature_Bitmap.");
Extended__Feature__Bitmap 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_pS__Handover.is_bound()) {
ret_val.pS__Handover() = single_value->field_pS__Handover.valueof();
}
if (single_value->field_gigabitInterface.is_bound()) {
ret_val.gigabitInterface() = single_value->field_gigabitInterface.valueof();
}
if (single_value->field_mOCN.is_bound()) {
ret_val.mOCN() = single_value->field_mOCN.valueof();
}
if (single_value->field_cS__PS__Coordination__Enhancements.is_bound()) {
ret_val.cS__PS__Coordination__Enhancements() = single_value->field_cS__PS__Coordination__Enhancements.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void Extended__Feature__Bitmap_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.Extended_Feature_Bitmap.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Extended__Feature__Bitmap_template[list_length];
}

Extended__Feature__Bitmap_template& Extended__Feature__Bitmap_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.Extended_Feature_Bitmap.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Extended_Feature_Bitmap.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& Extended__Feature__Bitmap_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Extended__Feature__Bitmap_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Extended_Feature_Bitmap.");
return single_value->field_iEI;
}

BITSTRING_template& Extended__Feature__Bitmap_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Extended__Feature__Bitmap_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Extended_Feature_Bitmap.");
return single_value->field_ext;
}

LIN2__2a_template& Extended__Feature__Bitmap_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Extended__Feature__Bitmap_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Extended_Feature_Bitmap.");
return single_value->field_lengthIndicator;
}

BITSTRING_template& Extended__Feature__Bitmap_template::pS__Handover()
{
set_specific();
return single_value->field_pS__Handover;
}

const BITSTRING_template& Extended__Feature__Bitmap_template::pS__Handover() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pS_Handover of a non-specific template of type @BSSGP_Types.Extended_Feature_Bitmap.");
return single_value->field_pS__Handover;
}

BITSTRING_template& Extended__Feature__Bitmap_template::gigabitInterface()
{
set_specific();
return single_value->field_gigabitInterface;
}

const BITSTRING_template& Extended__Feature__Bitmap_template::gigabitInterface() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gigabitInterface of a non-specific template of type @BSSGP_Types.Extended_Feature_Bitmap.");
return single_value->field_gigabitInterface;
}

BITSTRING_template& Extended__Feature__Bitmap_template::mOCN()
{
set_specific();
return single_value->field_mOCN;
}

const BITSTRING_template& Extended__Feature__Bitmap_template::mOCN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mOCN of a non-specific template of type @BSSGP_Types.Extended_Feature_Bitmap.");
return single_value->field_mOCN;
}

BITSTRING_template& Extended__Feature__Bitmap_template::cS__PS__Coordination__Enhancements()
{
set_specific();
return single_value->field_cS__PS__Coordination__Enhancements;
}

const BITSTRING_template& Extended__Feature__Bitmap_template::cS__PS__Coordination__Enhancements() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cS_PS_Coordination_Enhancements of a non-specific template of type @BSSGP_Types.Extended_Feature_Bitmap.");
return single_value->field_cS__PS__Coordination__Enhancements;
}

BITSTRING_template& Extended__Feature__Bitmap_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& Extended__Feature__Bitmap_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @BSSGP_Types.Extended_Feature_Bitmap.");
return single_value->field_spare;
}

int Extended__Feature__Bitmap_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Extended_Feature_Bitmap which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 8;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.Extended_Feature_Bitmap 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.Extended_Feature_Bitmap 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.Extended_Feature_Bitmap containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Extended_Feature_Bitmap containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Extended_Feature_Bitmap containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Extended_Feature_Bitmap containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Extended_Feature_Bitmap containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Extended_Feature_Bitmap containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Extended_Feature_Bitmap.");
  }
  return 0;
}

void Extended__Feature__Bitmap_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(", pS_Handover := ");
single_value->field_pS__Handover.log();
TTCN_Logger::log_event_str(", gigabitInterface := ");
single_value->field_gigabitInterface.log();
TTCN_Logger::log_event_str(", mOCN := ");
single_value->field_mOCN.log();
TTCN_Logger::log_event_str(", cS_PS_Coordination_Enhancements := ");
single_value->field_cS__PS__Coordination__Enhancements.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 Extended__Feature__Bitmap_template::log_match(const Extended__Feature__Bitmap& 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_pS__Handover.match(match_value.pS__Handover(), legacy)){
TTCN_Logger::log_logmatch_info(".pS_Handover");
single_value->field_pS__Handover.log_match(match_value.pS__Handover(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gigabitInterface.match(match_value.gigabitInterface(), legacy)){
TTCN_Logger::log_logmatch_info(".gigabitInterface");
single_value->field_gigabitInterface.log_match(match_value.gigabitInterface(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mOCN.match(match_value.mOCN(), legacy)){
TTCN_Logger::log_logmatch_info(".mOCN");
single_value->field_mOCN.log_match(match_value.mOCN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cS__PS__Coordination__Enhancements.match(match_value.cS__PS__Coordination__Enhancements(), legacy)){
TTCN_Logger::log_logmatch_info(".cS_PS_Coordination_Enhancements");
single_value->field_cS__PS__Coordination__Enhancements.log_match(match_value.cS__PS__Coordination__Enhancements(), 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(", pS_Handover := ");
single_value->field_pS__Handover.log_match(match_value.pS__Handover(), legacy);
TTCN_Logger::log_event_str(", gigabitInterface := ");
single_value->field_gigabitInterface.log_match(match_value.gigabitInterface(), legacy);
TTCN_Logger::log_event_str(", mOCN := ");
single_value->field_mOCN.log_match(match_value.mOCN(), legacy);
TTCN_Logger::log_event_str(", cS_PS_Coordination_Enhancements := ");
single_value->field_cS__PS__Coordination__Enhancements.log_match(match_value.cS__PS__Coordination__Enhancements(), 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 Extended__Feature__Bitmap_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_pS__Handover.encode_text(text_buf);
single_value->field_gigabitInterface.encode_text(text_buf);
single_value->field_mOCN.encode_text(text_buf);
single_value->field_cS__PS__Coordination__Enhancements.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.Extended_Feature_Bitmap.");
}
}

void Extended__Feature__Bitmap_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_pS__Handover.decode_text(text_buf);
single_value->field_gigabitInterface.decode_text(text_buf);
single_value->field_mOCN.decode_text(text_buf);
single_value->field_cS__PS__Coordination__Enhancements.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 Extended__Feature__Bitmap_template[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.Extended_Feature_Bitmap.");
}
}

void Extended__Feature__Bitmap_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: {
    Extended__Feature__Bitmap_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Extended_Feature_Bitmap has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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) pS__Handover().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gigabitInterface().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mOCN().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cS__PS__Coordination__Enhancements().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_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(), "pS_Handover")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pS__Handover().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gigabitInterface")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gigabitInterface().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mOCN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mOCN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_PS_Coordination_Enhancements")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cS__PS__Coordination__Enhancements().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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.Extended_Feature_Bitmap: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Extended__Feature__Bitmap_template* precondition = new Extended__Feature__Bitmap_template;
    precondition->set_param(*param.get_elem(0));
    Extended__Feature__Bitmap_template* implied_template = new Extended__Feature__Bitmap_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Extended__Feature__Bitmap_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Extended_Feature_Bitmap");
  }
  is_ifpresent = param.get_ifpresent();
}

void Extended__Feature__Bitmap_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.Extended_Feature_Bitmap");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Extended_Feature_Bitmap");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Extended_Feature_Bitmap");
single_value->field_pS__Handover.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Extended_Feature_Bitmap");
single_value->field_gigabitInterface.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Extended_Feature_Bitmap");
single_value->field_mOCN.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Extended_Feature_Bitmap");
single_value->field_cS__PS__Coordination__Enhancements.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Extended_Feature_Bitmap");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Extended_Feature_Bitmap");
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.Extended_Feature_Bitmap");
}

boolean Extended__Feature__Bitmap_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Extended__Feature__Bitmap_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;
}

Source__to__Target__Transparent__Container::Source__to__Target__Transparent__Container()
{
}

Source__to__Target__Transparent__Container::Source__to__Target__Transparent__Container(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_source__to__Target__Transparent__Container__Contents)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_source__to__Target__Transparent__Container__Contents(par_source__to__Target__Transparent__Container__Contents)
{
}

Source__to__Target__Transparent__Container::Source__to__Target__Transparent__Container(const Source__to__Target__Transparent__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Source_to_Target_Transparent_Container.");
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.source__to__Target__Transparent__Container__Contents().is_bound()) field_source__to__Target__Transparent__Container__Contents = other_value.source__to__Target__Transparent__Container__Contents();
else field_source__to__Target__Transparent__Container__Contents.clean_up();
}

void Source__to__Target__Transparent__Container::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_source__to__Target__Transparent__Container__Contents.clean_up();
}

const TTCN_Typedescriptor_t* Source__to__Target__Transparent__Container::get_descriptor() const { return &Source__to__Target__Transparent__Container_descr_; }
Source__to__Target__Transparent__Container& Source__to__Target__Transparent__Container::operator=(const Source__to__Target__Transparent__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Source_to_Target_Transparent_Container.");
  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.source__to__Target__Transparent__Container__Contents().is_bound()) field_source__to__Target__Transparent__Container__Contents = other_value.source__to__Target__Transparent__Container__Contents();
  else field_source__to__Target__Transparent__Container__Contents.clean_up();
}
return *this;
}

boolean Source__to__Target__Transparent__Container::operator==(const Source__to__Target__Transparent__Container& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_source__to__Target__Transparent__Container__Contents==other_value.field_source__to__Target__Transparent__Container__Contents;
}

boolean Source__to__Target__Transparent__Container::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_source__to__Target__Transparent__Container__Contents.is_bound());
}
boolean Source__to__Target__Transparent__Container::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_source__to__Target__Transparent__Container__Contents.is_value();
}
void Source__to__Target__Transparent__Container::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(", source_to_Target_Transparent_Container_Contents := ");
field_source__to__Target__Transparent__Container__Contents.log();
TTCN_Logger::log_event_str(" }");
}

void Source__to__Target__Transparent__Container::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 (source__to__Target__Transparent__Container__Contents().is_bound()) source__to__Target__Transparent__Container__Contents().set_implicit_omit();
}

void Source__to__Target__Transparent__Container::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.Source_to_Target_Transparent_Container 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) source__to__Target__Transparent__Container__Contents().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(), "source_to_Target_Transparent_Container_Contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__to__Target__Transparent__Container__Contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Source_to_Target_Transparent_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Source_to_Target_Transparent_Container");
  }
}

void Source__to__Target__Transparent__Container::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_source__to__Target__Transparent__Container__Contents.encode_text(text_buf);
}

void Source__to__Target__Transparent__Container::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_source__to__Target__Transparent__Container__Contents.decode_text(text_buf);
}

void Source__to__Target__Transparent__Container::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 Source__to__Target__Transparent__Container::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 Source__to__Target__Transparent__Container::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, Source__to__Target__Transparent__Container_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Source__to__Target__Transparent__Container_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, Source__to__Target__Transparent__Container_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Source__to__Target__Transparent__Container_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_source__to__Target__Transparent__Container__Contents.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_94) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Source__to__Target__Transparent__Container::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, Source__to__Target__Transparent__Container_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Source__to__Target__Transparent__Container_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(Source__to__Target__Transparent__Container_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Source__to__Target__Transparent__Container_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_source__to__Target__Transparent__Container__Contents.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(Source__to__Target__Transparent__Container_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(Source__to__Target__Transparent__Container_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_94) {
  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_94.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 Source__to__Target__Transparent__Container_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_source__to__Target__Transparent__Container__Contents;
};

void Source__to__Target__Transparent__Container_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_source__to__Target__Transparent__Container__Contents = ANY_VALUE;
}
}
}

void Source__to__Target__Transparent__Container_template::copy_value(const Source__to__Target__Transparent__Container& 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.source__to__Target__Transparent__Container__Contents().is_bound()) {
  single_value->field_source__to__Target__Transparent__Container__Contents = other_value.source__to__Target__Transparent__Container__Contents();
} else {
  single_value->field_source__to__Target__Transparent__Container__Contents.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Source__to__Target__Transparent__Container_template::copy_template(const Source__to__Target__Transparent__Container_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.source__to__Target__Transparent__Container__Contents().get_selection()) {
single_value->field_source__to__Target__Transparent__Container__Contents = other_value.source__to__Target__Transparent__Container__Contents();
} else {
single_value->field_source__to__Target__Transparent__Container__Contents.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 Source__to__Target__Transparent__Container_template[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 Source__to__Target__Transparent__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new Source__to__Target__Transparent__Container_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.Source_to_Target_Transparent_Container.");
break;
}
set_selection(other_value);
}

Source__to__Target__Transparent__Container_template::Source__to__Target__Transparent__Container_template()
{
}

Source__to__Target__Transparent__Container_template::Source__to__Target__Transparent__Container_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Source__to__Target__Transparent__Container_template::Source__to__Target__Transparent__Container_template(const Source__to__Target__Transparent__Container& other_value)
{
copy_value(other_value);
}

Source__to__Target__Transparent__Container_template::Source__to__Target__Transparent__Container_template(const OPTIONAL<Source__to__Target__Transparent__Container>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Source__to__Target__Transparent__Container&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Source_to_Target_Transparent_Container from an unbound optional field.");
}
}

Source__to__Target__Transparent__Container_template::Source__to__Target__Transparent__Container_template(Source__to__Target__Transparent__Container_template* p_precondition, Source__to__Target__Transparent__Container_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Source__to__Target__Transparent__Container_template::Source__to__Target__Transparent__Container_template(Dynamic_Match_Interface<Source__to__Target__Transparent__Container>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Source__to__Target__Transparent__Container>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Source__to__Target__Transparent__Container_template::Source__to__Target__Transparent__Container_template(const Source__to__Target__Transparent__Container_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Source__to__Target__Transparent__Container_template::~Source__to__Target__Transparent__Container_template()
{
clean_up();
}

Source__to__Target__Transparent__Container_template& Source__to__Target__Transparent__Container_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Source__to__Target__Transparent__Container_template& Source__to__Target__Transparent__Container_template::operator=(const Source__to__Target__Transparent__Container& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Source__to__Target__Transparent__Container_template& Source__to__Target__Transparent__Container_template::operator=(const OPTIONAL<Source__to__Target__Transparent__Container>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Source__to__Target__Transparent__Container&)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.Source_to_Target_Transparent_Container.");
}
return *this;
}

Source__to__Target__Transparent__Container_template& Source__to__Target__Transparent__Container_template::operator=(const Source__to__Target__Transparent__Container_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Source__to__Target__Transparent__Container_template::match(const Source__to__Target__Transparent__Container& 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.source__to__Target__Transparent__Container__Contents().is_bound()) return FALSE;
if(!single_value->field_source__to__Target__Transparent__Container__Contents.match(other_value.source__to__Target__Transparent__Container__Contents(), 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.Source_to_Target_Transparent_Container.");
}
return FALSE;
}

boolean Source__to__Target__Transparent__Container_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_source__to__Target__Transparent__Container__Contents.is_bound();
}

boolean Source__to__Target__Transparent__Container_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_source__to__Target__Transparent__Container__Contents.is_value();
}

void Source__to__Target__Transparent__Container_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;
}

Source__to__Target__Transparent__Container Source__to__Target__Transparent__Container_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.Source_to_Target_Transparent_Container.");
Source__to__Target__Transparent__Container 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_source__to__Target__Transparent__Container__Contents.is_bound()) {
ret_val.source__to__Target__Transparent__Container__Contents() = single_value->field_source__to__Target__Transparent__Container__Contents.valueof();
}
return ret_val;
}

void Source__to__Target__Transparent__Container_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.Source_to_Target_Transparent_Container.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Source__to__Target__Transparent__Container_template[list_length];
}

Source__to__Target__Transparent__Container_template& Source__to__Target__Transparent__Container_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.Source_to_Target_Transparent_Container.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Source_to_Target_Transparent_Container.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& Source__to__Target__Transparent__Container_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Source__to__Target__Transparent__Container_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Source_to_Target_Transparent_Container.");
return single_value->field_iEI;
}

BITSTRING_template& Source__to__Target__Transparent__Container_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Source__to__Target__Transparent__Container_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Source_to_Target_Transparent_Container.");
return single_value->field_ext;
}

LIN2__2a_template& Source__to__Target__Transparent__Container_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Source__to__Target__Transparent__Container_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Source_to_Target_Transparent_Container.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Source__to__Target__Transparent__Container_template::source__to__Target__Transparent__Container__Contents()
{
set_specific();
return single_value->field_source__to__Target__Transparent__Container__Contents;
}

const OCTETSTRING_template& Source__to__Target__Transparent__Container_template::source__to__Target__Transparent__Container__Contents() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field source_to_Target_Transparent_Container_Contents of a non-specific template of type @BSSGP_Types.Source_to_Target_Transparent_Container.");
return single_value->field_source__to__Target__Transparent__Container__Contents;
}

int Source__to__Target__Transparent__Container_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_to_Target_Transparent_Container 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.Source_to_Target_Transparent_Container 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.Source_to_Target_Transparent_Container 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.Source_to_Target_Transparent_Container containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_to_Target_Transparent_Container containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_to_Target_Transparent_Container containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_to_Target_Transparent_Container containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_to_Target_Transparent_Container containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Source_to_Target_Transparent_Container containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Source_to_Target_Transparent_Container.");
  }
  return 0;
}

void Source__to__Target__Transparent__Container_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(", source_to_Target_Transparent_Container_Contents := ");
single_value->field_source__to__Target__Transparent__Container__Contents.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 Source__to__Target__Transparent__Container_template::log_match(const Source__to__Target__Transparent__Container& 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_source__to__Target__Transparent__Container__Contents.match(match_value.source__to__Target__Transparent__Container__Contents(), legacy)){
TTCN_Logger::log_logmatch_info(".source_to_Target_Transparent_Container_Contents");
single_value->field_source__to__Target__Transparent__Container__Contents.log_match(match_value.source__to__Target__Transparent__Container__Contents(), 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(", source_to_Target_Transparent_Container_Contents := ");
single_value->field_source__to__Target__Transparent__Container__Contents.log_match(match_value.source__to__Target__Transparent__Container__Contents(), 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 Source__to__Target__Transparent__Container_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_source__to__Target__Transparent__Container__Contents.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.Source_to_Target_Transparent_Container.");
}
}

void Source__to__Target__Transparent__Container_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_source__to__Target__Transparent__Container__Contents.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 Source__to__Target__Transparent__Container_template[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.Source_to_Target_Transparent_Container.");
}
}

void Source__to__Target__Transparent__Container_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: {
    Source__to__Target__Transparent__Container_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.Source_to_Target_Transparent_Container 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) source__to__Target__Transparent__Container__Contents().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(), "source_to_Target_Transparent_Container_Contents")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          source__to__Target__Transparent__Container__Contents().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Source_to_Target_Transparent_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Source__to__Target__Transparent__Container_template* precondition = new Source__to__Target__Transparent__Container_template;
    precondition->set_param(*param.get_elem(0));
    Source__to__Target__Transparent__Container_template* implied_template = new Source__to__Target__Transparent__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Source__to__Target__Transparent__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Source_to_Target_Transparent_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void Source__to__Target__Transparent__Container_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.Source_to_Target_Transparent_Container");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_to_Target_Transparent_Container");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_to_Target_Transparent_Container");
single_value->field_source__to__Target__Transparent__Container__Contents.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Source_to_Target_Transparent_Container");
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.Source_to_Target_Transparent_Container");
}

boolean Source__to__Target__Transparent__Container_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Source__to__Target__Transparent__Container_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;
}

Target__to__Source__Transparent__Container::Target__to__Source__Transparent__Container()
{
}

Target__to__Source__Transparent__Container::Target__to__Source__Transparent__Container(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message(par_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message)
{
}

Target__to__Source__Transparent__Container::Target__to__Source__Transparent__Container(const Target__to__Source__Transparent__Container& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Target_to_Source_Transparent_Container.");
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.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().is_bound()) field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message = other_value.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message();
else field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.clean_up();
}

void Target__to__Source__Transparent__Container::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.clean_up();
}

const TTCN_Typedescriptor_t* Target__to__Source__Transparent__Container::get_descriptor() const { return &Target__to__Source__Transparent__Container_descr_; }
Target__to__Source__Transparent__Container& Target__to__Source__Transparent__Container::operator=(const Target__to__Source__Transparent__Container& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Target_to_Source_Transparent_Container.");
  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.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().is_bound()) field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message = other_value.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message();
  else field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.clean_up();
}
return *this;
}

boolean Target__to__Source__Transparent__Container::operator==(const Target__to__Source__Transparent__Container& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message==other_value.field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message;
}

boolean Target__to__Source__Transparent__Container::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.is_bound());
}
boolean Target__to__Source__Transparent__Container::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.is_value();
}
void Target__to__Source__Transparent__Container::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(", handover_to_UTRAN_or_Radio_Bearer_Reconfiguration_radio_interface_message := ");
field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.log();
TTCN_Logger::log_event_str(" }");
}

void Target__to__Source__Transparent__Container::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 (handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().is_bound()) handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().set_implicit_omit();
}

void Target__to__Source__Transparent__Container::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.Target_to_Source_Transparent_Container 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) handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().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(), "handover_to_UTRAN_or_Radio_Bearer_Reconfiguration_radio_interface_message")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Target_to_Source_Transparent_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Target_to_Source_Transparent_Container");
  }
}

void Target__to__Source__Transparent__Container::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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.encode_text(text_buf);
}

void Target__to__Source__Transparent__Container::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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.decode_text(text_buf);
}

void Target__to__Source__Transparent__Container::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 Target__to__Source__Transparent__Container::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 Target__to__Source__Transparent__Container::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, Target__to__Source__Transparent__Container_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Target__to__Source__Transparent__Container_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, Target__to__Source__Transparent__Container_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Target__to__Source__Transparent__Container_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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.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_106) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Target__to__Source__Transparent__Container::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, Target__to__Source__Transparent__Container_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Target__to__Source__Transparent__Container_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(Target__to__Source__Transparent__Container_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Target__to__Source__Transparent__Container_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.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(Target__to__Source__Transparent__Container_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(Target__to__Source__Transparent__Container_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_106) {
  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_106.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 Target__to__Source__Transparent__Container_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message;
};

void Target__to__Source__Transparent__Container_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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message = ANY_VALUE;
}
}
}

void Target__to__Source__Transparent__Container_template::copy_value(const Target__to__Source__Transparent__Container& 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.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().is_bound()) {
  single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message = other_value.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message();
} else {
  single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Target__to__Source__Transparent__Container_template::copy_template(const Target__to__Source__Transparent__Container_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.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().get_selection()) {
single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message = other_value.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message();
} else {
single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.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 Target__to__Source__Transparent__Container_template[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 Target__to__Source__Transparent__Container_template(*other_value.implication_.precondition);
implication_.implied_template = new Target__to__Source__Transparent__Container_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.Target_to_Source_Transparent_Container.");
break;
}
set_selection(other_value);
}

Target__to__Source__Transparent__Container_template::Target__to__Source__Transparent__Container_template()
{
}

Target__to__Source__Transparent__Container_template::Target__to__Source__Transparent__Container_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Target__to__Source__Transparent__Container_template::Target__to__Source__Transparent__Container_template(const Target__to__Source__Transparent__Container& other_value)
{
copy_value(other_value);
}

Target__to__Source__Transparent__Container_template::Target__to__Source__Transparent__Container_template(const OPTIONAL<Target__to__Source__Transparent__Container>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Target__to__Source__Transparent__Container&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Target_to_Source_Transparent_Container from an unbound optional field.");
}
}

Target__to__Source__Transparent__Container_template::Target__to__Source__Transparent__Container_template(Target__to__Source__Transparent__Container_template* p_precondition, Target__to__Source__Transparent__Container_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Target__to__Source__Transparent__Container_template::Target__to__Source__Transparent__Container_template(Dynamic_Match_Interface<Target__to__Source__Transparent__Container>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Target__to__Source__Transparent__Container>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Target__to__Source__Transparent__Container_template::Target__to__Source__Transparent__Container_template(const Target__to__Source__Transparent__Container_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Target__to__Source__Transparent__Container_template::~Target__to__Source__Transparent__Container_template()
{
clean_up();
}

Target__to__Source__Transparent__Container_template& Target__to__Source__Transparent__Container_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Target__to__Source__Transparent__Container_template& Target__to__Source__Transparent__Container_template::operator=(const Target__to__Source__Transparent__Container& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Target__to__Source__Transparent__Container_template& Target__to__Source__Transparent__Container_template::operator=(const OPTIONAL<Target__to__Source__Transparent__Container>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Target__to__Source__Transparent__Container&)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.Target_to_Source_Transparent_Container.");
}
return *this;
}

Target__to__Source__Transparent__Container_template& Target__to__Source__Transparent__Container_template::operator=(const Target__to__Source__Transparent__Container_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Target__to__Source__Transparent__Container_template::match(const Target__to__Source__Transparent__Container& 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.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().is_bound()) return FALSE;
if(!single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.match(other_value.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message(), 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.Target_to_Source_Transparent_Container.");
}
return FALSE;
}

boolean Target__to__Source__Transparent__Container_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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.is_bound();
}

boolean Target__to__Source__Transparent__Container_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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.is_value();
}

void Target__to__Source__Transparent__Container_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;
}

Target__to__Source__Transparent__Container Target__to__Source__Transparent__Container_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.Target_to_Source_Transparent_Container.");
Target__to__Source__Transparent__Container 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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.is_bound()) {
ret_val.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message() = single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.valueof();
}
return ret_val;
}

void Target__to__Source__Transparent__Container_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.Target_to_Source_Transparent_Container.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Target__to__Source__Transparent__Container_template[list_length];
}

Target__to__Source__Transparent__Container_template& Target__to__Source__Transparent__Container_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.Target_to_Source_Transparent_Container.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Target_to_Source_Transparent_Container.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& Target__to__Source__Transparent__Container_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Target__to__Source__Transparent__Container_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Target_to_Source_Transparent_Container.");
return single_value->field_iEI;
}

BITSTRING_template& Target__to__Source__Transparent__Container_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Target__to__Source__Transparent__Container_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Target_to_Source_Transparent_Container.");
return single_value->field_ext;
}

LIN2__2a_template& Target__to__Source__Transparent__Container_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Target__to__Source__Transparent__Container_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Target_to_Source_Transparent_Container.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Target__to__Source__Transparent__Container_template::handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message()
{
set_specific();
return single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message;
}

const OCTETSTRING_template& Target__to__Source__Transparent__Container_template::handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field handover_to_UTRAN_or_Radio_Bearer_Reconfiguration_radio_interface_message of a non-specific template of type @BSSGP_Types.Target_to_Source_Transparent_Container.");
return single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message;
}

int Target__to__Source__Transparent__Container_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_to_Source_Transparent_Container 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.Target_to_Source_Transparent_Container 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.Target_to_Source_Transparent_Container 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.Target_to_Source_Transparent_Container containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_to_Source_Transparent_Container containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_to_Source_Transparent_Container containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_to_Source_Transparent_Container containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_to_Source_Transparent_Container containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Target_to_Source_Transparent_Container containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Target_to_Source_Transparent_Container.");
  }
  return 0;
}

void Target__to__Source__Transparent__Container_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(", handover_to_UTRAN_or_Radio_Bearer_Reconfiguration_radio_interface_message := ");
single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.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 Target__to__Source__Transparent__Container_template::log_match(const Target__to__Source__Transparent__Container& 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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.match(match_value.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message(), legacy)){
TTCN_Logger::log_logmatch_info(".handover_to_UTRAN_or_Radio_Bearer_Reconfiguration_radio_interface_message");
single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.log_match(match_value.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message(), 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(", handover_to_UTRAN_or_Radio_Bearer_Reconfiguration_radio_interface_message := ");
single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.log_match(match_value.handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message(), 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 Target__to__Source__Transparent__Container_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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.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.Target_to_Source_Transparent_Container.");
}
}

void Target__to__Source__Transparent__Container_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_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.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 Target__to__Source__Transparent__Container_template[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.Target_to_Source_Transparent_Container.");
}
}

void Target__to__Source__Transparent__Container_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: {
    Target__to__Source__Transparent__Container_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.Target_to_Source_Transparent_Container 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) handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().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(), "handover_to_UTRAN_or_Radio_Bearer_Reconfiguration_radio_interface_message")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Target_to_Source_Transparent_Container: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Target__to__Source__Transparent__Container_template* precondition = new Target__to__Source__Transparent__Container_template;
    precondition->set_param(*param.get_elem(0));
    Target__to__Source__Transparent__Container_template* implied_template = new Target__to__Source__Transparent__Container_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Target__to__Source__Transparent__Container_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Target_to_Source_Transparent_Container");
  }
  is_ifpresent = param.get_ifpresent();
}

void Target__to__Source__Transparent__Container_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.Target_to_Source_Transparent_Container");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Target_to_Source_Transparent_Container");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Target_to_Source_Transparent_Container");
single_value->field_handover__to__UTRAN__or__Radio__Bearer__Reconfiguration__radio__interface__message.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Target_to_Source_Transparent_Container");
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.Target_to_Source_Transparent_Container");
}

boolean Target__to__Source__Transparent__Container_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Target__to__Source__Transparent__Container_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__Identifier__BSSGP::RNC__Identifier__BSSGP()
{
}

RNC__Identifier__BSSGP::RNC__Identifier__BSSGP(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,
    const OCTETSTRING& par_rNC__ID)
  :   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),
  field_rNC__ID(par_rNC__ID)
{
}

RNC__Identifier__BSSGP::RNC__Identifier__BSSGP(const RNC__Identifier__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.RNC_Identifier_BSSGP.");
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();
if (other_value.rNC__ID().is_bound()) field_rNC__ID = other_value.rNC__ID();
else field_rNC__ID.clean_up();
}

void RNC__Identifier__BSSGP::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();
field_rNC__ID.clean_up();
}

const TTCN_Typedescriptor_t* RNC__Identifier__BSSGP::get_descriptor() const { return &RNC__Identifier__BSSGP_descr_; }
RNC__Identifier__BSSGP& RNC__Identifier__BSSGP::operator=(const RNC__Identifier__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.RNC_Identifier_BSSGP.");
  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();
  if (other_value.rNC__ID().is_bound()) field_rNC__ID = other_value.rNC__ID();
  else field_rNC__ID.clean_up();
}
return *this;
}

boolean RNC__Identifier__BSSGP::operator==(const RNC__Identifier__BSSGP& 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
  && field_rNC__ID==other_value.field_rNC__ID;
}

boolean RNC__Identifier__BSSGP::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())
  || (field_rNC__ID.is_bound());
}
boolean RNC__Identifier__BSSGP::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()
  && field_rNC__ID.is_value();
}
void RNC__Identifier__BSSGP::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(", rNC_ID := ");
field_rNC__ID.log();
TTCN_Logger::log_event_str(" }");
}

void RNC__Identifier__BSSGP::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();
if (rNC__ID().is_bound()) rNC__ID().set_implicit_omit();
}

void RNC__Identifier__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 (12<param.get_size()) {
      param.error("record value of type @BSSGP_Types.RNC_Identifier_BSSGP has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) rNC__ID().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rNC_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rNC__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.RNC_Identifier_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.RNC_Identifier_BSSGP");
  }
}

void RNC__Identifier__BSSGP::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);
field_rNC__ID.encode_text(text_buf);
}

void RNC__Identifier__BSSGP::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);
field_rNC__ID.decode_text(text_buf);
}

void RNC__Identifier__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__Identifier__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__Identifier__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;
  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, RNC__Identifier__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(RNC__Identifier__BSSGP_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, RNC__Identifier__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(RNC__Identifier__BSSGP_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;
  RAW_Force_Omit field_11_force_omit(11, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_rNC__ID.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_11_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field2 -= decoded_field_length;
  if (field_iEI !=  os_93) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RNC__Identifier__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 = 12;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RNC__Identifier__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RNC__Identifier__BSSGP_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);
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, General__Types::OCT2_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(RNC__Identifier__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(RNC__Identifier__BSSGP_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]);
  encoded_length += field_rNC__ID.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[11]);
  {
  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 = 9;
  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(9);
  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;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[8].level = myleaf.body.node.nodes[11]->curr_pos.level;
  myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[8].pos = myleaf.body.node.nodes[11]->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(RNC__Identifier__BSSGP_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(RNC__Identifier__BSSGP_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_93) {
  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_93.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 RNC__Identifier__BSSGP_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;
OCTETSTRING_template field_rNC__ID;
};

void RNC__Identifier__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_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;
single_value->field_rNC__ID = ANY_VALUE;
}
}
}

void RNC__Identifier__BSSGP_template::copy_value(const RNC__Identifier__BSSGP& 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();
}
if (other_value.rNC__ID().is_bound()) {
  single_value->field_rNC__ID = other_value.rNC__ID();
} else {
  single_value->field_rNC__ID.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RNC__Identifier__BSSGP_template::copy_template(const RNC__Identifier__BSSGP_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();
}
if (UNINITIALIZED_TEMPLATE != other_value.rNC__ID().get_selection()) {
single_value->field_rNC__ID = other_value.rNC__ID();
} else {
single_value->field_rNC__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 RNC__Identifier__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__Identifier__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new RNC__Identifier__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_Identifier_BSSGP.");
break;
}
set_selection(other_value);
}

RNC__Identifier__BSSGP_template::RNC__Identifier__BSSGP_template()
{
}

RNC__Identifier__BSSGP_template::RNC__Identifier__BSSGP_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RNC__Identifier__BSSGP_template::RNC__Identifier__BSSGP_template(const RNC__Identifier__BSSGP& other_value)
{
copy_value(other_value);
}

RNC__Identifier__BSSGP_template::RNC__Identifier__BSSGP_template(const OPTIONAL<RNC__Identifier__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RNC__Identifier__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.RNC_Identifier_BSSGP from an unbound optional field.");
}
}

RNC__Identifier__BSSGP_template::RNC__Identifier__BSSGP_template(RNC__Identifier__BSSGP_template* p_precondition, RNC__Identifier__BSSGP_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RNC__Identifier__BSSGP_template::RNC__Identifier__BSSGP_template(Dynamic_Match_Interface<RNC__Identifier__BSSGP>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RNC__Identifier__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RNC__Identifier__BSSGP_template::RNC__Identifier__BSSGP_template(const RNC__Identifier__BSSGP_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RNC__Identifier__BSSGP_template::~RNC__Identifier__BSSGP_template()
{
clean_up();
}

RNC__Identifier__BSSGP_template& RNC__Identifier__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RNC__Identifier__BSSGP_template& RNC__Identifier__BSSGP_template::operator=(const RNC__Identifier__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RNC__Identifier__BSSGP_template& RNC__Identifier__BSSGP_template::operator=(const OPTIONAL<RNC__Identifier__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RNC__Identifier__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_Identifier_BSSGP.");
}
return *this;
}

RNC__Identifier__BSSGP_template& RNC__Identifier__BSSGP_template::operator=(const RNC__Identifier__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RNC__Identifier__BSSGP_template::match(const RNC__Identifier__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.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;
if(!other_value.rNC__ID().is_bound()) return FALSE;
if(!single_value->field_rNC__ID.match(other_value.rNC__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.RNC_Identifier_BSSGP.");
}
return FALSE;
}

boolean RNC__Identifier__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_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()
 || single_value->field_rNC__ID.is_bound();
}

boolean RNC__Identifier__BSSGP_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()
 && single_value->field_rNC__ID.is_value();
}

void RNC__Identifier__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__Identifier__BSSGP RNC__Identifier__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_Identifier_BSSGP.");
RNC__Identifier__BSSGP 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();
}
if (single_value->field_rNC__ID.is_bound()) {
ret_val.rNC__ID() = single_value->field_rNC__ID.valueof();
}
return ret_val;
}

void RNC__Identifier__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_Identifier_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RNC__Identifier__BSSGP_template[list_length];
}

RNC__Identifier__BSSGP_template& RNC__Identifier__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_Identifier_BSSGP.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& RNC__Identifier__BSSGP_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& RNC__Identifier__BSSGP_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_iEI;
}

BITSTRING_template& RNC__Identifier__BSSGP_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& RNC__Identifier__BSSGP_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_ext;
}

LIN2__2a_template& RNC__Identifier__BSSGP_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& RNC__Identifier__BSSGP_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_lengthIndicator;
}

HEXSTRING_template& RNC__Identifier__BSSGP_template::mccDigit1()
{
set_specific();
return single_value->field_mccDigit1;
}

const HEXSTRING_template& RNC__Identifier__BSSGP_template::mccDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit1 of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_mccDigit1;
}

HEXSTRING_template& RNC__Identifier__BSSGP_template::mccDigit2()
{
set_specific();
return single_value->field_mccDigit2;
}

const HEXSTRING_template& RNC__Identifier__BSSGP_template::mccDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit2 of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_mccDigit2;
}

HEXSTRING_template& RNC__Identifier__BSSGP_template::mccDigit3()
{
set_specific();
return single_value->field_mccDigit3;
}

const HEXSTRING_template& RNC__Identifier__BSSGP_template::mccDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mccDigit3 of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_mccDigit3;
}

HEXSTRING_template& RNC__Identifier__BSSGP_template::mncDigit3()
{
set_specific();
return single_value->field_mncDigit3;
}

const HEXSTRING_template& RNC__Identifier__BSSGP_template::mncDigit3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit3 of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_mncDigit3;
}

HEXSTRING_template& RNC__Identifier__BSSGP_template::mncDigit1()
{
set_specific();
return single_value->field_mncDigit1;
}

const HEXSTRING_template& RNC__Identifier__BSSGP_template::mncDigit1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit1 of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_mncDigit1;
}

HEXSTRING_template& RNC__Identifier__BSSGP_template::mncDigit2()
{
set_specific();
return single_value->field_mncDigit2;
}

const HEXSTRING_template& RNC__Identifier__BSSGP_template::mncDigit2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mncDigit2 of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_mncDigit2;
}

OCTETSTRING_template& RNC__Identifier__BSSGP_template::lac()
{
set_specific();
return single_value->field_lac;
}

const OCTETSTRING_template& RNC__Identifier__BSSGP_template::lac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lac of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_lac;
}

OCTETSTRING_template& RNC__Identifier__BSSGP_template::rac()
{
set_specific();
return single_value->field_rac;
}

const OCTETSTRING_template& RNC__Identifier__BSSGP_template::rac() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rac of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_rac;
}

OCTETSTRING_template& RNC__Identifier__BSSGP_template::rNC__ID()
{
set_specific();
return single_value->field_rNC__ID;
}

const OCTETSTRING_template& RNC__Identifier__BSSGP_template::rNC__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rNC_ID of a non-specific template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
return single_value->field_rNC__ID;
}

int RNC__Identifier__BSSGP_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RNC_Identifier_BSSGP which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 12;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.RNC_Identifier_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_Identifier_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_Identifier_BSSGP containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RNC_Identifier_BSSGP containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RNC_Identifier_BSSGP containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RNC_Identifier_BSSGP containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RNC_Identifier_BSSGP containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.RNC_Identifier_BSSGP containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.RNC_Identifier_BSSGP.");
  }
  return 0;
}

void RNC__Identifier__BSSGP_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(", rNC_ID := ");
single_value->field_rNC__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 RNC__Identifier__BSSGP_template::log_match(const RNC__Identifier__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_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);
}
if(!single_value->field_rNC__ID.match(match_value.rNC__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".rNC_ID");
single_value->field_rNC__ID.log_match(match_value.rNC__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(", 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(", rNC_ID := ");
single_value->field_rNC__ID.log_match(match_value.rNC__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 RNC__Identifier__BSSGP_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);
single_value->field_rNC__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.RNC_Identifier_BSSGP.");
}
}

void RNC__Identifier__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_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);
single_value->field_rNC__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 RNC__Identifier__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_Identifier_BSSGP.");
}
}

void RNC__Identifier__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__Identifier__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 (12<param.get_size()) {
      param.error("record template of type @BSSGP_Types.RNC_Identifier_BSSGP has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) 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));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) rNC__ID().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rNC_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rNC__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.RNC_Identifier_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RNC__Identifier__BSSGP_template* precondition = new RNC__Identifier__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    RNC__Identifier__BSSGP_template* implied_template = new RNC__Identifier__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RNC__Identifier__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.RNC_Identifier_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void RNC__Identifier__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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_mccDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_mccDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_mccDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_mncDigit3.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_mncDigit1.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_mncDigit2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_lac.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_rac.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_BSSGP");
single_value->field_rNC__ID.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.RNC_Identifier_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_Identifier_BSSGP");
}

boolean RNC__Identifier__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RNC__Identifier__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;
}

IMEI__Value::IMEI__Value()
{
}

IMEI__Value::IMEI__Value(const BITSTRING& par_typeOfIdentity,
    const BITSTRING& par_oddevenIndicator,
    const HEXSTRING& par_digits)
  :   field_typeOfIdentity(par_typeOfIdentity),
  field_oddevenIndicator(par_oddevenIndicator),
  field_digits(par_digits)
{
}

IMEI__Value::IMEI__Value(const IMEI__Value& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.IMEI_Value.");
if (other_value.typeOfIdentity().is_bound()) field_typeOfIdentity = other_value.typeOfIdentity();
else field_typeOfIdentity.clean_up();
if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
else field_oddevenIndicator.clean_up();
if (other_value.digits().is_bound()) field_digits = other_value.digits();
else field_digits.clean_up();
}

void IMEI__Value::clean_up()
{
field_typeOfIdentity.clean_up();
field_oddevenIndicator.clean_up();
field_digits.clean_up();
}

const TTCN_Typedescriptor_t* IMEI__Value::get_descriptor() const { return &IMEI__Value_descr_; }
IMEI__Value& IMEI__Value::operator=(const IMEI__Value& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.IMEI_Value.");
  if (other_value.typeOfIdentity().is_bound()) field_typeOfIdentity = other_value.typeOfIdentity();
  else field_typeOfIdentity.clean_up();
  if (other_value.oddevenIndicator().is_bound()) field_oddevenIndicator = other_value.oddevenIndicator();
  else field_oddevenIndicator.clean_up();
  if (other_value.digits().is_bound()) field_digits = other_value.digits();
  else field_digits.clean_up();
}
return *this;
}

boolean IMEI__Value::operator==(const IMEI__Value& other_value) const
{
return field_typeOfIdentity==other_value.field_typeOfIdentity
  && field_oddevenIndicator==other_value.field_oddevenIndicator
  && field_digits==other_value.field_digits;
}

boolean IMEI__Value::is_bound() const
{
return (field_typeOfIdentity.is_bound())
  || (field_oddevenIndicator.is_bound())
  || (field_digits.is_bound());
}
boolean IMEI__Value::is_value() const
{
return field_typeOfIdentity.is_value()
  && field_oddevenIndicator.is_value()
  && field_digits.is_value();
}
void IMEI__Value::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ typeOfIdentity := ");
field_typeOfIdentity.log();
TTCN_Logger::log_event_str(", oddevenIndicator := ");
field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", digits := ");
field_digits.log();
TTCN_Logger::log_event_str(" }");
}

void IMEI__Value::set_implicit_omit()
{
if (typeOfIdentity().is_bound()) typeOfIdentity().set_implicit_omit();
if (oddevenIndicator().is_bound()) oddevenIndicator().set_implicit_omit();
if (digits().is_bound()) digits().set_implicit_omit();
}

void IMEI__Value::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.IMEI_Value 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) typeOfIdentity().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) oddevenIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) digits().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(), "typeOfIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeOfIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "digits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          digits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.IMEI_Value: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.IMEI_Value");
  }
}

void IMEI__Value::encode_text(Text_Buf& text_buf) const
{
field_typeOfIdentity.encode_text(text_buf);
field_oddevenIndicator.encode_text(text_buf);
field_digits.encode_text(text_buf);
}

void IMEI__Value::decode_text(Text_Buf& text_buf)
{
field_typeOfIdentity.decode_text(text_buf);
field_oddevenIndicator.decode_text(text_buf);
field_digits.decode_text(text_buf);
}

void IMEI__Value::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 IMEI__Value::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 IMEI__Value::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_typeOfIdentity.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::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_oddevenIndicator.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, IMEI__Value_digits_descr_.raw->forceomit);
  decoded_field_length = field_digits.RAW_decode(IMEI__Value_digits_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 IMEI__Value::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IMEI__Value_digits_descr_.raw);
  encoded_length += field_typeOfIdentity.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_oddevenIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_digits.RAW_encode(IMEI__Value_digits_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct IMEI__Value_template::single_value_struct {
BITSTRING_template field_typeOfIdentity;
BITSTRING_template field_oddevenIndicator;
HEXSTRING_template field_digits;
};

void IMEI__Value_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_typeOfIdentity = ANY_VALUE;
single_value->field_oddevenIndicator = ANY_VALUE;
single_value->field_digits = ANY_VALUE;
}
}
}

void IMEI__Value_template::copy_value(const IMEI__Value& other_value)
{
single_value = new single_value_struct;
if (other_value.typeOfIdentity().is_bound()) {
  single_value->field_typeOfIdentity = other_value.typeOfIdentity();
} else {
  single_value->field_typeOfIdentity.clean_up();
}
if (other_value.oddevenIndicator().is_bound()) {
  single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
  single_value->field_oddevenIndicator.clean_up();
}
if (other_value.digits().is_bound()) {
  single_value->field_digits = other_value.digits();
} else {
  single_value->field_digits.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void IMEI__Value_template::copy_template(const IMEI__Value_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.typeOfIdentity().get_selection()) {
single_value->field_typeOfIdentity = other_value.typeOfIdentity();
} else {
single_value->field_typeOfIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oddevenIndicator().get_selection()) {
single_value->field_oddevenIndicator = other_value.oddevenIndicator();
} else {
single_value->field_oddevenIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.digits().get_selection()) {
single_value->field_digits = other_value.digits();
} else {
single_value->field_digits.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 IMEI__Value_template[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 IMEI__Value_template(*other_value.implication_.precondition);
implication_.implied_template = new IMEI__Value_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.IMEI_Value.");
break;
}
set_selection(other_value);
}

IMEI__Value_template::IMEI__Value_template()
{
}

IMEI__Value_template::IMEI__Value_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

IMEI__Value_template::IMEI__Value_template(const IMEI__Value& other_value)
{
copy_value(other_value);
}

IMEI__Value_template::IMEI__Value_template(const OPTIONAL<IMEI__Value>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const IMEI__Value&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.IMEI_Value from an unbound optional field.");
}
}

IMEI__Value_template::IMEI__Value_template(IMEI__Value_template* p_precondition, IMEI__Value_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

IMEI__Value_template::IMEI__Value_template(Dynamic_Match_Interface<IMEI__Value>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<IMEI__Value>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

IMEI__Value_template::IMEI__Value_template(const IMEI__Value_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

IMEI__Value_template::~IMEI__Value_template()
{
clean_up();
}

IMEI__Value_template& IMEI__Value_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

IMEI__Value_template& IMEI__Value_template::operator=(const IMEI__Value& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

IMEI__Value_template& IMEI__Value_template::operator=(const OPTIONAL<IMEI__Value>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const IMEI__Value&)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.IMEI_Value.");
}
return *this;
}

IMEI__Value_template& IMEI__Value_template::operator=(const IMEI__Value_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean IMEI__Value_template::match(const IMEI__Value& 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.typeOfIdentity().is_bound()) return FALSE;
if(!single_value->field_typeOfIdentity.match(other_value.typeOfIdentity(), legacy))return FALSE;
if(!other_value.oddevenIndicator().is_bound()) return FALSE;
if(!single_value->field_oddevenIndicator.match(other_value.oddevenIndicator(), legacy))return FALSE;
if(!other_value.digits().is_bound()) return FALSE;
if(!single_value->field_digits.match(other_value.digits(), 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.IMEI_Value.");
}
return FALSE;
}

boolean IMEI__Value_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_typeOfIdentity.is_bound()
 || single_value->field_oddevenIndicator.is_bound()
 || single_value->field_digits.is_bound();
}

boolean IMEI__Value_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_typeOfIdentity.is_value()
 && single_value->field_oddevenIndicator.is_value()
 && single_value->field_digits.is_value();
}

void IMEI__Value_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;
}

IMEI__Value IMEI__Value_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.IMEI_Value.");
IMEI__Value ret_val;
if (single_value->field_typeOfIdentity.is_bound()) {
ret_val.typeOfIdentity() = single_value->field_typeOfIdentity.valueof();
}
if (single_value->field_oddevenIndicator.is_bound()) {
ret_val.oddevenIndicator() = single_value->field_oddevenIndicator.valueof();
}
if (single_value->field_digits.is_bound()) {
ret_val.digits() = single_value->field_digits.valueof();
}
return ret_val;
}

void IMEI__Value_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.IMEI_Value.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new IMEI__Value_template[list_length];
}

IMEI__Value_template& IMEI__Value_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.IMEI_Value.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.IMEI_Value.");
return value_list.list_value[list_index];
}

BITSTRING_template& IMEI__Value_template::typeOfIdentity()
{
set_specific();
return single_value->field_typeOfIdentity;
}

const BITSTRING_template& IMEI__Value_template::typeOfIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field typeOfIdentity of a non-specific template of type @BSSGP_Types.IMEI_Value.");
return single_value->field_typeOfIdentity;
}

BITSTRING_template& IMEI__Value_template::oddevenIndicator()
{
set_specific();
return single_value->field_oddevenIndicator;
}

const BITSTRING_template& IMEI__Value_template::oddevenIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oddevenIndicator of a non-specific template of type @BSSGP_Types.IMEI_Value.");
return single_value->field_oddevenIndicator;
}

HEXSTRING_template& IMEI__Value_template::digits()
{
set_specific();
return single_value->field_digits;
}

const HEXSTRING_template& IMEI__Value_template::digits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field digits of a non-specific template of type @BSSGP_Types.IMEI_Value.");
return single_value->field_digits;
}

int IMEI__Value_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_Value 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.IMEI_Value 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.IMEI_Value 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.IMEI_Value containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_Value containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_Value containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_Value containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_Value containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_Value containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.IMEI_Value.");
  }
  return 0;
}

void IMEI__Value_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ typeOfIdentity := ");
single_value->field_typeOfIdentity.log();
TTCN_Logger::log_event_str(", oddevenIndicator := ");
single_value->field_oddevenIndicator.log();
TTCN_Logger::log_event_str(", digits := ");
single_value->field_digits.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 IMEI__Value_template::log_match(const IMEI__Value& 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_typeOfIdentity.match(match_value.typeOfIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".typeOfIdentity");
single_value->field_typeOfIdentity.log_match(match_value.typeOfIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oddevenIndicator.match(match_value.oddevenIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".oddevenIndicator");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_digits.match(match_value.digits(), legacy)){
TTCN_Logger::log_logmatch_info(".digits");
single_value->field_digits.log_match(match_value.digits(), 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("{ typeOfIdentity := ");
single_value->field_typeOfIdentity.log_match(match_value.typeOfIdentity(), legacy);
TTCN_Logger::log_event_str(", oddevenIndicator := ");
single_value->field_oddevenIndicator.log_match(match_value.oddevenIndicator(), legacy);
TTCN_Logger::log_event_str(", digits := ");
single_value->field_digits.log_match(match_value.digits(), 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 IMEI__Value_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_typeOfIdentity.encode_text(text_buf);
single_value->field_oddevenIndicator.encode_text(text_buf);
single_value->field_digits.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.IMEI_Value.");
}
}

void IMEI__Value_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_typeOfIdentity.decode_text(text_buf);
single_value->field_oddevenIndicator.decode_text(text_buf);
single_value->field_digits.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 IMEI__Value_template[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.IMEI_Value.");
}
}

void IMEI__Value_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: {
    IMEI__Value_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.IMEI_Value 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) typeOfIdentity().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) oddevenIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) digits().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(), "typeOfIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          typeOfIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oddevenIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oddevenIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "digits")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          digits().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.IMEI_Value: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    IMEI__Value_template* precondition = new IMEI__Value_template;
    precondition->set_param(*param.get_elem(0));
    IMEI__Value_template* implied_template = new IMEI__Value_template;
    implied_template->set_param(*param.get_elem(1));
    *this = IMEI__Value_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.IMEI_Value");
  }
  is_ifpresent = param.get_ifpresent();
}

void IMEI__Value_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_typeOfIdentity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IMEI_Value");
single_value->field_oddevenIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IMEI_Value");
single_value->field_digits.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IMEI_Value");
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.IMEI_Value");
}

boolean IMEI__Value_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean IMEI__Value_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;
}

IMEI__BSSGP::IMEI__BSSGP()
{
}

IMEI__BSSGP::IMEI__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const IMEI__Value& par_iMEI)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_iMEI(par_iMEI)
{
}

IMEI__BSSGP::IMEI__BSSGP(const IMEI__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.IMEI_BSSGP.");
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.iMEI().is_bound()) field_iMEI = other_value.iMEI();
else field_iMEI.clean_up();
}

void IMEI__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_iMEI.clean_up();
}

const TTCN_Typedescriptor_t* IMEI__BSSGP::get_descriptor() const { return &IMEI__BSSGP_descr_; }
IMEI__BSSGP& IMEI__BSSGP::operator=(const IMEI__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.IMEI_BSSGP.");
  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.iMEI().is_bound()) field_iMEI = other_value.iMEI();
  else field_iMEI.clean_up();
}
return *this;
}

boolean IMEI__BSSGP::operator==(const IMEI__BSSGP& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_iMEI==other_value.field_iMEI;
}

boolean IMEI__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_iMEI.is_bound());
}
boolean IMEI__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_iMEI.is_value();
}
void IMEI__BSSGP::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(", iMEI := ");
field_iMEI.log();
TTCN_Logger::log_event_str(" }");
}

void IMEI__BSSGP::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 (iMEI().is_bound()) iMEI().set_implicit_omit();
}

void IMEI__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 (4<param.get_size()) {
      param.error("record value of type @BSSGP_Types.IMEI_BSSGP 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) iMEI().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(), "iMEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.IMEI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.IMEI_BSSGP");
  }
}

void IMEI__BSSGP::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_iMEI.encode_text(text_buf);
}

void IMEI__BSSGP::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_iMEI.decode_text(text_buf);
}

void IMEI__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 IMEI__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 IMEI__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;
  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, IMEI__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(IMEI__BSSGP_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, IMEI__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(IMEI__BSSGP_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, IMEI__Value_descr_.raw->forceomit);
  decoded_field_length = field_iMEI.RAW_decode(IMEI__Value_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_118) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int IMEI__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 = 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, IMEI__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IMEI__BSSGP_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, IMEI__Value_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(IMEI__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(IMEI__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_iMEI.RAW_encode(IMEI__Value_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(IMEI__BSSGP_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(IMEI__BSSGP_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_118) {
  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_118.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 IMEI__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
IMEI__Value_template field_iMEI;
};

void IMEI__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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_iMEI = ANY_VALUE;
}
}
}

void IMEI__BSSGP_template::copy_value(const IMEI__BSSGP& 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.iMEI().is_bound()) {
  single_value->field_iMEI = other_value.iMEI();
} else {
  single_value->field_iMEI.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void IMEI__BSSGP_template::copy_template(const IMEI__BSSGP_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.iMEI().get_selection()) {
single_value->field_iMEI = other_value.iMEI();
} else {
single_value->field_iMEI.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 IMEI__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 IMEI__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new IMEI__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.IMEI_BSSGP.");
break;
}
set_selection(other_value);
}

IMEI__BSSGP_template::IMEI__BSSGP_template()
{
}

IMEI__BSSGP_template::IMEI__BSSGP_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

IMEI__BSSGP_template::IMEI__BSSGP_template(const IMEI__BSSGP& other_value)
{
copy_value(other_value);
}

IMEI__BSSGP_template::IMEI__BSSGP_template(const OPTIONAL<IMEI__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const IMEI__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.IMEI_BSSGP from an unbound optional field.");
}
}

IMEI__BSSGP_template::IMEI__BSSGP_template(IMEI__BSSGP_template* p_precondition, IMEI__BSSGP_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

IMEI__BSSGP_template::IMEI__BSSGP_template(Dynamic_Match_Interface<IMEI__BSSGP>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<IMEI__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

IMEI__BSSGP_template::IMEI__BSSGP_template(const IMEI__BSSGP_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

IMEI__BSSGP_template::~IMEI__BSSGP_template()
{
clean_up();
}

IMEI__BSSGP_template& IMEI__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

IMEI__BSSGP_template& IMEI__BSSGP_template::operator=(const IMEI__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

IMEI__BSSGP_template& IMEI__BSSGP_template::operator=(const OPTIONAL<IMEI__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const IMEI__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.IMEI_BSSGP.");
}
return *this;
}

IMEI__BSSGP_template& IMEI__BSSGP_template::operator=(const IMEI__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean IMEI__BSSGP_template::match(const IMEI__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.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.iMEI().is_bound()) return FALSE;
if(!single_value->field_iMEI.match(other_value.iMEI(), 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.IMEI_BSSGP.");
}
return FALSE;
}

boolean IMEI__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_iMEI.is_bound();
}

boolean IMEI__BSSGP_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_iMEI.is_value();
}

void IMEI__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;
}

IMEI__BSSGP IMEI__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.IMEI_BSSGP.");
IMEI__BSSGP 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_iMEI.is_bound()) {
ret_val.iMEI() = single_value->field_iMEI.valueof();
}
return ret_val;
}

void IMEI__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.IMEI_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new IMEI__BSSGP_template[list_length];
}

IMEI__BSSGP_template& IMEI__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.IMEI_BSSGP.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.IMEI_BSSGP.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& IMEI__BSSGP_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& IMEI__BSSGP_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.IMEI_BSSGP.");
return single_value->field_iEI;
}

BITSTRING_template& IMEI__BSSGP_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& IMEI__BSSGP_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.IMEI_BSSGP.");
return single_value->field_ext;
}

LIN2__2a_template& IMEI__BSSGP_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& IMEI__BSSGP_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.IMEI_BSSGP.");
return single_value->field_lengthIndicator;
}

IMEI__Value_template& IMEI__BSSGP_template::iMEI()
{
set_specific();
return single_value->field_iMEI;
}

const IMEI__Value_template& IMEI__BSSGP_template::iMEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iMEI of a non-specific template of type @BSSGP_Types.IMEI_BSSGP.");
return single_value->field_iMEI;
}

int IMEI__BSSGP_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_BSSGP 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.IMEI_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.IMEI_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.IMEI_BSSGP containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_BSSGP containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_BSSGP containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_BSSGP containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_BSSGP containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.IMEI_BSSGP containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.IMEI_BSSGP.");
  }
  return 0;
}

void IMEI__BSSGP_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(", iMEI := ");
single_value->field_iMEI.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 IMEI__BSSGP_template::log_match(const IMEI__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_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_iMEI.match(match_value.iMEI(), legacy)){
TTCN_Logger::log_logmatch_info(".iMEI");
single_value->field_iMEI.log_match(match_value.iMEI(), 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(", iMEI := ");
single_value->field_iMEI.log_match(match_value.iMEI(), 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 IMEI__BSSGP_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_iMEI.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.IMEI_BSSGP.");
}
}

void IMEI__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_iMEI.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 IMEI__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.IMEI_BSSGP.");
}
}

void IMEI__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: {
    IMEI__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 (4<param.get_size()) {
      param.error("record template of type @BSSGP_Types.IMEI_BSSGP 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) iMEI().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(), "iMEI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iMEI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.IMEI_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    IMEI__BSSGP_template* precondition = new IMEI__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    IMEI__BSSGP_template* implied_template = new IMEI__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = IMEI__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.IMEI_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void IMEI__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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IMEI_BSSGP");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IMEI_BSSGP");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IMEI_BSSGP");
single_value->field_iMEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.IMEI_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.IMEI_BSSGP");
}

boolean IMEI__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean IMEI__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;
}

Time__To__MBMS__Data__Transfer::Time__To__MBMS__Data__Transfer()
{
}

Time__To__MBMS__Data__Transfer::Time__To__MBMS__Data__Transfer(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_valuePart)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_valuePart(par_valuePart)
{
}

Time__To__MBMS__Data__Transfer::Time__To__MBMS__Data__Transfer(const Time__To__MBMS__Data__Transfer& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
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.valuePart().is_bound()) field_valuePart = other_value.valuePart();
else field_valuePart.clean_up();
}

void Time__To__MBMS__Data__Transfer::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_valuePart.clean_up();
}

const TTCN_Typedescriptor_t* Time__To__MBMS__Data__Transfer::get_descriptor() const { return &Time__To__MBMS__Data__Transfer_descr_; }
Time__To__MBMS__Data__Transfer& Time__To__MBMS__Data__Transfer::operator=(const Time__To__MBMS__Data__Transfer& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
  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.valuePart().is_bound()) field_valuePart = other_value.valuePart();
  else field_valuePart.clean_up();
}
return *this;
}

boolean Time__To__MBMS__Data__Transfer::operator==(const Time__To__MBMS__Data__Transfer& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_valuePart==other_value.field_valuePart;
}

boolean Time__To__MBMS__Data__Transfer::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_valuePart.is_bound());
}
boolean Time__To__MBMS__Data__Transfer::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_valuePart.is_value();
}
void Time__To__MBMS__Data__Transfer::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(", valuePart := ");
field_valuePart.log();
TTCN_Logger::log_event_str(" }");
}

void Time__To__MBMS__Data__Transfer::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 (valuePart().is_bound()) valuePart().set_implicit_omit();
}

void Time__To__MBMS__Data__Transfer::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.Time_To_MBMS_Data_Transfer 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Time_To_MBMS_Data_Transfer: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Time_To_MBMS_Data_Transfer");
  }
}

void Time__To__MBMS__Data__Transfer::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_valuePart.encode_text(text_buf);
}

void Time__To__MBMS__Data__Transfer::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_valuePart.decode_text(text_buf);
}

void Time__To__MBMS__Data__Transfer::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__To__MBMS__Data__Transfer::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__To__MBMS__Data__Transfer::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__To__MBMS__Data__Transfer_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Time__To__MBMS__Data__Transfer_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__To__MBMS__Data__Transfer_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Time__To__MBMS__Data__Transfer_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_valuePart.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_139) 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__To__MBMS__Data__Transfer::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, Time__To__MBMS__Data__Transfer_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Time__To__MBMS__Data__Transfer_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(Time__To__MBMS__Data__Transfer_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Time__To__MBMS__Data__Transfer_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_valuePart.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(Time__To__MBMS__Data__Transfer_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__To__MBMS__Data__Transfer_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_139) {
  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_139.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__To__MBMS__Data__Transfer_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_valuePart;
};

void Time__To__MBMS__Data__Transfer_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_valuePart = ANY_VALUE;
}
}
}

void Time__To__MBMS__Data__Transfer_template::copy_value(const Time__To__MBMS__Data__Transfer& 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.valuePart().is_bound()) {
  single_value->field_valuePart = other_value.valuePart();
} else {
  single_value->field_valuePart.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Time__To__MBMS__Data__Transfer_template::copy_template(const Time__To__MBMS__Data__Transfer_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.valuePart().get_selection()) {
single_value->field_valuePart = other_value.valuePart();
} else {
single_value->field_valuePart.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Time__To__MBMS__Data__Transfer_template[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__To__MBMS__Data__Transfer_template(*other_value.implication_.precondition);
implication_.implied_template = new Time__To__MBMS__Data__Transfer_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_To_MBMS_Data_Transfer.");
break;
}
set_selection(other_value);
}

Time__To__MBMS__Data__Transfer_template::Time__To__MBMS__Data__Transfer_template()
{
}

Time__To__MBMS__Data__Transfer_template::Time__To__MBMS__Data__Transfer_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Time__To__MBMS__Data__Transfer_template::Time__To__MBMS__Data__Transfer_template(const Time__To__MBMS__Data__Transfer& other_value)
{
copy_value(other_value);
}

Time__To__MBMS__Data__Transfer_template::Time__To__MBMS__Data__Transfer_template(const OPTIONAL<Time__To__MBMS__Data__Transfer>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Time__To__MBMS__Data__Transfer&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer from an unbound optional field.");
}
}

Time__To__MBMS__Data__Transfer_template::Time__To__MBMS__Data__Transfer_template(Time__To__MBMS__Data__Transfer_template* p_precondition, Time__To__MBMS__Data__Transfer_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Time__To__MBMS__Data__Transfer_template::Time__To__MBMS__Data__Transfer_template(Dynamic_Match_Interface<Time__To__MBMS__Data__Transfer>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Time__To__MBMS__Data__Transfer>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Time__To__MBMS__Data__Transfer_template::Time__To__MBMS__Data__Transfer_template(const Time__To__MBMS__Data__Transfer_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Time__To__MBMS__Data__Transfer_template::~Time__To__MBMS__Data__Transfer_template()
{
clean_up();
}

Time__To__MBMS__Data__Transfer_template& Time__To__MBMS__Data__Transfer_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Time__To__MBMS__Data__Transfer_template& Time__To__MBMS__Data__Transfer_template::operator=(const Time__To__MBMS__Data__Transfer& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Time__To__MBMS__Data__Transfer_template& Time__To__MBMS__Data__Transfer_template::operator=(const OPTIONAL<Time__To__MBMS__Data__Transfer>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Time__To__MBMS__Data__Transfer&)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_To_MBMS_Data_Transfer.");
}
return *this;
}

Time__To__MBMS__Data__Transfer_template& Time__To__MBMS__Data__Transfer_template::operator=(const Time__To__MBMS__Data__Transfer_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Time__To__MBMS__Data__Transfer_template::match(const Time__To__MBMS__Data__Transfer& 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.valuePart().is_bound()) return FALSE;
if(!single_value->field_valuePart.match(other_value.valuePart(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
}
return FALSE;
}

boolean Time__To__MBMS__Data__Transfer_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_valuePart.is_bound();
}

boolean Time__To__MBMS__Data__Transfer_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_valuePart.is_value();
}

void Time__To__MBMS__Data__Transfer_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__To__MBMS__Data__Transfer Time__To__MBMS__Data__Transfer_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_To_MBMS_Data_Transfer.");
Time__To__MBMS__Data__Transfer 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_valuePart.is_bound()) {
ret_val.valuePart() = single_value->field_valuePart.valueof();
}
return ret_val;
}

void Time__To__MBMS__Data__Transfer_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_To_MBMS_Data_Transfer.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Time__To__MBMS__Data__Transfer_template[list_length];
}

Time__To__MBMS__Data__Transfer_template& Time__To__MBMS__Data__Transfer_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_To_MBMS_Data_Transfer.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& Time__To__MBMS__Data__Transfer_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Time__To__MBMS__Data__Transfer_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
return single_value->field_iEI;
}

BITSTRING_template& Time__To__MBMS__Data__Transfer_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Time__To__MBMS__Data__Transfer_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
return single_value->field_ext;
}

LIN2__2a_template& Time__To__MBMS__Data__Transfer_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Time__To__MBMS__Data__Transfer_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& Time__To__MBMS__Data__Transfer_template::valuePart()
{
set_specific();
return single_value->field_valuePart;
}

const OCTETSTRING_template& Time__To__MBMS__Data__Transfer_template::valuePart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valuePart of a non-specific template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
return single_value->field_valuePart;
}

int Time__To__MBMS__Data__Transfer_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer 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.Time_To_MBMS_Data_Transfer 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_To_MBMS_Data_Transfer 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_To_MBMS_Data_Transfer containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
  }
  return 0;
}

void Time__To__MBMS__Data__Transfer_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(", valuePart := ");
single_value->field_valuePart.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void Time__To__MBMS__Data__Transfer_template::log_match(const Time__To__MBMS__Data__Transfer& 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_valuePart.match(match_value.valuePart(), legacy)){
TTCN_Logger::log_logmatch_info(".valuePart");
single_value->field_valuePart.log_match(match_value.valuePart(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ 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(", valuePart := ");
single_value->field_valuePart.log_match(match_value.valuePart(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Time__To__MBMS__Data__Transfer_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_valuePart.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BSSGP_Types.Time_To_MBMS_Data_Transfer.");
}
}

void Time__To__MBMS__Data__Transfer_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_valuePart.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Time__To__MBMS__Data__Transfer_template[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_To_MBMS_Data_Transfer.");
}
}

void Time__To__MBMS__Data__Transfer_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__To__MBMS__Data__Transfer_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.Time_To_MBMS_Data_Transfer 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) valuePart().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(), "valuePart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valuePart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BSSGP_Types.Time_To_MBMS_Data_Transfer: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Time__To__MBMS__Data__Transfer_template* precondition = new Time__To__MBMS__Data__Transfer_template;
    precondition->set_param(*param.get_elem(0));
    Time__To__MBMS__Data__Transfer_template* implied_template = new Time__To__MBMS__Data__Transfer_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Time__To__MBMS__Data__Transfer_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Time_To_MBMS_Data_Transfer");
  }
  is_ifpresent = param.get_ifpresent();
}

void Time__To__MBMS__Data__Transfer_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_To_MBMS_Data_Transfer");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_To_MBMS_Data_Transfer");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_To_MBMS_Data_Transfer");
single_value->field_valuePart.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Time_To_MBMS_Data_Transfer");
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_To_MBMS_Data_Transfer");
}

boolean Time__To__MBMS__Data__Transfer_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Time__To__MBMS__Data__Transfer_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

MBMS__Session__Repetition__Number::MBMS__Session__Repetition__Number()
{
}

MBMS__Session__Repetition__Number::MBMS__Session__Repetition__Number(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const OCTETSTRING& par_repetitionNumber)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_repetitionNumber(par_repetitionNumber)
{
}

MBMS__Session__Repetition__Number::MBMS__Session__Repetition__Number(const MBMS__Session__Repetition__Number& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MBMS_Session_Repetition_Number.");
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.repetitionNumber().is_bound()) field_repetitionNumber = other_value.repetitionNumber();
else field_repetitionNumber.clean_up();
}

void MBMS__Session__Repetition__Number::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_repetitionNumber.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__Session__Repetition__Number::get_descriptor() const { return &MBMS__Session__Repetition__Number_descr_; }
MBMS__Session__Repetition__Number& MBMS__Session__Repetition__Number::operator=(const MBMS__Session__Repetition__Number& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MBMS_Session_Repetition_Number.");
  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.repetitionNumber().is_bound()) field_repetitionNumber = other_value.repetitionNumber();
  else field_repetitionNumber.clean_up();
}
return *this;
}

boolean MBMS__Session__Repetition__Number::operator==(const MBMS__Session__Repetition__Number& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_repetitionNumber==other_value.field_repetitionNumber;
}

boolean MBMS__Session__Repetition__Number::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_repetitionNumber.is_bound());
}
boolean MBMS__Session__Repetition__Number::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_repetitionNumber.is_value();
}
void MBMS__Session__Repetition__Number::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(", repetitionNumber := ");
field_repetitionNumber.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__Session__Repetition__Number::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 (repetitionNumber().is_bound()) repetitionNumber().set_implicit_omit();
}

void MBMS__Session__Repetition__Number::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.MBMS_Session_Repetition_Number 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) repetitionNumber().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(), "repetitionNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repetitionNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.MBMS_Session_Repetition_Number: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.MBMS_Session_Repetition_Number");
  }
}

void MBMS__Session__Repetition__Number::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_repetitionNumber.encode_text(text_buf);
}

void MBMS__Session__Repetition__Number::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_repetitionNumber.decode_text(text_buf);
}

void MBMS__Session__Repetition__Number::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MBMS__Session__Repetition__Number::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MBMS__Session__Repetition__Number::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, MBMS__Session__Repetition__Number_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(MBMS__Session__Repetition__Number_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, MBMS__Session__Repetition__Number_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__Session__Repetition__Number_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_repetitionNumber.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_140) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__Session__Repetition__Number::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, MBMS__Session__Repetition__Number_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MBMS__Session__Repetition__Number_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(MBMS__Session__Repetition__Number_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(MBMS__Session__Repetition__Number_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_repetitionNumber.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(MBMS__Session__Repetition__Number_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(MBMS__Session__Repetition__Number_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_140) {
  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_140.RAW_encode(General__Types::OCT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct MBMS__Session__Repetition__Number_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
OCTETSTRING_template field_repetitionNumber;
};

void MBMS__Session__Repetition__Number_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_repetitionNumber = ANY_VALUE;
}
}
}

void MBMS__Session__Repetition__Number_template::copy_value(const MBMS__Session__Repetition__Number& 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.repetitionNumber().is_bound()) {
  single_value->field_repetitionNumber = other_value.repetitionNumber();
} else {
  single_value->field_repetitionNumber.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMS__Session__Repetition__Number_template::copy_template(const MBMS__Session__Repetition__Number_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.repetitionNumber().get_selection()) {
single_value->field_repetitionNumber = other_value.repetitionNumber();
} else {
single_value->field_repetitionNumber.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new MBMS__Session__Repetition__Number_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MBMS__Session__Repetition__Number_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__Session__Repetition__Number_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.MBMS_Session_Repetition_Number.");
break;
}
set_selection(other_value);
}

MBMS__Session__Repetition__Number_template::MBMS__Session__Repetition__Number_template()
{
}

MBMS__Session__Repetition__Number_template::MBMS__Session__Repetition__Number_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

MBMS__Session__Repetition__Number_template::MBMS__Session__Repetition__Number_template(const MBMS__Session__Repetition__Number& other_value)
{
copy_value(other_value);
}

MBMS__Session__Repetition__Number_template::MBMS__Session__Repetition__Number_template(const OPTIONAL<MBMS__Session__Repetition__Number>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MBMS__Session__Repetition__Number&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.MBMS_Session_Repetition_Number from an unbound optional field.");
}
}

MBMS__Session__Repetition__Number_template::MBMS__Session__Repetition__Number_template(MBMS__Session__Repetition__Number_template* p_precondition, MBMS__Session__Repetition__Number_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

MBMS__Session__Repetition__Number_template::MBMS__Session__Repetition__Number_template(Dynamic_Match_Interface<MBMS__Session__Repetition__Number>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<MBMS__Session__Repetition__Number>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

MBMS__Session__Repetition__Number_template::MBMS__Session__Repetition__Number_template(const MBMS__Session__Repetition__Number_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

MBMS__Session__Repetition__Number_template::~MBMS__Session__Repetition__Number_template()
{
clean_up();
}

MBMS__Session__Repetition__Number_template& MBMS__Session__Repetition__Number_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

MBMS__Session__Repetition__Number_template& MBMS__Session__Repetition__Number_template::operator=(const MBMS__Session__Repetition__Number& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

MBMS__Session__Repetition__Number_template& MBMS__Session__Repetition__Number_template::operator=(const OPTIONAL<MBMS__Session__Repetition__Number>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MBMS__Session__Repetition__Number&)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.MBMS_Session_Repetition_Number.");
}
return *this;
}

MBMS__Session__Repetition__Number_template& MBMS__Session__Repetition__Number_template::operator=(const MBMS__Session__Repetition__Number_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean MBMS__Session__Repetition__Number_template::match(const MBMS__Session__Repetition__Number& 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.repetitionNumber().is_bound()) return FALSE;
if(!single_value->field_repetitionNumber.match(other_value.repetitionNumber(), 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.MBMS_Session_Repetition_Number.");
}
return FALSE;
}

boolean MBMS__Session__Repetition__Number_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_repetitionNumber.is_bound();
}

boolean MBMS__Session__Repetition__Number_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_repetitionNumber.is_value();
}

void MBMS__Session__Repetition__Number_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

MBMS__Session__Repetition__Number MBMS__Session__Repetition__Number_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.MBMS_Session_Repetition_Number.");
MBMS__Session__Repetition__Number 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_repetitionNumber.is_bound()) {
ret_val.repetitionNumber() = single_value->field_repetitionNumber.valueof();
}
return ret_val;
}

void MBMS__Session__Repetition__Number_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.MBMS_Session_Repetition_Number.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MBMS__Session__Repetition__Number_template[list_length];
}

MBMS__Session__Repetition__Number_template& MBMS__Session__Repetition__Number_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.MBMS_Session_Repetition_Number.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MBMS_Session_Repetition_Number.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& MBMS__Session__Repetition__Number_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& MBMS__Session__Repetition__Number_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.MBMS_Session_Repetition_Number.");
return single_value->field_iEI;
}

BITSTRING_template& MBMS__Session__Repetition__Number_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& MBMS__Session__Repetition__Number_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.MBMS_Session_Repetition_Number.");
return single_value->field_ext;
}

LIN2__2a_template& MBMS__Session__Repetition__Number_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& MBMS__Session__Repetition__Number_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.MBMS_Session_Repetition_Number.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& MBMS__Session__Repetition__Number_template::repetitionNumber()
{
set_specific();
return single_value->field_repetitionNumber;
}

const OCTETSTRING_template& MBMS__Session__Repetition__Number_template::repetitionNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field repetitionNumber of a non-specific template of type @BSSGP_Types.MBMS_Session_Repetition_Number.");
return single_value->field_repetitionNumber;
}

int MBMS__Session__Repetition__Number_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Repetition_Number 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.MBMS_Session_Repetition_Number 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.MBMS_Session_Repetition_Number 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.MBMS_Session_Repetition_Number containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Repetition_Number containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Repetition_Number containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Repetition_Number containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Repetition_Number containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MBMS_Session_Repetition_Number containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MBMS_Session_Repetition_Number.");
  }
  return 0;
}

void MBMS__Session__Repetition__Number_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(", repetitionNumber := ");
single_value->field_repetitionNumber.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void MBMS__Session__Repetition__Number_template::log_match(const MBMS__Session__Repetition__Number& 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_repetitionNumber.match(match_value.repetitionNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".repetitionNumber");
single_value->field_repetitionNumber.log_match(match_value.repetitionNumber(), 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(", repetitionNumber := ");
single_value->field_repetitionNumber.log_match(match_value.repetitionNumber(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void MBMS__Session__Repetition__Number_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_repetitionNumber.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.MBMS_Session_Repetition_Number.");
}
}

void MBMS__Session__Repetition__Number_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_repetitionNumber.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MBMS__Session__Repetition__Number_template[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.MBMS_Session_Repetition_Number.");
}
}

void MBMS__Session__Repetition__Number_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MBMS__Session__Repetition__Number_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.MBMS_Session_Repetition_Number 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) repetitionNumber().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(), "repetitionNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          repetitionNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.MBMS_Session_Repetition_Number: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__Session__Repetition__Number_template* precondition = new MBMS__Session__Repetition__Number_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__Session__Repetition__Number_template* implied_template = new MBMS__Session__Repetition__Number_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__Session__Repetition__Number_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.MBMS_Session_Repetition_Number");
  }
  is_ifpresent = param.get_ifpresent();
}

void MBMS__Session__Repetition__Number_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.MBMS_Session_Repetition_Number");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Repetition_Number");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Repetition_Number");
single_value->field_repetitionNumber.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MBMS_Session_Repetition_Number");
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.MBMS_Session_Repetition_Number");
}

boolean MBMS__Session__Repetition__Number_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean MBMS__Session__Repetition__Number_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;
}

Active__PFCs__List__BSSGP::Active__PFCs__List__BSSGP()
{
}

Active__PFCs__List__BSSGP::Active__PFCs__List__BSSGP(const OCTETSTRING& par_iEI,
    const BITSTRING& par_ext,
    const LIN2__2a& par_lengthIndicator,
    const INTEGER& par_number__of__PFCs,
    const Multiple__PFIs__BSSGP& par_pFIs)
  :   field_iEI(par_iEI),
  field_ext(par_ext),
  field_lengthIndicator(par_lengthIndicator),
  field_number__of__PFCs(par_number__of__PFCs),
  field_pFIs(par_pFIs)
{
}

Active__PFCs__List__BSSGP::Active__PFCs__List__BSSGP(const Active__PFCs__List__BSSGP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Active_PFCs_List_BSSGP.");
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.number__of__PFCs().is_bound()) field_number__of__PFCs = other_value.number__of__PFCs();
else field_number__of__PFCs.clean_up();
if (other_value.pFIs().is_bound()) field_pFIs = other_value.pFIs();
else field_pFIs.clean_up();
}

void Active__PFCs__List__BSSGP::clean_up()
{
field_iEI.clean_up();
field_ext.clean_up();
field_lengthIndicator.clean_up();
field_number__of__PFCs.clean_up();
field_pFIs.clean_up();
}

const TTCN_Typedescriptor_t* Active__PFCs__List__BSSGP::get_descriptor() const { return &Active__PFCs__List__BSSGP_descr_; }
Active__PFCs__List__BSSGP& Active__PFCs__List__BSSGP::operator=(const Active__PFCs__List__BSSGP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Active_PFCs_List_BSSGP.");
  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.number__of__PFCs().is_bound()) field_number__of__PFCs = other_value.number__of__PFCs();
  else field_number__of__PFCs.clean_up();
  if (other_value.pFIs().is_bound()) field_pFIs = other_value.pFIs();
  else field_pFIs.clean_up();
}
return *this;
}

boolean Active__PFCs__List__BSSGP::operator==(const Active__PFCs__List__BSSGP& other_value) const
{
return field_iEI==other_value.field_iEI
  && field_ext==other_value.field_ext
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_number__of__PFCs==other_value.field_number__of__PFCs
  && field_pFIs==other_value.field_pFIs;
}

boolean Active__PFCs__List__BSSGP::is_bound() const
{
return (field_iEI.is_bound())
  || (field_ext.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_number__of__PFCs.is_bound())
  || (field_pFIs.is_bound());
}
boolean Active__PFCs__List__BSSGP::is_value() const
{
return field_iEI.is_value()
  && field_ext.is_value()
  && field_lengthIndicator.is_value()
  && field_number__of__PFCs.is_value()
  && field_pFIs.is_value();
}
void Active__PFCs__List__BSSGP::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(", number_of_PFCs := ");
field_number__of__PFCs.log();
TTCN_Logger::log_event_str(", pFIs := ");
field_pFIs.log();
TTCN_Logger::log_event_str(" }");
}

void Active__PFCs__List__BSSGP::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 (number__of__PFCs().is_bound()) number__of__PFCs().set_implicit_omit();
if (pFIs().is_bound()) pFIs().set_implicit_omit();
}

void Active__PFCs__List__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 (5<param.get_size()) {
      param.error("record value of type @BSSGP_Types.Active_PFCs_List_BSSGP 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) number__of__PFCs().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFIs().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(), "number_of_PFCs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PFCs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFIs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFIs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Active_PFCs_List_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BSSGP_Types.Active_PFCs_List_BSSGP");
  }
}

void Active__PFCs__List__BSSGP::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_number__of__PFCs.encode_text(text_buf);
field_pFIs.encode_text(text_buf);
}

void Active__PFCs__List__BSSGP::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_number__of__PFCs.decode_text(text_buf);
field_pFIs.decode_text(text_buf);
}

void Active__PFCs__List__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 Active__PFCs__List__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 Active__PFCs__List__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;
  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;
  int value_of_length_field3 = 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, Active__PFCs__List__BSSGP_ext_descr_.raw->forceomit);
  decoded_field_length = field_ext.RAW_decode(Active__PFCs__List__BSSGP_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, Active__PFCs__List__BSSGP_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(Active__PFCs__List__BSSGP_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, Active__PFCs__List__BSSGP_number__of__PFCs_descr_.raw->forceomit);
  decoded_field_length = field_number__of__PFCs.RAW_decode(Active__PFCs__List__BSSGP_number__of__PFCs_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());
  INTEGER tmp3 = field_number__of__PFCs.convert_to_Integer(Active__PFCs__List__BSSGP_number__of__PFCs_descr_);
  field_number__of__PFCs = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 1;
  value_of_length_field2 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, Multiple__PFIs__BSSGP_descr_.raw->forceomit);
  decoded_field_length = field_pFIs.RAW_decode(Multiple__PFIs__BSSGP_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, value_of_length_field3, 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;
  value_of_length_field3 -= decoded_field_length;
  if (field_iEI !=  os_95) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Active__PFCs__List__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 = 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, Active__PFCs__List__BSSGP_ext_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Active__PFCs__List__BSSGP_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Active__PFCs__List__BSSGP_number__of__PFCs_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Multiple__PFIs__BSSGP_descr_.raw);
  encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ext.RAW_encode(Active__PFCs__List__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_lengthIndicator.RAW_encode(Active__PFCs__List__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &Active__PFCs__List__BSSGP_number__of__PFCs_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = -1;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[3]->length = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_pFIs.RAW_encode(Multiple__PFIs__BSSGP_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(Active__PFCs__List__BSSGP_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(Active__PFCs__List__BSSGP_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_95) {
  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_95.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 Active__PFCs__List__BSSGP_template::single_value_struct {
OCTETSTRING_template field_iEI;
BITSTRING_template field_ext;
LIN2__2a_template field_lengthIndicator;
INTEGER_template field_number__of__PFCs;
Multiple__PFIs__BSSGP_template field_pFIs;
};

void Active__PFCs__List__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_iEI = ANY_VALUE;
single_value->field_ext = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_number__of__PFCs = ANY_VALUE;
single_value->field_pFIs = ANY_VALUE;
}
}
}

void Active__PFCs__List__BSSGP_template::copy_value(const Active__PFCs__List__BSSGP& 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.number__of__PFCs().is_bound()) {
  single_value->field_number__of__PFCs = other_value.number__of__PFCs();
} else {
  single_value->field_number__of__PFCs.clean_up();
}
if (other_value.pFIs().is_bound()) {
  single_value->field_pFIs = other_value.pFIs();
} else {
  single_value->field_pFIs.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Active__PFCs__List__BSSGP_template::copy_template(const Active__PFCs__List__BSSGP_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.number__of__PFCs().get_selection()) {
single_value->field_number__of__PFCs = other_value.number__of__PFCs();
} else {
single_value->field_number__of__PFCs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pFIs().get_selection()) {
single_value->field_pFIs = other_value.pFIs();
} else {
single_value->field_pFIs.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 Active__PFCs__List__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 Active__PFCs__List__BSSGP_template(*other_value.implication_.precondition);
implication_.implied_template = new Active__PFCs__List__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.Active_PFCs_List_BSSGP.");
break;
}
set_selection(other_value);
}

Active__PFCs__List__BSSGP_template::Active__PFCs__List__BSSGP_template()
{
}

Active__PFCs__List__BSSGP_template::Active__PFCs__List__BSSGP_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

Active__PFCs__List__BSSGP_template::Active__PFCs__List__BSSGP_template(const Active__PFCs__List__BSSGP& other_value)
{
copy_value(other_value);
}

Active__PFCs__List__BSSGP_template::Active__PFCs__List__BSSGP_template(const OPTIONAL<Active__PFCs__List__BSSGP>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Active__PFCs__List__BSSGP&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BSSGP_Types.Active_PFCs_List_BSSGP from an unbound optional field.");
}
}

Active__PFCs__List__BSSGP_template::Active__PFCs__List__BSSGP_template(Active__PFCs__List__BSSGP_template* p_precondition, Active__PFCs__List__BSSGP_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

Active__PFCs__List__BSSGP_template::Active__PFCs__List__BSSGP_template(Dynamic_Match_Interface<Active__PFCs__List__BSSGP>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Active__PFCs__List__BSSGP>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Active__PFCs__List__BSSGP_template::Active__PFCs__List__BSSGP_template(const Active__PFCs__List__BSSGP_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

Active__PFCs__List__BSSGP_template::~Active__PFCs__List__BSSGP_template()
{
clean_up();
}

Active__PFCs__List__BSSGP_template& Active__PFCs__List__BSSGP_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

Active__PFCs__List__BSSGP_template& Active__PFCs__List__BSSGP_template::operator=(const Active__PFCs__List__BSSGP& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

Active__PFCs__List__BSSGP_template& Active__PFCs__List__BSSGP_template::operator=(const OPTIONAL<Active__PFCs__List__BSSGP>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const Active__PFCs__List__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.Active_PFCs_List_BSSGP.");
}
return *this;
}

Active__PFCs__List__BSSGP_template& Active__PFCs__List__BSSGP_template::operator=(const Active__PFCs__List__BSSGP_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean Active__PFCs__List__BSSGP_template::match(const Active__PFCs__List__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.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.number__of__PFCs().is_bound()) return FALSE;
if(!single_value->field_number__of__PFCs.match(other_value.number__of__PFCs(), legacy))return FALSE;
if(!other_value.pFIs().is_bound()) return FALSE;
if(!single_value->field_pFIs.match(other_value.pFIs(), 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.Active_PFCs_List_BSSGP.");
}
return FALSE;
}

boolean Active__PFCs__List__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_iEI.is_bound()
 || single_value->field_ext.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_number__of__PFCs.is_bound()
 || single_value->field_pFIs.is_bound();
}

boolean Active__PFCs__List__BSSGP_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_number__of__PFCs.is_value()
 && single_value->field_pFIs.is_value();
}

void Active__PFCs__List__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;
}

Active__PFCs__List__BSSGP Active__PFCs__List__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.Active_PFCs_List_BSSGP.");
Active__PFCs__List__BSSGP 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_number__of__PFCs.is_bound()) {
ret_val.number__of__PFCs() = single_value->field_number__of__PFCs.valueof();
}
if (single_value->field_pFIs.is_bound()) {
ret_val.pFIs() = single_value->field_pFIs.valueof();
}
return ret_val;
}

void Active__PFCs__List__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.Active_PFCs_List_BSSGP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Active__PFCs__List__BSSGP_template[list_length];
}

Active__PFCs__List__BSSGP_template& Active__PFCs__List__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.Active_PFCs_List_BSSGP.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Active_PFCs_List_BSSGP.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& Active__PFCs__List__BSSGP_template::iEI()
{
set_specific();
return single_value->field_iEI;
}

const OCTETSTRING_template& Active__PFCs__List__BSSGP_template::iEI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Active_PFCs_List_BSSGP.");
return single_value->field_iEI;
}

BITSTRING_template& Active__PFCs__List__BSSGP_template::ext()
{
set_specific();
return single_value->field_ext;
}

const BITSTRING_template& Active__PFCs__List__BSSGP_template::ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Active_PFCs_List_BSSGP.");
return single_value->field_ext;
}

LIN2__2a_template& Active__PFCs__List__BSSGP_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const LIN2__2a_template& Active__PFCs__List__BSSGP_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Active_PFCs_List_BSSGP.");
return single_value->field_lengthIndicator;
}

INTEGER_template& Active__PFCs__List__BSSGP_template::number__of__PFCs()
{
set_specific();
return single_value->field_number__of__PFCs;
}

const INTEGER_template& Active__PFCs__List__BSSGP_template::number__of__PFCs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field number_of_PFCs of a non-specific template of type @BSSGP_Types.Active_PFCs_List_BSSGP.");
return single_value->field_number__of__PFCs;
}

Multiple__PFIs__BSSGP_template& Active__PFCs__List__BSSGP_template::pFIs()
{
set_specific();
return single_value->field_pFIs;
}

const Multiple__PFIs__BSSGP_template& Active__PFCs__List__BSSGP_template::pFIs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pFIs of a non-specific template of type @BSSGP_Types.Active_PFCs_List_BSSGP.");
return single_value->field_pFIs;
}

int Active__PFCs__List__BSSGP_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Active_PFCs_List_BSSGP 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.Active_PFCs_List_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.Active_PFCs_List_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.Active_PFCs_List_BSSGP containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Active_PFCs_List_BSSGP containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Active_PFCs_List_BSSGP containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Active_PFCs_List_BSSGP containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Active_PFCs_List_BSSGP containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Active_PFCs_List_BSSGP containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Active_PFCs_List_BSSGP.");
  }
  return 0;
}

void Active__PFCs__List__BSSGP_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(", number_of_PFCs := ");
single_value->field_number__of__PFCs.log();
TTCN_Logger::log_event_str(", pFIs := ");
single_value->field_pFIs.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 Active__PFCs__List__BSSGP_template::log_match(const Active__PFCs__List__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_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_number__of__PFCs.match(match_value.number__of__PFCs(), legacy)){
TTCN_Logger::log_logmatch_info(".number_of_PFCs");
single_value->field_number__of__PFCs.log_match(match_value.number__of__PFCs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pFIs.match(match_value.pFIs(), legacy)){
TTCN_Logger::log_logmatch_info(".pFIs");
single_value->field_pFIs.log_match(match_value.pFIs(), 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(", number_of_PFCs := ");
single_value->field_number__of__PFCs.log_match(match_value.number__of__PFCs(), legacy);
TTCN_Logger::log_event_str(", pFIs := ");
single_value->field_pFIs.log_match(match_value.pFIs(), 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 Active__PFCs__List__BSSGP_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_number__of__PFCs.encode_text(text_buf);
single_value->field_pFIs.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.Active_PFCs_List_BSSGP.");
}
}

void Active__PFCs__List__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_iEI.decode_text(text_buf);
single_value->field_ext.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_number__of__PFCs.decode_text(text_buf);
single_value->field_pFIs.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 Active__PFCs__List__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.Active_PFCs_List_BSSGP.");
}
}

void Active__PFCs__List__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: {
    Active__PFCs__List__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 (5<param.get_size()) {
      param.error("record template of type @BSSGP_Types.Active_PFCs_List_BSSGP 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) number__of__PFCs().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pFIs().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(), "number_of_PFCs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          number__of__PFCs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pFIs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pFIs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) 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.Active_PFCs_List_BSSGP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Active__PFCs__List__BSSGP_template* precondition = new Active__PFCs__List__BSSGP_template;
    precondition->set_param(*param.get_elem(0));
    Active__PFCs__List__BSSGP_template* implied_template = new Active__PFCs__List__BSSGP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Active__PFCs__List__BSSGP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BSSGP_Types.Active_PFCs_List_BSSGP");
  }
  is_ifpresent = param.get_ifpresent();
}

void Active__PFCs__List__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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Active_PFCs_List_BSSGP");
single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Active_PFCs_List_BSSGP");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Active_PFCs_List_BSSGP");
single_value->field_number__of__PFCs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Active_PFCs_List_BSSGP");
single_value->field_pFIs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Active_PFCs_List_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.Active_PFCs_List_BSSGP");
}

boolean Active__PFCs__List__BSSGP_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean Active__PFCs__List__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;
}


} /* end of namespace */
